Advertisement:

SSI.php question: Online member count

Aloittaja MoreBloodWine, syyskuu 14, 2013, 10:25:52 AP

« edellinen - seuraava »

MoreBloodWine

$online_members = number_format($context['num_users_online']);

Thats a line from the stat sig code used to produce the image in my signature. Well, I was curious how it would be changed to show either online guest / online users "actual members".

I wana add an extra line to my sig for guests to seperate them from actual online users if possible.

Ty.

Edit: Here's the entire code set form the php file.

<?php

if (file_exists(dirname(__FILE__) . '/../SSI.php')) {
   require(
dirname(__FILE__) . '/../SSI.php');
}
else
die();

signature();

function 
signature(){

$data file_get_contents(dirname(__FILE__) . '/../index.php');
if (
preg_match('/$forum_version = [\'"]SMF\s*([^\']*)[\'"]/is'$data$m)
  || 
preg_match('/@version\s*([0-9\.]*(?:\s?RC[0-9]*)?)/is'$data$m)
  
//  || preg_match('/Software Version:\s*SMF\s*([0-9\.]*(?:\s?RC[0-9]*)?)/is', $data, $m)
) {  
  
// $m[1] now holds the version number  
} else {  
  
// parse error  
}

global 
$smcFunc$context$settings$modSettings$boardurl;

   
$request $smcFunc['db_query']('''
      SELECT count(session)         
      FROM {db_prefix}log_online
      '
,
      array()
   );
   
list (
$context['num_users_online']) = $smcFunc['db_fetch_row']($request);   
$smcFunc['db_free_result']($request);

$forum_name $context['forum_name'];
$forum_url $boardurl;
$now forum_time();
$timel date("F jS Y g:ia T"$now);
$total_members number_format($context['common_stats']['total_members']);
$online_members number_format($context['num_users_online']); 
$total_topics number_format($context['common_stats']['total_topics']);
$total_posts number_format($context['common_stats']['total_posts']);
$last_member $context['common_stats']['latest_member']['name'];
$forum_version $m[1];

$base = isset($_GET['base']) ? trim(htmlspecialchars($_GET['base'])) : '';

switch (
$base) {
    case 
'alt1':
        
$image ='http://www.dust514corps.com/forum_stat_sigs/signature_info_alt1.png';
        break;
    case 
'alt2':
        
$image 'http://www.dust514corps.com/forum_stat_sigs/signature_info_alt2.png';
        break;
    default:
       
$image 'http://www.dust514corps.com/forum_stat_sigs/signature_info.png';
}

$im imagecreatefrompng($image);
if (!
$im)
 {
   
$im imagecreatetruecolor(385110); // x-coordinate,  y-coordinate
   //default is black but if you want another background color uncheck
   //imagefill($im, 0, 0, 255, 0, 0); // red etc
 

 
$green ImageColorAllocate ($im2312417);
$lightblue ImageColorAllocate ($im0204153);
$lightgreen ImageColorAllocate ($im15325551); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
 
ImageString($im341"Statistics of $forum_name"$lightblue); 
ImageString($im310215"$forum_url"$lightblue);
ImageString($im310231"Time: $timel"$lightgreen);
ImageString($im310246"Total Members: $total_members"$white);
ImageString($im310261"Online Members: $online_members"$white);
ImageString($im326246"Total Topics: $total_topics"$white);
ImageString($im326261"Total Posts: $total_posts"$white);
ImageString($im310276"Latest Member: $last_member"$lightgreen);
ImageString($im312091"Forum Version: $forum_version"$red);

$php PHP_VERSION
header("Content-Type: image/png");
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
  
Imagepng($im,null,9,null);  
  }
else {
    
Imagepng($im,null,9,null);
  }    
ImageDestroy ($im); 
}
?>
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Advertisement: