Hi Guys,
I am not a PHP programmer. So this means if the CODE is not clean enough, be my guest and post yours. This is a RECAP for showing the SIGNATURE
in COMMENTS, ACCOUNT, TORRENT DETAILS and the ADMINCP.PHP. In fact, the addition of this code will post the
IMAGE instead of a
LINK.
This as been tested on version 2.06.
Note: I suggest that you take the UPLOAD YOUR AVATAR MOD located at this post [url="
http://www.torrenttrader.org/index.php?showtopic=7034&hl=upavatar%5C.php"]http://www.torrenttrader.org/index.php?sho...vatar\.php[/url] and change all the AVATAR word for SIGNATURES.
Please if you do so, do not forget to create yourself a folder called SIGNATURES in your root directory.
*****************************************************
The code below will add the signature in the COMMENTS.
In the backend folder, edit the FUNCTIONS.PHP
Find:
print("<td valign=top width='75%' class=table_col2>
Replace with:
print("<td valign=top width='75%' class=table_col2>$commenttext<br><br><br><br>");
if ( $usersignature <> "" )
{
echo "<img border='0' src='". stripslashes($row["signature"])."'></td>";
}
print("</tr></table><BR>\n");
***************************************************
The code below will add a signature log in the Account.
In your root folder, edit the ACCOUNT.PHP.
Find:
? print("<B>".SIGNATURE.""); ?>:</b>
Add Below:
<?
if ( $usersignature <> "" )
{
echo "<img border='0' src='". stripslashes( $CURUSER["signature"] )."'>";
}
?><br>
***************************************************
The code below will add the signature in the Admin Control Panel.
In the backend folder, edit the ADMINCP.PHP.
Find:
<td align="center"><a href=admincp.php?action=users><img src="images/admin/users.gif" border=0 width=32 height=32><br>Users</a><BR></td>
Add Below:
<td align="center"><a href=admincp.php?action=signature><img src="images/admin/avatar.gif" border=0 width=32 height=32><br>Signature Log</a><BR></td>
Find:
if ($action=="avatars"){
stdhead("Avatar Log");
navmenu();
begin_frame("Avatar Log");
$query = mysql_query("SELECT count(*) FROM users WHERE enabled='yes' AND avatar !=''");
$count = mysql_fetch_row($query);
$count = $count[0];
list($pagertop, $pagerbottom, $limit) = pager(50, $count, 'admincp.php?action=avatars&');
echo ($pagertop);
?>
<CENTER><TABLE class=table_table>
<TR>
<TD class=table_head><b>User</b></TD>
<TD class=table_head><b><center>Avatar</center></b></TD>
</TR><?
$query = "SELECT username, id, avatar FROM users WHERE enabled='yes' AND avatar !='' $limit";
$res = mysql_query($query);
while($arr = mysql_fetch_array($res)){
echo("<TR><TD class=table_col1><b><A href=\"account-details.php?id=" . $arr['id'] . "\">" . $arr['username'] . "</b></A></TD><TD class=table_col2>");
if (!$arr['avatar'])
echo "<img width=\"80\" src=images/default_avatar.gif></td>";
else
echo "<img width=\"80\" src=\"".htmlspecialchars($arr["avatar"])."\"></td>";
}
?>
</TABLE></CENTER>
<?
echo ($pagerbottom);
end_frame();
stdfoot();
}
Add Below the avatar frame:
/////list signatures
if ($action=="signature"){
stdhead("Signature Log");
navmenu();
begin_frame("Signature Log");
$query = mysql_query("SELECT count(*) FROM users WHERE enabled='yes' AND signature !=''");
$count = mysql_fetch_row($query);
$count = $count[0];
list($pagertop, $pagerbottom, $limit) = pager(15, $count, 'admincp.php?action=signature&');
echo ($pagertop);
?>
<CENTER><TABLE class=table_table>
<TR>
<TD class=table_head><b>User</b></TD>
<TD class=table_head><b><center>Signature</center></b></TD>
</TR><?
$query = "SELECT username, id, signature FROM users WHERE enabled='yes' AND signature !='' $limit";
$res = mysql_query($query);
while($arr = mysql_fetch_array($res)){
$usersignature = stripslashes(format_comment($arr["signature"]));
echo("<TR><TD class=table_col1><b><A href=\"account-details.php?id=" . $arr['id'] . "\">" . $arr['username'] . "</b></A></TD><TD class=table_col2>");
echo "<img border='0' src='". $usersignature ."'></tr>";
}
?>
</TABLE></CENTER>
<?
echo ($pagerbottom);
end_frame();
stdfoot();
}
///////////////////