usergroups index page

Started by gram, September 14, 2011, 04:49:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

#11
I know for a fact you mixed php and html, you need to be using color syntax editors so you can clearly see when you've broken it, if you dont have the experience to take one glance and know it your fucked and never will know, dont mix php and html without breaking in and out first.


gram


MrRep


<?php
    
//==Start activeusers - pdq
     
$keys['activeusers']    = 'activeusers';
     
$active_users_cache $mc1->get_value($keys['activeusers']);
     if (
$active_users_cache === false) {
     
$dt $_SERVER['REQUEST_TIME'] - 180;                       
     
$activeusers '';
     
$active_users_cache = array();
     
$res sql_query('SELECT id, username, class, donor, title, warned, enabled, chatpost, leechwarn, pirate, king '.
              
'FROM users WHERE last_access >= '.$dt.' '.
              
'ORDER BY username ASC') or sqlerr(__FILE____LINE__);
     
$actcount mysql_num_rows($res);
     while (
$arr mysql_fetch_assoc($res)) {
      if (
$activeusers
      
$activeusers .= ",\n";
      
$activeusers .= '<b>'.format_username($arr).'</b>';
     }
     
$active_users_cache['activeusers'] = $activeusers;
     
$active_users_cache['actcount']    = $actcount;
     
$mc1->cache_value($keys['activeusers'] , $active_users_cache$INSTALLER09['expires']['activeusers']);
     }
     if (!
$active_users_cache['activeusers'])
     
$active_users_cache['activeusers'] = 'There have been no active users in the last 15 minutes.';
     
$active_users '<div class="headline">'.$lang['index_active'].'&nbsp;('.$active_users_cache['actcount'].')</div>
     <div class="headbody">
     <!--<a href=\'javascript: klappe_news("a1")\'><img border=\'0\' src=\'pic/plus.gif\' id=\'pica1\' alt=\'[Hide/Show]\' /></a><div id=\'ka1\' style=\'display: none;\'>-->
     <!--<a class="altlink"  title="Click for more info" id="div_open1" style="font-weight:bold;cursor:pointer;"><img border=\'0\' src=\'pic/plus.gif\' alt=\'[Hide/Show]\' /></a>
     <div id="div_info1" style="display:none;background-color:#FEFEF4;max-width:940px;padding: 5px 5px 5px 10px;">-->
     '
.$active_users_cache['activeusers'].'
 <p align="center"><b> <big><font color="#FF0000">User Class Legend</font></big> </b></p>
                   <p align="center"><b>
                  <font color="#ff0000">SysOp</font>
              -&nbsp;<font color="#0027b8">Administrator</font>
              -&nbsp;<font color="#00cc00">Super Moderators</font>
              -&nbsp;<font color="#00ffff">Moderators</font>
              -&nbsp;<font color="#f14f00">Uploader</font>
              -&nbsp;<font color="#8a8a00">PA Legend</font>
              -&nbsp;<font color="#FFC0CB">GFX</font>
              -&nbsp;<font color="#CCFF33">VIP</font>
              -&nbsp;<font color="#ffff00">PA Veteran</font>
              -&nbsp;<font color="#842DCE">PA Elite</font>
              -&nbsp;<font color="#408080">PA Power</font>
              -&nbsp;<font color="#0094d2">PA Member</font> 

</b></p>
     </div><!--</div>-->'
;
     
$HTMLOUT .= $active_users;
     
//== end activeusers
?>


gram

<?php
    
//==Start activeusers - pdq
     
$keys['activeusers']    = 'activeusers';
     
$active_users_cache $mc1->get_value($keys['activeusers']);
     if (
$active_users_cache === false) {
     
$dt $_SERVER['REQUEST_TIME'] - 180;                       
     
$activeusers '';
     
$active_users_cache = array();
     
$res sql_query('SELECT id, username, class, donor, title, warned, highspeed, enabled, chatpost, leechwarn, pirate, king '.
              
'FROM users WHERE last_access >= '.$dt.' '.
              
'ORDER BY username ASC') or sqlerr(__FILE____LINE__);
     
$actcount mysql_num_rows($res);
     while (
$arr mysql_fetch_assoc($res)) {
      if (
$activeusers
      
$activeusers .= ",\n";
      
$activeusers .= '<b>'.format_username($arr).'</b>';
     }
     
$active_users_cache['activeusers'] = $activeusers;
     
$active_users_cache['actcount']    = $actcount;
     
$mc1->cache_value($keys['activeusers'] , $active_users_cache$INSTALLER09['expires']['activeusers']);
     }
     if (!
$active_users_cache['activeusers'])
     
$active_users_cache['activeusers'] = 'Ξ"ΞµΞ½ Ξ­Ο‡ΞΏΟ...Ξ½ Ο...πάΟ�ΞΎΞµΞΉ ΞµΞ½ΞµΟ�Ξ³ΞΏΞΉ Ο‡Ο�ήσΟ,,ΞµΟ, ΟƒΟ,,Ξ± Ο,,ελεΟ...Ο,,Ξ±Ξ―Ξ± 15 Ξ»ΞµΟ€Ο,,Ξ¬.';
     
$active_users '<div class="headline"><img src="./pic/active_users3.png" border="0" alt="Active_Users" title="Active_Users" width="25px" height="25px">'.$lang['index_active'].'&nbsp;('.$active_users_cache['actcount'].')</div>
     <div class="headbody">     
<!--<a href=\'javascript: klappe_news("a1")\'><img border=\'0\' src=\'pic/plus.gif\' id=\'pica1\' alt=\'[Hide/Show]\' /></a><div id=\'ka1\' style=\'display: none;\'>-->
     <!--<a class="altlink"  title="Click for more info" id="div_open1" style="font-weight:bold;cursor:pointer;"><img border=\'0\' src=\'pic/plus.gif\' alt=\'[Hide/Show]\' /></a>
     <div id="div_info1" style="display:none;background-color:#FEFEF4;max-width:940px;padding: 5px 5px 5px 10px;">-->
     '
.$active_users_cache['activeusers'].'
     </div><!--</div>-->'
;
     
$HTMLOUT .= $active_users;
     
//== end activeusers
?>


Mindless


gram


MrRep

well how i did it was like this
in blocks/active_users.php

under


'.$active_users_cache['activeusers'].'


add this (but edit to your groups and colours)


<p align="center"><b> <big><font color="#FF0000">User Class Legend</font></big> </b></p>
                   <p align="center"><b>
                  <font color="#ff0000">SysOp</font>
              -&nbsp;<font color="#0027b8">Administrator</font>
              -&nbsp;<font color="#00cc00">Super Moderators</font>
              -&nbsp;<font color="#00ffff">Moderators</font>
              -&nbsp;<font color="#f14f00">Uploader</font>
              -&nbsp;<font color="#8a8a00">PA Legend</font>
              -&nbsp;<font color="#FFC0CB">GFX</font>
              -&nbsp;<font color="#CCFF33">VIP</font>
              -&nbsp;<font color="#ffff00">PA Veteran</font>
              -&nbsp;<font color="#842DCE">PA Elite</font>
              -&nbsp;<font color="#408080">PA Power</font>
              -&nbsp;<font color="#0094d2">PA Member</font>

</b></p>

Mindless

Just alter what you have, active users is where the legend will be off course so edit block/index/active_users.php - Add a simple line of html with the classes color coded above the printed active users variable in its own td or whatever, its a basic 2 min job gram.

gram


MrRep

i have just hard coded mine into the active user block, simple bit of code :)

gram

i want to add the usergroups on index page
can anyone help me?: