PDA

View Full Version : Mini Mods - ForumSig 1.0


kg4mxz
20 Sep 2006, 02:31
Outputs a PNG image you can use as a forum signature with live forum statistics.

This was only tested with vB 3.6.1 There might be something similar to this already but I could not get a version that I could get to work so I made my own.

Install Time: <30 seconds

Installation:
Change $forumname to the name of your forum as you want it displayed in the image.
Upload sig.php and base.png to your forum root
Do any modifications to base.png you want (Optional)
Your signature is ready to use!A sample implementation in HTML:
<IMG SRC="http://yourdomain.com/path/to/forum/sig.php">

kg4mxz
20 Sep 2006, 02:32
This isn't meant to be a finished product! I know it needs design work :)

Please install this mod if you use it

aycan555
20 Sep 2006, 02:43
thanks...


**********22-09-2006 - Edited *************

When i look my site stats at homepage it says 37 Guest and 8 registered users..
When i looked into Who is online page, all guests viewing:

Unknown Location
/sig.php

:D:D:D

bada_bing
20 Sep 2006, 02:57
Where and why would you want to use this?

Jealousy10312
20 Sep 2006, 03:02
I have the same question.

Josh1
20 Sep 2006, 03:04
With a bit of work on the design side, i guess you could use it here. :p

kg4mxz
20 Sep 2006, 03:17
It's meant to be used as a forum signature.

bada_bing
20 Sep 2006, 03:29
Sorry I still dont get it??

Comalies
20 Sep 2006, 08:25
Works nice.

http://www.vbulletin.org/forum/showthread.php?p=1078961#post1078961

aceofspades
20 Sep 2006, 08:56
What is not to understand, its hardly complicated. You have your stats displayed on a png so you can display them on other forums. Thanks buddy, i tried to get the other version to work but it didnt.

asj
20 Sep 2006, 09:55
Thanks

Snake
20 Sep 2006, 10:04
Very nice. Thanks!

kg4mxz
20 Sep 2006, 11:01
Your Welcome! w00t! First Mod!

iran.gs
20 Sep 2006, 12:02
Installed this is the best updated news for admins to use as Sig... Highly recomended to all forum admins and muds

iran.gs
20 Sep 2006, 12:11
only one Q can i add flash to it ?

kg4mxz
20 Sep 2006, 12:14
No, you cannot

Phooey
20 Sep 2006, 14:24
Is there any way to make the text size a bit larger?

Edit: Nevermind, figured it out. You can see my modded version in my sig. :D

/installed

ragtek
20 Sep 2006, 17:58
1. make a jpg file
not all forums allow *.php in a sig

2. the design is terrible
also my english

aceofspades
20 Sep 2006, 18:35
1. You noob you use the png as your sig image.
2. He is a coder not a designer, and this is his first script. You think you could do better, make your own image and use it, thats what everyone else doing :rolleyes:

hilfe-forum
20 Sep 2006, 19:21
i change color her:


//Defines Colors
$background_color = imagecolorallocate($im, 78, 153, 255);
$text_color = imagecolorallocate($im, 255, 255, 255);




but the PNG always show the old color???

hilfe-forum
20 Sep 2006, 19:24
Is there any way to make the text size a bit larger?

Edit: Nevermind, figured it out. You can see my modded version in my sig. :D

/installed

please tell me the way to change text size

LICryptkeeper
20 Sep 2006, 19:54
1. You noob you use the png as your sig image.


he means that not all forums allow .php in image tags. I agree with ragtek that it should be cached into an image, and run as a cronjob, since it has the possibility of being a little sever-intensive.

it's how mine is running:

http://network.montrealforums.com/links/invite.php
outputs
http://network.montrealforums.com/links/invite2.jpg

the php is run every 15 minutes, and therefore the JPG gets updated every 15 minutes.

jw00dy
21 Sep 2006, 00:25
Very cool, thank you!

*installed*

jw00dy
21 Sep 2006, 00:36
he means that not all forums allow .php in image tags. I agree with ragtek that it should be cached into an image, and run as a cronjob, since it has the possibility of being a little sever-intensive.

it's how mine is running:

http://network.montrealforums.com/links/invite.php
outputs
http://network.montrealforums.com/links/invite2.jpg

the php is run every 15 minutes, and therefore the JPG gets updated every 15 minutes.
That's very cool. I can already tell mine is taking a hit with the sig.

Phooey
21 Sep 2006, 01:48
please tell me the way to change text size
Find this code in the sig.php file, the numbers I bolded are what you change to make the text larger:

// Adds Text
imagestring($im, 1, 5, 5, $forumname . " Statistics", $text_color);
imagestring($im, 1, 5, 15, "Threads: " . $totalthreads, $text_color);
imagestring($im, 1, 5, 25, "Posts: " . $totalposts, $text_color);
imagestring($im, 1, 105, 15, "Users: " . $totalusers, $text_color);

Kanustep
21 Sep 2006, 04:13
Great hack! How do we add more variables, for example:
- Last thread
- Users online: this could be a mess!
- Active members
- Last member registration

hilfe-forum
21 Sep 2006, 10:52
Find this code in the sig.php file, the numbers I bolded are what you change to make the text larger:

// Adds Text
imagestring($im, 1, 5, 5, $forumname . " Statistics", $text_color);
imagestring($im, 1, 5, 15, "Threads: " . $totalthreads, $text_color);
imagestring($im, 1, 5, 25, "Posts: " . $totalposts, $text_color);
imagestring($im, 1, 105, 15, "Users: " . $totalusers, $text_color);


Cool THX :)

optrex
21 Sep 2006, 11:07
he means that not all forums allow .php in image tags. I agree with ragtek that it should be cached into an image, and run as a cronjob, since it has the possibility of being a little sever-intensive.

it's how mine is running:

http://network.montrealforums.com/links/invite.php
outputs
http://network.montrealforums.com/links/invite2.jpg

the php is run every 15 minutes, and therefore the JPG gets updated every 15 minutes.

can you tell me how I would set this cron job up - to update every 15 mins and output a jpg?

ragtek
21 Sep 2006, 17:46
oh sorry that i just said the truth
1.not in all forums is php allow
2. its better for the performance when you cache it every 30 minutes

and if you think that i'm a noob its ok for me

Qwest
21 Sep 2006, 19:01
Hey guys.

For those of you complaining about forums not accepting sig.php as an image. Simply add this code to a .htaccess file and place it in the same directory as base.png and sig.php

RewriteEngine on
RewriteRule ^base.png$ sig.php

Then just link to base.png and Apache will automatically use sig.php

Ricsca
22 Sep 2006, 01:01
Very Thanks ;)

aveon
22 Sep 2006, 02:30
if you can design something like this for the side column wold be lot nicer than sig thanx

ConqSoft
22 Sep 2006, 03:30
if you can design something like this for the side column wold be lot nicer than sig thanx

This is for you to use on OTHER forum sites you visit, not for display on your own forum.

optrex
22 Sep 2006, 09:02
Hey guys.

For those of you complaining about forums not accepting sig.php as an image. Simply add this code to a .htaccess file and place it in the same directory as base.png and sig.php

RewriteEngine on
RewriteRule ^base.png$ sig.php

Then just link to base.png and Apache will automatically use sig.php

Nice tip, but not something you can do to get it to show on vbulletin.com for instance ;)

Fax
22 Sep 2006, 11:00
does this mod work on windows os ?

optrex
22 Sep 2006, 11:06
Don't see why not - its just php.

Qwest
22 Sep 2006, 14:19
Nice tip, but not something you can do to get it to show on vbulletin.com for instance ;)
Well vbulletin.com doesn't allow ANY images in sigs does it?

I think you misread the point of my tip.

My tip makes it so you can use <img src=http://mysite.com/base.png>

instead of using <img src=http://mysite.com/sig.php>

because a lot of boards are set up to not allow dynamic images (images that end in anything other than .gif or .jpg or .png)

Fax
25 Sep 2006, 10:01
i'm using vbulletin 3.6.0 on a windows 2003 dedicated server (i know this is for 3.6.1 but some users have this working on 3.6.0) and cannot get this to work.

error output:-
query_first("SELECT COUNT(threadid) FROM " . TABLE_PREFIX . "vbthread"); $totalthreads = implode(",",$totalthreads); $totalposts = $db->query_first("SELECT COUNT(postid) FROM " . TABLE_PREFIX . "vbpost"); $totalposts = implode(",",$totalposts); $totalusers = $db->query_first("SELECT COUNT(userid) FROM " . TABLE_PREFIX . "vbuser"); $totalusers = implode(",",$totalusers); // Loads a PNG image function LoadPNG($imgname) { $im = @imagecreatefrompng($imgname); /* Attempt to open */ if (!$im) { /* See if it failed */ $im = imagecreatetruecolor(150, 30); /* Create a blank image */ $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an errmsg */ imagestring($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; } // Actually Loads the image $im = @LoadPNG('base.png'); //Adds the Header header("Content-type: image/png"); //Defines Colors $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 0, 255, 0); // Adds Text imagestring($im, 1, 5, 5, $forumname . " Statistics", $text_color); imagestring($im, 1, 5, 15, "Threads: " . $totalthreads, $text_color); imagestring($im, 1, 5, 25, "Posts: " . $totalposts, $text_color); imagestring($im, 1, 105, 15, "Users: " . $totalusers, $text_color); //Outputs the image imagepng($im); imagedestroy($im); ?>

i use table prefix of vb so i changed this in the sig.php, i have tried with the standard settings but this didn't work either.

any ideas ?

Mrflow
22 Oct 2006, 04:58
it is possible to be put Profile Fields of vbulletin like country, posts or another extra thing?

DavutPasha
23 Oct 2006, 23:06
I added some extra lines. You can see my signature.

* Server Load
* Server Uptime
* Server Activity

I want to share my own codes with you..


// information about server activity
$sunucu = @fsockopen(localhost, 80);
if ($sunucu) {
$sunucudurumu .= "ACTIVE";
}
else {
$sunucudurumu .= "INACTIVE";
}

// Uptime and Server Load istatistics
$uptimekaydi = trim(exec("uptime"));
if ($uptimekaydi) {
if (preg_match("/, *(\d) (users?), .*: (.*), (.*), (.*)/", $uptimekaydi, $uptime)) {
$kullanicilar[0] = $uptime[1];
$kullanicilar[1] = $uptime[2];
$suankiyuk = $uptime[3];
$yukleme15 = $uptime[4];
$yukleme30 = $uptime[5];
}
} else {
$kullanicilar[0] = "Mevcut degil";
$kullanicilar[1] = "--";
$suankiyuk = "Mevcut degil";
$yukleme15 = "--";
$yukleme30 = "--";
}
$uptime = shell_exec("cut -d. -f1 /proc/uptime");
$gun = floor($uptime/60/60/24);
$saat = $uptime/60/60%24;
$dakika = $uptime/60%60;
$saniye = $uptime%60;


you can add this informations like this;


$information1 = "DAVUTPASHA.COM HAS $suankiyuk SERVER LOAD AND ALSO";
$information2= " WE HAVEN'T HAD ANY PROBLEM ABOUT $gun DAYS $saat:$dakika:$saniye SECONDS.";

imagestring($im, 2, 41, 92, "SERVER ACTIVITY: " . $sunucudurumu, $text_color);
imagestring($im, 2, 5, 16, $information1, $text_color);
imagestring($im, 2, 5, 29, $information2, $text_color);



Main codes are in Turkish. I translated them to English. You can translate other words.

See my sig: http://www.davutpasha.com/imzam.php

Tuga®™
27 Oct 2006, 17:07
I added some extra lines. You can see my signature.

* Server Load
* Server Uptime
* Server Activity

I want to share my own codes with you..


// information about server activity
$sunucu = @fsockopen(localhost, 80);
if ($sunucu) {
$sunucudurumu .= "ACTIVE";
}
else {
$sunucudurumu .= "INACTIVE";
}

// Uptime and Server Load istatistics
$uptimekaydi = trim(exec("uptime"));
if ($uptimekaydi) {
if (preg_match("/, *(\d) (users?), .*: (.*), (.*), (.*)/", $uptimekaydi, $uptime)) {
$kullanicilar[0] = $uptime[1];
$kullanicilar[1] = $uptime[2];
$suankiyuk = $uptime[3];
$yukleme15 = $uptime[4];
$yukleme30 = $uptime[5];
}
} else {
$kullanicilar[0] = "Mevcut degil";
$kullanicilar[1] = "--";
$suankiyuk = "Mevcut degil";
$yukleme15 = "--";
$yukleme30 = "--";
}
$uptime = shell_exec("cut -d. -f1 /proc/uptime");
$gun = floor($uptime/60/60/24);
$saat = $uptime/60/60%24;
$dakika = $uptime/60%60;
$saniye = $uptime%60;


you can add this informations like this;


$information1 = "DAVUTPASHA.COM HAS $suankiyuk SERVER LOAD AND ALSO";
$information2= " WE HAVEN'T HAD ANY PROBLEM ABOUT $gun DAYS $saat:$dakika:$saniye SECONDS.";

imagestring($im, 2, 41, 92, "SERVER ACTIVITY: " . $sunucudurumu, $text_color);
imagestring($im, 2, 5, 16, $information1, $text_color);
imagestring($im, 2, 5, 29, $information2, $text_color);



Main codes are in Turkish. I translated them to English. You can translate other words.

See my sig: http://www.davutpasha.com/imzam.php

hi mate i have one imagem like you can please help me wath i put inside off the sign.php

http://cracktugateam.com/forum/sig.php

i insert the image in anex.

Thank you

Jaxx
04 Nov 2006, 19:14
*edited*

Figured it out.

Thanks for the mod.

Riku Yuizaki
05 Nov 2006, 01:02
Nice mod, I made one like this as well, its awesome, you can display pretty much anything you want on it, you can do stuff like this even:

https://www.vbulletin.org/forum/
not one query used anywhere in it!

Shouzen
07 Nov 2006, 18:33
How do i make it work like that?
how do i make a .htaccess file?

Tuga®™
07 Nov 2006, 18:37
http://cracktugateam.com/forum/sig.php

work fine now;)

zompus
08 Nov 2006, 21:26
Wont work for me, prolly because i got vbseo installed... doubleyellowcard.com/sig.php

zompus
08 Nov 2006, 21:38
anyone got any suggestions on what i can do?

zompus
09 Nov 2006, 01:59
hmmm?

kg4mxz
09 Nov 2006, 02:08
Sorry, don't have vBSEO so I have no idea (I am accepting donations :D )

ashley53680
18 Nov 2006, 04:26
Worked perfectly! I just quickly did a base and uploaded things. Took less then 3 minutes from start to finish. :)

sduckie2k5
19 Nov 2006, 12:51
Works great, thanks!

TRR
01 Dec 2006, 11:53
can you tell me how I would set this cron job up - to update every 15 mins and output a jpg?

Same here

MaestroX
08 Dec 2006, 13:09
I've installed this fine hack but my only concern is that when I view "who's online" there seems to be an awfull lot of people (and spiders) on the actual php page of the image. Its strange cause my .htaccess rewrites them to a .png file. Should I be worried?

organik81
08 Dec 2006, 14:16
THNX

http://www.dunyaforum.com/forum/imza.php

Tbadl
08 Dec 2006, 15:28
nice work

I will try to add to it ArabicGD

Xoxideforums
19 Dec 2006, 01:27
I understand how to change the font size. But how the heck do you change font style like this person did?

And I'm also interested in setting up a cron so I can use an image that gets updated.

Nice mod, I made one like this as well, its awesome, you can display pretty much anything you want on it, you can do stuff like this even:

https://www.vbulletin.org/forum/
not one query used anywhere in it!

zompus
22 Jan 2007, 22:42
This don't work with VBSeo!

Check: http://doubleyellowcard.com/sig.php - blank.

Riku Yuizaki
19 Mar 2007, 01:38
Woah, completely forgot about this...

To use different style fonts, refer to http://us3.php.net/manual/en/function.imagettftext.php

SLY LS1
06 Oct 2007, 11:38
Nice mod, I made one like this as well, its awesome, you can display pretty much anything you want on it, you can do stuff like this even:

http://www.rpgpalace.net/sakura/sakura_banner_05.png
not one query used anywhere in it!

Can you share some of the code, I like the members online bit

Cheers

SLY LS1
06 Oct 2007, 12:50
Ok heres how to add some others for those who dont know how

Members Online:

//Members Online//
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$guestsarry = $vbulletin->db->query_first("SELECT COUNT(host) AS sessions FROM " . TABLE_PREFIX . "session WHERE userid = 0 AND lastactivity > $datecut");
$membersarry = $vbulletin->db->query_read("SELECT DISTINCT userid FROM " . TABLE_PREFIX . "session WHERE userid <> 0 AND lastactivity > $datecut");
$guests = intval($guestsarry['sessions']);
$members = intval($vbulletin->db->num_rows($membersarry));
$online = $guests + $members;

And add this to get it to show:

imagestring($im, 2, 100, 30, "Members Online: " . $online, $text_color);

and another

Newest User:

//newest User//
$newuser = $vbulletin->db->query_first("SELECT username AS newuser FROM " . TABLE_PREFIX . "user ORDER BY userid DESC LIMIT 1");
$newuser = $newuser['newuser'];

And add this to get it to show:

imagestring($im, 2, 230, 30, "Newest Members: " . $newuser, $text_color);

Hengest
06 Oct 2007, 20:10
Hey guys.

For those of you complaining about forums not accepting sig.php as an image. Simply add this code to a .htaccess file and place it in the same directory as base.png and sig.php

RewriteEngine on
RewriteRule ^base.png$ sig.php

Then just link to base.png and Apache will automatically use sig.php

I tried this but when linking to the .png that is all I get, ie. not linking to the php. Any ideas or suggestions?