/*
+--------------------------------------------------------------------------+
| |
| THIS FILE IS CREATED BY PiratKapten - TorrentStart.nu |
| You may edit this code as long as my name remains. To show respect! |
| |
| View lastets online image (avatars) |
| Plugin to Template Shares |
| |
| VERSION 0.3 |
| |
| CREATED: 08-02-2010 |
| LAST EDIT: 09-02-2010 |
+--------------------------------------------------------------------------+
*/
// Dont change for future reference.
{
define('TS_P_VERSION', 'lastlogin 0.3');
}
// Security Check.
{
die("<font face='verdana' size='2' color='darkred'><b>Error!</b> Direct initialization of this file is not allowed.</font>");
}
/*-----------------------------SET YOUR SETTINGS HERE---------------------------------------*/
//****** OBS! ******************* OBS! ******************** OBS! ****************************/
//The hashcolor/html-color on yours usergroups must have like this <span style="color:#009F00;"><strong>{username}</strong></span>
//And NOT <span style="rgb(225,84,84);<strong>{username}</strong></span>... You can edit this in: Setting Panel -> Manage Usergroups.
//Hope you understand it =)
/******************************* Time for mathematics ***************************************/
//Counts avatars/images to output
$limit = 11;
//Number of breaks in the table (</tr><tr>)
$line_break = 0;
/*************** Time for Height, width and yours defult avatar/image ***********************/
//Height of avatars
$img_height = 62;
//Width of avatars
$img_width = 55;
//Avatars default image (leave blank if to views default avatars and "not" default avatars)
$default_avatar = '/pic/default_avatar.png';
/*------------------------------------------------------------------------------------------*/
// Query
$sql_query = 'SELECT u.id, u.username, u.avatar, u.last_login, u.usergroup, u.donor, g.namestyle, g.gid
FROM users u LEFT JOIN usergroups g ON (u.usergroup=g.gid)
'.(isset($default_avatar) ?
'WHERE avatar != "'.$default_avatar.'"' : '').'
ORDER BY last_login DESC LIMIT 0,'.$limit;
{
$lastlogin .= 'Sorry, no data found!';
} else {
$round = 1;
$break_count = ($limit/$line_break);
$lastlogin .= '<!-- Begin Lastlogin. (Coded by PiratKapten - TorrentStart.nu) -->';
$lastlogin .= '<table cellpadding="0" cellspacing="0"><tr>';
{//While begin
{
$user_avatar = '<img src="'.$user['avatar'].'" width="'.$img_width.'" height="'.$img_height.'" alt="'.$user['id'].'">';
} else {
$user_avatar = '<img src="'.$default_avatar.'" width="'.$img_width.'" height="'.$img_height.'" alt="'.$user['id'].'">';
}
$explode = get_user_color($user['username'], $user['namestyle']);
$explodes = explode('"', $explode);
$namestyle = $explodes['0'].$explodes['1'].$explodes['2'].' '.($user['donor'] == "yes" ? "<img src=".$BASEURL."/pic/star.gif>" : '');
$lastlogin .= '<td class="none"><div style="padding:2px; margin:2px; border: 1px solid #dddddd;">';
$lastlogin .= '<a href="'.ts_seo($user['id'],$user['username']).'" onmouseover="ddrivetip(\'<center>'.$namestyle.'</center>\', 115)"; onmouseout="hideddrivetip()">'.$user_avatar.'</a>';
$lastlogin .= '</div></td>';
// Checks This Rounds In The While's Loop.
if ($round === $break_count){
$lastlogin .= '</tr><tr>';
}
$round++;
}// While end
$lastlogin .= '</tr></table>';
$lastlogin .= '<!-- End of Lastlogin. (Coded by PiratKapten - TorrentStart.nu) -->';
}
?>