Advertisement:

Author Topic: signature info stats [no more updates and support]  (Read 160689 times)

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
signature info stats [no more updates and support]
« on: August 20, 2005, 10:42:12 PM »
So ...

New vision (Oct 12,  2007) - One man show signature



Get the code here

Arcade last 4 games + scores + position only
arcade last games thumbnails or scores + position
SMF  Shop -> money


access as
Code: [Select]
[img]http://www.mydomain.com/sign.php?u=x[/img]
http://www.mydomain.com/sign.php?u=x

u=x -> user ID

or
Code: [Select]
[img]http://www.mydomain.com/sign.png?u=x[/img]
http://www.mydomain.com/sign.png?u=x

u=x -> user ID

by adding  2 lines into your .htaccess file.

RewriteEngine On
RewriteRule sign.png sign.php


If the file sign.php is inside the folder /forum then .htaccess must be...

RewriteEngine On
RewriteRule sign.png /forum/sign.php


Clasic signature info stats-----------------------


-----------------------------------
First case no use font (left image)

STEP 1
make a file, for example signature_info.php and copy this file into root path of SMF installation. {full code below}

STEP 2
copy an image for background, for example this image (right click/save as image) --> into /Themes/Default/images    path

STEP 3
Goto your profile settings and set this text into your signature area ->
Code: [Select]
[img]http://my.forum.url.com/signature_info.php[/img]for example ->
Code: [Select]
[img]http://www.iamsmfuser.com/signature_info.php[/img]


Finally set your signature -->
Code: [Select]
[img]http://mydomain/signinfo.png[/img][/center]


signature_info.php NO_FONTS (SMF 1.1.x)

Code: [Select]
<?php

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

signature();

function 
signature()
{
global 
$context$settings$modSettings$db_prefix$boardurl;

$result db_query("
SELECT COUNT(session)
FROM 
{$db_prefix}log_online"__FILE____LINE__);
list ($context['users_online']) = mysql_fetch_row($result);
mysql_free_result($result);

$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$now forum_time();
$timel date("d-M-Y H:i:s",$now);
$total_members $context['common_stats']['total_members'];
$total_posts $context['common_stats']['total_posts'];
$total_topics $context['common_stats']['total_topics'];
$online_members $context ['users_online'];
$last_member $context['common_stats']['latest_member']['name'];

$image "$img_url/images/signature_info.png"// or where you want
$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); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);
 
ImageString($im3101"$forum_name"$blue); 
ImageString($im39415"$forum_url"$blue);
ImageString($im39031"$timel Local Time"$green);
ImageString($im39046"Total Members : $total_members"$red);
ImageString($im39061"Online Members: $online_members"$red);
ImageString($im322061"Total Posts: $total_posts"$red);
ImageString($im322046"Total Topics: $total_topics"$red);
ImageString($im39076"Latest Member: $last_member "$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,90,null);
  }    
ImageDestroy ($im); 
}
?>

signature_info.php NO_FONTS (SMF 2.x.x)

Code: [Select]
<?php

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

signature();

function 
signature()
{
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);

$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$now forum_time();
$timel date("d-M-Y H:i:s",$now);
$total_members $context['common_stats']['total_members'];
$total_posts $context['common_stats']['total_posts'];
$total_topics $context['common_stats']['total_topics'];
$online_members $context['num_users_online'];
$last_member $context['common_stats']['latest_member']['name'];

$image "$img_url/images/signature_info.png"// or where you want
$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); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);
 
ImageString($im3101"$forum_name"$blue); 
ImageString($im39415"$forum_url"$blue);
ImageString($im39031"$timel Local Time"$green);
ImageString($im39046"Total Members : $total_members"$red);
ImageString($im39061"Online Members: $online_members"$red);
ImageString($im322061"Total Posts: $total_posts"$red);
ImageString($im322046"Total Topics: $total_topics"$red);
ImageString($im39076"Latest Member: $last_member "$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); 
}
?>
----------------------------------------------------------------------------------------------------------------------------------

Second  case use font (right image)

STEP 1 STEP 2 STEP 3 is the same with first case

STEP 4
Make a folder /fonts in the same path of /Themes or where you want but change this from signature_info.php below
copy into folder /fonts a font file (ttf), for example arial.ttf or MTCORSVA.TTF (Monotype Corsiva) or other font but change the name and path from signature_info.php file below.



signature_info.php use font (SMF 1.1.x)

Code: [Select]
<?php

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

signature();

function 
signature()
{
global 
$context$settings$modSettings$db_prefix$boardurl$boarddir;

$result db_query("
SELECT COUNT(session)
FROM 
{$db_prefix}log_online"__FILE____LINE__);
list ($context['users_online']) = mysql_fetch_row($result);
mysql_free_result($result);

$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$now forum_time();
$timel date("d-M-Y H:i:s",$now);
$total_members $context['common_stats']['total_members'];
$total_posts $context['common_stats']['total_posts'];
$total_topics $context['common_stats']['total_topics'];
$online_members $context ['users_online'];
$last_member $context['common_stats']['latest_member']['name'];

$image "$img_url/images/signature_info.png"// or where you want
$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); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);
$font $boarddir .'/fonts/arial.ttf'// change your font path and name here
 
imagettftext($im1201015$blue$font"$forum_name"); 
imagettftext($im1209431$blue$font"$forum_url");
imagettftext($im1209046$green$font"$timel Local Time");
imagettftext($im1209061$red$font"Total Members : $total_members");
imagettftext($im1209076$red$font"Online Members: $online_members");
imagettftext($im12022076$red$font"Total Posts: $total_posts");
imagettftext($im12022061$red$font"Total Topics: $total_topics");
imagettftext($im1209091$red$font"Latest Member: $last_member ");
 
$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); 
}
?>

signature_info.php use font (SMF 2.x.x)

Code: [Select]
<?php

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

signature();

function 
signature()
{
global 
$smcFunc$context$settings$modSettings$boardurl$boarddir;

$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);

$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$now forum_time();
$timel date("d-M-Y H:i:s",$now);
$total_members $context['common_stats']['total_members'];
$total_posts $context['common_stats']['total_posts'];
$total_topics $context['common_stats']['total_topics'];
$online_members $context ['users_online'];
$last_member $context['common_stats']['latest_member']['name'];

$image "$img_url/images/signature_info.png"// or where you want
$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); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);
$font $boarddir .'/fonts/arial.ttf'// change your font path and name here
 
imagettftext($im1201015$blue$font"$forum_name"); 
imagettftext($im1209431$blue$font"$forum_url");
imagettftext($im1209046$green$font"$timel Local Time");
imagettftext($im1209061$red$font"Total Members : $total_members");
imagettftext($im1209076$red$font"Online Members: $online_members");
imagettftext($im12022076$red$font"Total Posts: $total_posts");
imagettftext($im12022061$red$font"Total Topics: $total_topics");
imagettftext($im1209091$red$font"Latest Member: $last_member ");
 
$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); 
}
?>
« Last Edit: July 19, 2009, 06:14:23 AM by sebastian »

Offline Snickers

  • Jr. Member
  • **
  • Posts: 127
Re: signature info stats
« Reply #1 on: September 08, 2005, 09:55:52 AM »
I did a few changes so it fits mine better:

Code: ("signature_info.php") [Select]
<?php

require(dirname(__FILE__) . &#39;/SSI.php&#39;);

$result db_query("
SELECT COUNT(session)
FROM 
{$db_prefix}log_online"__FILE____LINE__);
list ($context[&#39;users_online&#39;]) = mysql_fetch_row($result);
mysql_free_result($result);

$forum_version = &#39;SMF 1.1 Beta 3 Public&#39;; //make manually changes
$forum_name $context[&#39;forum_name&#39;];
$forum_url $boardurl;
$now forum_time();
$total_members $context[&#39;common_stats&#39;][&#39;total_members&#39;];
$total_posts $context[&#39;common_stats&#39;][&#39;total_posts&#39;];
$total_topics $context[&#39;common_stats&#39;][&#39;total_topics&#39;];
$online_members $context [&#39;users_online&#39;];
$latest_member $context[&#39;common_stats&#39;][&#39;latest_member&#39;];
 

$image "http://www.******.com/Themes/default/images/800%20by%20180.jpg"// or where you want
$im imagecreatefrompng($image); 
$green ImageColorAllocate ($im2312417); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);

 
ImageString($im3101"Statistics of $forum_name"$blue); 
ImageString($im39415"$forum_url"$blue);
ImageString($im39031"latest_member"$green); 
ImageString($im39061"Total Members : $total_members"$red);
ImageString($im39076"Online Members: $online_members"$red);
ImageString($im322061"Total Posts: $total_posts"$red);
ImageString($im322076"Total Topics: $total_topics"$red);
ImageString($im39091"Forum Version: $forum_version "$black);
 
header("Content-Type: image/png"); 
Imagepng($im,&#39;&#39;,100); 
ImageDestroy ($im); 

?>

Please help me!

and I havn't edited the SSI.php....

Offline Valodim

  • Full Member
  • ***
  • Posts: 417
Re: signature info stats
« Reply #2 on: September 08, 2005, 10:07:47 AM »
help you with what? I don't see no question or error message in your post... ::)

Offline Snickers

  • Jr. Member
  • **
  • Posts: 127
Re: signature info stats
« Reply #3 on: September 08, 2005, 11:51:52 AM »
Oh sorry, well when I go to reply mode and write:



and press preview, it doesn't show any image :(

Also if I go to: http://www.*****.com/signature_info.php

it says: The image “http://www.*****.com/signature_info.php” cannot be displayed, because it contains errors.

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #4 on: October 19, 2005, 04:07:38 AM »
What errors Snickers?

Quote
$image = "http://www.******.com/Themes/default/images/800%20by%20180.jpg"; // or where you want
  <---- Yours modification

MUST BE PNG FILE TO WORK PROPERLY because you call this file by header("Content-Type: image/png");

« Last Edit: October 19, 2005, 04:37:20 AM by sebastian »

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,590
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: signature info stats
« Reply #5 on: October 19, 2005, 04:24:46 AM »
Nice tip, thanks for sharing.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Offline eohjay

  • Newbie
  • *
  • Posts: 3
Re: signature info stats
« Reply #6 on: November 05, 2005, 05:06:36 AM »
Hi, I've got a quick question for this...

I went through and edited everything and it seems to be working all right, but my Total Members, Total Posts, Total Topics, and Latest Member sections show up blank. The Online Members section works fine though, oddly.

Here's a example...



I have a feeling I'm missing something fairly obvious, can I get any help please?

Offline Sting

  • Semi-Newbie
  • *
  • Posts: 61
  • Gender: Male
    • Subspace/Continuum Info & Tutorials
Re: signature info stats
« Reply #7 on: November 05, 2005, 04:01:43 PM »
mine won't show the latest member, but I haven't added any of this... strange.

Offline CKnetworX

  • Semi-Newbie
  • *
  • Posts: 14
  • Gender: Male
  • cknetworx.com
    • CKnetworX
Re: signature info stats
« Reply #8 on: November 11, 2005, 08:13:32 PM »
Hi, I've got a quick question for this...

I went through and edited everything and it seems to be working all right, but my Total Members, Total Posts, Total Topics, and Latest Member sections show up blank. The Online Members section works fine though, oddly.

Here's a example...



I have a feeling I'm missing something fairly obvious, can I get any help please?

Same here...
FREE Domains [nofollow] FREE Webhosting [nofollow]



Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #9 on: November 11, 2005, 08:50:00 PM »
eohjay or CKnetworX can you post your php code of "signature_info.php"? This tip is very easy to work properly.

ps Tested only with SMF 1.1 beta 3 and SMF 1.1 RC1

Now Snickers and Sting this is wrong --> ImageString($im, 3, 90, 31, "latest_member", $green);
Replace with this -> ImageString($im, 3, 90, 31, "latest_member : $latest_member", $green);
« Last Edit: November 11, 2005, 09:26:54 PM by sebastian »

Offline spottedhog

  • Sr. Member
  • ****
  • Posts: 782
  • Gender: Male
Re: signature info stats
« Reply #10 on: June 17, 2006, 12:31:23 PM »
I have this signature_info.php working on my own forums, however, when I try to use it as a signature in another forum website, it does not work.  These other websites are phpbb websites.

any ideas?

thanks....


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #12 on: July 08, 2006, 11:30:22 AM »
spottedhog  i haven't tried it in any phpbb forum, normally it can work anywhere.

Well, doesn's work.  I suppose it will work only with a mod to deactivate some default features of phpbb2.
Try this --->
open your .htaccess ADD this line AddType application/x-httpd-php .png

then rename your .php file to .png file... For example signinfo.php to signinfo.png...

Finally set your signature 
Code: [Select]
[img]http://mydomain/signinfo.png[/img]

ArkServer i thing there's something wrong with your ssi.php and signature_info.php file.

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

If you have PHP v5.1++ try this
Code: [Select]
Imagepng($im,'',9) instead
Code: [Select]
Imagepng($im,'',90)
« Last Edit: August 07, 2006, 07:15:23 PM by sebastian »

Offline PrizeLive.com

  • Full Member
  • ***
  • Posts: 683
    • PrizeLive.com
Re: signature info stats
« Reply #13 on: July 08, 2006, 06:23:15 PM »
is this available for version 1.1 rc2?
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #14 on: July 09, 2006, 07:39:43 AM »
Yes, is very simple script.

Offline PrizeLive.com

  • Full Member
  • ***
  • Posts: 683
    • PrizeLive.com
Re: signature info stats
« Reply #15 on: July 09, 2006, 06:54:42 PM »
Yes, is very simple script.

do i just use the code in the first post?
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #16 on: July 10, 2006, 07:32:08 AM »
Yes SurfExcelerator!

Offline IncubuS

  • Semi-Newbie
  • *
  • Posts: 14
    • http://www.the-ien.com
Re: signature info stats
« Reply #17 on: July 15, 2006, 08:06:37 PM »
Indeed very lovely , thanks for sharing .
www.the-ien.com [nofollow]

Offline PrizeLive.com

  • Full Member
  • ***
  • Posts: 683
    • PrizeLive.com
Re: signature info stats
« Reply #18 on: July 26, 2006, 01:51:19 PM »
I tried this but no stats are showing...

This is all that shows -->



I'm using version 1.1 RC2.

Can someone help?
« Last Edit: July 26, 2006, 02:03:04 PM by SurfExcelerator.com »
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Offline Chucky

  • Jr. Member
  • **
  • Posts: 123
Re: signature info stats
« Reply #19 on: July 29, 2006, 08:00:17 AM »
How do I make the entire image a hyperlink? Oh, and I almost forgot to say without using actual linking tags. I want the linking code to be in the php signature info file... possible?
« Last Edit: July 29, 2006, 08:06:10 AM by Chucky »