Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[BLOCK][MOD]Scrolling Affiliates!
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-07-25 10:26:33
by modding my other mod for a friends list i have managed to amke a affiliates version which looks like below





add via php my admin

CREATE TABLE IF NOT EXISTS `Affil2` (

 `url` text NOT NULL,

 `name` text NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin1;



--

-- Dumping data for table `Affil2`

--



INSERT INTO `Affil2` (`url`, `name`) VALUES

('"http://piratescove.uni.cc/"', '"http://img154.imageshack.us/img154/6661/nblogozh6.jpg"'),







first

create addaffil2.php






<?



require_once("backend/functions.php");

dbconn(false);

if (!$CURUSER || $CURUSER["class"]<"6"){

show_error_msg("Error","Sorry you do not have the rights to access this page!");

}



stdhead("Add Affiliate");

?>



<FORM NAME="fa" ACTION="addafilpst.php" METHOD="POST">

Please make sure there are quotes around the url<br>



<B>Image URL:</B> <INPUT TYPE="text" NAME="name" SIZE=40><br>

<B>Site URL: </B> <INPUT TYPE="text" NAME="url" VALUE="URL HERE IN QUOTES" SIZE=40><br>

<P><INPUT TYPE="submit" VALUE="Add Link"></P>

</FORM>

---<a href="http://piratescove.uni.cc">Code By Tengo @ Pirates Cove</a> ---

<?



?>





then create addafilpst.php





<?php

require_once("backend/functions.php");

dbconn(false);

stdhead("Add Affiliate");



if ($_SERVER['REQUEST_METHOD'] == "POST") {



// the following 4 lines are needed if your server has register_globals set to Off

$name = $_POST['name'];

$url = $_POST['url'];



$SQL = " INSERT INTO Affil2 ";

$SQL = $SQL . " ( name, url) VALUES ";

$SQL = $SQL . " ('$name','$url') ";

$result = mysql_query($SQL);



if (!$result) {

echo("ERROR: " . mysql_error() . "\n$SQL\n"); }



echo ("New Link Added\n");



}

?>





upload thoose to your root directory



then create

afil2_block.php (upload with block manger in admincp)





<?	

begin_block(" Affiliates ");

?>

<marquee onMouseover="this.scrollAmount=2" onMouseout="this.scrollAmount=6">

<?

$query = mysql_query ("SELECT * From Affil2");

while($row = mysql_fetch_array($query))



{

$url = $row['url'];

$name = $row['name'];

echo "<a href=",$row['url'],"><img border=0 WIDTH=200 HEIGHT=100  src=",$row['name'],"/> </a>";

}



end_block();

?>





add in admin cp



<td align="center"><a href=addaffil2.php><img src="images/admin/rules.gif" border=0 width=32 height=32><br>Affiliates<br>Bottom</a><BR></td>









if you would like it to be viewed at the bottom of your apge and not the top:

in index.php

find

stdfoot();[/code



and add above it

[code]

include ('blocks/afil2_block.php');
Unknown User
2008-11-10 03:49:17
worked like a charm, thank you!
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728