Recent Posts
C | 1 sec ago
C# | 33 sec ago
None | 40 sec ago
C# | 47 sec ago
C# | 50 sec ago
C# | 1 min ago
None | 2 min ago
None | 2 min ago
None | 3 min ago
None | 4 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By PiratKapten on the 9th of Feb 2010 11:30:37 PM Download | Raw | Embed | Report
  1. /*
  2. +--------------------------------------------------------------------------+
  3. |                                                                          |
  4. |  THIS FILE IS CREATED BY PiratKapten - TorrentStart.nu                   |
  5. |  You may edit this code as long as my name remains. To show respect!     |
  6. |                                                                          |
  7. |   View lastets online image (avatars)                                    |
  8. |   Plugin to Template Shares                                              |
  9. |                                                                          |
  10. |   VERSION 0.3                                                            |
  11. |                                                                          |
  12. |   CREATED: 08-02-2010                                                    |
  13. |   LAST EDIT: 09-02-2010                                                  |
  14. +--------------------------------------------------------------------------+
  15. */
  16.  
  17. // Dont change for future reference.
  18. if (!defined('TS_P_VERSION'))
  19. {
  20.         define('TS_P_VERSION', 'lastlogin 0.3');
  21. }
  22. // Security Check.
  23. if (!defined('IN_PLUGIN_SYSTEM'))
  24. {
  25.         die("<font face='verdana' size='2' color='darkred'><b>Error!</b> Direct initialization of this file is not allowed.</font>");
  26. }
  27.  
  28. /*-----------------------------SET YOUR SETTINGS HERE---------------------------------------*/
  29.  
  30. //****** OBS! ******************* OBS! ******************** OBS! ****************************/
  31. //The hashcolor/html-color on yours usergroups must have like this <span style="color:#009F00;"><strong>{username}</strong></span>
  32. //And NOT <span style="rgb(225,84,84);<strong>{username}</strong></span>... You can edit this in: Setting Panel -> Manage Usergroups.
  33. //Hope you understand it =)
  34.  
  35. /******************************* Time for mathematics ***************************************/
  36.  
  37. //Counts avatars/images to output
  38. $limit = 11;
  39. //Number of breaks in the table (</tr><tr>)
  40. $line_break = 0;
  41.  
  42. /*************** Time for Height, width and yours defult avatar/image ***********************/
  43.  
  44. //Height of avatars
  45. $img_height = 62;
  46. //Width of avatars
  47. $img_width =  55;
  48. //Avatars default image (leave blank if to views default avatars and "not" default avatars)
  49. $default_avatar = '/pic/default_avatar.png';
  50.  
  51. /*------------------------------------------------------------------------------------------*/
  52.  
  53.          // Query
  54.          $sql_query = 'SELECT u.id, u.username, u.avatar, u.last_login, u.usergroup, u.donor, g.namestyle, g.gid
  55.                   FROM users u LEFT JOIN usergroups g ON (u.usergroup=g.gid)
  56.                   '.(isset($default_avatar) ? 'WHERE avatar != "'.$default_avatar.'"' : '').'
  57.                   ORDER BY last_login DESC LIMIT 0,'.$limit;
  58.  
  59.      $query = mysql_query($sql_query);
  60.  
  61.     if (!mysql_num_rows($query) > 0)
  62.     {
  63.          $lastlogin .= 'Sorry, no data found!';
  64.     } else {
  65.           $round = 1;
  66.           $break_count = ($limit/$line_break);
  67.           $lastlogin .= '<!-- Begin Lastlogin. (Coded by PiratKapten - TorrentStart.nu) -->';
  68.           $lastlogin .= '<table cellpadding="0" cellspacing="0"><tr>';
  69.                 while($user = mysql_fetch_assoc($query))
  70.                 {//While begin
  71.             if (!empty($user['avatar']) || file_exists($BASEURL.$user['avatar']))
  72.             {
  73.                 $user_avatar = '<img src="'.$user['avatar'].'" width="'.$img_width.'" height="'.$img_height.'" alt="'.$user['id'].'">';
  74.             } else {
  75.                 $user_avatar = '<img src="'.$default_avatar.'" width="'.$img_width.'" height="'.$img_height.'" alt="'.$user['id'].'">';
  76.             }
  77.             $explode = get_user_color($user['username'], $user['namestyle']);
  78.  
  79.             $explodes = explode('"', $explode);
  80.  
  81.             $namestyle = $explodes['0'].$explodes['1'].$explodes['2'].'&nbsp;'.($user['donor'] == "yes" ? "<img src=".$BASEURL."/pic/star.gif>" : '');
  82.  
  83.             $lastlogin .= '<td class="none"><div style="padding:2px; margin:2px; border: 1px solid #dddddd;">';
  84.  
  85.             $lastlogin .= '<a href="'.ts_seo($user['id'],$user['username']).'" onmouseover="ddrivetip(\'<center>'.$namestyle.'</center>\', 115)"; onmouseout="hideddrivetip()">'.$user_avatar.'</a>';
  86.  
  87.             $lastlogin .= '</div></td>';
  88.             // Checks This Rounds In The While's Loop.
  89.             if ($round === $break_count){
  90.                 $lastlogin .= '</tr><tr>';
  91.                 unset($round);
  92.             }
  93.             $round++;
  94.                  }// While end
  95.        $lastlogin .= '</tr></table>';
  96.        $lastlogin .= '<!-- End of Lastlogin. (Coded by PiratKapten - TorrentStart.nu) -->';
  97.      }
  98. ?>
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: