News:

Wondering if this will always be free?  See why free is better.

Main Menu

signature info stats [no more updates and support]

Started by sebastian, August 20, 2005, 10:42:12 PM

Previous topic - Next topic

MoreBloodWine

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. ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

Unfortunately, no!!! Remove this line.

MoreBloodWine

Quote from: sebastian on August 24, 2008, 05:32:06 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.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

Hi, bad news again. String only.

MoreBloodWine

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.

[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
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

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.

MoreBloodWine

Quote from: 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.
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.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

#167
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
$im = imagecreatefrompng($image);

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

MoreBloodWine

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 ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

This seems to be the only thing showing up now after adding your "edits"

[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
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

#170
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
$img_url = $settings['default_theme_url'];

With
$img_url = "your_forum_directory/Themes/default/";

Solution 2

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

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



MoreBloodWine

#171
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.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

#172
QuoteActually, do I need to do both solutions or just one ?

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

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

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...
QuoteI noticed that the online members is also counting guests, is there anyway to not have it count guests

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


Add
$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;
}

}


MoreBloodWine

#173
Quote from: sebastian on November 03, 2008, 03:36:30 PM
QuoteCome 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.

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.

[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
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits



sebastian

#175
@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
$image = "$img_url/images/signature_info.png"; // or where you want
$im = imagecreatefrompng($image);


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


Find
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
header("Content-Type: image/jpeg");
  Imagejpeg($im, null, 90);


MoreBloodWine

Quote from: sebastian on November 03, 2008, 10:50:55 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
$image = "$img_url/images/signature_info.png"; // or where you want
$im = imagecreatefrompng($image);


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


Find
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
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 ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

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

header("Content-Type: image/png");
Imagepng($im,'',9);
// if PHP v5.2.6 ++
// Imagepng($im,'',9); 
ImageDestroy ($im);
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


sebastian

Signature Info Stats Jpeg Version

<?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 ($im255255255);
$black ImageColorAllocate ($im000);

ImageString($im3101"$image"$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); 

  
header("Content-Type: image/jpeg");
  
Imagejpeg($imnull90);  
  
ImageDestroy ($im); 
  
}
?>



Nibogo

#179
Sebastian excuse me again ,

I try the first code and everything is ok:



But I try the code for every member in my localhost and I get this:

Warning: imagecreatefrompng(http://localhost/beta/Themes/Default/images/noavatar.png) [function.imagecreatefrompng]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/beta/firma.php on line 148

Warning: getimagesize(http://localhost/beta/Themes/Default/images/sign.png) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/beta/firma.php on line 153

Warning: imagesx(): supplied argument is not a valid Image resource in /var/www/beta/firma.php on line 163

Warning: imagesy(): supplied argument is not a valid Image resource in /var/www/beta/firma.php on line 164


What I can do?

Advertisement: