Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: sebastian on August 20, 2005, 10:42:12 PM

Title: signature info stats [no more updates and support]
Post by: sebastian on August 20, 2005, 10:42:12 PM
So ...

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

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_tl.gif&hash=f6a72cd6b0363123880dbbb63e53179a)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_tr.gif&hash=3492901f89e6914ccce9bebbc2782c96)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_bl.gif&hash=f7fa546ecc795b7a56f380349348480b)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_br.gif&hash=15127a7b95b669d8cc3122c4c5f1db0e)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_arcl.gif&hash=df44c0827dafa4629721836d7324200c)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_arcr.gif&hash=27f345f9f1ef9b6a6f9adb0ead3a73ae)


Get the code here (http://www.simplemachines.org/community/index.php?topic=46408.msg1271553#msg1271553)
Arcade last 4 games + scores + position only (http://www.simplemachines.org/community/index.php?topic=46408.120)
arcade last games thumbnails or scores + position (http://www.simplemachines.org/community/index.php?topic=46408.msg1280432#msg1280432)
SMF  Shop -> money (http://www.simplemachines.org/community/index.php?topic=46408.msg1275537#msg1275537)


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-----------------------

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign2007.gif&hash=847de6807746d5e05c8ec7e7daea2306)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsignfont2007.gif&hash=3d4eda52f7b7a9976abbdf4dfcc43a64)

-----------------------------------
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) --> (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsignature_info.png&hash=fb46ab48e75d610ed51af29f993ce6ef) 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); 
}
?>
Title: Re: signature info stats
Post by: Snickers 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....
Title: Re: signature info stats
Post by: Valodim on September 08, 2005, 10:07:47 AM
help you with what? I don't see no question or error message in your post... ::)
Title: Re: signature info stats
Post by: Snickers on September 08, 2005, 11:51:52 AM
Oh sorry, well when I go to reply mode and write:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.%2A%2A%2A%2A%2A.com%2Fsignature_info.php&hash=fe99a8bc93c3d37a601f4e6166160b63)

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.
Title: Re: signature info stats
Post by: sebastian 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");

Title: Re: signature info stats
Post by: Owdy on October 19, 2005, 04:24:46 AM
Nice tip, thanks for sharing.
Title: Re: signature info stats
Post by: eohjay 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...

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Feohjay.net%2Fsmf%2Fsignature_info.php&hash=39cb0c39b4f1176a606ab38eb7eea3e8)

I have a feeling I'm missing something fairly obvious, can I get any help please?
Title: Re: signature info stats
Post by: Sting on November 05, 2005, 04:01:43 PM
mine won't show the latest member, but I haven't added any of this... strange.
Title: Re: signature info stats
Post by: CKnetworX 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...

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Feohjay.net%2Fsmf%2Fsignature_info.php&hash=39cb0c39b4f1176a606ab38eb7eea3e8)

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

Same here...
Title: Re: signature info stats
Post by: sebastian 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);
Title: Re: signature info stats
Post by: spottedhog 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....
Title: Re: signature info stats
Post by: ArkServer on June 17, 2006, 12:56:41 PM
I get a blank screen
http://atlantis.montecarlohosting.net/~arksvr/forum/signature_info.php
Title: Re: signature info stats
Post by: sebastian 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)
Title: Re: signature info stats
Post by: PrizeLive.com on July 08, 2006, 06:23:15 PM
is this available for version 1.1 rc2?
Title: Re: signature info stats
Post by: sebastian on July 09, 2006, 07:39:43 AM
Yes, is very simple script.
Title: Re: signature info stats
Post by: PrizeLive.com on July 09, 2006, 06:54:42 PM
Yes, is very simple script.

do i just use the code in the first post?
Title: Re: signature info stats
Post by: sebastian on July 10, 2006, 07:32:08 AM
Yes SurfExcelerator!
Title: Re: signature info stats
Post by: IncubuS on July 15, 2006, 08:06:37 PM
Indeed very lovely , thanks for sharing .
Title: Re: signature info stats
Post by: PrizeLive.com on July 26, 2006, 01:51:19 PM
I tried this but no stats are showing...

This is all that shows -->

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg502.imageshack.us%2Fimg502%2F9480%2Funtitledgc2.png&hash=0321ca855de1f1d2d7e27a3fd1b50ec1)

I'm using version 1.1 RC2.

Can someone help?
Title: Re: signature info stats
Post by: Chucky 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?
Title: Re: signature info stats
Post by: spottedhog on July 29, 2006, 08:27:32 AM
Surf---  try an image file that has more height and less width.  As you can see from my sig, I resized everything to make it fit.  And yes, I removed some items to make it space out ok. 
Title: Re: signature info stats
Post by: sebastian on August 07, 2006, 07:03:37 PM
For Chucky and spottedhog (older post about  forum who do not accept .php link as signature)

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]

Title: Re: signature info stats
Post by: spottedhog on August 07, 2006, 07:46:42 PM
Thanks!!!   I had long forgotten about it.....  I will try it!

thanks again!
Title: Re: signature info stats
Post by: karlbenson on August 10, 2006, 12:27:07 PM
Latest member wasnt working for me, so i changed
$latest_member = $context['common_stats']['latest_member'];

to

$latest_member = $context['common_stats']['latest_member']['name'];
Title: Re: signature info stats
Post by: a2h_ on August 18, 2006, 06:45:08 AM
I tried to add the font the same way the topic starter did but it still looked the same...

Code: [Select]
<?php
$img_number 
imagecreate(150,25);
$backcolor imagecolorallocate($img_number,0,0,0);
$textcolor imagecolorallocate($img_number,255,255,255);
$font "fonts/cour.ttf"// change your font path and name here
imagefill($img_number,0,0,$backcolor);
$number "$_SERVER[REMOTE_ADDR]";
Imagestring($img_number,10,5,5,$number,$textcolor);

header("Content-type: image/gif");
imagegif($img_number);
?>
My font is Courier New, in http://rctxtremegamez.aonservers.com/forum/fonts/cour.ttf
Title: Re: signature info stats
Post by: sebastian on August 20, 2006, 05:43:44 PM
It's not the same.
Check your script syndax again.

Quote
imagestring ( resource image, int font, int x, int y, string s, int col )
http://php.net/imagestring
 

Try to use 1,2,3,4 or 5 no 10

Title: Re: signature info stats
Post by: a2h_ on August 21, 2006, 03:01:34 AM
10? How would that be Courier New? PHP is so confusing....
Title: Re: signature info stats
Post by: spottedhog on August 21, 2006, 07:11:42 AM
Did you try putting in the absolute path to your font file?
Title: Re: signature info stats
Post by: sebastian on August 21, 2006, 08:28:46 AM
Try this ...

Quote
<?php

$im = imagecreatetruecolor(130,30);
$white = ImageColorAllocate ($im, 255, 255, 255);
$font = "fonts/cour.ttf"; // change your font path and name here
$number = "$_SERVER[REMOTE_ADDR]";

imagettftext($im, 12, 0, 20, 20, $white, $font, $number);

header("Content-Type: image/png");
Imagepng($im,'',9);
ImageDestroy ($im);

?>
Title: Re: signature info stats
Post by: a2h_ on August 22, 2006, 02:47:59 AM
Doesn't work, just gives me an image 4 pixels wide. Go to my forum http://www.rctxtremegamez.aonservers.com/forum/ (http://www.rctxtremegamez.aonservers.com/forum/) and look at the section 'Your user IP has been logged'.
Title: Re: signature info stats
Post by: sebastian on August 22, 2006, 06:39:14 AM
If you have PHP version 4.0+ then Imagepng($im,'',90); otherwise if your php version is 5.0 + then  Imagepng($im,'',9);

It work fine. http://www.rctxtremegamez.aonservers.com/forum/userip.php

.... does not exist any problem.
Title: Re: signature info stats
Post by: a2h_ on August 22, 2006, 08:10:32 PM
Fatal error: Call to undefined function: imagettftext() in /home/rctxtrem/public_html/forum/userip.php on line 8
Title: Re: signature info stats
Post by: sebastian on August 23, 2006, 11:48:26 AM
rctxtreme this is impossible
yesterday your little script it was well.

Check all elements of imagettftext() again.
or copy-past this script here.
Title: Re: signature info stats
Post by: a2h_ on August 24, 2006, 03:13:53 AM
No, yesterday I used the old script that I started with
Title: Re: signature info stats
Post by: sebastian on August 24, 2006, 08:43:17 AM
http://php.net/manual/en/function.imagettftext.php#61227
http://www.tomrafteryit.net/authimage-error-call-to-undefined-function-imagettftext/

Αccording to these sites:
Those errors indicate that your PHP installation does not have True Type Font support compiled.
Title: Re: signature info stats
Post by: a2h_ on August 26, 2006, 07:17:46 AM
The guy that owns my webhost is like 'use <font>'... omfgwtf...
Title: Re: signature info stats
Post by: sebastian on August 26, 2006, 11:38:15 AM
Forget true type fonts ... Get GDfonts...
like this Your IP (http://www.remorse.gr/gdfont/gdfont.php)

Download Courier GDfont (http://www.remorse.gr/gdfont/Courier.gdf)

Code: [Select]
<?php
header
("Content-type: image/png");
$im imagecreatetruecolor(29018);
$black imagecolorallocate($im000);
$white imagecolorallocate($im255255255);
imagefilledrectangle($im004919$black);
$font imageloadfont("Courier.gdf");
$number "$_SERVER[REMOTE_ADDR]";
imagestring($im$font100"Your IP adress is:$number"$white);
imagepng($im);
?>
Title: Re: signature info stats
Post by: a2h_ on August 28, 2006, 06:17:11 AM
It works, thanks, now I just need to wait for TP 0.9.5
Title: Re: signature info stats
Post by: efootball on October 30, 2006, 10:55:07 AM
Thanks just what i was looking for
Title: Re: signature info stats
Post by: Inque187 on November 22, 2006, 11:29:18 PM
Worked like a charm for me! Thanks! I even added some database calls for numbers which update daily. Check out my signature.
Title: Re: signature info stats
Post by: Witte on December 06, 2006, 05:03:15 PM
Brilliant little script, thanks a lot Sebastian, works a treat on SMF 1,1...it also works on phpBB bpoards as well!...I'll change the image round when I get some spare time :D
Title: Re: signature info stats
Post by: a2h_ on January 20, 2007, 06:37:07 PM
OK, I'm on a new host (for a long time too) and I've decided to pick this up...

Code: [Select]
<?php

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


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

$forum_version 'SMF 1.1.1'; //make manually changes
$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$now forum_time();
$time gmdate("d-M-Y H:i:s",$now);
$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'];
$forum_version_png $forum_version;

$image "$img_url/images/signature_info.png"// or where you want
$im imagecreatefrompng($image); 
$green ImageColorAllocate ($im2913811); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);
$font "./Themes/fonts/micross.ttf"// change your font path and name here

imagettftext($im1202015$blue$font"Statistics of $forum_name"); 
imagettftext($im12017430$blue$font"$forum_url");
imagettftext($im1209045$white$font"$time Greenwich Time"); 
imagettftext($im1209060$white$font"$timel Local Time");
imagettftext($im1209075$red$font"Total Members : $total_members");
imagettftext($im1209090$red$font"Online Members: $online_members");
imagettftext($im12023575$red$font"Total Posts: $total_posts");
imagettftext($im12023590$red$font"Total Topics: $total_topics");
imagettftext($im12090105$black$font"Forum Version: $forum_version_png");
 
header("Content-Type: image/png"); 
Imagepng($im,'',90);
// if PHP v5.1 ++
//Imagepng($im,'',9); 
ImageDestroy ($im); 


?>

This is not the final thing, it was done as a basic test to see if ttf works. Unfortunately the script (NOT TTFTEXT) does not work. Go here:

http://www.a2h.8m6.net/gameon/stats.php

And also look at the code, you can see that all the files I linked in the code exist.
Title: Re: signature info stats
Post by: sebastian on January 21, 2007, 07:06:49 AM
Have you try to add this line?
Code: [Select]
Imagepng($im,'',9); instead of
Code: [Select]
Imagepng($im,'',90);
Title: Re: signature info stats
Post by: a2h_ on January 22, 2007, 01:47:43 AM
Would that be appropriate?

Quote
PHP version    4.4.3
MySQL version    4.1.21-standard-log
cPanel Build    10.9.0-RELEASE 118
Title: Re: signature info stats
Post by: sebastian on January 22, 2007, 05:59:48 AM
YES!!! and then check the name of font, maybe is MICROSS.TTF or micross.TTF on your SERVER.
Code: [Select]
$font = "./Themes/fonts/micross.ttf"; // change your font path and name here
Title: Re: signature info stats
Post by: Tanks on February 28, 2007, 07:09:39 AM
I tried to use this and i follwed the instructions.. it comes up as a blank page

http://www.gapeindex.dk/signature.png

I use SMF 1.1 RC3 with TP 0.9.6 [PHP Version 4.4.4]

What can i be doin wrong ? I cant even get the stats to show  :o

Edit: If i open in firefox i get this message

The image “http://www.gapeindex.dk/signature.png” cannot be displayed, because it contains errors.
Title: Re: signature info stats
Post by: sebastian on February 28, 2007, 07:30:54 PM
Can you post your code?  
Title: Re: signature info stats
Post by: Tanks on March 01, 2007, 03:10:26 AM
I followed the steps in the first post of this topic

and this is the code i used

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

$forum_ver 'SMF ' $modSettings['smfVersion'];
$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$timezone $modSettings['time_offset'];
$now forum_time();
$time gmdate("d-M-Y H:i:s",$now 3600*($timezone+date("I")));
$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'];
 

$image "http://www.gapeindex.dk/images/signature.png"// 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"$time Greenwich Time"$green); 
ImageString($im39046"$timel Local Time"$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_ver "$black);
 
header("Content-Type: image/png"); 
Imagepng($im,'',90);
// if PHP v5.1 ++
// Imagepng($im,'',9);  
ImageDestroy ($im); 
}
?>

Maybe my php is to old and dont support this ?? I dont have any coding skills so i really cant tell but im quite sure i followed all the steps in the first post.  :)
Title: Re: signature info stats
Post by: sebastian on March 01, 2007, 04:23:28 AM
Your image http://www.gapeindex.dk/images/signature.png (http://www.gapeindex.dk/images/signature.png) link did not display anything... Try another acceptable.

Create first a blank color .png file without text.

 
Title: Re: signature info stats
Post by: Tanks on March 04, 2007, 07:27:54 AM
Your image http://www.gapeindex.dk/images/signature.png (http://www.gapeindex.dk/images/signature.png) link did not display anything... Try another acceptable.

Create first a blank color .png file without text.

 

Im not sure i understand.. that link is my blank(blue) png file i wanted to use for background... its not that one that makes problems ?
Title: Re: signature info stats
Post by: sebastian on March 04, 2007, 10:21:53 AM
Well i am sure knat that's your problem. Have you try another .png file?

If you have the same problem...
...open your .htaccess and remove this line AddType application/x-httpd-php .png
Title: Re: signature info stats
Post by: dumbelljunkie on May 17, 2007, 10:35:39 AM
How do you this with a Joomla bridge ?
Title: Re: signature info stats
Post by: sebastian on May 17, 2007, 02:11:47 PM
No difference dumbelljunkie... Just follow the  instructions.
Title: Re: signature info stats
Post by: dumbelljunkie on May 17, 2007, 02:23:05 PM
Tried that in every way (first option only) but I can't get it to work..

It only shows a white screen witht he link from my signature, and a {alt} for the image.

Perhaps use a full url for the image ?
Title: Re: signature info stats
Post by: sebastian on May 17, 2007, 02:39:30 PM
{alt} ??? = alt="my signature"  ???

Check your script again. This script is so simple. Can you post your code?

Title: Re: signature info stats
Post by: dumbelljunkie on May 18, 2007, 03:53:20 AM
Perhaps simple for the one's who understand PHP ;) I'm trying to learn it but it's more difficuld than I wanted if you don't have Dutch basics... ;)
This is the code I put in the root dir:

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

$forum_ver 'SMF ' $modSettings['smfVersion'];
$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$timezone $modSettings['time_offset'];
$now forum_time();
$time gmdate("d-M-Y H:i:s",$now 3600*($timezone+date("I")));
$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'];
 

$image "$img_url/images/signature_info.png"// 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"$time Greenwich Time"$green); 
ImageString($im39046"$timel Local Time"$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_ver "$black);
 
header("Content-Type: image/png"); 
Imagepng($im,'',90);
// if PHP v5.1 ++
// Imagepng($im,'',9);  
ImageDestroy ($im); 
}
?>

The background image is in themes/default/signature_info.png with the same name as the php. Only thing I wonder is the .htaccess, since Joomla has that and the forum doesn't anymore, should I make a new htacess for the forum, or should I add the code in the htacess at the Joomla one ?
Title: Re: signature info stats
Post by: sebastian on May 18, 2007, 04:43:51 AM
If exist remove this line from your .htaccess file AddType application/x-httpd-php .png then check your script.

If this problem remain check your php version and make the right changes.

php version = 4.0+ then Imagepng($im,'',90)
php version = 5.0+ then Imagepng($im,'',9)

Title: Re: signature info stats
Post by: dumbelljunkie on May 18, 2007, 04:52:02 AM
Removed the line from htaccess but the problemremains.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.powerlifting-forum.nl%2Fforum%2Fadmin_beheer%2Fsig.png&hash=c8d28622697f095ae58e960da3a8da6d)

Forumversie: SMF 1.1.2 (meer details)
Huidige SMF-versie: SMF 1.1.2
PHP-versie: 4.3.11
MySQL-versie: 4.1.21-log
Serverversie: Apache/2.0.53 (Fedora)
GD-versie: bundled (2.0.28 compatible)

I don't think I can change anything to the php, my host won't allow much..
Title: Re: signature info stats
Post by: sebastian on May 18, 2007, 05:32:48 AM
Make changes only to your signature_info.php file.
Your version is php 4 and your code is right Imagepng($im,'',90).

This link is wrong. [xxxx.xxx/forum/admin_beheer/sig.png]
The right link is xxxx.xxx/forum/signature_info.php but still not working.

You can use sig.png only if exist AddType application/x-httpd-php .png else put file with extension .php (for example signature_info.php).

Ι've no ideas what is error at the moment.

ps Open signature_info.php find Imagepng($im,'',90) and replace with Imagepng($im,'',0)

0 = no Compression


 
Title: Re: signature info stats
Post by: dumbelljunkie on May 18, 2007, 06:06:15 AM
It has to be a problem with the Joomla bridge, it causes many functions to fail in smf. Perhaps the htaccess in joomla just won't allow it.

the xxxx.xxx/forum/admin_beheer/sig.png was nothing more than a screenshot to show what is wrong

the original background image is (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.powerlifting-forum.nl%2Fforum%2FThemes%2Fdefault%2Fimages%2Fsignature_info.png&hash=bccb53c73838d2427411e33e49d1ed33)

the php is to be found in signature_info.php (http://www.powerlifting-forum.nl/forum/signature_info.php)

Funny how the joomla bridge causes so many small issues..

Edit: I made that change
Code: [Select]
Imagepng($im,'',0) but when I access signature_info.php (http://www.powerlifting-forum.nl/forum/signature_info.php)
directly it only shows a blank screen. Without that piece of code it shows the box with the red cross meaning it can't load the image.

pff crazy IE and FF show different pages to the sig, in anycase it doesn't work. I forgot to mention the link in the profile:

Code: [Select]
[img]http://www.powerlifting-forum.nl/forum/signature_info.php[/img]
Title: Re: signature info stats
Post by: sebastian on May 18, 2007, 06:12:39 AM
Yes dumbelljunkie, have you try this -> Imagepng($im,'',0) ?
Title: Re: signature info stats
Post by: brianjw on July 15, 2007, 08:18:28 AM
I need help. How would I add Latest member to right under the Online Members. Can you edit the following code to make it work like that. :)

Thanks.
Brianjw

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

$forum_ver 'SMF ' $modSettings['smfVersion'];
$img_url $settings['default_theme_url']; 
$forum_name $context['forum_name'];
$forum_url $boardurl;
$timezone $modSettings['time_offset'];
$now forum_time();
$time gmdate("d-M-Y H:i:s",$now 3600*($timezone+date("I")));
$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'];
 

$image "$img_url/images/signature_info.png"// or where you want
$im imagecreatefrompng($image); 
$green ImageColorAllocate ($im2312417); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);

 
ImageString($im3901"$forum_url"$blue);
ImageString($im39015"$time Greenwich Time"$green); 
ImageString($im39031"$timel Local Time"$green);
ImageString($im39046"Total Members : $total_members"$red);
ImageString($im39061"Online Members: $online_members"$red);
ImageString($im323046"Total Posts: $total_posts"$red);
ImageString($im323061"Total Topics: $total_topics"$red);
ImageString($im39076"Forum Version: $forum_ver "$black);
 
header("Content-Type: image/png"); 
Imagepng($im,'',90);
// if PHP v5.1 ++
// Imagepng($im,'',9);  
ImageDestroy ($im); 
}
?>

EDIT: Also it says my smf version is 1.1.2 instead of 1.1.3 and what is Greenwich time?
EDIT2: Changed code.
Title: Re: signature info stats
Post by: sebastian on July 15, 2007, 09:44:17 AM
Hello brianjw

Just add, modify & delete some lines...

Code: [Select]
$last_member = $context['common_stats']['latest_member']['name'];
ImageString($im, 3, 90, 76, "Latest Member: $last_member ", $red);

REPLACE
Code: [Select]
//$forum_ver = 'SMF ' . $modSettings['smfVersion'];WITH
Code: [Select]
$forum_ver = 'SMF 1.1.3'; //manual changes
REPLACE
Code: [Select]
ImageString($im, 3, 90, 76, "Forum Version: $forum_ver ", $black);WITH
Code: [Select]
ImageString($im, 3, 90, 91, "Forum Version: $forum_ver ", $black);
DELETE
$timezone = $modSettings['time_offset'];
$time = gmdate("d-M-Y H:i:s",$now - 3600*($timezone+date("I")));
ImageString($im, 3, 90, 15, "$time Greenwich Time", $green);


Finally

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

//$forum_ver = 'SMF ' . $modSettings['smfVersion'];
$forum_ver 'SMF 1.1.3'//manual changes
$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); 
$green ImageColorAllocate ($im2312417); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);

 
ImageString($im3901"$forum_url"$blue);
ImageString($im39031"$timel Local Time"$green);
ImageString($im39046"Total Members : $total_members"$red);
ImageString($im39061"Online Members: $online_members"$red);
ImageString($im323046"Total Posts: $total_posts"$red);
ImageString($im323061"Total Topics: $total_topics"$red);
ImageString($im39076"Latest Member: $last_member "$red);
ImageString($im39091"Forum Version: $forum_ver "$black);
 
header("Content-Type: image/png"); 
Imagepng($im,'',90);
// if PHP v5.1 ++
//Imagepng($im,'',9);  
ImageDestroy ($im); 
}
?>
Title: Re: signature info stats
Post by: brianjw on July 15, 2007, 08:19:47 PM
Thanks. As you can see:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.brianjwilson.com%2Fsignature_info.php&hash=1f4eb8d6de76cd5396d692a0a8fa3020)
All is working well.

However, I did not make the manual edit for the version problem because I am thinking there has to be some other way. Somehow some file didn't get updated and I want to fix the file so it works and updates without a manual edit each time I upgrade. Any ideas where to go? SSI.php maybe? Wherever the code $modSettings['smfVersion'] is being called would be the place to go I think. :)

Brianjw

EDIT: Another few questions.
Title: Re: signature info stats
Post by: sebastian on July 16, 2007, 07:59:45 AM
I agree with you that 'SMF Version' is a weakness. However the definition of SMF Version becomes manually (index.php => $forum_version = 'SMF 1.1.3') and is being called as global variable.
This script is based on SSI.php which does not load this variable ($forum_version).

Quote
Can I make the local timezones time appear as am/pm time instead of military time?
$timel = date("d-M-Y g:i:s a",$now);

Quote
What was the point of Greenwich time to be in the code, what was it's purpous?
Not necessary. Delete this line.
Title: Re: signature info stats
Post by: L.G.S on July 16, 2007, 07:06:37 PM
Great mod, but a couple of questions:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ruthlessintent.com%2Fsiginfo.php&hash=f6f0114fcbe00f7a6b0757daa1f5de0e)


What code do I use to replace blue with yellow?
How can I make it so that there is a space in between Total members and Total topics?
Title: Re: signature info stats
Post by: brianjw on July 16, 2007, 07:46:54 PM
@sebastian: Thanks for all your help. I tried to replace that timezone space so I tried adding Total Boards. I used the following codes:
Code: [Select]
$total_boards = $context['common_stats']['total_boards'];
Code: [Select]
ImageString($im, 3, 90, 61, "Total Boards: $total_boards", $red);However it doesn't appear. Any ideas? (see signature)

@L.G.S: To replace the color blue with yellow you have to edit the following codes in the main file.
Find:
Code: [Select]
ImageString($im, 3, 10, 1, "$forum_name", $blue);
ImageString($im, 3, 94, 15, "$forum_url", $blue);
Replace:
Code: [Select]
ImageString($im, 3, 10, 1, "$forum_name", $yellow);
ImageString($im, 3, 94, 15, "$forum_url", $yellow);
Depending on the size of the space you have by the image width you descide. But for starters try some stuff below:
Find:
Code: [Select]
220Replace with:
Code: [Select]
230(make it a larger number for bigger space/make it smaller number for less space)
You may also try moving it over a little for more space...
Find: (note: you will have to manually find some of them as you can't find all this at once)
Code: [Select]
ImageString($im, 3, 94, 15, "$forum_url", $blue);
ImageString($im, 3, 90, 31, "$timel Local Time", $green);
ImageString($im, 3, 90, 46, "Total Members : $total_members", $red);
ImageString($im, 3, 90, 61, "Online Members: $online_members", $red);
ImageString($im, 3, 90, 76, "Latest Member: $last_member ", $red);
Replace with:
Code: [Select]
ImageString($im, 3, 89, 15, "$forum_url", $blue);
ImageString($im, 3, 85, 31, "$timel Local Time", $green);
ImageString($im, 3, 85, 46, "Total Members : $total_members", $red);
ImageString($im, 3, 85, 61, "Online Members: $online_members", $red);
ImageString($im, 3, 85, 76, "Latest Member: $last_member ", $red);

Hope this helps :)

Brianjw
Title: Re: signature info stats
Post by: L.G.S on July 16, 2007, 09:04:28 PM
Thanks, all worked except the colour change.

I presume I need to add a new line which would have an altered version of this, but I don't know the code:

Code: [Select]
$white = ImageColorAllocate ($im, 255, 255, 255);
Probably just need to edit the numbers but not sure to what.
Title: Re: signature info stats
Post by: sebastian on July 17, 2007, 04:04:26 AM
L.G.S
Yellow Color
Code: [Select]
$yellow = ImageColorAllocate ($im, 255, 204, 51);

brianjw
Total Boards

Code: [Select]
$result = db_query("
SELECT COUNT(*)
FROM {$db_prefix}boards AS b", __FILE__, __LINE__);
list ($context['num_boards']) = mysql_fetch_row($result);
mysql_free_result($result);

Code: [Select]
$total_boards = $context['num_boards'];
Title: Re: signature info stats
Post by: brianjw on July 17, 2007, 06:20:55 PM
Thanks it works. Also I was able to add a categories code by doing this:
Code: [Select]
$result = db_query("
SELECT COUNT(*)
FROM {$db_prefix}categories AS b", __FILE__, __LINE__);
list ($context['num_categories']) = mysql_fetch_row($result);
mysql_free_result($result);
Code: [Select]
$total_cats = $context['num_categories'];
;) Brianjw
Title: Re: signature info stats
Post by: sebastian on July 18, 2007, 04:43:28 AM
Perfectly  ;)
Title: Re: signature info stats
Post by: L.G.S on July 19, 2007, 07:02:15 AM
I got some problems...

I've tried changing all the placement code but I can't seem to get what I want.

See this here:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ruthlessintent.com%2Fpainsig.php&hash=55e583bd4a6bb02f22332c28b09c2d49)

I'd like all the text under my link to be moved over to the left more so all the stats show, and then moved down a little so they aren't covering the circle graphic as much.

Can that be done?
 
Title: Re: signature info stats
Post by: sebastian on July 19, 2007, 08:15:05 AM
Just play with x-coordinate, y-coordinate.


example
Code: [Select]
ImageString($im, 3, 10, 1, "$forum_name", $blue);
ImageString($im, 3, 94, 31, "$forum_url", $blue);
ImageString($im, 3, 30, 46, "$timel Local Time", $green);
ImageString($im, 3, 30, 61, "Total Members : $total_members", $red);
ImageString($im, 3, 30, 76, "Online Members: $online_members", $red);
ImageString($im, 3, 160, 76, "Total Posts: $total_posts", $red);
ImageString($im, 3, 160, 61, "Total Topics: $total_topics", $red);
ImageString($im, 3, 30, 91, "Latest Member: $last_member ", $red);
Title: Re: signature info stats
Post by: L.G.S on July 19, 2007, 08:55:12 AM
which ones are he x and y?
Title: Re: signature info stats
Post by: sebastian on July 19, 2007, 10:20:19 AM
Quote
which ones are he x and y?

ImageString($im, 3, 30, 91, "Latest Member: $last_member ", $red);

30 = x
91 = y
Title: Re: signature info stats
Post by: brianjw on August 09, 2007, 01:07:54 PM
I just started getting internal server error on
http://www.brianjwilson.com/signature_info.php
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.brianjwilson.com%2Fsignature_info.php&hash=1f4eb8d6de76cd5396d692a0a8fa3020)
so it shows up broken. I recently installed Flashchat integration if that might do anything. Flashchat integration modifies SSI.php so...

Any ideas?
Title: Re: signature info stats
Post by: sebastian on August 09, 2007, 05:40:33 PM
I recently installed Flashchat integration if that might do anything. Flashchat integration modifies SSI.php so...

I don't think so ... Its a server problem 500. Check your error_log file for errors about signature_info.php.
Title: Re: signature info stats
Post by: brianjw on August 09, 2007, 06:12:22 PM
I use godaddy and am not sure where to see the error log?
Title: Re: signature info stats
Post by: sebastian on August 09, 2007, 07:44:01 PM
Via ftp client  check your SMF FORUM folder.

File error_log.
Title: Re: signature info stats
Post by: brianjw on August 09, 2007, 07:45:44 PM
Via ftp client  check your SMF FORUM folder.

File error_log.
I don't seem to have that file.
Title: Re: signature info stats
Post by: sebastian on August 10, 2007, 12:17:58 AM
Well brianjw, we need informations about what caused this error because the Internal Server Error - 500 is very generic message.

Your rest site work properly without Internal Server Error? There are several reports about this fault.
If yes the solution : Having problems with mod_security? (http://www.simplemachines.org/community/index.php?topic=34270.0)

   ... or no ...

1. Check again signature_info.php file permitions.
2. Try to upload a new signature info stats.
3. Try to run a simple hello.php file.
     <?php echo 'hello'; ?>





Title: Re: signature info stats
Post by: brianjw on August 10, 2007, 09:22:50 AM
The signature_info.php file permissions are set to 644.
Uploaded a new one, still internal server error.
Title: Re: signature info stats
Post by: sebastian on August 10, 2007, 12:27:30 PM
I believe most servers will log a 500 error in the error_log file.

I recently installed Flashchat integration if that might do anything. Flashchat integration modifies SSI.php so...

What permition does SSI.php file have now?




Title: Re: signature info stats
Post by: brianjw on August 10, 2007, 01:27:31 PM
What permition does SSI.php file have now?
644
Title: Re: signature info stats
Post by: sebastian on August 10, 2007, 03:19:17 PM
Make a backup of .htaccess file and try this : Having problems with mod_security? (http://www.simplemachines.org/community/index.php?topic=34270.0)
Title: Re: signature info stats
Post by: brianjw on August 10, 2007, 04:01:25 PM
It didn't work either. :(

Maybe I should attach SSI.php... any other files I should maybe attach that signature_info.php needs?

Brianjw
Title: Re: signature info stats
Post by: sebastian on August 10, 2007, 07:16:42 PM
I don't understand what going on here...

...we need informations about what caused this error because the Internal Server Error - 500 is very generic message.

Actually we need an error log file.

Please try to run two more things:
1 . a simple hello.php file.
     <?php echo 'hello'; ?>

2. no2.php
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);
}

?>
Title: Re: signature info stats
Post by: brianjw on August 11, 2007, 11:54:02 AM
I don't understand what going on here...

...we need informations about what caused this error because the Internal Server Error - 500 is very generic message.

Actually we need an error log file.

Please try to run two more things:
1 . a simple hello.php file.
     <?php echo 'hello'; ?>

2. no2.php
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);
}

?>

I am confused on what you want me to do with running php files.

Can you explain a little more in detail?
Title: Re: signature info stats
Post by: sebastian on August 11, 2007, 01:54:10 PM
We try to locate the point of code that causes this problem.
Title: Re: signature info stats
Post by: brianjw on August 11, 2007, 04:41:55 PM
I know but what goes in the hello.php and more detail?

Sorry I am no coder :(
Title: Re: signature info stats
Post by: brianjw on August 11, 2007, 05:58:42 PM
Sorry to double post but since I think signature_info.php requires SSI.php this maybe what is causing it
http://www.simplemachines.org/community/index.php?topic=188328.0
I posted this. ;)
Title: Re: signature info stats
Post by: sebastian on August 11, 2007, 06:48:49 PM
... I think signature_info.php requires SSI.php this maybe what is causing it

...Did you check this with the original SSI.php?

I can not simulate this server internal error, probably there is a problem between HTTP headers and your shared Web hosting. I am not sure. Goddady's linux hosting plans do not support non-parsed headers...

So forget hello.php, run only no2.php which is without any header, just for verification.


Title: Re: signature info stats
Post by: brianjw on August 11, 2007, 09:40:01 PM
I will check the original ssi.php in the morning.

Ok. Well I have emailed godaddy for this help with this as well.

How do I run it. Like go to it directly on my website. And do I upload the code into a file called no2.php and upload it over and run it?

Thanks,
Title: Re: signature info stats
Post by: sebastian on August 12, 2007, 06:50:30 AM
Yes, like this http://www.brianjwilson.com/no2.php

Don't forget webserver's error log.
Title: Re: signature info stats
Post by: brianjw on August 12, 2007, 09:16:26 AM
Yes, like this http://www.brianjwilson.com/no2.php

Don't forget webserver's error log.
Ok. I will do that now.

Also this is the email I received by godaddy about the webserver error log.
Quote
Dear Brian,

Thank you for contacting online support.

I do apologize for any inconvenience this may have caused, unfortunately with the current hosting plan you are on you are unable to access the error logs for your hosting account. If you would like to have access to the logs, you will need to upgrade your account to include CGI.

You can upgrade or downgrade your hosting plan(s) from within your customer account.

To upgrade or downgrade your hosting:

• Log in to your Account Manager.
• Select Web Hosting & Databases from the Hosting & Email menu at the top of the page.
• Click the hosting plan you wish to upgrade or downgrade.
• Click Upgrade/Downgrade Hosting Account.
• Select the new hosting account type you wish to have.
• Follow the on-screen prompts to complete the process.


NOTE: If you are upgrading to a hosting plan that has a higher monthly cost than the one you are currently using, you will be charged the difference in price between what you have already paid and the cost of the new type of hosting purchased for the same period of time. If you downgrade to a hosting plan that has a lower monthly cost, the hosting plan will be extended by the number of months that could be purchased using the difference in cost.


Please let us know if we can help you in any other way.

Regards,

Robbie P
Online Support

I will see what I can upgrade to some time today...

EDIT
no2.php gives an internal server error as well.
Title: Re: signature info stats
Post by: sebastian on August 12, 2007, 10:38:31 AM
So, CGI is a extra feature.

no2.php gives an internal server error as well.

You are right. SSI.php its the problem.
Title: Re: signature info stats
Post by: brianjw on August 12, 2007, 06:17:03 PM
I posted my SSI.php in the link below. Can you search it and maybe compare it to SMF's original?
Thanks.
http://www.simplemachines.org/community/index.php?topic=188328.0 (http://www.simplemachines.org/community/index.php?topic=188328.0)
(this link opens in the same window)
Title: Re: signature info stats
Post by: sebastian on August 12, 2007, 08:30:32 PM
Another test. Disable some lines.

1. Open SSI.php
2. Go to line 59

Just and this //
from
Code: [Select]
require_once($sourcedir . '/Subs-Seo4SMF.php');to
Code: [Select]
// require_once($sourcedir . '/Subs-Seo4SMF.php');
3. Go to line 710-763

Before
Code: [Select]
// --- Begin FlashChat integration ---add this /*

After
Code: [Select]
// --- End     FlashChat integration ---add this */

Code: [Select]
/*
// --- Begin FlashChat integration ---
*
*
*
*
*
// --- End     FlashChat integration ---
*/
Title: Re: signature info stats
Post by: brianjw on August 13, 2007, 12:13:09 PM
I did exactly as you said but it seems to still be giving an internal server error. I think we're getting somewhere though!

I guess we need to find all the mods that I don't have installed out of there.
Title: Re: signature info stats
Post by: sebastian on August 13, 2007, 03:46:35 PM
I guess we need to find all the mods that I don't have installed out of there.

 First remove or disable SEO4SMF completely.

...we need an error log file.
Title: Re: signature info stats
Post by: brianjw on August 13, 2007, 04:28:17 PM
I have removed both codes and mods completely! The errorlog is unaccessible until I have money to switch hosts which I don't have now. We just need to keep fooling around with stuff (making backups).
Title: Re: signature info stats
Post by: sebastian on August 13, 2007, 05:30:09 PM
Ok brianjw.
Title: Re: signature info stats
Post by: brianjw on August 13, 2007, 06:21:17 PM
Man is this complicated.
Title: Re: signature info stats
Post by: GC on August 14, 2007, 12:32:12 AM
This must be a full time job :)

My problem is this:
Fatal error: Call to undefined function: imagecreatefrompng() in /home/gctim/public_html/signature_info.php on line 33

I am not using the PNG .htaccess thing because it is messing with the rest of my .PNG files.

My current signature_info.php
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 "/images/gcsig_info.png"// or where you want
$im imagecreatefrompng($image); 
$green ImageColorAllocate ($im2312417); 
$blue ImageColorAllocate ($im00255); 
$red ImageColorAllocate ($im25500);
$white ImageColorAllocate ($im255255255);
$black ImageColorAllocate ($im000);
$font $boarddir .'/fonts/gunplay.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,'',9);  
  }
else {
    
Imagepng($im,'',90);
  }  

ImageDestroy ($im); 
}
?>


My file locations:
http://www.glitcherscorner.com/signature_info.php
http://www.glitcherscorner.com/images/gcsig_info.png

My .htaccess is blank.

PHP version     4.4.7

What is wrong? :S

I have tried changing
Code: [Select]
$im = imagecreatefrompng($image);to
Code: [Select]
$im = @imagecreatefrompng($image); but then it only displays a blank page and the img does not show up anywhere. Whats wrong?
Title: Re: signature info stats
Post by: sebastian on August 14, 2007, 11:26:04 AM
This is a GD Library problem. Perhaps GD library is not installed on your server. Check your GD Library.

Admin/Support and Credits/

Support Information
.
.
.
GD version: bundled (2.0.34 compatible)  <-- For Example
Title: Re: signature info stats
Post by: GC on August 14, 2007, 01:10:16 PM
I was afraid of this :(

I use to have GD on my old server, but i recently switched over. I might have to go and install it later today. Thank you for a fast reply.
Title: Re: signature info stats
Post by: brianjw on August 14, 2007, 01:17:07 PM
What about my problem lol?
Title: Re: signature info stats
Post by: sebastian on August 14, 2007, 05:37:29 PM
...also ssi_examples.php (http://www.brianjwilson.com/ssi_examples.php) gives the same internal error but ssi_examples.shtml (http://www.brianjwilson.com/ssi_examples.shtml) works properly.
Title: Re: signature info stats
Post by: brianjw on August 14, 2007, 05:56:44 PM
hmmmm i don't know.
Title: Re: signature info stats
Post by: brianjw on October 10, 2007, 06:33:28 PM
Well subastian, just to let you know, I got the past problems solved. ^
I have a paid.or.free request for you if possible. Using functions from smf and some custom mods. How would
Quote
I would love to use a signature thing on my website. I have modified my gamer card and would like it to do something like this:

-Where it says '-Username Here-' it actually displays the members display name (not username).
-Where it says 'Rep' put the total karma (whatever option is set in admin panel) of that member.
-Where it says 'Posts' put the number of posts the member has made on the website.
-Where it says 'Gender' put the image for the male or the female.
-Where it says '-Latest 4 Arcade Games Played-' Put the latest 4 games that the member has played.
-Where you see that avatar, put the members avatar. If they have no avatar display an image that says No Avatar and that goes with the colors of the sig.

It looks like this.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.gamerzgarage.com%2Fcard.png&hash=cd60e950283bb49d85e6d9d13b421f0d)

I am willing to pay for this. I would also like this private for my site at the time being

Let me know what you can do with this.
I also would like this sig to be added to their signature automatically when they register and they can take it off if they want. ;)

Also it would be awesome if members could access there signature like this - http://www.gamerzgarage.com/sig.php?u=1 (id)

THANKS SO MUCH :)
Brianjw
Title: Re: signature info stats
Post by: sebastian on October 10, 2007, 10:25:01 PM
Hi, brianjw.

You have really great ideas. A couple of thinks first.
I dont want money. I will try to do this tip but this does not guarantee any good result or how long will it take.  Also i would like this free for all people.

Conclusion: search also other solutions.
Title: Re: signature info stats
Post by: brianjw on October 11, 2007, 08:08:54 AM
Sounds good :)!
Also do you think you can help me make the image above a little cleaner and nicer.
Title: Re: signature info stats
Post by: sebastian on October 12, 2007, 05:52:44 AM
Example: Copy sign.png & noavatar.png into default image folder.

Themes/default/images/

Make a file. For example: sign.php
sign.php & ssi.php -> Same Path.

Access signature as
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

// Your settings +++++++++++++++++++++++++++++++++++
$backimg = "$img_url/images/sign.png"; // or where you want
$noavatar = "$img_url/images/noavatar.png"; // or where you want
$set_avatar_height = 0; //move avatar up/down
$set_avatar_width = 0; //move avatar left/right
$set_gender_style = 0; // 0 text , 1 image
$set_gender_height = -92; //move gender up/down
$set_gender_width = -230; //move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++


demo here (http://www.simplemachines.org/community/index.php?topic=46408.msg332615#msg332615)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign.png&hash=2a5b2547cac6cbf7808feef484f7b1f6)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fnoavatar.png&hash=fd705440c3fab139a04d2259bbeeee6b)

For SMF 1.1.x

Code: [Select]
<?php

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

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else die();


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);

 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want 
$noavatar "$img_url/images/noavatar.png"// or where you want 
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Genter: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,null,9,null); 
  }
else {
Imagepng($image,null,90,null); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}


?>


For SMF 2.x.x

Code: [Select]
<?php

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

getinfos();
signature();

function 
getinfos()
{
global 
$smcFunc$context$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

    
$result $smcFunc['db_query']('''
        SELECT member_name
        FROM {db_prefix}members
        WHERE id_member = '
. (int) $id_mem.' AND is_activated = 1
        LIMIT 1
        '
,
        array()
    );

     if (
$smcFunc['db_fetch_row']($result) > 0)  
{

 
$mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach (
$mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    
'lbuser' => $memberContext[$id_mem]
);

foreach (
$context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else die();

if (!empty(
$context['avatar']))
  {
  
$mommy = !empty($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 $smcFunc['db_query']('','
SELECT filename
FROM {db_prefix}attachments
WHERE id_attach = ' 
. (int) $mommy ' AND attachment_type = 0 AND approved = 1
LIMIT 1'
,
array()
);

list(
$count_result) = $smcFunc['db_fetch_row']($result2);

   
$context['filename_avatar'] = $count_result;
   
$smcFunc['db_free_result']($result2);
      
  }
  
  
$smcFunc['db_free_result']($result);
 }
 

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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (!empty(
$context['filename_avatar'])) 
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want 
$noavatar "$img_url/images/noavatar.png"// or where you want
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

if (!empty($avatar)) {$avatar $avatar;}
else {
$avatar $noavatar;}

if (!empty(
$lemo)) { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Genter: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,null,9,null); 
  }
else {
Imagepng($image,null,90,null); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}


?>
Title: Re: signature info stats [new features]
Post by: brianjw on October 13, 2007, 02:16:28 PM
I am getting a blank page while accessing - http://www.gamerzgarage.com/sig.php?u=1
I didn't change anything out of the file. I have uploaded the images to the default/images.

brianjw
Title: Re: signature info stats [new features]
Post by: sebastian on October 13, 2007, 03:42:26 PM
Εrror occurred. There is 7 die().

Make a file & run like sign_error.php?u=1

Code: [Select]
<?php

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

error_reporting(E_ALL E_NOTICE);

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';
$context['error_sign'] = '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : $context['error_sign'] = 'No ID';
else 
$context['error_sign'] = 'No ID';

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }
} else { 
$context['error_sign'] = 'No member ID';}

  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);
 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female"; }
else {
$gender "n/a";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++Don't  SAVE your images as  web & devices / images must be .png 
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
// Your settings +++++++++++++++++++++++++++++++++++

//$backimg = checkurl($backimg);
//$noavatar = checkurl($noavatar);

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else { echo 
'No extension'; die();}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { echo 
'Wrong width/height'; die();}

$image imagecreatetruecolor($image_width$image_height); 

$image imagecreatefrompng($backimg); 
$size getimagesize($backimg); 
$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

if (
$context['error_sign'] == '') { $error 'No errors'; } else {
$error $context['error_sign']; }

ImageString($image5334"$membername"$black); 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Gender: $gender"$black);
ImageString($image42066"Karma: $karma"$black);
ImageString($image42086"Error: $error"$black);

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

function 
checkurl($url)
{
  
$getHeaders = @get_headers($url);
  if (
preg_match("|200|"$getHeaders[0])) {
  return 
$url;
  unset(
$getHeaders);
  } else {  echo 
'File not exist'; die();}

}
?>
Title: Re: signature info stats [new features]
Post by: brianjw on October 13, 2007, 08:47:32 PM
I used your code, saved it as sign_error.php
then went to http://www.gamerzgarage.com/sign_error.php?u=1 and yet.. it still is blank.. :(

Any other ideas?
Title: Re: signature info stats [new features]
Post by: sebastian on October 13, 2007, 10:04:22 PM
...well your server again...
Try my sign.png file. Re upload the updated sign_error.php <-- check

... next delete all the die();  functions. <-- check

... next delete 2 lines <-- check
$backimg = checkurl($backimg);
$noavatar = checkurl($noavatar);

... original sign.php file also updated
Title: Re: signature info stats [new features]
Post by: brianjw on October 14, 2007, 12:46:19 AM
Ok, last problems - It is working except the errors are showing on the card like the image below:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.gamerzgarage.com%2Fsign_error.php%3Fu%3D1&hash=6a8a6cf5d505a91e15d3f62e7de71298)
I would also like to know how to make it so it shows the ™ properly (unlike image above). Also how to make images be transparent when they are supposed to be ;) (background). How would I make it show the "image" of the male/female other than the word. And How would I add the arcade part of it like I posted/requested above.

Here is my code:
Code: [Select]
<?php

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

error_reporting(E_ALL E_NOTICE);

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';
$context['error_sign'] = '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : $context['error_sign'] = 'No ID';
else 
$context['error_sign'] = 'No ID';

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['good'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }
} else { 
$context['error_sign'] = 'No member ID';}

  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);
 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female"; }
else {
$gender "n/a";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++Don't  SAVE your images as  web & devices / images must be .png 
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
// Your settings +++++++++++++++++++++++++++++++++++

//$backimg = checkurl($backimg);
//$noavatar = checkurl($noavatar);

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else { echo 
'No extension'; }

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { echo 
'Wrong width/height'; }

$image imagecreatetruecolor($image_width$image_height); 

$image imagecreatefrompng($backimg); 
$size getimagesize($backimg); 
$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

if (
$context['error_sign'] == '') { $error 'No errors'; } else {
$error $context['error_sign']; }

ImageString($image5334"$membername"$black); 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Genter: $gender"$black);
ImageString($image42066"Karma: $karma"$black);
ImageString($image42086"Error: $error"$black);

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

function 
checkurl($url)
{
  
$getHeaders = @get_headers($url);
  if (
preg_match("|200|"$getHeaders[0])) {
  return 
$url;
  unset(
$getHeaders);
  } else {  echo 
'File not exist'; }

}
?>

Title: Re: signature info stats [new features]
Post by: sebastian on October 14, 2007, 03:34:40 AM
Ok, last problems - It is working except the errors are showing on the card like the image below:

What happen with updated sign.php? sign_error.php its only for tracing errors.

Also how to make images be transparent when they are supposed to be ;) (background)

Yes they are supposed to be transparent. Save as WEB / PNG-8 / NO-DITHER / 256 COLORS / .

How would I make it show the "image" of the male/female other than the word

sign.php updated (http://www.simplemachines.org/community/index.php?topic=46408.msg1271553#msg1271553)
$set_gender_style = 1; // 0 text , 1 image

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_gno.gif&hash=c4a9a9c129ec4930e2def3259b3ea6d9)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_gny.gif&hash=33e09848ffaf7dc9d1e672a2585d7828)

I would also like to know how to make it so it shows the ™ properly (unlike image above).

Like this ?
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_brian.png&hash=cc65b080cd3fbc9b26001181152af144)

And How would I add the arcade part of it like I posted/requested above.

Did You mean SMF Arcade (http://custom.simplemachines.org/mods/index.php?mod=36)?
Title: Re: signature info stats [new features]
Post by: brianjw on October 14, 2007, 10:24:13 AM
sign.php updated (http://www.simplemachines.org/community/index.php?topic=46408.msg1271553#msg1271553)
$set_gender_style = 1; // 0 text , 1 image
I have updated sign.php with that code and it displays blank :(
Like this ?
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_brian.png&hash=cc65b080cd3fbc9b26001181152af144)
I ment showing the TM symbol correctly. ;)

Did You mean SMF Arcade (http://custom.simplemachines.org/mods/index.php?mod=36)?
Yes :)
Title: Re: signature info stats [new features]
Post by: sebastian on October 14, 2007, 11:39:04 AM
Arcade last 4 games + scores + position


Code: [Select]
<?php

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

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else die();


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

$y 0;

$context['arcade']['latest_games'] = ArcadeLatestGames(40$id_mem);

if (count($context['arcade']['latest_games']) > 0)
foreach ($context['arcade']['latest_games'] as $game) {
$context['arcadelast'][$y] .= $game['name'].'-'.$game['score'].'-'.$game['position'];
$y++; }

mysql_free_result($result);
mysql_free_result($result2);

 }

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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];
$arcade1 $context['arcadelast'][0];
$arcade2 $context['arcadelast'][1];
$arcade3 $context['arcadelast'][2];
$arcade4 $context['arcadelast'][3];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want 
$noavatar "$img_url/images/noavatar.png"// or where you want 
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 1// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
ImageString($image2167"Arcade: $arcade1"$black);
ImageString($image2177"Last 4: $arcade2"$black);
ImageString($image2187"Played: $arcade3"$black);
ImageString($image2197"Games : $arcade4"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Gender: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,null,9,null); 
  }
else {
Imagepng($image,null,90,null); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

function 
ArcadeLatestGames($count 4$start 0$mem_id null)
{
global $db_prefix;

$games db_query("
SELECT  game.gameName, score.score, score.position, score.endTime
FROM (
{$db_prefix}arcade_scores AS score, {$db_prefix}arcade_games AS game)
WHERE score.ID_MEMBER = "
$mem_id ." AND score.ID_GAME = game.ID_GAME
ORDER BY endTime DESC
LIMIT 
$start,$count",__FILE__,__LINE__);

$data = array();

while ($game mysql_fetch_assoc($games))
$data[] = array(
'name' => $game['gameName'],
'score' => comma_format($game['score']),
'position' => ($game['position'])
);

return $data;
mysql_free_result($games);
}
?>

--------------------------------------------

I have updated sign.php with that code and it displays blank

Sign.php or Sign_arcade.php

1. Well ... // again or delete 2 lines.
   //$backimg = checkurl($backimg);
   //$noavatar = checkurl($noavatar);

2. Add error_reporting(E_ALL ^ E_NOTICE); before getinfos();

3. delete all die();
Title: Re: signature info stats [new features]
Post by: brianjw on October 15, 2007, 10:06:42 AM
For the arcade, can you make it display the latest 4 games played ONLY and show them in images (no text for the arcade).
-----------------------------------------------------------------------------------------------------------------
sign.php

I did everything you said and it shows up a broken image or when you refresh it shows up in the following like characters. Make them show in images like: (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.gamerzgarage.com%2FGames%2FactiondrivinggameXec.gif&hash=6c02ae0a139f4657806bd575efc94c80) EXCEPT resize them to be more like: (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.gamerzgarage.com%2FGames%2FactiondrivinggameXec.gif&hash=6c02ae0a139f4657806bd575efc94c80)
Quote
<br />
<b>Warning</b>:  mysql_free_result(): supplied argument is not a valid MySQL result resource in <b>/home/content/b/j/w/bjwilson/html/sign.php</b> on line <b>90</b><br />
‰PNG


IHDRnYPj IDAT8í½y˜%Gu/xNDär—Ú÷&shy;—êîjµZ&shy;V·ö]`   ²Ø1‹mìáÁÆð<c|cüÀï
ãñàÇ{àcì÷0›Ý ´´ºµµ¤îVï]û^uë.™qæÈ›7oÞ{«oõ&©«~ßýª2##O,'¶³zžkXÃNžçDÿ®a
«ˆýkÛ¶*Gô™™Ï¼¸—wöý÷¿HÝööéo|¾ù}°tÿ÷Zßûû03–Þ¶ÛnlᜊkXÃÅ,"¸-
ù|>Æ*ä{þÂì‘Ï~X'œùéùû6¼ë#3Ï<ÚýºwŒÝÿÝ֝7ýöWš·îš   QÈ´ÿ¯Ÿoé_Ÿlh\c˜5\LÀ\×Å|>ŸËå´Ö†O¼ÙÉü艑/ºp쥁;~#ÑÕ߶ûVò=ä‘”BËžÞû`nüÔÑû&ôllúÀ'Z7]ÒÐÝ¿6Ȭáâ@È'Œ±D"ù|>›ÍVQÒŸßûð©Ï}tÓ;>Ô¶ãzî¸ iZ   cÈ8p®
ùéç~õÂ?ýUáÝßxû[Û::,Ëz¥‹¹†5œLwÏ3¬’L&é"¼¹é‘/~rëûÿCÛŽëÁ+Pn   ¤&shy;4^AD@ŒBX]W¿^¸‰'ÿá /¶t_~Ã-ÍÍͯ΁¥··FFFÎ,òŠ^_ÃkˆHDŒ1 ¢È²^ú“ßÿ;9v¼íÒk Ÿ#¯¾GÒ¥€(à0¼‚ˆÄ9
‹,µn»ôšTvnüÞoïîKl¿Ìqèëë«š‰ááá³,†¡¼":afz{{ëyqxx¸¯¯Ï°G4pm‡põÀp‹ùâ"\Íû™…ìè   Í-Í0"(äÉ/€ïƒV¤   H"2dŒ“%Qkоç#ó§FO¾| § &shy;&shy;
Ož<i’€ðVk}NJR?húúúÂÌ,ƒ0~x}®r¾†W?Â9˜aÒ ’
ÚIIIDäûTðÀ÷H©`« #ƐsÐÀ€ B€%àK•Ëå”RfäŠâ¶³ãǏ¯ˆ`4þÙ¼»†Õƒè"¢43ËúÔß?ûü#þ¨ãÒ«-Ë!é“ô@ÊâÊJkƐq"ˆ ¸7›™|ñÉS¼á`祻ÓiÛ¶
ÍXÚѐ7ÀÑ£G+C–y½Å‰=ª|}TõÝ5¬!„áÓb͵ù„ˆR½ë&shy;ßüÄÓ_ûŒõ“oï¾û·[Ö]B¾$ß-Aë`µ‚€ˆÀ1ÀÄÌ‹OíùÁ?LñÔƒÝWmغ}ýúõ‰D¢Rš   Õ:æª!‡Þ´iÓƍ> ›6m€Ã‡‡‘M„Ê×Øæ:¤{Tùt
kˆ!*T1 ¬U̍eY}—í:ü±Ï/|ý?ýä?¾qèHïÎ[Hz$e°¸/’ΑkDyêG?{úÏíسñ¦-[¶ìÚµ«¿¿ß²¬ªÓ•:Y:´eËÓ¾Ííi   nÙ²%3¤pèÐ!s[™ÜÚœj
µJT´Öfq/ Ü,&¢D"1888ü‘?;üÜÓûø¥Æî
Ɇ6ò=Ò
--there is more on the link below--
http://www.gamerzgarage.com/sign.php?u=1
Here is my code:
Code: [Select]
<?php

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

error_reporting(E_ALL E_NOTICE);
getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : 

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['good'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else 


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);

 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

// $backimg = checkurl($backimg);
// $noavatar = checkurl($noavatar);

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else 

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { }

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Genter: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

function 
checkurl($url)
{
  
$getHeaders = @get_headers($url);
  if (
preg_match("|200|"$getHeaders[0])) {
  return 
$url;
  unset(
$getHeaders);
  } else {  }
}

?>

Title: Re: signature info stats [new features]
Post by: Embrace on October 15, 2007, 07:43:13 PM
I get nothing, when I run the error file I get Wrong width/height

I assume this is due to the fact that my avatars are 125/100

Please advice :)

Thanks,
Embrace
Title: Re: signature info stats [new features]
Post by: sebastian on October 15, 2007, 08:32:41 PM
I get nothing, when I run the error file I get Wrong width/height

I assume this is due to the fact that my avatars are 125/100

Please advice :)

Thanks,
Embrace

Well take some decisions:
1. Reduce your avatar height to <106px or
2. Make your sign.png file biggest >135px also set new height restrictions
   
//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=126 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width - 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height - 121) * 0.35);
 }
else { die();}

Bellow an image for example: height 135px / width 300px;
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign135.png&hash=3b5be578ed47b14a0650454b5c02b10f)

@brianjw

Your script without die(); has some errors. You must remove else also [ else { die(); } ]. Anyway.
try a new brian_error.php


Code: [Select]
<?php

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

error_reporting(E_ALL E_NOTICE);

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else { echo 
'No id'; die();}

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }
} else { 
$context['error_sign'] = 'No member ID';}

  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);
 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

//$backimg = checkurl($backimg);
//$noavatar = checkurl($noavatar);

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else { echo 
'No extension'; die();}

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { echo 
'Wrong width/height'; die();}

$image imagecreatetruecolor($image_width$image_height); 

$image imagecreatefrompng($backimg); 
$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Genter: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

function 
checkurl($url)
{
  
$getHeaders = @get_headers($url);
  if (
preg_match("|200|"$getHeaders[0])) {
  return 
$url;
  unset(
$getHeaders);
  } else {  echo 
'File not exist'; die();}

}
?>
Title: Re: signature info stats [new features]
Post by: brianjw on October 15, 2007, 09:49:06 PM
Well the error when I run http://www.gamerzgarage.com/sign.php?u=1 was
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/content/b/j/w/bjwilson/html/sign.php on line 88
and the code being used is
Code: [Select]
<?php

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

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] :

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['good'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

}

  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);

 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

$backimg checkurl($backimg);
$noavatar checkurl($noavatar);

if (
$avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Gender: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

function 
checkurl($url)
{
  
$getHeaders = @get_headers($url);
  if (
preg_match("|200|"$getHeaders[0])) {
  return 
$url;
  unset(
$getHeaders);
  }
}

?>

------------------------------------------------------
brian_error.php is working well :)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.gamerzgarage.com%2Fbrian_error.php%3Fu%3D1&hash=96dcf4fe00e466617cfa3777f82d7cec)

Brianjw
Title: Re: signature info stats [new features]
Post by: Embrace on October 15, 2007, 10:48:45 PM
the sign_error.php was the only one that worked for me also

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.knightsofnight.com%2Fsign_error.php%3Fu%3D3&hash=4118dd6b5218ad06794535fea6eab781)

Gonna modify alot, add the money and such there also :)
Title: Re: signature info stats [new features]
Post by: Embrace on October 15, 2007, 11:39:29 PM
WOOOT! got everything working

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.knightsofnight.com%2Fsign_error.php%3Fu%3D3&hash=4118dd6b5218ad06794535fea6eab781)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fxfiresigs.com%2FEmbrace.png&hash=07c319a536ad67796744438475599046)



EDIT: is there anyway for me to make the image a png extension, some of the forums I use do not allow php files and I would like to post it on them.


Thanks :)
Title: Re: signature info stats [new features]
Post by: sebastian on October 15, 2007, 11:58:38 PM
@brianjw & @Embrace i thing the problem is 2 lines. (sign.php)
$backimg = checkurl($backimg); delete or //
$noavatar = checkurl($noavatar); delete or //

Please take a time to confirm it or not.
If not also try to add this error_reporting(E_ALL ^ E_NOTICE); at the top of the script.

...or copy paste & make sig.php
Code: [Select]
<?php

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

error_reporting(E_ALL E_NOTICE);

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else die();


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);

 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Genter: $gender"$black);
} else {
ImageString($image5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

?>

Title: Re: signature info stats [new features]
Post by: Embrace on October 16, 2007, 12:36:04 AM
Ok awesome, I got it working... the only thing I need now is, somtimes the font shows up red, sometimes black?

How can I add the money from the smfshop mod, I want to replace the gender with that...


Thanks!
Title: Re: signature info stats [new features]
Post by: sebastian on October 16, 2007, 01:28:28 AM
... is there anyway for me to make the image a png extension, some of the forums I use do not allow php files and I would like to post it on them.

open your .htaccess ADD this line AddType application/x-httpd-php .png
then rename your .php file to .png file... sign.php -> sign.png
access as
Code: [Select]
[img]http://mydomain/sign.png[/img]
... the only thing I need now is, somtimes the font shows up red, sometimes black?

You mean Posts: 532 or Posts: 532 alternately?

Title: Re: signature info stats [new features]
Post by: sebastian on October 16, 2007, 02:10:49 AM
smf shop money

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fsign_mn.gif&hash=b5f516218b056b7451e4d5e341bfc9ff)

Code: [Select]
<?php

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

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

$result db_query("
SELECT memberName, money
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

 $context['members_money'] = array();
    while (
$money_items mysql_fetch_assoc($result))
{

$context['members_money'][] = array(
'get_money' => $money_items['money']
);
    
}  

foreach ($context['members_money'] as $member_money)
{
  $context['money'] = $member_money['get_money'];
}

} else die();


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);

 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];
$money $context['money'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want 
$noavatar "$img_url/images/noavatar.png"// or where you want 
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 1// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"Posts: $posts"$black);
ImageString($image42051"Karma: $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5314"$membername"$black);
ImageString($image42066"Gender: $gender"$black);
ImageString($image42081"Money: $money"$black);
} else {
ImageString($image5444"$membername"$black);
ImageString($image42066"Money: $money"$black);
}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,null,9,null); 
  }
else {
Imagepng($image,null,90,null); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

?>
Title: Re: signature info stats [new features]
Post by: Embrace on October 16, 2007, 09:35:33 AM
Wow, Thanks


You completely freaking rock! This is actually somthing that I have been trying to get for along time now... thanks so much :)

I also figured out most of the color problem, I beleive its due to a faulty PNG in the avatar.

I still cant get the .png extension to work, and the Karma displays oddly but still!!!!

Title: Re: signature info stats [new features]
Post by: sebastian on October 16, 2007, 07:31:06 PM
I still cant get the .png extension to work

open your .httacces & add:
RewriteEngine On
RewriteRule sign.png /your.folder.of/sign.php

sign = whatever name

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fasignset.png%3Fu%3D1&hash=427033ddf53a531c83cc6c18c781e4f3)

?
and the Karma displays oddly but still!!!!

Do you want your Karma like this -> Karma: 223 instead Karma: +223 / -223 ???????????????
Title: Re: signature info stats [new features]
Post by: Embrace on October 16, 2007, 11:23:58 PM
Well for the karma I would like it to display the correct values :P

Karma: +54/-3

instead of

Karma +54/-54


That rewrite worked, im guessing that there is no easy way to make it so its somthing like

www.knightsofnight.com/embracesig.png?
Title: Re: signature info stats [new features]
Post by: sebastian on October 17, 2007, 01:29:53 AM
Well for the karma I would like it to display the correct values :P

Karma: +54/-3

instead of

Karma +54/-54

Oh, sorry the problem was:
    $context['karmaBad'] = $item_comm['lbuser']['karma']['good'];

Correct
    $context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];

all scripts updated now. Thank you.

guessing that there is no easy way to make it so its somthing like


where is the trouble now?

For the arcade, can you make it display the latest 4 games played ONLY and show them in images (no text for the arcade).
My opinion is that these thumbsnails are too tiny after the resizing. Text is much better.
Title: Re: signature info stats [new features]
Post by: Embrace on October 17, 2007, 08:52:29 AM
no real trouble I would just like the .png to be the ending of the url, so I could use the image on other sites that do not use smf :)
Title: Re: signature info stats [new features]
Post by: sebastian on October 17, 2007, 09:32:59 AM
no real trouble I would just like the .png to be the ending of the url, so I could use the image on other sites that do not use smf :)

Find
Code: [Select]
if ($_GET['u'] >= 1)
    $id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

replace
Code: [Select]
$id_mem = 1;
where $id_mem = your id

run as sign.png
Title: Re: signature info stats [new features]
Post by: Embrace on October 17, 2007, 09:43:56 AM
Ok so I would have to customize that for every member than?

No problem though, sounds like a good admin only thing :P Thanks!
Title: Re: signature info stats [new features]
Post by: sebastian on October 17, 2007, 10:17:43 AM
Ok so I would have to customize that for every member than?

No problem though, sounds like a good admin only thing :P Thanks!

unfortunately... just one user.
Title: Re: signature info stats [new features]
Post by: brianjw on October 18, 2007, 05:46:21 PM
My opinion is that these thumbsnails are too tiny after the resizing. Text is much better.
Could you make one anyway? As a test. It's like putting avatars on the image except it shows smaller images for the latest 4 (can be changed) played arcade games.
If it is something you still would rather not do... ($$$)

EDIT
What would I do to put the color, "#e1e1e1" into the code so I can do like $grey (never mind, I figured it out using photoshop)
--edit 2--
How and where would I make the avatar smaller in size to fit the signature?
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.gamerzgarage.com%2Fsig.php%3Fu%3D1&hash=009b1efcb14554841882ef81420c3402)
and...
On my website there is a ™ displayed after Tuxie so it would appear as Tuxie™ normally. Well the signature seems not be recognizing symbols and is showing â ˘ instead. Any idea why and how to fix this? Thanks!

Edit 3
I am trying to add an admin function part to this. I have been successful. The only problem I am getting is getting the modsettings functions to work on sig.php -
Code: [Select]
<?php

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

error_reporting(E_ALL E_NOTICE);

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else die();


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);

mysql_free_result($result);
mysql_free_result($result2);

 }


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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/sign.png
$noavatar "$img_url/images/noavatar.png"// or where you want -> http://www.yourdomain.com/Themes/Default/images/noavatar.png
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 0// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
// Your settings +++++++++++++++++++++++++++++++++++

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$image imagecreatetruecolor($image_width$image_height); 
$image imagecreatefrompng($backimg);  

$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($image$img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($image$img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}
 
$green ImageColorAllocate ($image2312417); 
$blue ImageColorAllocate ($image00255); 
$red ImageColorAllocate ($image25500);
$white ImageColorAllocate ($image255255255);
$black ImageColorAllocate ($image000);

 
ImageString($image42035"'. $modSettings['sig_posts'] .': $posts"$black);
ImageString($image42051"'. $modSettings['sig_karma'] .': $karma"$black);
if (
$set_gender_style == 0) {
ImageString($image5554"$membername"$grey);
ImageString($image42066"'. $modSettings['sig_gender'] .': $gender"$black);
} else {
ImageString($image5554"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($image,'',9); 
  }
else {
Imagepng($image,'',90); 
  }    
ImageDestroy ($image);
ImageDestroy ($img_bgr);  
}

?>

mainly these codes are the problem (but how do I keep them and get rid of the following error):
Code: [Select]
ImageString($image, 4, 20, 35, "'. $modSettings['sig_posts'] .': $posts", $black);
ImageString($image, 4, 20, 51, "'. $modSettings['sig_karma'] .': $karma", $black);
if ($set_gender_style == 0) {
ImageString($image, 5, 55, 4, "$membername", $grey);
ImageString($image, 4, 20, 66, "'. $modSettings['sig_gender'] .': $gender", $black);
} else {ImageString($image, 5, 55, 4, "$membername", $black);}
Quote
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/b/j/w/bjwilson/html/test/sig.php on line 202
also is alright if I make this into a mod, if I display all credits mainly to you.
-----
Brianjw
Title: Re: signature info stats [new features]
Post by: sebastian on October 19, 2007, 02:29:55 AM
On my website there is a ™ displayed after Tuxie so it would appear as Tuxie™ normally. Well the signature seems not be recognizing symbols and is showing â ˘ instead. Any idea why and how to fix this?

You need True Type Font. This is also usefull for Non English Characters.

Upload your ttf font.

add after
Code: [Select]
$black = ImageColorAllocate ($image, 0, 0, 0);this
Code: [Select]
$font = 'fonts/somefont.TTF'; // change your font path and name here
find
Code: [Select]
ImageString($image, 5, 31, 4, "$membername", $black);replace
 
Code: [Select]
imagettftext($image, 12, 0, 31, 17, $black, $font, "$membername");
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fasignset.png%3Fu%3D1&hash=427033ddf53a531c83cc6c18c781e4f3)

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in

Code: [Select]
$sig_posts = $modSettings['sig_posts'];
$sig_karma = $modSettings['sig_karma'];
$sig_gender = $modSettings['sig_gender'];
 
ImageString($image, 4, 20, 35, "$sig_posts: $posts", $black);
ImageString($image, 4, 20, 51, "$sig_karma: $karma", $black);
if ($set_gender_style == 0) {
ImageString($image, 5, 31, 4, "$membername", $grey);
ImageString($image, 4, 20, 66, "$sig_gender: $gender", $black);
} else {ImageString($image, 5, 44, 4, "$membername", $black);}

also is alright if I make this into a mod, if I display all credits mainly to you

Yes.
Title: Re: signature info stats [new features]
Post by: sebastian on October 20, 2007, 06:05:08 AM
signature arcade last games thumbs

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.remorse.gr%2Fsmfiles%2Fnothumb.gif&hash=b39719c48a348291d7922bc344af08ed)

Copy nothumb.gif into ./Games folder.

Some thumbnails is defectivelly.

Settings
$set_arcade_style = 1; //0 text , 1 image
$context['set_arcade_game_folder'] = 'Games'; //without any /
$context['set_arcade_height'] = 3; //move arcade up/down
$context['set_arcade_width'] = 67; //move arcade left/right
$context['set_thumb_width'] = 40; //set  thumb width
$context['set_thumb_height'] = 40; //set  thumb height

Code: [Select]
<?php

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

getinfos();
signature();

function 
getinfos()
{
global 
$context$db_prefix$memberContext;

$mommy '';

if (
$_GET['u'] >= 1)
    
$id_mem = isset($_GET['u']) ? (int) $_GET['u'] : die();
else die();

$result db_query("
SELECT memberName
FROM 
{$db_prefix}members
WHERE ID_MEMBER = " 
. (int) $id_mem "
AND is_activated = 1
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result) > 0)  
{

 $mprofile[] = (int) $id_mem;

loadMemberData($mprofilefalse'profile');

foreach ($mprofile as $profile)
{
loadMemberContext($profile);


$context['item_comms'] = array();

$context['item_comms'][] = array(
    'lbuser' => $memberContext[$id_mem]
);

foreach ($context['item_comms'] as $item_comm)
    {
$context['membername'] = $item_comm['lbuser']['name'];
$context['posts'] = $item_comm['lbuser']['posts'];
$context['gender'] = $item_comm['lbuser']['gender']['image'];
$context['karmaBad'] = $item_comm['lbuser']['karma']['bad'];
    
$context['karmaGood'] = $item_comm['lbuser']['karma']['good'];
$context['avatar'] = $item_comm['lbuser']['avatar']['href'];
    }

} else die();


  
$mommy = isset($context['avatar']) ? $context['avatar'] : ''
  
$mommy preg_split('/;/',$mommy, -1PREG_SPLIT_OFFSET_CAPTURE);
  
$mommy $mommy [1][0];
  
$mommy trim(substr(strrchr($mommy'='), 1));

$result2 db_query("
SELECT filename
FROM 
{$db_prefix}attachments
WHERE ID_ATTACH = " 
. (int) $mommy "
LIMIT 1"
__FILE____LINE__);

     if (
db_affected_rows($result2) > 0)  
 {

 $context['avatar_sign_id'] = array();
    while (
$row_items mysql_fetch_assoc($result2))
{

$context['avatar_sign_id'][] = array(
'filename' => $row_items['filename']
);
    
}  

foreach ($context['avatar_sign_id'] as $avatar_item)
{
  $context['filename_avatar'] = $avatar_item['filename'];
}

  } 
unset($mommy);
ArcadeLatestGames(40$id_mem);

$y 0;
$context['arcade']['latest_games'] = ArcadeLatestGames(40$id_mem);

if (count($context['arcade']['latest_games']) > 0)
foreach ($context['arcade']['latest_games'] as $game) {
$context['arcadelast'][$y] .= $game['name'].'-'.$game['score'].'-'.$game['position'];
$context['arcade_thumbs'][$y] = $game['thumbnail'];
$y++; }

mysql_free_result($result);
mysql_free_result($result2);

 }

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

$lemo '';
$img_url $settings['default_theme_url']; 

$membername $context['membername'];
$posts $context['posts'];

    if (
$context['filename_avatar'] != ''
     {
       
$lemo $context['filename_avatar'];
     }
    else {
       
$lemo '';
     } 

$avatar $context['avatar'];
$gender $context['gender'];

$arcade1 $context['arcadelast'][0];
$arcade2 $context['arcadelast'][1];
$arcade3 $context['arcadelast'][2];
$arcade4 $context['arcadelast'][3];

$arcadethump1 $context['arcade_thumbs'][0];
$arcadethump2 $context['arcade_thumbs'][1];
$arcadethump3 $context['arcade_thumbs'][2];
$arcadethump4 $context['arcade_thumbs'][3];

$arcade_thumb $boardurl.'/'.$set_arcade_game_folder.'/'.$context['arcade_thumbs'][0];


if (
preg_match'/Male/'$gender))
{
    
$gender "male";
$img_gender "$img_url/images/Male.gif";

elseif (
preg_match'/Female/'$gender)) {
    
$gender "female";
    
$img_gender "$img_url/images/Female.gif"; }
else {
$gender "n/a"$img_gender "$img_url/images/star.gif";}

$karmaBad $context['karmaBad'];
$karmaGood $context['karmaGood'];   
if (
$modSettings['karmaMode'] == '1'

$karma $karmaGood $karmaBad;
} elseif (
$modSettings['karmaMode'] == '2')
{
$karma '+'.$karmaGood.' / '.'-'.$karmaBad;
} elseif (
$modSettings['karmaMode'] == '0'
{
$karma 'n/a';
}
// Your settings +++++++++++++++++++++++++++++++++++ 
$backimg "$img_url/images/sign.png"// or where you want 
$noavatar "$img_url/images/noavatar.png"// or where you want 
$set_avatar_height 0//move avatar up/down
$set_avatar_width 0//move avatar left/right
$set_gender_style 1// 0 text , 1 image
$set_gender_height = -92//move gender up/down
$set_gender_width = -230//move gender left/right
$set_arcade_style 1//0 text , 1 image
$context['set_arcade_game_folder'] = 'Games'//without any /
$context['set_arcade_height'] = 3//move arcade up/down
$context['set_arcade_width'] = 67//move arcade left/right
$context['set_thumb_width'] = 40//set  thumb width
$context['set_thumb_height'] = 40//set  thumb height
// Your settings +++++++++++++++++++++++++++++++++++

if ($avatar != '') {$avatar $avatar;}
else {
$avatar $noavatar;}

if (
$lemo != '') { $ext substr(strrchr($lemo'.'), 1); }
else {
$ext substr(strrchr($avatar'.'), 1);}

unset(
$lemo);

if (
$ext == 'png') {$img_bgr imagecreatefrompng($avatar); }
elseif (
$ext == 'jpg') {$img_bgr imagecreatefromjpeg($avatar); }
elseif (
$ext == 'gif') {$img_bgr imagecreatefromgif($avatar); }
else die();

$size getimagesize($backimg);

if (
$set_gender_style == 1) {
$img_bgr_gender imagecreatefromgif($img_gender);
$image_width_gender imagesx($img_bgr_gender);  
$image_height_gender imagesy($img_bgr_gender);
$dest_x_gender $size[0] - $image_width_gender $set_gender_width;  
$dest_y_gender $size[1] - $image_height_gender $set_gender_height;
}

$image_width imagesx($img_bgr);  
$image_height imagesy($img_bgr);

//______________avatar  width & height must be <=106
if ($image_width <=106 && $image_width >=10 && $image_height <=106 && $image_height >=10)
  {
$set_avatar_width =  $set_avatar_width + (($image_width 101) * 0.35);
$set_avatar_height =  $set_avatar_height + (($image_height 101) * 0.35);
 }
else { die();}

$context['image'] = imagecreatetruecolor($image_width$image_height); 
$context['image'] = imagecreatefrompng($backimg);  


$dest_x $size[0] - $image_width $set_avatar_width;  
$dest_y $size[1] - $image_height $set_avatar_height
imagecopymerge($context['image'], $img_bgr,  $dest_x$dest_y00$image_width$image_height100);
if (
$set_gender_style == 1) {
imagecopymerge($context['image'], $img_bgr_gender,  $dest_x_gender$dest_y_gender00$image_width_gender$image_height_gender100);
}

if (
$set_arcade_style == 1) {

        
arcade_last_games ($arcadethump1 1);
        
arcade_last_games ($arcadethump2 43);
        
arcade_last_games ($arcadethump3 86);
        
arcade_last_games ($arcadethump4 129);
  
}

$green ImageColorAllocate ($context['image'], 2312417); 
$blue ImageColorAllocate ($context['image'], 00255); 
$red ImageColorAllocate ($context['image'], 25500);
$white ImageColorAllocate ($context['image'], 255255255);
$black ImageColorAllocate ($context['image'], 000);
 
ImageString($context['image'], 42032"Posts: $posts"$black);
ImageString($context['image'], 42048"Karma: $karma"$black);
if (
$set_arcade_style == 0) {
ImageString($context['image'], 2167"Arcade: $arcade1"$black);
ImageString($context['image'], 2177"Last 4: $arcade2"$black);
ImageString($context['image'], 2187"Played: $arcade3"$black);
ImageString($context['image'], 2197"Games : $arcade4"$black);
}
if (
$set_gender_style == 0) {
ImageString($context['image'], 5314"$membername"$black);
ImageString($context['image'], 42066"Gender: $gender"$black);
} else {
ImageString($context['image'], 5444"$membername"$black);}

header("Content-Type: image/png"); 

$php PHP_VERSION
if (@
version_compare(PHP_VERSION'5.1.0'">="))
  {
  
// if PHP v5.1 ++
Imagepng($context['image'],null,9,null); 
  }
else {
Imagepng($context['image'],null,90,null); 
  }    
ImageDestroy ($context['image']);
ImageDestroy ($img_bgr);  


}

function 
ArcadeLatestGames($count 4$start 0$mem_id null)
{
global $context$db_prefix;

$games db_query("
SELECT  game.gameName, game.thumbnail, score.score, score.position, score.endTime
FROM (
{$db_prefix}arcade_scores AS score, {$db_prefix}arcade_games AS game)
WHERE score.ID_MEMBER = "
$mem_id ." AND score.ID_GAME = game.ID_GAME
ORDER BY endTime DESC
LIMIT 
$start,$count",__FILE__,__LINE__);
    
$data = array();

while ($game mysql_fetch_assoc($games))
$data[] = array(
'name' => $game['gameName'],
'thumbnail' => $game['thumbnail'],
'score' => comma_format($game['score']),
'position' => ($game['position'])
);

return $data;

mysql_free_result($games);
}

function 
arcade_last_games ($game_name$width_px)
 {
 global 
$context;
 
 
$image $context['img_back'];
$img_thumb_exist $context['set_arcade_game_folder'].'/'.$game_name;
$arcade_thumb file_exists($img_thumb_exist) ? $arcade_thumb $img_thumb_exist $arcade_thumb $context['set_arcade_game_folder'].'/nothumb.gif';

$dest_x_arcade_px $width_px;

$img_bgr_arcade imagecreatefromgif($arcade_thumb);
$image_width_arcade imagesx($img_bgr_arcade);  
$image_height_arcade imagesy($img_bgr_arcade);

$dest_x_arcade $context['set_arcade_height'] + $dest_x_arcade_px;
$dest_y_arcade $context['set_arcade_width'];

$img_bgr_arcade_thumb imagecreatetruecolor($context['set_thumb_width'], $context['set_thumb_height']);
imagecopyresized($img_bgr_arcade_thumb$img_bgr_arcade0000$context['set_thumb_width'], $context['set_thumb_height'], $image_width_arcade$image_height_arcade);
imagecopymerge($context['image'], $img_bgr_arcade_thumb$dest_x_arcade$dest_y_arcade00$context['set_thumb_width'], $context['set_thumb_height'], 100);
 
 }
  
?>
Title: Re: signature info stats [new features]
Post by: brianjw on October 20, 2007, 03:44:55 PM
Thanks so much! I am not able to test it yet though! I will let you know if it works when I do :)
Title: Re: signature info stats [new features]
Post by: Sun11 on December 29, 2007, 12:54:26 PM
Can someone make a Mod, meaning i can automatically install it on SMF from Packages for SMF 1.1.4 PLEASE
Title: Re: signature info stats [new features]
Post by: Fiery on January 21, 2008, 12:06:26 AM
Can someone make a Mod, meaning i can automatically install it on SMF from Packages for SMF 1.1.4 PLEASE

Have you requested this in the correct area?
Title: Re: signature info stats [new features]
Post by: sebastian on January 21, 2008, 08:06:39 AM
Can someone make a Mod, meaning i can automatically install it on SMF from Packages for SMF 1.1.4 PLEASE

Too sophisticated. Simple make and upload your file.
Title: Re: signature info stats [new features]
Post by: Nibogo on April 01, 2008, 07:34:28 PM
when i go to:

http://mundo-se.com/foro/sign.php?u=1

appear:

Quote
Warning:  imagecreatefrompng() [function.imagecreatefrompng (http://mundo-se.com/foro/function.imagecreatefrompng)]: URL file-access is disabled in the server configuration in /www/zzl.org/s/e/-/se-world/htdocs/foro/sign.php on line 157
 
 Warning:  imagecreatefrompng(http://mundo-se.com/foro/index.php?action=dlattach;attach=135;type=avatar) [function.imagecreatefrompng (http://mundo-se.com/foro/function.imagecreatefrompng)]: failed to open stream: no suitable wrapper could be found in /www/zzl.org/s/e/-/se-world/htdocs/foro/sign.php on line 157
 
 Warning:  getimagesize() [function.getimagesize (http://mundo-se.com/foro/function.getimagesize)]: URL file-access is disabled in the server configuration in /www/zzl.org/s/e/-/se-world/htdocs/foro/sign.php on line 162
 
 Warning:  getimagesize(http://mundo-se.com/foro/Themes/default/images/sign.png) [function.getimagesize (http://mundo-se.com/foro/function.getimagesize)]: failed to open stream: no suitable wrapper could be found in /www/zzl.org/s/e/-/se-world/htdocs/foro/sign.php on line 162
 
 Warning:  imagesx(): supplied argument is not a valid Image resource in /www/zzl.org/s/e/-/se-world/htdocs/foro/sign.php on line 172
 
 Warning:  imagesy(): supplied argument is not a valid Image resource in /www/zzl.org/s/e/-/se-world/htdocs/foro/sign.php on line 173
Title: Re: signature info stats [new features]
Post by: Panzer- on April 01, 2008, 11:36:44 PM
Very nice, thanks for the share.
Title: Re: signature info stats [new features]
Post by: sebastian on April 02, 2008, 05:35:27 AM
@ Thank you Panzer-

@ NIBOGO

First delete all personal data.
Second try to set $set_gender_style = 0; // 0 text , 1 image

Your server  probably does not allow remote connections. Try to use absolute paths.
example: Themes/default/images/male.gif instead http://www.mysite.com/Themes/default/male.gif

Line 88, add
global $context, $settings, $modSettings ,$boarddir;

Line 91, replace
$img_url = $boarddir.'/Themes/default';

So...

Code: [Select]
global $context, $settings, $modSettings, $boarddir;

$lemo = '';
$img_url = $boarddir.'/Themes/default';

Title: Re: signature info stats
Post by: matasanos on April 27, 2008, 01:34:49 PM
hi all

i have a strange error..

when a user doesnt have avatar...all is correct.

but when i put a user with avatar....i get a white page with this message "No Extension"
Title: Re: signature info stats
Post by: sebastian on April 28, 2008, 09:19:55 AM
Hello matasanos,

Can you give us your GD library info?

make a php file like this gdinfo.php
Code: [Select]
<?php
var_dump
(gd_info());
?>

Title: Re: signature info stats
Post by: Nibogo on May 02, 2008, 08:46:41 PM
sebastian your code didnt work , i have another server and have the same error:

Code: [Select]
Warning:  imagecreatefrompng() [function.imagecreatefrompng]: URL file-access is disabled in the server configuration in /home/.sauvignon/nibogo2/mundo-se.com/foro/archivo.php on line 157
 
 Warning:  imagecreatefrompng(http://www.mundo-se.com/foro/avatars/Tux/Tux1.png) [function.imagecreatefrompng]: failed to open stream: no suitable wrapper could be found in /home/.sauvignon/nibogo2/mundo-se.com/foro/archivo.php on line 157
 
 Warning:  getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /home/.sauvignon/nibogo2/mundo-se.com/foro/archivo.php on line 161
 
 Warning:  getimagesize(http://www.mundo-se.com/foro/Themes/default/images/sign.png) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /home/.sauvignon/nibogo2/mundo-se.com/foro/archivo.php on line 161
 
 Warning:  imagesx(): supplied argument is not a valid Image resource in /home/.sauvignon/nibogo2/mundo-se.com/foro/archivo.php on line 171
 
 Warning:  imagesy(): supplied argument is not a valid Image resource in /home/.sauvignon/nibogo2/mundo-se.com/foro/archivo.php on line 172
Title: Re: signature info stats
Post by: sebastian on May 03, 2008, 02:15:20 AM
Hello again NIBOGO,

And again, your server  does not allow remote connections. Try to use absolute paths.
Example ->
avatars/Tux/Tux1.png instead
http://www.mundo-se.com/foro/avatars/Tux/Tux1.png

So...Gooo to function signature()
Search first
Code: [Select]
global $context, $settings, $modSettings, $db_prefixreplace
Code: [Select]
global $context, $settings, $modSettings, $db_prefix, $boardurl;
Search second
Code: [Select]
$avatar = $context['avatar'];replace
Code: [Select]
$avatar = $context['avatar'];
$avatar = str_replace($boardurl.'/', '', $avatar);

Your $boardurl = http://www.mundo-se.com/foro/
Your image link is = http://www.mundo-se.com/foro/avatars/Tux/Tux1.png

Result
absolute path = avatars/Tux/Tux1.png

I hope you find this useful.
Title: Re: signature info stats
Post by: Ginza on May 27, 2008, 08:47:22 PM
I have saved the signature_info.php in the directory along with the SSI.php.
and the image signinfo.pnp in /themes/default/images

the image location is http://mysite.com/themes/default/images/signinfo.png

Quote
Now you said:
Finally set your signature -->
Code: [Select]
Code: [img]http://mydomain/signinfo.png[/img]

wont this be http://mysite.com/themes/default/images/signinfo.png?

and in the signature_info.php won't the following code ie

Code: [Select]
$image = "$img_url/images/signature_info.png"; // or where you want
be

Code: [Select]
$image = "$img_url/images/signinfo.png"; // ??

Please advice as I couldnt get the image coming up.
Title: Re: signature info stats
Post by: brianjw on May 27, 2008, 09:18:12 PM
If the image is located in http://mysite.com/themes/default/images/signinfo.png then the code would be:
Code: [Select]
$image = "$img_url/images/signinfo.png"; // or where you want
so you were correct. :)
Title: Re: signature info stats
Post by: Ginza on May 27, 2008, 10:36:26 PM
Thanks for the reply.

What about the signature,

will it be
Code: [Select]
[img]http://mydomain/signinfo.png[/img]
OR

Code: [Select]
[img]http://mydomain/themes/default/images/signinfo.png[/img]  ??
Title: Re: signature info stats
Post by: brianjw on May 27, 2008, 10:57:10 PM
The signature will be
Code: [Select]
[img]http://mydomain/signature_info.php[/img]The php code displays the picture. The picture that is in the location is just a background image for the dynamic signature. The dynamic signature is generated and rendered in the php file so you'd link to the php file.
Title: Re: signature info stats
Post by: Ginza on May 27, 2008, 11:05:45 PM
brianjw... thank you so much.. i will give it a shot and i will come back if i have any issue.
Title: Re: signature info stats
Post by: Nibogo on June 04, 2008, 09:14:54 PM
Hello again NIBOGO,

And again, your server  does not allow remote connections. Try to use absolute paths.
Example ->
avatars/Tux/Tux1.png instead
http://www.mundo-se.com/foro/avatars/Tux/Tux1.png (http://www.mundo-se.com/foro/avatars/Tux/Tux1.png)

So...Gooo to function signature()
Search first
Code: [Select]
global $context, $settings, $modSettings, $db_prefixreplace
Code: [Select]
global $context, $settings, $modSettings, $db_prefix, $boardurl;
Search second
Code: [Select]
$avatar = $context['avatar'];replace
Code: [Select]
$avatar = $context['avatar'];
$avatar = str_replace($boardurl.'/', '', $avatar);

Your $boardurl = http://www.mundo-se.com/foro/ (http://www.mundo-se.com/foro/)
Your image link is = http://www.mundo-se.com/foro/avatars/Tux/Tux1.png (http://www.mundo-se.com/foro/avatars/Tux/Tux1.png)

Result
absolute path = avatars/Tux/Tux1.png

I hope you find this useful.


Thanks for your help but didnt work i do the two modifications  :'( :'( :'(

This mod is not for me  :( :(
Title: Re: signature info stats
Post by: MoreBloodWine on August 22, 2008, 03:17:59 AM
I'm trying to have the Greenwich under my local time and I moved the code around but it doesnt seem tp bump down. What gives... this is the code I have and what that code puts out as my image. Also, no biggie but more curious on this one. I noticed that the online members is also counting guests, is there anyway to not have it count guests ?

Edit: What needs to be added to add a Newest Member line ? I was thinking I could just take out the Greenwich Time and use that empty space for a Newest Member line.

Edit: All problems being fixed right now, only takes some playing around with to learn on your own, Thx ;-)

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.eojmarket.com%2Fsigninfo.php&hash=18b1e88c690a3cd1da5cd598524e7fe1)

Code: [Select]
Code emoved...
Title: Re: signature info stats
Post by: MoreBloodWine on August 22, 2008, 09:36:03 PM
Is there a way to automatically pull the forum version in my case 1.1.5 so it doesnt need to be manually edited upon forum updates etc. ?
Title: Re: signature info stats
Post by: sebastian on August 24, 2008, 05:32:06 AM
Unfortunately, no!!! Remove this line.
Title: Re: signature info stats
Post by: MoreBloodWine on August 24, 2008, 08:20:21 AM
Unfortunately, no!!! Remove this line.
Just figured I'd ask, woulda been kinda cool though.

Also, one quick question... if there a way to make smething hyperlink on it like the sites web address ? I trired a few things that didnt wor, hope the question makes sense.
Title: Re: signature info stats
Post by: sebastian on September 07, 2008, 09:09:49 AM
Hi, bad news again. String only.
Title: Re: signature info stats
Post by: MoreBloodWine on November 02, 2008, 06:34:33 PM
This pops up from time to time, I was curious if you know whats causing it. Like is there a problem with the code / image or just something configured wrong in my php.ini file.

Code: [Select]
[02-Nov-2008 11:45:09] PHP Warning: imagecreatefrompng() [function.imagecreatefrompng]: Cannot read image data in /home/eojmarke/public_html/signinfo3.php on line 29
[02-Nov-2008 11:45:09] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 30
[02-Nov-2008 11:45:09] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 31
[02-Nov-2008 11:45:09] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 32
[02-Nov-2008 11:45:09] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 33
[02-Nov-2008 11:45:09] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 34
[02-Nov-2008 11:45:09] PHP Warning: imagestring(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 37
[02-Nov-2008 11:45:09] PHP Warning: imagestring(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 38
[02-Nov-2008 11:45:09] PHP Warning: imagestring(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 39
[02-Nov-2008 11:45:09] PHP Warning: imagestring(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 40
[02-Nov-2008 11:45:09] PHP Warning: imagestring(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 41
[02-Nov-2008 11:45:09] PHP Warning: imagepng(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 44
[02-Nov-2008 11:45:09] PHP Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/eojmarke/public_html/signinfo3.php on line 47
Title: Re: signature info stats
Post by: sebastian on November 02, 2008, 10:35:14 PM
Hello,

This code is very simple. I have two thoughts about that errors.

1. For some reason imagecreatefrompng function fails to read your source png image file.
2. The Imagecreatefrompng function needs GD library to generate this png image.
   So something relative to GD library occurs this error.
Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 12:44:15 AM
Hello,

This code is very simple. I have two thoughts about that errors.

1. For some reason imagecreatefrompng function fails to read your source png image file.
2. The Imagecreatefrompng function needs GD library to generate this png image.
   So something relative to GD library occurs this error.
Well, I do have GD and as far as IO can tell its fine.

http://www.eojmarket.com/gd_info.php

Edit: As far as I know the "script" is acting fine as you can see from my signature.
Title: Re: signature info stats
Post by: sebastian on November 03, 2008, 08:11:42 AM
Quote
: As far as I know the "script" is acting fine as you can see from my signature.

Hi,

I did not say that it does not exist, obviously you have GD library already.
Try to replace the png file or try to handle the error.

After
Code: [Select]
$im = imagecreatefrompng($image);
Add
Code: [Select]
if (!$im)
 {
   $im = imagecreatetruecolor(385, 110); // x-coordinate,  y-coordinate
   //default is black but if you want another background color uncheck
   //imagefill($im, 0, 0, 255, 0, 0); // red etc
 }
Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 10:51:55 AM
Well I put in the changes, so heres hoping it works heh.

The error itself didnt seem to be messing with anything it just kept creating an error file which is annoying. Either way Thx, I'll post back with info to let you know if it work or not ;-)
Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 01:39:13 PM
This seems to be the only thing showing up now after adding your "edits"

Code: [Select]
[03-Nov-2008 11:43:06] PHP Warning: imagecreatefrompng() [function.imagecreatefrompng]: Cannot read image data in /home/eojmarke/public_html/signinfo3.php on line 29
Title: Re: signature info stats
Post by: sebastian on November 03, 2008, 02:25:02 PM
Solution 1

Try to use absolute paths.

->: Forum_directory/Themes/default/images/signature.png  instead http://www.mysite.com/Forum_directory/Themes/default/images/signature.png

Replace
Code: [Select]
$img_url = $settings['default_theme_url'];

With
Code: [Select]
$img_url = "your_forum_directory/Themes/default/";
Solution 2

Your background image is black... so...

Delete 2 lines
Code: [Select]
$image = "$img_url/images/signature_info.png"; // or where you want
$im = imagecreatefrompng($image);

Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 02:56:16 PM
Sorry for the trouble, I'll give number 2 a shot first so I dont have to mess with paths. If that fixes it great if not then I'll try number one. Either way ty for the help, one thing I am glad for is that I atleast got the status image working because I remember trying this about 2 yrs ago or something like that and got frustrated as hell because I couldnt get it to work heh.

Edit: Actually, do I need to do both solutions or just one ?

Edit 2: Come to think of it wont deleting that line make the "script" stop working. I ask becaue one of the lines you say to delete appears to be the line that calls the image.
Title: Re: signature info stats
Post by: sebastian on November 03, 2008, 03:36:30 PM
Quote
Actually, do I need to do both solutions or just one ?

Just one, Solution 2 is the best for you now.

Quote
Come to think of it wont deleting that line make the "script" stop working. I ask becaue one of the lines you say to delete appears to be the line that calls the image

There is no problem because the next lines solve this issue.

Code: [Select]
if (!$im)
{
   $im = imagecreatetruecolor(385, 110); // x-coordinate,  y-coordinate
   //default is black but if you want another background color uncheck
   //imagefill($im, 0, 0, 255, 0, 0); // red etc
}


...also...
Quote
I noticed that the online members is also counting guests, is there anyway to not have it count guests

Remove
Code: [Select]
$result = db_query("
SELECT COUNT(session)
FROM {$db_prefix}log_online", __FILE__, __LINE__);
list ($context['users_online']) = mysql_fetch_row($result);

Add
Code: [Select]
$result = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}log_online", __FILE__, __LINE__);

    $context['users_online'] = 0;

while ($row = mysql_fetch_assoc($result))
{

    if (!empty($row['ID_MEMBER']))
{
$context['users_online']++;
continue;
}

}
Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 04:10:00 PM
Quote
Come to think of it wont deleting that line make the "script" stop working. I ask becaue one of the lines you say to delete appears to be the line that calls the image

There is no problem because the next lines solve this issue.

Code: [Select]
if (!$im)
{
   $im = imagecreatetruecolor(385, 110); // x-coordinate,  y-coordinate
   //default is black but if you want another background color uncheck
   //imagefill($im, 0, 0, 255, 0, 0); // red etc
}
Well, the thing is I use three variations of this script to acconodate a few people... look here.

http://www.eojmarket.com/index.php?topic=272.msg2412#msg2412

Edit: Also solution 1 didnt seem to work as I'm till getting the below. So it would seem that solution two is my best option but since I use three varations of the script I dont see how removing the image line would fix the one problem without creationg others due to the three versions of this that I have.

Code: [Select]
[03-Nov-2008 11:43:06] PHP Warning: imagecreatefrompng() [function.imagecreatefrompng]: Cannot read image data in /home/eojmarke/public_html/signinfo3.php on line 29
Title: Re: signature info stats
Post by: Nibogo on November 03, 2008, 06:36:39 PM
Sebastian any update for smf 2.0???
Title: Re: signature info stats
Post by: sebastian on November 03, 2008, 10:50:55 PM
@NIBOGO

Signature info stats for SMF 2.0 Beta already exists. Look into first post.
 (search signature_info.php NO_FONTS (SMF 2.x.x))

@MoreBloodWine

Upload a jpeg file. (signature_info.jpg)

Find
Code: [Select]
$image = "$img_url/images/signature_info.png"; // or where you want
$im = imagecreatefrompng($image);

Replace
Code: [Select]
$image = "$img_url/images/signature_info.jpg"; // or where you want
$im = imagecreatefromjpeg($image);

Find
Code: [Select]
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);}

Replace
Code: [Select]
header("Content-Type: image/jpeg");
  Imagejpeg($im, null, 90);
Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 10:56:49 PM
@NIBOGO

Signature info stats for SMF 2.0 Beta already exists. Look the first post.
 (search signature_info.php NO_FONTS (SMF 2.x.x))

@MoreBloodWine

Upload a jpeg file.

Find
Code: [Select]
$image = "$img_url/images/signature_info.png"; // or where you want
$im = imagecreatefrompng($image);

Replace
Code: [Select]
$image = "$img_url/images/signature_info.jpg"; // or where you want
$im = imagecreatefromjpeg($image);

Find
Code: [Select]
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);}

Replace
Code: [Select]
header("Content-Type: image/jpeg");
  Imagejpeg($im, null, 90);
Thx, I'll convert my "image" to a jpg and make your changes and that should fix whatever associated errors I'm having without affecting the three version of this I have. Either way I'll post back with the news ;-)
Title: Re: signature info stats
Post by: MoreBloodWine on November 03, 2008, 11:02:44 PM
That last change of yours I'm unsure what to do exactly. I only say that because that last bit of code I changed once before to fix something I read in this 9 page thread. Anyway, this is what the last bit of code looks like that comes before the ?>

Code: [Select]
header("Content-Type: image/png");
Imagepng($im,'',9);
// if PHP v5.2.6 ++
// Imagepng($im,'',9); 
ImageDestroy ($im);
Title: Re: signature info stats
Post by: sebastian on November 04, 2008, 08:01:17 AM
Signature Info Stats Jpeg Version

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.jpg"// or where you want
$im imagecreatefromjpeg($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