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
[ADDON] Add warned image (!)
Controls ·  Search New posts · Mark unread

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

Unknown User
2008-02-08 11:26:58
This mod will add a warning (!) image to warned users. It was requested [url="http://www.torrenttrader.org/index.php?showtopic=7843"]here[/url]. This code is based on a vanilla 2.02 install with the [url="http://www.torrenttrader.org/index.php?showtopic=7249"]VIP/DONOR[/url] mod.  Sorry for those of you who are just installing 2.03 but this will probably not work 100% since the VIP/DONOR mod will not work completely with 2.03. You will need to apply the VIP/DONOR mod before this one or it will not work!. Tested in a development environment, not production.

There are no SQL modifications required for this mod. So first, let's start with the comments...

In functions.php, find:

if ($row["donated"] > 0) { $donated = "<img src=images/star.gif border=0>"; } else { $donated = ""; }
Under, add:


if ($row["warned"] != "no") { $warned = "<img src=images/warned.gif border=0>";}





Next, find (twice):



<b>$postername $donated</b>



Replace with:



<b>$postername $donated $warned</b>







That's it for comments. Next, we do the blocks.

In onlineusers_block.php, find:



$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());



Replace with:



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





find:



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

$star = ""; }



Under, add:



if ($user["warned"] != "no") { $warned = " <img src=images/warned.gif border=0>"; }





Find:

</font></a>$star, "



Replace with:



</font></a>$star$warned, "







login_block.php:

find:

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

else { $star = ""; }

begin_block("".$CURUSER[username]."$star");



Replace with:



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

if ($CURUSER["warned"] != "no") { $warned = "&nbspl<img src=images/warned.gif border=0>";}

begin_block("".$CURUSER[username]."$star $warned");







On to the shoutbox...

find:



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



Replace with:



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





find:



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']));





Replace with:



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

if ($a["2"] != "no") { $warned = " <img src=images/warned.gif border=0>"; }



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.' '.$warned.':</b></a>  '.nl2br(format_comment($row['message']));



That should be it. I realized while writing this that quite a few things changed in 2.03 and the VIP/DONOR mod might not work 100% anymore... when I get some time I'll try to update it and maybe integrate it with this one. As usual, let me know of problems and I'll see what I can do.

warned.gif
warned.gif
Unknown User
2008-02-08 17:14:25
ok i applied this mod and all my users in the shoutbox and usersonline_block where warned  :) !

(in my case i have your vip/donor mod only for donors)
Unknown User
2008-02-08 18:01:34
Thanks! Nice Work!

wolfnet
Unknown User
2008-02-11 23:52:00
it worked fine for you?no problem?

i don't know why but even my system user when shouts a new torrent, he recieves the warned gif

:)
Unknown User
2008-02-12 04:47:50
"SpaZiuR, post: 38819":
it worked fine for you?no problem?i don't know why but even my system user when shouts a new torrent, he recieves the warned gif

:)
lol yeah it did that to me on my test site.. but I thought I fixed it.. this mod is a total mess now since a lot changed in recent versions. I'll rewrite it and incorporate both once we have a stable branch to work off...

Post your shoutbox.php and I'll look at it
Unknown User
2008-02-12 10:19:59
ok i'll post here my shoutbox.php and my index.php(because i have the usersoline block in the middle, and had the same problem as in the shoutbox),

yhis is from my working tracker and it's TT2.02, i haven't applied this mod in these two php...

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

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=2011"]shoutbox.php[/url]
shoutbox.php
Download
index.php
Download
Unknown User
2008-02-12 16:47:18
Well shoutbox.php works 100% with the mods I said above on my test site with your shoutbox.php :S

index.php, find:

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





find:

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



under, add:



if ($user["warned"] != "no") { $warned = " <img src=images/warned.gif border=0>"; }





find:



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



replace with:



print("<a href=\"account-details.php?id=".$user["id"]."\"><font style=\" color: 

".$color."\">".$user["username"]."</font></a>$star$warned, ");



Also tested and working on my test site (TT 2.03 SVN).
Unknown User
2008-02-12 19:48:03
ok i'll give it a try when i go home!!(i'm working  :)  )

thanks Ezerbeth!!!
Unknown User
2008-02-13 12:09:15
ok i think it's working in the users online...and login block but in my shoutbox everything was ok until my system user shouted a new user then all the users in the shoutbox got warned....any clue?
Unknown User
2008-02-14 06:12:40
Yoo Ezerbeth , works great on 2.01 !!! Groovy Mod, yep yep yep

I only got an error on comments, it show the warned, gonna corect in commentable if I can, and report

see u bye bye  :)
Unknown User
2008-02-17 12:30:22
OK everything's fine 4 me, in addition to the unwarmed code I did 4 dada, in technical support section,

BUT !  sometimes warned icon is shown in shoutbox !  its a weird issue,

ONLY sometimes , perhaps if 2 or 3 times a day, shoutbox loose contact with my host server, the refreshing,

the warned icon is shown on every shout messages,

If someone got an idea , it would be appreciated, lolll   :)  :D
Unknown User
2008-04-03 05:35:21
still 2 issues here!!in torrent comments all of my users are warned .... next to their username it allways appears the .gif...

in my shoutbox still the same problem everything is ok until the System user (i have new user in shoutbox mod, and new torrent in shoutbox), shouts a new user or a new torrent, everybody recieves a warned gif....

any clue of how i solve this problem?
Unknown User
2008-08-29 22:06:54
hi  :)

try this :replace this :

if ($user["warned"] != "no") { $warned = " <img src=images/warned.gif border=0>"; }



BY :

if ($user["warned"] > 'no') { $warned = " <img src=images/warned.gif border=0>"; 
} else {

$warned = ""; }
Unknown User
2008-08-30 08:23:40
$warned = $user["warned"] == "no" ? "" : "<img src=images/warned.gif border=0>";
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