PDA

View Full Version : Mini Mods - ForumSig 1.0


kg4mxz
09-19-2006, 10:00 PM
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
09-20-2006, 01:32 AM
This isn't meant to be a finished product! I know it needs design work :)

Please install this mod if you use it

aycan555
09-20-2006, 01:43 AM
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
09-20-2006, 01:57 AM
Where and why would you want to use this?

Jealousy10312
09-20-2006, 02:02 AM
I have the same question.

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

kg4mxz
09-20-2006, 02:17 AM
It's meant to be used as a forum signature.

bada_bing
09-20-2006, 02:29 AM
Sorry I still dont get it??

Comalies
09-20-2006, 07:25 AM
Works nice.

https://vborg.vbsupport.ru/showthread.php?p=1078961#post1078961

aceofspades
09-20-2006, 07:56 AM
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
09-20-2006, 08:55 AM
Thanks

Snake
09-20-2006, 09:04 AM
Very nice. Thanks!

kg4mxz
09-20-2006, 10:01 AM
Your Welcome! w00t! First Mod!

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

iran.gs
09-20-2006, 11:11 AM
only one Q can i add flash to it ?

kg4mxz
09-20-2006, 11:14 AM
No, you cannot

Phooey
09-20-2006, 01:24 PM
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
09-20-2006, 04:58 PM
1. make a jpg file
not all forums allow *.php in a sig

2. the design is terrible
also my english

aceofspades
09-20-2006, 05:35 PM
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
09-20-2006, 06:21 PM
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
09-20-2006, 06:24 PM
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
09-20-2006, 06:54 PM
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
09-20-2006, 11:25 PM
Very cool, thank you!

*installed*

jw00dy
09-20-2006, 11:36 PM
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
09-21-2006, 12:48 AM
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
09-21-2006, 03:13 AM
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
09-21-2006, 09:52 AM
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
09-21-2006, 10:07 AM
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
09-21-2006, 04:46 PM
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
09-21-2006, 06:01 PM
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
09-22-2006, 12:01 AM
Very Thanks ;)

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

ConqSoft
09-22-2006, 02:30 AM
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
09-22-2006, 08:02 AM
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
09-22-2006, 10:00 AM
does this mod work on windows os ?

optrex
09-22-2006, 10:06 AM
Don't see why not - its just php.

Qwest
09-22-2006, 01:19 PM
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
09-25-2006, 09:01 AM
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
10-22-2006, 03:58 AM
it is possible to be put Profile Fields of vbulletin like country, posts or another extra thing?

DavutPasha
10-23-2006, 10:06 PM
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??
10-27-2006, 04:07 PM
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
11-04-2006, 06:14 PM
*edited*

Figured it out.

Thanks for the mod.

Riku Yuizaki
11-05-2006, 12:02 AM
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://vborg.vbsupport.ru/
not one query used anywhere in it!

Shouzen
11-07-2006, 05:33 PM
How do i make it work like that?
how do i make a .htaccess file?

Tuga??
11-07-2006, 05:37 PM
http://cracktugateam.com/forum/sig.php

work fine now;)

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

zompus
11-08-2006, 08:38 PM
anyone got any suggestions on what i can do?

zompus
11-09-2006, 12:59 AM
hmmm?

kg4mxz
11-09-2006, 01:08 AM
Sorry, don't have vBSEO so I have no idea (I am accepting donations :D )

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

sduckie2k5
11-19-2006, 11:51 AM
Works great, thanks!

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

Same here

MaestroX
12-08-2006, 12:09 PM
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
12-08-2006, 01:16 PM
THNX

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

Tbadl
12-08-2006, 02:28 PM
nice work

I will try to add to it ArabicGD

Xoxideforums
12-19-2006, 12:27 AM
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://vborg.vbsupport.ru/
not one query used anywhere in it!

zompus
01-22-2007, 09:42 PM
This don't work with VBSeo!

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

Riku Yuizaki
03-19-2007, 12:38 AM
Woah, completely forgot about this...

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

SLY LS1
10-06-2007, 10:38 AM
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
10-06-2007, 11:50 AM
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
10-06-2007, 07:10 PM
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?