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
Class Colors Function for 2.08
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2013-05-01 11:16:43
For example change: $a[username] with: ".class_user($a[username])." and so far...
Unknown User
2013-05-13 18:50:00
in memberlist.php

sherch

$arr[username]

change to


".class_user($arr[username])."
2013-06-08 17:25:42
a person tested to the ad?

    $subject = $_POST["subject"];
   $debut ="."/forums.php?action=viewtopic&topicid=".$topicid."&page=last']".$subject."Nouveau topic par";
   $fin = "."/account-details.php?id=".$CURUSER['id']."]".$CURUSER['username']."";
   $post_text = sqlesc($debut." ".$_POST["subject"]."".$fin);
   SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES ('', 'Le Forum', $post_text, '".get_date_time()."', '0')");


Unknown User
2013-06-09 00:46:54
hello Tiloup where put this code?

bonjour Tiloup ou mettre les lignes de code?quel fichiƩ?

i want testing  :)

j'aimerais tester  :)
2013-06-09 01:00:08
"phoenix75, post: 90727":

hello Tiloup where put this code?

bonjour Tiloup ou mettre les lignes de code?quel fichiƩ?

i want testing  :)

j'aimerais tester  :)
[url="https://www.torrenttrader.org/topic/16496-annonce-forumsphp-et-ajshoutbox/"]ICI / HERE[/url]
Unknown User
2013-07-11 04:24:21
What can I change here so that the usename is shown in the colors then? This works great except that the name is not shown in the color....


  $new_ajmsg = "New Torrent: ."/torrents-details.php?id=".$id."]".$torrent." has been uploaded by ."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "";

Unknown User
2013-07-11 07:04:47
try this but no tested:

in backend/function.php

search:

//start class colors function
function class_user($name) {
global $site_config;
$a ="SELECT class, donated, warned, enabled FROM `users` WHERE username ='".$name."'";
$res = SQL_Query_exec($a);
$classy = @mysql_fetch_row($res);
switch ($classy[0]) {

case 7: // Administrator
$col = "".$site_config["administrator_color"]."";
break;
case 6: // Super Moderator
$col = "".$site_config["super_moderator_color"]."";
break;
case 5: // Moderator
$col = "".$site_config["moderator_color"]."";
break;
case 4: // Uploader
$col = "".$site_config["uploader_color"]."";
break;
case 3: // VIP
$col = "".$site_config["vip_color"]."";
break;
case 2: // Power User
$col = "".$site_config["power_user_color"]."";
break;
case 1: // User
$col = "".$site_config["user_color"]."";

}if($classy[1]>0){
$star="<img src='".$site_config[SITEURL]."/images/star.png' alt='donated' border='0'>";
}else{ $star="";}
if($classy[2]=="yes"){
$warn="<img src='".$site_config[SITEURL]."/images/warned.png' alt='warned' border=0>";
}else{ $warn=""; }
if($classy[3]=="no"){
$disabled="<img src='".$site_config[SITEURL]."/images/disabled.png' alt='disabled' border=0>";
}else{ $disabled=""; }
return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."</font>");
}
//end class colors function

add after:

function class_user_bbcode($name) {
global $site_config;
$a ="SELECT class FROM `users` WHERE username ='".$name."'";
$res = SQL_Query_exec($a);
$classy = @mysql_fetch_row($res);
switch ($classy[0]) {

case 15: // Administrator
$col = "".$site_config["administrator_color"]."";
break;
case 6: // Super Moderator
$col = "".$site_config["super_moderator_color"]."";
break;
case 5: // Moderator
$col = "".$site_config["moderator_color"]."";
break;
case 4: // Uploader
$col = "".$site_config["uploader_color"]."";
break;
case 3: // VIP
$col = "".$site_config["vip_color"]."";
break;
case 2: // Power User
$col = "".$site_config["power_user_color"]."";
break;
case 1: // User
$col = "".$site_config["user_color"]."";
}
return unesc("".$name."");
}

and change in the message for shoutbox:

" .$CURUSER['username']. "

by :


".class_user_bbcode($CURUSER['username'])."
Unknown User
2013-07-11 17:14:55
great stuff thanks very much working like a charm mate, thanks for your help.....

In index.php the code for latest torrents display is as follows, how would the class_user_bbcode be written in there  to have it displat the colors as well?


// latest torrents^M
begin_frame(T_("LATEST_TORRENTS"));^M
^M
print("<br /><center><a href='torrents.php'>".T_("BROWSE_TORRENTS")."</a> - <a href='torrents-search.php'>".T_("SEARCH_TORRENTS")."</a></center><br />");^M
^M
if ($site_config["MEMBERSONLY"] && !$CURUSER) {^M
       echo "<br /><br /><center><b>".T_("BROWSE_MEMBERS_ONLY")."</b></center><br /><br />";^M
if($CURUSER["downloadbanned"]=="yes")
               show_error_msg("Error","Your download rights have been taken away. If you feel this was an error then please PM staff.",1);

} else {^M
       $query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' ORDER BY id DESC LIMIT 25";^M
       $res = SQL_Query_exec($query);^M
       if (mysql_num_rows($res)) {^M
               torrenttable($res);^M
       }else {^M
       ^M
    print("<div class='f-border'>");^M
    print("<div class='f-cat' width='100%'>".T_("NOTHING_FOUND")."</div>");^M
    print("<div>");^M
    print T_("NO_UPLOADS");^M
    print("</div>");^M
    print("</div>");^M
^M
       }^M
       if ($CURUSER)^M
               SQL_Query_exec("UPDATE users SET last_browse=".gmtime()." WHERE id=$CURUSER[id]");^M
^M
}^M
end_frame();
Unknown User
2013-07-16 16:26:39
Anyone able to help perhaps?? Pretty Please?
2013-07-16 21:54:01
In functions.php change this :

case 'uploader':
echo "<td class='ttable_col$x' align='center'>";
if (($row["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $row["owner"] && $CURUSER["edit_torrents"] != "yes")
echo "Anonymous";
elseif ($row["username"])
echo "<a href='account-details.php?id=$row[owner]'>$row[username]</a>";
else
echo "Unknown";
echo "</td>";
break;

to this :


case 'uploader':
echo "<td class='ttable_col$x' align='center'>";
if (($row["anon"] == "yes" || $row["privacy"] == "strong") && $CURUSER["id"] != $row["owner"] && $CURUSER["edit_torrents"] != "yes")
echo "Anonymous";
elseif ($row["username"])
echo "<a href='account-details.php?id=$row[owner]'>".class_user($row[username])."</a>";
else
echo "Unknown";
echo "</td>";
break;
Unknown User
2013-07-17 04:09:29
That works perfect, thanks very very much for the help bud......
Unknown User
2013-07-18 15:17:16
Merci
Unknown User
2013-07-20 17:20:13
Here is an example

search

$postername = $arr2["username"];

replaces

$postername = class_user($arr2["username"]);

you have to do for the rest
Unknown User
2013-08-28 23:52:58
Hey, I want to be able to apply styling to each individual class. Like, I wan to make the user names come out bold, and maybe underlined, or with a textshadow...

// class colors
$site_config['administrator_color'] = '#009AFF'; // Administrator
$site_config['super_moderator_color'] = '#00C000'; // Super Moderator
$site_config['moderator_color'] = '#007F00'; // Moderator
$site_config['uploader_color'] = '#00A49E'; // Uploader
$site_config['vip_color'] = '#7FB600'; // VIP
$site_config['power_user_color'] = '#BD8B00'; // Power User
$site_config['user_color'] = '#856A00'; // User

like, i want to do..

<span style="color:#0112e7; font-weight: bold; border-bottom: 1px dotted black;">$row[user]</span>
and I want to do that to customize each user class. Can somone point me into the rigth direction, I have looked aroudn forum a bit couldnt find it.. any help is greatly appreciated!  :D

Unknown User
2013-08-29 00:12:35
i guess in thoery could modify function class_user

like changing

return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."</font>");

to
  if ($classy[0]==7)
 return unesc('<span style="color:'.$col.'; text-shadow: 1px #3520fd;>"'.$name.'</span>'.$star.''.$warn.''.$disabled.'');
 elseif ($classy[0]==6)
 return unesc('<span style="color:'.$col.'; text-shadow: 1px #3520fd;>"'.$name.'</span>'.$star.''.$warn.''.$disabled.'');
 else
 return unesc("<font color='".$col."'>".$name."".$star."".$warn."".$disabled."</font>");

might work
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