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]Friendly sites List
Controls ·  Search New posts · Mark unread

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

Unknown User
2008-07-22 14:29:34
ok this script will allow you to add a list of sites to a block via admin cp it will look like below



Add via PHPMYADMIN

CREATE TABLE IF NOT EXISTS `affil` (

 `Url` text NOT NULL,

 `name` text NOT NULL,

 `who` text NOT NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin1;



--

-- Dumping data for table `affil`

--



INSERT INTO `affil` (`Url`, `name`, `who`) VALUES

('<a href="http://piratescove.uni.cc">', 'Pirates Cove', 'Friendly Site'),
createa file called affilad.php


<?



require_once("backend/functions.php");

dbconn(false);

stdhead("Add Affiliate");

?>



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

<B>Description: </B> <INPUT TYPE="text" NAME="who" SIZE=40 value="Friendly Site!"> <br>

<B>Site Name:</B> <INPUT TYPE="text" NAME="name" SIZE=40><br>Please make sure there are quotes around the url<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 createa file called as.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

$who = $_POST['who'];

$name = $_POST['name'];

$url = $_POST['url'];



$SQL = " INSERT INTO affil ";

$SQL = $SQL . " (who, name, Url) VALUES ";

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

$result = mysql_query($SQL);



if (!$result) {

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



echo ("New Link Added\n");



}

?>







upload both of thoose files to your root directory!



thn createa file calledFriends_block.php (the name isnt important as long as it has _block.php at the end!



<?	

begin_block(" Friends ");

?>

<marquee direction=up scrollamount=2 loop=infinite>

<?

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

while($row = mysql_fetch_array($query))

{

$url = $row['Url'];

$description = $row['who'];

$name = $row['name'];

echo "<center> <br><a href=",$row['Url'],">",$row['name']," </a> <br> ",$row['who'];

}

end_block();

?>







upload that via blocks in admin cp!





in admincp.php add:



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



and that is it! goto your admincp press affiliates ad add them!

any problems please write here il b happy to help!
Unknown User
2008-07-22 16:02:19
why should I have to put my details for mysql? why are you connecting to the databank again or a different way? Torrent Trader has a way to connect so it might be better to do it that way and not make a new way of connecting.
Unknown User
2008-07-22 16:15:08
as.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

$who = $_POST['who'];

$name = $_POST['name'];

$url = $_POST['url'];



$SQL = " INSERT INTO affil ";

$SQL = $SQL . " (who, name, Url) VALUES ";

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

$result = mysql_query($SQL);



if (!$result) {

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



echo ("New Link Added\n");



}

?>





friends_block.php



<?	

begin_block(" Friends ");



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

while($row = mysql_fetch_array($query))

{

$url = $row['Url'];

$description = $row['who'];

$name = $row['name'];

echo "<center> <br>",$row['Url'],$row['name']," </a> <br> ",$row['who'];

}



end_block();

?>
Unknown User
2008-07-22 20:47:18
thnx for the updated coed everytime i tried it with require_oince i got an error so i did it like that, and also i have no idea how to do php coding or mysql i was learning as i went and for a first tikme coder and for my first project i though i did quiet well!
Unknown User
2008-07-23 09:01:51
first post updated with no need to fill in mysql, a new marquee function and no need to add html via the addafil!
Unknown User
2008-12-15 15:17:30
Hello,

for me its working very well,

but there is just a small problem when I go with my mouse to click on the link in the block Friends of the link continuously move then that link should be stopped.

It should be either in the block scrollingnews.

Thank you your help is very appreciated.
Unknown User
2008-12-15 15:41:36
I try whit this code but, because i have other scroll at the same page just one scroll work the other don't move.  :D

<?    
begin_block(" Liens Affili
Unknown User
2008-12-15 22:48:59
I use your scrip for make a new block : Generator for prez.

Thanks
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