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
User Posts

Go to Profile

Posting in "in progress" because I hope others can bring improvements to this.

Original post is [url="http://www.torrenttrader.org/index.php?showtopic=4592"]here[/url].

SQL:

CREATE TABLE `friends` (

 `id` int(10) unsigned NOT NULL auto_increment,

 `userid` int(10) unsigned NOT NULL default '0',

 `friendid` int(10) unsigned NOT NULL default '0',

 PRIMARY KEY  (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
In header.php, add this wherever you like... this is totally optional and you can skip it if you don't want a link in your header.


<a href=friend.php>Friends</a>





Now open up account-details.php and find:



			   <a href=report.php?user=<?=$user["id"]?>>Report Member</a><BR>



Below, add:



			   <a href=friends.php?user=<?=$user["id"]?>>Add to my Friends</a>




Upload all 3 files to your server, and enjoy!

I'll update the account-details code later so it checks if the user is in the friend list, and if it is add a delete friend link instead...

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=1782"]friends.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=1783"]friend.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=1784"]takedelfriend.php[/url]
That's a good idea, give users incentive to become VIP  :)

@TS I have other things there so I figured I'd leave them there if others wanna use them too
I restarted like 5 times.. not sure which was the best way to do this every time... So I ended up doing mods separately. This means, it looks more complex than it really is as you really only have to apply 1/3 of the code below!

This mod adds a start for VIP users, AND/OR donators. Codes are posted separately at first, then both applied. Meaning that you have a separate mod where VIP users get the star, one where donators get the star, and one where both get the star, so read carefully and don't just copy/paste the code blindly!

If you want to use it for DONATORS only, follow ONLY the text between the blue tags!
If you want to use it for VIPs only, follow ONLY the text between the green tags!
If you want to use it for BOTH, follow ONLY the text between the orange tags!

Let's start with the comments (this is both for torrent comments and news comments):
============================================
This is to add a star for DONATORS!
============================================
in functions.php find:
find:

if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes"))  {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
replace with:

if ($row["donated"] > 0) { $donated = "<img src=images/star.gif border=0>";
} else {
$donated = "";
}
if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes")) {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername $donated</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");

Then, just under that:

} else {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
}
replace with:

  }else {
print("<tr><td valign=top width=150 align=left
class=table_col2><center><b>$postername $donated</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
}

============================================

============================================
This is to add a star for VIPs!
============================================
find:

if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes")) {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
replace with:

if ($row["class"] == 3) { $vip = "<img src=images/star.gif border=0>";
} else {
$vip = "";
}
if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes")) {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername $vip</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");

Then, just under that:

} else {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
}
replace with:

} else {
print("<tr><td valign=top width=150 align=left
class=table_col2><center><b>$postername $vip</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
}

============================================


============================================
This is if you want to add it for both!
============================================

find:

if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes")) {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
replace with:

if ($row["class"] == 3 || $row["donated"] > 0) {
if ($site_config["donatedstar"] || $site_config["vipstar"]) {
$star = "<img src=images/star.gif border=0>";
} else {
$star = "";
}
}
if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes")) {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername $star</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");

Then, just under that:

} else {
print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
}
replace with:

} else {
print("<tr><td valign=top width=150 align=left
class=table_col2><center><b>$postername $star</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>");
}

============================================

And that's it for the torrent comments!
Now for the blocks...

Online users block:
in onlineusers_block.php

============================================
This is if you want to add it for DONATORS!
============================================
find:

$usersonlinequery = mysql_query("SELECT id, username, class FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP(" .
get_dt_num() . ") - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());
replace with:

$usersonlinequery = mysql_query("SELECT id, username, class, donated FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP(" .
get_dt_num() . ") - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());
find:

print("<a href="account-details.php?id=".$user["id"].""><font style=" color:
".$color."">".$user["username"]."</font></a>, ");

replace with:

if ($user["donated"] > 0) {
$star = " <img src=images/star.gif border=0>";
} else {
$star = "";
}
print("<a href="account-details.php?id=".$user["id"].""><font style=" color:
".$color."">".$user["username"]."</font></a>$star, ");

============================================


============================================
This is if you want to add it for VIPs!
============================================
find:

print("<a href="account-details.php?id=".$user["id"].""><font style=" color:
".$color."">".$user["username"]."</font></a>, ");
replace with:

if ($user["class"] == 3) {
$star = " <img src=images/star.gif border=0>";
} else {
$star = "";
}
print("<a href="account-details.php?id=".$user["id"].""><font style=" color:
".$color."">".$user["username"]."</font></a>$star, ");
============================================


============================================
This is if you want to add it for BOTH!
============================================
find:

$usersonlinequery = mysql_query("SELECT id, username, class FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP(" .
get_dt_num() . ") - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());

replace with:
$usersonlinequery = mysql_query("SELECT id, username, class, donated FROM users WHERE privacy !='strong' AND UNIX_TIMESTAMP(" .
get_dt_num() . ") - UNIX_TIMESTAMP(users.last_access) < 900") or die(mysql_error());


find:

print("<a href="account-details.php?id=".$user["id"].""><font style=" color:
".$color."">".$user["username"]."</font></a>, ");
replace with:

if ($user["class"] == 3 || $user["donated"] > 0) {
$star = " <img src=images/star.gif border=0>";
} else {
$star = "";
}
print("<a href="account-details.php?id=".$user["id"].""><font style=" color:
".$color."">".$user["username"]."</font></a>$star, ");
============================================


And that's it for the users online block!
Now for the blocks...

Login block:
in login_block.php

============================================
This is if you want to add it for DONATORS!
============================================
find:

begin_block("$CURUSER[username]");

replace with:

if ($CURUSER["donated"] > 0) {
$star = "&nbspl<img src=images/star.gif border=0>";
} else {
$star = "";
}
begin_block("".$CURUSER[username]."$star");
============================================


============================================
This is if you want to add it for VIPs!
============================================
find:

begin_block("$CURUSER[username]");

replace with:

if (get_user_class($CURUSER) == "3") {
$star = "&nbspl<img src=images/star.gif border=0>";
} else {
$star = "";
}
begin_block("".$CURUSER[username]."$star");
============================================


============================================
This is if you want to add it for BOTH!
============================================
find:

begin_block("$CURUSER[username]");

replace with:

if (get_user_class($CURUSER) == "3" || $CURUSER["donated"] > 0) {
$star = "&nbspl<img src=images/star.gif border=0>";
} else {
$star = "";
}
begin_block("".$CURUSER[username]."$star");
============================================


That's it for the blocks....
Now the shoutbox!

in shoutbox.php

============================================
This is if you want to add it for DONATORS!
============================================
find:

$a = mysql_query("SELECT class, FROM `users` WHERE id = $row[userid] ");

replace with:

$a = mysql_query("SELECT class, donated FROM `users` WHERE id = $row[userid] ");
find:

echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$row['user'].':</b></a> '.nl2br(format_comment($row['message']));
replace with:

if ($a["1"] > 0) { $star = " <img src=images/star.gif border=0>";
} else {
$star = "";
}

echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$user.' '.$star.':</b></a> '.nl2br(format_comment($row['message']));

============================================


============================================
This is if you want to add it for VIPs!
============================================
find:

echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$row['user'].':</b></a> '.nl2br(format_comment($row['message']));
replace with:

if ($a["0"] == "3") {
$star = " <img src=images/star.gif border=0>";
} else {
$star = "";
}
echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$row['user'].' '.$star.':</b></a> '.nl2br(format_comment($row['message']));

============================================


============================================
This is if you want to add it for BOTH!
============================================
find:

$a = mysql_query("SELECT class, FROM `users` WHERE id = $row[userid] ");

replace with:

$a = mysql_query("SELECT class, donated FROM `users` WHERE id = $row[userid] ");
find:

echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$row['user'].':</b></a> '.nl2br(format_comment($row['message']));
replace with:

if ($a["0"] == "3" || $a["1"] > 0) {
$star = " <img src=images/star.gif border=0>";
} else {
$star = "";
}
echo '</td><td style="font-size: 12px; padding-left: 5px"><a
href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'"
target="_parent"><b>'.$row['user'].' '.$star.':</b></a> '.nl2br(format_comment($row['message']));

============================================

Whew! I think that's it.... Let me know if I missed anything, I'll add it right away!
I know, I havn't done the forums, waiting for an 'official' one from the developers...
or maybe I'll add it tomorrow, need some sleep now :S

I think making it a config.php option would be pretty cool.. $siteconfig['collapsable'] = 'peerlist, nfo, filelist'; or something? :)
Thanks, already added this to my own site a while back. Will this be part of 2.03? :)
Thanks :)
Anonym.to is in functions.php.. use the search function, we talked quite a lot about it in the 'technical support' section a little while back. To remove the new window, remove target=_new or target=_blank (not sure which one it is...) but be aware that doing so will remove *all* anonym.to redirects on your site.
"avi-torrents, post: 35093":
If you delete an account then sign up again with same username the problem becomes more apparent.

Care to explain? That's how I tested my invite system, by deleting and recreating the same 5 usernames a bunch of times...
:) uhh... hmmm... I seriously don't see how it can affect them that way... all it does is wrap colors codes around $row[user] so in theory what you're saying can't be caused by the mod... unless your user classes are different but even then, the problem you're talking about couldn't possibly be related

Just tested it myself, created a new user.. it's working fine   :(

I think it's that random shoutbox problems where users cant talk that's haunting you... I had that in 1.x and some of my users are reporting it in 2.x too.. I even rewrote the way shoutbox handles logged in users and that problem's still there :P
[MOD] Thanks — 2007-11-11 02:31:41 in v2 Only Mods Complete
Read what TS said just above about torrents-details.php
Pretty sure I saw this requested somewhere.. can't find where so here goes...

Thanks go out to TS for this, as usual  :)

Original post is [url="http://www.torrenttrader.org/index.php?showtopic=3962"]http://www.torrenttrader.org/index.php?showtopic=3962[/url]

If you used the color mod for the online users, you should use the same colors...

In shoutbox.php, find:

echo "<div align='right' style='float: right'><a

href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><div>";

}
Below, add:


$a = mysql_query("SELECT class FROM `users` WHERE id = $row[userid] ");

$a = @mysql_fetch_row($a);

switch ($a[0]) {

case 7: // Admin

$user = "<font color=blue>$row[user]</font>";  

break;

case 6: // Super Moderator

$user = "<font color=orange>$row[user]</font>";

break;

case 5: // Moderator

$user = "<font color=brown>$row[user]</font>";

break;

case 4: // Uploader  

$user = "<font color=green>$row[user]</font>";  

break;

case 3: // VIP  

$user = "<font color=red>$row[user]</font>";

break;

case 2: // Power User

$user = "<font color=purple>$row[user]</font>";

break;

case 1: // Member

$user = "<font color=black>$row[user]</font>";

break;

case "": // System (torrent announce, request announce, etc...)

$user = "</a><font color=#CC66CC><b>$row[user]</b></font>";

break;

default: // User

$user = $row[user];

}





find:

'.$row['user'].'



replace with:

'.$user.'




Blah... sorry TS/FLASH, forgot to add [MOD] to the title :S
Should be..

$msg_bt = chr(3)."2 New Torrent: (".chr(3)."10 $torrent".chr(3)."2 ) Size: (".chr(3)."10 ".mksize($torrentsize).chr(3)."2 ) Category: (".chr(3)."10 ".$cat_details["parent_cat"].": ". $cat_details["name"].chr(3)."2 )  Link: (".chr(3)."10 {$site_config['SITEURL']}/torrents-details.php?id=$id&hit=1".chr(3)."2 )\r\n";


Fixes the category issues
This is nice. I'm working on something based on a 1.x mod that was posted here (which I can't find..). Perhaps I'll integrate this into it.
Nice, thanks :P
[MOD] Thanks — 2007-10-03 20:12:30 in v2 Only Mods Complete
Much nicer than the other one.. thanks  :P

Guess you can either lock and/or delete mine :P
[MOD] Thanks — 2007-10-02 17:40:27 in v2 Only Mods Complete
Sorry, I missed that one, edited first post.
Nice! I needed to do that too.. you saved me the work :P
[MOD] Thanks — 2007-10-02 10:16:38 in v2 Only Mods Complete
Taken from Krapan's post [url="http://www.torrenttrader.org/index.php?showtopic=675"]here[/url] and modified to fit 2.x.

Dont forget to backup!

SQL:

CREATE TABLE `thanks` (

`torrentid` int(11) NOT NULL default '0',

`userid` int(11) NOT NULL default '0',

`id` int(11) NOT NULL auto_increment,

PRIMARY KEY  (`id`)

) TYPE=MyISAM AUTO_INCREMENT=743;
Open torrent-details.php and find (or wherever it is you want to add it...):


		$a = mysql_fetch_assoc($speedQ);

$totalspeed = mksize($a["totalspeed"]) . "/s";

}else{

$totalspeed = "No Activity";

}





Below, add:



// Thanx mod

$torrentid = $_GET["id"];

$thanks_sql = mysql_query("SELECT * FROM thanks where torrentid=$torrentid");

 $thanks_all = mysql_numrows($thanks_sql);

 if ($thanks_all) {

 while($rows_t = mysql_fetch_array($thanks_sql)) {

 $thanks_userid = $rows_t["userid"];

 $user_sql = mysql_query("SELECT * FROM users where id=$thanks_userid");

 $rows_a = mysql_fetch_array($user_sql);

 $username_t = $rows_a["username"];

 $thanksby =  $thanksby."<a href='userdetails.php?id=$thanks_userid'>$username_t</a>, ";

 }

 $t_userid = $CURUSER["id"];  

 $tsql = mysql_query("SELECT COUNT(*) FROM thanks where torrentid=$torrentid and userid=$t_userid");

 $trows = mysql_fetch_array($tsql);

 $t_ab = $trows[0];

if ($t_ab == "0" && $CURUSER["id"] != $row["owner"]) {

$thanksby = $thanksby." <form action=\"thanks.php\" method=\"post\">

<input type=\"submit\" name=\"submit\" value=\"Say Thanks!\">

<input type=\"hidden\" name=\"torrentid\" value=\"$torrentid\">

</form>";

}

else {

$thanksby = $thanksby." <form action=\"thanks.php\" method=\"post\">

<input type=\"submit\" name=\"submit\" value=\"Say Thanks!\" disabled>

<input type=\"hidden\" name=\"torrentid\" value=\"$torrentid\">

</form>";

}

}

else {

if ($CURUSER["id"] == $row["owner"]){

$thanksby = $thanksby." <form action=\"thanks.php\" method=\"post\">

<input type=\"submit\" name=\"submit\" value=\"Say Thanks!\" disabled>

<input type=\"hidden\" name=\"torrentid\" value=\"$torrentid\">

</form>";

}

else

$thanksby = "No Thanks Yet

<form action=\"thanks.php\" method=\"post\">

<input type=\"submit\" name=\"submit\" value=\"Say Thanks!\">

<input type=\"hidden\" name=\"torrentid\" value=\"$torrentid\">

</form>

";

}  print("<br><table><tr>

<td valign=top><table border=0 width=100 cellspacing=0 cellpadding=0><tr><td class=alt5 align=center><b>Thanks by</b></td>

</tr></table></td><td width=100%>" . $thanksby . "</td></tr></table>");



//Thanx mod end







Create a file called thanks.php and paste this:



<?

require("backend/functions.php");

dbconn();



$userid = $CURUSER["id"];

$torrentid = $_POST["torrentid"];

if (isset($userid) && isset($torrentid))

{

$res = mysql_query("INSERT INTO thanks (torrentid, userid) VALUES ($torrentid, $userid)");





header("Location: $SITEURL/torrents-details.php?id=$torrentid&thanks=1");

}

else {



header("Location: $SITEURL/index.php");  



}



?>



And voila, thanks mod works on 2.x  :P

Tested and working.
Yay, nicely done :P
You're absolutely right, but this was the simplest way to fix the rehash issue with the pure TCL code  :P

But it's a great idea to put into a seperate file and call it, thanks for the tip :P
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