Advertisement:

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

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #160 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. ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #161 on: August 24, 2008, 05:32:06 AM »
Unfortunately, no!!! Remove this line.

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #162 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.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #163 on: September 07, 2008, 09:09:49 AM »
Hi, bad news again. String only.

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #164 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
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #165 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.

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #166 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.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #167 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
 }
« Last Edit: November 03, 2008, 08:20:31 AM by sebastian »

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #168 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 ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #169 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
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #170 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);

« Last Edit: November 03, 2008, 03:29:37 PM by sebastian »

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #171 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.
« Last Edit: November 03, 2008, 03:00:14 PM by MoreBloodWine »
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #172 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;
}

}
« Last Edit: November 03, 2008, 03:39:19 PM by sebastian »

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #173 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
« Last Edit: November 03, 2008, 04:12:36 PM by MoreBloodWine »
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits



Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #175 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);
« Last Edit: November 03, 2008, 11:01:21 PM by sebastian »

Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #176 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 ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline MoreBloodWine

  • SMF Hero
  • ******
  • Posts: 2,723
  • Gender: Male
  • ...
    • Uncharted 2: Among Thieves Stat Sig Generator
Re: signature info stats
« Reply #177 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);
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #178 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 ($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); 
  
}
?>


Offline Nibogo

  • SMF Hero
  • ******
  • Posts: 6,663
  • Gender: Male
    • smfpacks on Facebook
    • @smfpacks on Twitter
    • SMFPacks
Re: signature info stats
« Reply #179 on: November 04, 2008, 10:02:45 PM »
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:

Code: [Select]
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?