Advertisement:

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

Witte

  • Guest
Re: signature info stats
« Reply #40 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

Offline a2h_

  • Jr. Member
  • **
  • Posts: 209
  • Gender: Male
    • Geniuose At Work
Re: signature info stats
« Reply #41 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.
« Last Edit: January 22, 2007, 01:45:41 AM by rctxtreme »
With an underscore. Because the one without an underscore's taken.

Offline sebastian

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

Offline a2h_

  • Jr. Member
  • **
  • Posts: 209
  • Gender: Male
    • Geniuose At Work
Re: signature info stats
« Reply #43 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
With an underscore. Because the one without an underscore's taken.

Offline sebastian

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

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: signature info stats
« Reply #45 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.
« Last Edit: February 28, 2007, 07:17:38 AM by Knat »

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #46 on: February 28, 2007, 07:30:54 PM »
Can you post your code?  

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: signature info stats
« Reply #47 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.  :)

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #48 on: March 01, 2007, 04:23:28 AM »
Your image http://www.gapeindex.dk/images/signature.png link did not display anything... Try another acceptable.

Create first a blank color .png file without text.

 
« Last Edit: March 01, 2007, 04:27:45 AM by sebastian »

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: signature info stats
« Reply #49 on: March 04, 2007, 07:27:54 AM »
Your image 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 ?

Offline sebastian

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

Offline dumbelljunkie

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
    • Powerlifting Forum
Re: signature info stats
« Reply #51 on: May 17, 2007, 10:35:39 AM »
How do you this with a Joomla bridge ?
SMF 1.1.2 Joomla 1.0.12 Bridge 1.1.7

Offline sebastian

  • Jr. Member
  • **
  • Posts: 204
  • Gender: Male
Re: signature info stats
« Reply #52 on: May 17, 2007, 02:11:47 PM »
No difference dumbelljunkie... Just follow the  instructions.

Offline dumbelljunkie

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
    • Powerlifting Forum
Re: signature info stats
« Reply #53 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 ?
« Last Edit: May 17, 2007, 02:29:16 PM by dumbelljunkie »
SMF 1.1.2 Joomla 1.0.12 Bridge 1.1.7

Offline sebastian

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


Offline dumbelljunkie

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
    • Powerlifting Forum
Re: signature info stats
« Reply #55 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 ?
SMF 1.1.2 Joomla 1.0.12 Bridge 1.1.7

Offline sebastian

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


Offline dumbelljunkie

  • Jr. Member
  • **
  • Posts: 154
  • Gender: Male
    • Powerlifting Forum
Re: signature info stats
« Reply #57 on: May 18, 2007, 04:52:02 AM »
Removed the line from htaccess but the problemremains.



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..
SMF 1.1.2 Joomla 1.0.12 Bridge 1.1.7

Offline sebastian

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


 
« Last Edit: May 18, 2007, 06:06:08 AM by sebastian »

Offline dumbelljunkie

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

the php is to be found in 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
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]
« Last Edit: May 18, 2007, 06:20:04 AM by dumbelljunkie »
SMF 1.1.2 Joomla 1.0.12 Bridge 1.1.7