View Full Version : Forum stats on signature image
tkeil69575
03-25-2003, 10:00 PM
Remember the forum rules here at vB.org and don't exceed the signature dimensions: https://vborg.vbsupport.ru/showthread.php?threadid=50062 . Signatures in violation of the rules will be suspended. --filburt1
Hi all,
What this hack does:
Calls up your Forum statistics (like No. of Members, Threads and Posts) and creates a new image on your server using GD which you can use as a signature image, where ever you like - have a look at my signature and you'll see what I mean. This is only my 2nd hack - so be kind to me ;)
In order to have the image created, say every 15 minutes you will need to set up a cronjob. Infos are provided in the instructions.txt, and alternatives for those who do not have access to crontab on their server.
Support:
Because I'm pretty busy, I will provide only limited support. Will look in here once a week or so.
Credits:
to kars10 for kicking me in the ass ;) and getting me to code this - thanks karsten
greets
tina
Update 23.06.2003
- global.php no longer required, thus when signature image is being created it no longer shows up in "who is onlne"
- quality of image output improved
- debug modus with email notification integrated
- tested with gd2
corsacrazy
03-26-2003, 06:43 PM
im not too sure how to create this cron job mate?
tkeil69575
03-26-2003, 06:46 PM
hi corsacrazy,
you will only need to set up a cronjob if you want the image created automatically every 15 minutes. Its not a must. Read the instructions corsacrazy. It does not tell how to do it exactly, because that goes beyond the scope I can offer, but it tells you alternatives if you do not have access to telnet or webmin or ssh to create you own cronjob.
greets
tina
Fi_InCogNiTo
03-26-2003, 06:47 PM
Sorry, I'm still a little new, but what is a cron job?
tkeil69575
03-26-2003, 06:49 PM
Today at 09:47 PM Fi_InCogNiTo said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=373724#post373724)
Sorry, I'm still a little new, but what is a cron job?
A cron job is a script that runs at periodic intervals. In this case you would set it up to call up signature.php every 15 Minutes for example.
corsacrazy
03-26-2003, 07:00 PM
cheers :D
works great
i realied u can query n e thing u wont in there ! i put members online and newest member ! also for the total registered this doesnt count the mods or admins or n e other usergoup ONLY people in registered group "2" to fix that just copy the get total members query from your index.php
tkeil69575
03-26-2003, 07:05 PM
Hi corsacrazy,
yes thanks for the info about the usergroup. I forgot to remove that. I've updated the hack just now, and yes your right of course, theoretically you can query anything you want :)
tina
filburt1
03-26-2003, 07:05 PM
Just for the record, I started the trend :p
tkeil69575
03-26-2003, 07:08 PM
Today at 10:05 PM filburt1 said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=373740#post373740)
Just for the record, I started the trend :p hihi filburt,
would you like credits? ;)
I'd be glad to give them to you.
tina
corsacrazy
03-26-2003, 07:12 PM
($img, 255, 255, 255);//RGB values - Backgroundcolor of stats
how wood i make that #fffffff (white ) ?
tkeil69575
03-26-2003, 07:15 PM
The white Backgroundcolor is set transparent on line 53
try replacing:
imagecolortransparent($img, $bg_color); // Set Background transparent
with:
//imagecolortransparent($img, $bg_color); // Set Background transparent
then the background of the stats will remain white. or better try replacing the background color 255,255,255 with an RGB value which is not part of you sig.jpg
tkeil69575
03-26-2003, 07:23 PM
just a note do not directly link you image to http://www.youdomain.com/signature.php but preferably to the image created by signature.php which is located at http://www.yourdomain.com/images/signatur/signatur.jpg otherwhise the load on your server might get a bit high if you have you signature image placed in many threads in some forum.
greets tina
Fi_InCogNiTo
03-26-2003, 07:29 PM
I just noticed something on my board. When I use this as my sig, it shows this on who's online 4 times right now(prolly refreshes)
See attached
Kars10
03-26-2003, 07:30 PM
I see lots of cool signatures here!! :)
Great work Tina... ;)
Regards
Kars
* Kars10 kicks install!
Fi_InCogNiTo
03-26-2003, 07:32 PM
Maybe linking it to the jpg the php makes will solve this? I think the 14 guests viewing the php is from here ;)
Kars10
03-26-2003, 07:34 PM
@ Fi_InCogNiTo, you must run the signature.php, otherwise your stats would not update... ;)
Kars
Fi_InCogNiTo
03-26-2003, 07:37 PM
No, it's updated. I mean if you link to the php file instead of your jpg file, everyone who views the sig(even outside the forum) will show on Who's Online at your own forum. Look at my site and check whos online ;)
Oh boy, if this falls into the wrong hands, someone could gather a lotta IPs with this lol
iggy123
03-26-2003, 08:47 PM
well I am totally lost!!! THnx anyway
Davey
03-26-2003, 08:49 PM
Yes this is extremely dangerous.
From just viewing this thread, Fi_InCogNiTo can now see my IP in his admin log, or online.php.
This hack *might* not be such a good idea.....
Dave.
Gardener
03-26-2003, 08:53 PM
Today at 09:29 PM Fi_InCogNiTo said this in Post #13 (https://vborg.vbsupport.ru/showthread.php?postid=373758#post373758)
I just noticed something on my board. When I use this as my sig, it shows this on who's online 4 times right now(prolly refreshes)
See attached
Are you linking to the image or the php file. I know on my site I have a cron job set to run every 10 mins. and it shows up on who's online.
Fi_InCogNiTo
03-26-2003, 08:59 PM
Today at 05:53 PM Gardener said this in Post #20 (https://vborg.vbsupport.ru/showthread.php?postid=373785#post373785)
Are you linking to the image or the php file. I know on my site I have a cron job set to run every 10 mins. and it shows up on who's online.
That was when I was linking to the php. I am now linking to the jpg and found a better use for it ;)
Thanks for the idea. I can now use this for advertising =D
Good hack.
Kars10
03-26-2003, 09:16 PM
You must link to the JPG, not to the signature.php. ;)
Kars
Erwin
03-26-2003, 09:27 PM
Great work. I may use this...
I may use it if I can set up cronjobs over at phpwebhosting.....
/me clicks the install button for future references
TheEDIGuy
03-26-2003, 10:34 PM
Excellent hack. Clicked Install.
GRRRRRRRRRRRR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Btw, it's not smart to call global.php. You're going to have all kinds of illegitimate guests.
And filburt1, I'm sorry. It appears I caused a domino effect, and now everyone will have one of these things. I didn't share though (except for with Overgrow, which I don't regret). I promise.
Link14716
03-26-2003, 11:46 PM
Mine is in my sig. Before I cron it, I need to get this to work correctly.
See how my image is? I need to make it actually look right...
http://www.vggmn.com/forums/signature/sig.jpeg
Any ideas?
try replacing this
imagejpeg($img, "./$ausgabedatei",$komprimierung);
with this
imagejpeg($img, "./$ausgabedatei",$komprimierung, 100); //last # is the quality of jpeg
Link14716
03-27-2003, 12:23 AM
Doesn't seem to work... :(
you need to replace this:
$img = imagecreate($width,$height);
with this:
$img = imagecreatetruecolor($width,$height);
- djr
Spitfireisgod
03-27-2003, 12:27 AM
supar *installs*
Link14716
03-27-2003, 12:31 AM
Thanks, djr! I found that at the PHP Online manual, put it in, saw that it worked, and then saw your post. Damn, I should've waited, would've saved me some time. :)
Thanks.
* Link14716 clicks install.
GoTTi
03-27-2003, 02:37 AM
got a error when i run signature.php:
Warning: imagecreatefromjpeg: Unable to open './images/signatur/sig.jpg' for reading in /home/SITE/public_html/forums/signature.php on line 44
Warning: imagecopy(): supplied argument is not a valid Image resource in /home/SITE/public_html/forums/signature.php on line 51
on line 44 it is:
$vorlage = imagecreatefromjpeg("./$vorlagedatei");
Is this calling for some GD use?
Velocd
03-27-2003, 03:33 AM
Neat-o, the trendy dynamic signature hack is about to get a whole lot trendier. ;)
I like the concept of updating a signature with dynamic stats, though I'll probably modify it to go further such as iRC stuff, etc.
* Velocd clicks install
Velocd
03-27-2003, 03:34 AM
@Da_Gotti: Didn't you recieve a similar problem with my vB Photo, then I had told you that it required the use of GD 2.0?
Yeah, this hack absolutely has to have GD2.0 installed, or else you're just gonna keep getting those errors.
just update php to 4.3.0, that comes with gd 2.0
Mental Stamina
03-27-2003, 04:00 AM
such a dope concept
much respect on conceiving and coding this
-Stamina
afterlab
03-27-2003, 04:46 AM
Great hack! I intend to implement tons of features alongside this hack. Thanks for sharing!
ricoche
03-27-2003, 06:00 AM
I really like this hack. Thanks very much!
Ricoche :bunny:
Kars10
03-27-2003, 06:59 AM
Today at 01:38 N!ck said this in Post #26 (https://vborg.vbsupport.ru/showthread.php?postid=373837#post373837)
GRRRRRRRRRRRR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
And filburt1, I'm sorry. It appears I caused a domino effect, and now everyone will have one of these things. I didn't share though (except for with Overgrow, which I don't regret). I promise.
Whats the Problem with that?? This hack here is orginal coding by Tina and not by Filburt1. Filburts is other code.
So cool down.
Kars ;)
tkeil69575
03-27-2003, 07:20 AM
imagejpeg($img, "./$ausgabedatei",$komprimierung, 100); //last # is the quality of jpeg
mr_e it would be wrong to replace it with the above code because $komprimierung is the variable for quality of the jpeg which is defined at the top of the file :)
Disturbed
03-27-2003, 08:40 AM
Today at 12:38 AM N!ck said this in Post #26 (https://vborg.vbsupport.ru/showthread.php?postid=373837#post373837)
GRRRRRRRRRRRR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Btw, it's not smart to call global.php. You're going to have all kinds of illegitimate guests.
And filburt1, I'm sorry. It appears I caused a domino effect, and now everyone will have one of these things. I didn't share though (except for with Overgrow, which I don't regret). I promise.
heh '100% original coding (and proudly not shared)' :rolleyes:
thanks for sharing tina, will use it, not here though :)
barny
03-27-2003, 09:20 AM
got a error when i run signature.php:
http://www.ovsc.de/forums/signature.php
gd2 install:
http://www1.ovsc.de/system/info.php
mforster
03-27-2003, 10:39 AM
Coolies - definately one I'll use when I get more than 9 members :p
Today at 01:59 AM Kars10 said this in Post #40 (https://vborg.vbsupport.ru/showthread.php?postid=373937#post373937)
Whats the Problem with that?? This hack here is orginal coding by Tina and not by Filburt1. Filburts is other code.
So cool down.
Kars ;)
It just bothers me that I seem to have caused filburt1's unique sig to become...um...not unique. I thought it was harmless when I made myself one, but now I think that it only continued to draw more attention to the concept that way. And now this...
Kars10
03-27-2003, 01:11 PM
Today at 15:25 N!ck said this in Post #45 (https://vborg.vbsupport.ru/showthread.php?postid=374011#post374011)
It just bothers me that I seem to have caused filburt1's unique sig to become...um...not unique. I thought it was harmless when I made myself one, but now I think that it only continued to draw more attention to the concept that way. And now this...
I hope that every hacker thinks that way now, than the great community ?vB.org dies on that.
Yes, why sharing hacks here?? Let us stop this now.
Every hack should be unique... :mad:
Sorry N!ck but thats childish
Kars
Overgrow
03-27-2003, 01:43 PM
If someone asks you not to give out their code, you should respect their wishes. All N!ck was doing was confirming for filburt that he did not give out his code. Same here, N!ck, I did not release that code to anyone.. more than a few asked and I said please check with N!ck as it's his and he has given my code the same respect.
It's not a big deal.. it doesn't take a brain surgeon to write the hack, but it was a great original idea-- credit to filburt.
Cheers~
Smoothie
03-27-2003, 01:49 PM
having all these damn signatures here slows this thread down to a crawl....
NuclioN
03-27-2003, 01:57 PM
I've tried to install this but i can't set a cronjob although i have permission to do it. I use Putty to connect but the line of code to make a cron is not enough it seems. How to proceed from scratch in Putty to set this cronjob?
Overgrow
03-27-2003, 02:02 PM
>>having all these damn signatures here slows this thread down to a crawl....
ahaha yea, now we're not only dependent on vB.org's server response but everyone else's.
Dean C
03-27-2003, 03:20 PM
Nice hack - thanks for releasing :)
- miSt
feh...... my server doesn't let me do cronjobs and that fake cron thing won't work for some reason
/me tried for 5 hours to set it up and gives up.
Nice hack anyways....
Overgrow
03-27-2003, 04:41 PM
I don't have mine cronned yet.. just run the php script every once in a while. Won't be instant updates but no big deal.
You could also do something like this at the top of global:
if (mt_rand(1,500)=='42' or $updatesigstats!=''){
require_once('/home/yourdir/sigstats.php'); // the full script name of your sig updater
}
About once in every 500 page views, it will update the signature stats. Or you can attach "&updatesigstats=on" to any URL and have it run the script as well.
Fi_InCogNiTo
03-27-2003, 05:12 PM
Can someone send me the code to make this do:
Just gather the amount of posts in only one forum for one user?
*example: I want a sig to let people know how many posts are in my news forum just by me.
GoTTi
03-27-2003, 05:30 PM
I dont understand, i have the recent version of PHP installed (4.3.1) and GD 2.0 or higher is not on my server!
I requested it be installed.
Good hack, but the Cron job does not work, yet if I run it manually it is fine.
Can anybody confirm if they have it running via a Cron job and also if they modified the code?
Thanks.
Shepski
03-28-2003, 08:53 AM
great hack but does anyone know how to get the thing to run on an NT server. fakecron doesnt seem to do it.
Edit: found it in the scheduler althought it isnt very obvious :(
TheEDIGuy
03-28-2003, 10:20 AM
I have it running on a cron, works perfectly.
Today at 12:20 PM TheEDIGuy said this in Post #58 (https://vborg.vbsupport.ru/showthread.php?postid=374486#post374486)
I have it running on a cron, works perfectly.
Ok, so it must be my setup.
Did you have to give any additional permissions to the .php to run as a Cron and could you tell me what directory you put it in please?
Currently mine is running in /forums/ and works when manually executed but not as a Cron job. However I have other Cron jobs setup and working such as ones for Hivemail.
Thanks.
squawell
03-28-2003, 12:21 PM
i have a question...
when i add a new variable but it did not show up??why??
where do i doing wrong?
Velocd
03-28-2003, 04:15 PM
>>having all these damn signatures here slows this thread down to a crawl....
ahaha yea, now we're not only dependent on vB.org's server response but everyone else's.
Maybe Filburt?s version where the image is outputted through running the script, but this hack simply saves the outputted image in a directory as a JPG so you can link to it as you would a regular signature image, so there should be no dependency on anyone?s server response, nor that much of a slow down (except for the kilobytes each signature takes of course).
limey
03-28-2003, 04:34 PM
Nice hack, I like it. Need to get my cron in order will try overgrow's addon.
Fi_InCogNiTo
03-28-2003, 04:43 PM
Yesterday at 02:12 PM Fi_InCogNiTo said this in Post #54 (https://vborg.vbsupport.ru/showthread.php?postid=374128#post374128)
Can someone send me the code to make this do:
Just gather the amount of posts in only one forum for one user?
*example: I want a sig to let people know how many posts are in my news forum just by me.
NuclioN
03-28-2003, 04:47 PM
Warning: imagecreatefromjpeg: Unable to open './forum/images/signature/sig.jpg' for reading
Fi_InCogNiTo
03-28-2003, 04:49 PM
Today at 01:47 PM NuclioN said this in Post #64 (https://vborg.vbsupport.ru/showthread.php?postid=374591#post374591)
Warning: imagecreatefromjpeg: Unable to open './forum/images/signature/sig.jpg' for reading
Try checking the way you named the directory it's calling for. It's spelled "signatur" in the php file ;)
also remember to set the proper permissions for the 'signatur' folder - chmod 777 i think it was
Fi_InCogNiTo
03-28-2003, 06:01 PM
I'm having a strange problem
Ever since I added this hack, my who's online has been showing 2 guests with almost the same ip(last number is dif in IP). They are always creating a new thread, even though there is never a new thread created, and they are on 24/7.
Screenshot attached :confused:
wooolF[RM]
03-28-2003, 08:47 PM
]uhm.. what about protecting the folder where signature.jpg is? it is chmodded 777 and anyone can do evil things with it...
BTW, great hack :)
Link14716
03-28-2003, 09:18 PM
wooolF, try this:
$text = "$numbermembers" . " $totalthreads" . " $totalposts";
NuclioN
03-28-2003, 09:27 PM
I can't get this to work :(
These are the path"s:
$zeilenabstand = 15; //Line spacing of stats text
$vorlagedatei = "forum/images/signatur/sig.jpg"; //Relative path to underlying signature image
$ausgabedatei = "forum/images/signatur/signature.jpg"; //Relative path and Name to new signature image with stats
error in attach
wooolF[RM]
03-28-2003, 09:27 PM
]oh... thnx for the answer... I allready fixed it by defining line spacing as 0 :)
$zeilenabstand = 0; //Line spacing of stats text
thnx alot anyway!
GoTTi
03-28-2003, 09:28 PM
Nuc, i got same error, its from not having the GD2 installed on your server
Souli
03-28-2003, 09:28 PM
Sehr nette Idee - funktioniert einwandfrei
--------------------------------------------------------
Nice Idea - works perfectly !
NuclioN
03-28-2003, 09:34 PM
Today at 11:28 PM Da_GoTTi said this in Post #72 (https://vborg.vbsupport.ru/showthread.php?postid=374701#post374701)
Nuc, i got same error, its from not having the GD2 installed on your server
Tnx Da_Gotti, we've a very lazy sysop. I'll kill him. :D
wooolF[RM]
03-28-2003, 09:40 PM
]here's example of my signature ;)
NuclioN
03-28-2003, 09:58 PM
You're evil wooolf :p Nice work!
wooolF[RM]
03-28-2003, 10:08 PM
]thanx mate! :D btw, I am evil ;)
My title on my forum is Evil Admin ;) :bunny:
TheEDIGuy
03-28-2003, 11:25 PM
Today at 07:52 AM HLodder said this in Post #59 (https://vborg.vbsupport.ru/showthread.php?postid=374494#post374494)
Ok, so it must be my setup.
Did you have to give any additional permissions to the .php to run as a Cron and could you tell me what directory you put it in please?
Currently mine is running in /forums/ and works when manually executed but not as a Cron job. However I have other Cron jobs setup and working such as ones for Hivemail.
Thanks.
Just like the instructions said, although I need to use the php in mine.
0,15,30,45 * * * * php /mypathfromroot/www/forums/signatur/signature.php
Damn, my bad!
It was the leading PHP that I did not have in my entry. I must have read those instructions several times but could not see the wood for the trees.
Thank you.
Chris Gwynne
03-28-2003, 11:51 PM
Question: Could I have the sig files on one site; the folder, images and php file. And have the cron job on another?
Am I able to call it and it work?
Thanks :)
squawell
03-29-2003, 01:45 AM
i have a problem if i want it auto updata every 15 mins
how should i creat the cron job?
Link14716
03-29-2003, 02:13 AM
Or...
0,15,30,45 * * * * wget http://www.yoursite.com/forums/signature.php
squawell
03-29-2003, 02:27 AM
Today at 12:13 PM Link14716 said this in Post #82 (https://vborg.vbsupport.ru/showthread.php?postid=374808#post374808)
Or...
0,15,30,45 * * * * wget http://www.yoursite.com/forums/signature.php
i type this
0,15,30,45 http://www.site.com/forum/signature.php
but it show up cant find page??
where do i doing wrong? :alien:
Link14716
03-29-2003, 02:49 AM
That wasn't a URL, that was a line for the cron job. If you have cpanel, you can create it there...
squawell
03-29-2003, 03:25 AM
Today at 12:49 PM Link14716 said this in Post #84 (https://vborg.vbsupport.ru/showthread.php?postid=374825#post374825)
That wasn't a URL, that was a line for the cron job. If you have cpanel, you can create it there...
sorry..not know much about english and still dont know how to do?
where to creat?creat a txt file name cron or....
thankz again........
xware
03-29-2003, 04:09 AM
How to change the text's charset?
thanks.
afterlab
03-29-2003, 04:49 AM
Is there anyway this can be in another format other than .jpg? JPG's quality is absolutely horrible.
Today at 06:49 AM afterlab said this in Post #87 (https://vborg.vbsupport.ru/showthread.php?postid=374857#post374857)
Is there anyway this can be in another format other than .jpg? JPG's quality is absolutely horrible.
In the signature.php file, find...
$img = imagecreate($width,$height);
...and change to...
$img = imagecreatetruecolor($width,$height);
...if you have not done so. This improved mine. By default it is set to zero compression with the line...
$komprimierung = 100;
wooolF[RM]
03-29-2003, 12:34 PM
]Today at 07:49 AM afterlab said this in Post #87 (https://vborg.vbsupport.ru/showthread.php?postid=374857#post374857)
Is there anyway this can be in another format other than .jpg? JPG's quality is absolutely horrible.
https://vborg.vbsupport.ru/attachment.php?s=&postid=374711
created with "imagecreatetruecolor" and 80 as compression (and only 25kb)
filburt1
03-29-2003, 03:11 PM
I've suspended many signatures because of users not reading the forum rules here regarding signature dimensions. Please read my big notice in the first post of this thread before using this mod for your signature here.
Link14716
03-29-2003, 04:01 PM
Damnit, 60 pixels too big... oh well, I will drop it to 300 then...
Done, happy? :)
afterlab
03-29-2003, 05:29 PM
I managed to make the file run with a .png, however this function, imagecreatetruecolor, does not run with my current version of PHP. I'll be upgrading soon.
Today at 12:29 PM afterlab said this in Post #92 (https://vborg.vbsupport.ru/showthread.php?postid=375140#post375140)
I managed to make the file run with a .png, however this function, imagecreatetruecolor, does not run with my current version of PHP. I'll be upgrading soon.
I think for PNG's you can just use imagecreate()
filburt1
03-29-2003, 05:56 PM
Today at 02:45 PM N!ck said this in Post #93 (https://vborg.vbsupport.ru/showthread.php?postid=375150#post375150)
I think for PNG's you can just use imagecreate()
Eh...imagecreatefrompng() is best for creating an image from a PNG...
However the GD library in 4.3.0 should use true color stuff instead of the normal functions because...long story, forgot the details, short story is the outputted image's color pallete looks horrible if you don't.
wooolF[RM]
03-29-2003, 09:15 PM
]everyone interested why should visit www.php.net and search for those functions :) there's a lot of usefull stuff to read ;) be a man and make yourself a gift instead of asking someone (/me looks @ dictator *gg* :D)
NuclioN
03-29-2003, 09:41 PM
I'm sorry, if you have GD2 with an earlier version of php will this work? Our isp had set the cronjob, confirmed that GD2 was installed and the whole output of signature.php is a bunch of errors, as written a couple of postings above. :(
Link14716
03-30-2003, 01:06 AM
Try taking "forum/" out of the config variables.
In other words:
$vorlagedatei = "images/signatur/sig.jpg"; //Relative path to underlying signature image
$ausgabedatei = "images/signatur/signature.jpg"; //Relative path and Name to new signature image with stats
And take the forum/ out in all the other variables. Upload it and see if it works.
Mijae
03-30-2003, 01:43 AM
Very nice, I use this image in several places now :)
Crazy Pete
04-02-2003, 12:12 PM
No matter what image I try to use for my sig, it keeps showing up as just an all-white box with the stats over it. Am I doing something wrong, or...?
Minots
04-02-2003, 04:09 PM
for running a php-file with cron, just try this command:
wget -q http://www.yourdomain.tld/signature.php >/dev/null
It works fine 4 me. ;)
sabret00the
04-02-2003, 04:26 PM
this is cool, i do like the idea, pity it would make my current sig a violations :cry:
Crazy Pete
04-02-2003, 07:51 PM
Today at 09:12 AM Crazy Pete said this in Post #99 (https://vborg.vbsupport.ru/showthread.php?postid=376700#post376700)
No matter what image I try to use for my sig, it keeps showing up as just an all-white box with the stats over it. Am I doing something wrong, or...?
No one knows why this is happening? :(
Here's the image example if you need to know what I mean...
http://www.expectedmiracles.com/forums/images/signatur/signatur.jpg
Schorsch
04-03-2003, 12:59 AM
working fine here, thanks tina :laugh:
filburt1
04-03-2003, 01:21 AM
I suspended your signature; read the BIG HIGHLIGHTED TEXT in the first post.
Mathiau
04-03-2003, 04:46 AM
nice - intersting!
Crazy Pete
04-04-2003, 03:24 AM
Anyone want to try and help me out here? I'd really appreciate it.
what do u need help with?
Crazy Pete
04-04-2003, 03:27 AM
My problem is that the signature image just shows up all white with the stats in it, no matter what I use for the sig.jpg starting image. I have no idea why, my host has the latest GD 2.0 with jpeg support enabled, and the configuration seems pretty straightfoward. Am I missing something stupid?
SmartGnome
04-04-2003, 09:31 AM
Great hack :banana:
Install clicked !!
Cheers
@Crazy Pete, are you using all the defaults? or what have you changed?
Crazy Pete
04-04-2003, 04:19 PM
I am. The only thing I changed was the filename from signature.php to sigimage.php, because I also installed hellsatan's signature image 3.0 hack which uses the same filename.
As for the defaults, I left them as-is. I guess I'll try redownloading it and trying it again.
Crazy Pete
04-04-2003, 04:25 PM
Nope, that didn't work either. Now it's not even creating the image at all. :(
is ur folder chmodded to 700/777? and is your folder called signatur?
Crazy Pete
04-05-2003, 08:00 PM
Yep, it is.
and your calling your image like this?
images/signatur/signatur.jpg
Crazy Pete
04-05-2003, 08:53 PM
Yup, but like I said now it won't even create the signatur.jpg image at all. Before it would, but it was just the white box with the stats over it. Now that I reuploaded the file, it doesn't even create the image. Hrm...
well, without actually seeing it i couldn't tell ya whats wrong then, it works fine for me though
DarkDraco07
04-07-2003, 03:26 AM
i uploaded the sig.php to my forums folder and then my root folder because it didnt work.
my problem is that when i run the .com/forums/signature.php i get a page not found, and when i run .com/signature.php i get a blank page.
DarkDraco07
04-09-2003, 02:32 AM
bump
when you first run the page, it will display the basic image with your forum stats on it, upload it to your forum directory and make sure your images/signatur/ folder is chmodded to 700/777 then put the default image in the signatur folder, also make sure signature is spelled the same thorought, in the file it doesn't have the ending 'e'
DarkDraco07
04-09-2003, 09:18 PM
700/777 ?
whats the 700 for? i only set it to 777
GoTTi
04-09-2003, 10:56 PM
Ok here is my problem...
my webhost installed GD, but its not showing on my php info page. But it is installed into /usr/bin/perl or the files are in there.....
WHAT DO I GOTTA DO TO GET GD ON MY SERVER?????? ;(
have them upgrade to php 4.3.0, that comes with GD
dstruct2k
04-10-2003, 09:19 PM
A lot of you guys are confused, especially those of you that are:
Too lazy to learn Cron Running your own server on WindowsI have a fix for people like you. I have created a SigMaker scheduled task that kills off the IE window it launches itself in. It will take editing of both of the included files, but it works perfectly!
Just make sure you run the Task as ANOTHER user, otherwise you'll get annoying windows appearing and dissapearing every 15 minutes. :D
dstruct2k
04-10-2003, 09:24 PM
Yesterday at 06:50 PM Da_GoTTi said this in Post #122 (https://vborg.vbsupport.ru/showthread.php?postid=379931#post379931)
installed into /usr/bin/perl or the files are in there.....
See... GD goes into the extensions folder of the PHP executable. Not your user directory. If it's in your user directory, and your host claims to have "installed" it, I'd change hosts now. They obviously don't know what they're doing. :bandit:
In the meantime, I suggest you tell them that GD comes with PHP, it just isn't enabled by default.
This line must exist in their php.ini file (well, it's called that on WINNT servers.... :nervous:) and must NOT be commented out with a semicolon.extension=php_gd2.dllThey could even add it to the bottom if they wanted, for easy removal if something goes wrong.
Trust me, it's simple to setup, it only took me 5 minutes of searching to figure out how to enable it when RC3 came along! :D
DarkDraco07
04-11-2003, 03:12 AM
ok im confused. the readme says upload sig.php to the forum directory and run it fromwww.yourdomain.com/sig.php ???
upload it to your forum directory then run it from www.YOURDOMAIN.com/FORUMDIRECTORY or if your forum's a subdomain FORUMDIRECTORY.YOURDOMAIN.com
upload it to your forum directory then run it from www.YOURDOMAIN.com/FORUMDIRECTORY/sig.php or if your forum's a subdomain FORUMDIRECTORY.YOURDOMAIN.com/sig.php
DarkDraco07
04-11-2003, 11:25 PM
my sig.php is still giving me a blank page without making the new jpg
Vivi Ornitier
04-12-2003, 12:35 AM
how do u make it show the users online???
copy the users online code from index.php and paste it in the sig.php file, then add the $usersonline variable (not exactly sure what it is) to the part where it makes the text
Hmm.... how would I move the text on the image.
I want to put it on the image in the attachment.
you'd have to change the $top and $left variable
ok here is a very weird problem...... I uploaded it all but everytime I try to vist the signature.php in my forums dir I get a
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.
Anyone know what might be going on?
http://www.eternalgamers.com/forums/signature.php
I know the file is there because I am seeing it in the ftp directory
all signature.php does is try to create the image, save it and display it, so if it doesn't exist that means that
images/signatur/signatur.jpg
does not exist, so for some reason it's not creating the image
any idea why it might not be creating it? I know gd is installed and everything because it works with vb2.3.0 image verifaction system
Courage
04-14-2003, 10:06 AM
Anyone has any ideea how this is made ? :D
https://vborg.vbsupport.ru/external/2006/05/10.jpg
Crazy Pete
04-14-2003, 03:59 PM
Yesterday at 06:17 PM Oricon said this in Post #136 (https://vborg.vbsupport.ru/showthread.php?postid=381685#post381685)
any idea why it might not be creating it? I know gd is installed and everything because it works with vb2.3.0 image verifaction system
Same problem here, unfortunately I have no idea why.
all i can say is make sure all the folders are chmodded and everything is named correctly, it's probably something little you just overlooked
iggy123
04-15-2003, 08:27 PM
could some one Please let me know how I add the number of people online to it???
Crazy Pete
04-15-2003, 08:59 PM
On my host that uses (according to the phpinfo file) GD Version
1.6.2 or higher, this hack works fine. On my other host that uses GD Version 2.0 or higher according to the same file, this hack doesn't work at all.
Is there something that needs to be done differently for my GD 2.0 host?
vB-Host.com
04-20-2003, 03:40 AM
Might want to update your install doc.. For users using Cpanel. You want to create a Cron Job using 0-60 for the minute and * for the others with the command of GET http://www.domain.com/forum/signature.php > /dev/null
see my screenshot below for it set up in a Cpanel Control Panel.
http://www.vb-host.com/forum/cron.gif
gengar003
04-24-2003, 01:30 AM
Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/pgsforum/public_html/vb/signature.php on line 44
I get that error when viewing signature.php... what's it mean?
MindTrix
04-26-2003, 09:20 PM
Newbie question!!! WHy is it my pics get changed when i upload them?? Like i did one recnetly with red writtin, now the whole pics gone red :>
vB-Host.com
04-26-2003, 10:38 PM
Today at 03:20 PM MindTrix said this in Post #144 (https://vborg.vbsupport.ru/showthread.php?postid=387639#post387639)
Newbie question!!! WHy is it my pics get changed when i upload them?? Like i did one recnetly with red writtin, now the whole pics gone red :>
Make your image in RGB after your done, go to "image mode" switch it to index, select to flatten, go to "image mode" again and reselect RGB. Go to "File" --> "save as" change the pull down from photoshop to JPG, save it as file name sig.jpg, up load to server, open your signature.php with a browser then go to signatur.jpg and it should look fine now. Be sure to refresh your browser too to get the latest image.
MindTrix
04-27-2003, 01:53 PM
In the browser the pics commin up nice like it should, but via the php file its still goin dodgy coloured :( Could it be somet in the php file??
subu1
04-29-2003, 10:08 PM
thxx for this Hack *install*
one can it indicate let how much user straight online on the Forums. With phpbb I saw in such a way :)
@gengar003 that means you don't have GD installed on your server
@MindTrix if your doing a .jpg make sure the function is ImageCreateTrueColor and not ImageCreate
DarkDraco07
05-05-2003, 02:56 AM
im having trouble finding the users online code in my index.php
it begins with
$activeusers = "";
$loggedinusers = "";
and ends with
eval("\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\";");
}
DarkDraco07
05-05-2003, 04:01 AM
yea, i finally found that and the total online today. thanks
i've used the images tags and pasted the url to the php file, now it just loads it on everyview and it will be up2date always ;x
subu1
05-05-2003, 03:28 PM
sorry my english is not so good, who can i displayed "Online now" and "online today", i must have it :banana:
thxxx subu
kdog316
05-06-2003, 12:40 AM
how come when my image goes to signatur.jpg it looks like crap
http://www.allaroundsite.com/forums/signature.php
DarkDraco07
05-06-2003, 01:25 AM
lessen the compression or use the code given i think on the 1st page to raise the quality
the compression/quality is the same thing, by default it's 100 (100% quality / no compression), the smaller the number the lesser the quality
thamyeuvn
05-18-2003, 06:30 AM
Yeah, nice idea.
Cool chew for Hot People :)
iggy123
05-21-2003, 10:10 AM
Mine worked fine until the other day - if you look at the signature in a post -
http://clanantivirus.net/forums/showthread.php?postid=5161#post5161
and then look at the stats when you run the signature.php
http://clanantivirus.net/forums/signature.php
there is a major discrepancy -
if you look at the sig.jpg
http://clanantivirus.net/forums/images/signatur/sig.jpg
then its obvious that the picture is able to be updated but for some reason the signatur.jpg isnt.
Never mind fixed it
KJ_innit
05-22-2003, 09:49 AM
does this work with GD libraries earlier than version 2?
subu1
05-22-2003, 10:43 AM
ups,
I have since yesterday GD2 , but my picture has thereby only 256 colors
look at my signatur, what can i do, need help please
gmarik
05-24-2003, 09:14 AM
Thanks. Really great.
Intex
05-24-2003, 03:18 PM
I can't seem to get this to work. I just receive an error. Could this be because I'm running PHP 4.1.2?
msimplay
05-28-2003, 03:02 PM
i get this error when i use the cron
Failed loading /usr/local/Zend/lib/ZendOptimizer.so:
/usr/local/Zend/lib/ZendOptimizer.so: cannot open shared object file: No such file or
directory
X-Powered-By: PHP/4.3.1
Set-Cookie: ;
path=/Vbulletin/
Set-Cookie: bblastvisit=1054137601; expires=Thu, 27-May-04 16:00:01
GMT; path=/Vbulletin/
Content-Type: image/png
Steve W.
06-02-2003, 04:21 PM
Everytime I uipload signature.php I get this:
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.
Any ideas?!
Minots
06-02-2003, 06:26 PM
@ msimplay
I?m using a simple bash-script to do the "cron-part" without trouble. (look in my attachment :))
little instructions:
* login to your server via ssh/telnet
* upload "cron_signature.sh" /root
* chmod it to 700
* add a line into your "/etc/crontab"-file like:
0,10,20,30,40,50 * * * * /root/cron_signature.sh
-------------- SNIPP --------------
About your error-message:
It looks like a mistaken 'ZendOptimizer'-installation. So there are 2 possible solutions.:
N?1.: reinstall of 'ZendOptimizer' by using the install.sh from it
N?2: uncomment or delete the 'ZendOptimizer'-lines in your php.ini (looks like:
[Zend]
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/lib/ZendOptimizer.so)
After that, just restart your webserver. ;)
eXtremeTim
06-08-2003, 08:37 PM
I just rewrote a bunch of this so that when i use the link to the php file as my sig image it doesn't go thro vb anymore as to keep it from messing with whos online. Plus i went ahead and made a count for total online. I also made it use a png template instead of a jpg template. :)
MentaL
06-11-2003, 03:12 PM
ive uploaded and did the cron job but my http://forum.ragezone.com/images/signatur/sig.jpg is not updating...
MentaL
06-11-2003, 03:16 PM
nm fixed it :)
msimplay
06-18-2003, 03:19 PM
06-02-03 at 08:26 PM Minots said this in Post #165 (https://vborg.vbsupport.ru/showthread.php?postid=403477#post403477)
@ msimplay
I?m using a simple bash-script to do the "cron-part" without trouble. (look in my attachment :))
little instructions:
* login to your server via ssh/telnet
* upload "cron_signature.sh" /root
* chmod it to 700
* add a line into your "/etc/crontab"-file like:
0,10,20,30,40,50 * * * * /root/cron_signature.sh
-------------- SNIPP --------------
About your error-message:
It looks like a mistaken 'ZendOptimizer'-installation. So there are 2 possible solutions.:
N?1.: reinstall of 'ZendOptimizer' by using the install.sh from it
N?2: uncomment or delete the 'ZendOptimizer'-lines in your php.ini (looks like:
[Zend]
zend_optimizer.optimization_level=15
zend_extension=/usr/local/Zend/lib/ZendOptimizer.so)
After that, just restart your webserver. ;)
lol Ez web is my host they sed it was normal
and its working so am not complaining :P
Minots
06-19-2003, 12:14 PM
lol Ez web is my host they sed it was normal
and its working so am not complaining :P
Muhhhahahahaha! :laugh:
Can?t believe that! LooooooL!
msimplay
06-19-2003, 12:16 PM
yeh i know its well stupid isn;t it
Minots
06-19-2003, 12:19 PM
jepp! it is.
Ninth Dimension
07-01-2003, 08:34 AM
wow, this is just TOO COOL!!! fantastic idea for a hack, i love it to bits :)
ogden2k
07-09-2003, 10:33 PM
Warning: imagecreatefromjpeg(/public_html/misc/sig/1.jpg) [function.imagecreatefromjpeg]: failed to create stream: No such file or directory in /home/./public_html/forums/signature.php on line 83
Warning: imagecopy(): supplied argument is not a valid Image resource in /home/./public_html/forums/signature.php on line 91
Warning: Cannot modify header information - headers already sent by (output started at /home/./public_html/forums/signature.php:83) in /home/./public_html/forums/signature.php on line 102
PNG
What am I doing wrong?
CHMOD777 for the right folder too
nymyth
07-13-2003, 03:22 AM
Warning: imagecreatefromjpeg(/home/jaydabhi/public_html/forums/images/sig/sig2.jpg) [function.imagecreatefromjpeg]: failed to create stream: No such file or directory in /home/jaydabhi/public_html/forums/signature.php on line 83
Warning: imagecopy(): supplied argument is not a valid Image resource in /home/jaydabhi/public_html/forums/signature.php on line 91
Warning: Cannot modify header information - headers already sent by (output started at /home/jaydabhi/public_html/forums/signature.php:83) in /home/jaydabhi/public_html/forums/signature.php on line 102
I get this error, anybody help me out...thanx
Peace
nymyth
07-13-2003, 03:27 AM
I do have GD 2.0 enabled, i saw the signatur2.jpg in my folder when i ftped, but i get that error...anybody??
Peace
Intex
07-13-2003, 08:41 AM
Hi tkeil69575
Can you tell me whether this can be modified to work with ImageMagick as I don't have GD2 on the server. If not, do you know whether you can isntall GD2 on a windows Apache host?
Thx :).
dstruct2k
07-16-2003, 12:15 PM
"Installing" GD2 on a Windows PHP server is easier than installing this hack. Here's how you do it: Open php.ini Search the file for "GD2" (it's only there once) Remove the semicolon (;) from the beginning of that line. Restart your server
You've just installed GD2! :D
Oh, and msimplay, I would not want to stay with ahost that considers an error message to be "normal".... :laugh:
Intex
07-17-2003, 08:08 PM
dstruct2K - what version of PHP did GD2 support begin because I don't have that in there :).
Minots
07-17-2003, 09:55 PM
@Intex
Try a look: http://www2.minots.de/Linux/docs/txt/PHP-HOWTO
monstergamer
07-21-2003, 11:28 PM
i got this
Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/local/psa/home/vhosts/monstergamer.net/httpdocs/vb/signature.php on line 83
Minots
07-21-2003, 11:53 PM
@monstergamer
Do you realy have GD2 support in PHP?
It doesn´t look like that.
monstergamer
07-21-2003, 11:56 PM
Today at 08:53 PM Minots said this in Post #182 (https://vborg.vbsupport.ru/showthread.php?postid=419589#post419589)
@monstergamer
Do you realy have GD2 support in PHP?
It doesn?t look like that. they say that they have image magic or some thing like that
is there any way this works with that
cause this is a cool hack
InfiniteWebby
07-28-2003, 12:03 AM
is there a way to add a timer inside the script the global.php so that if time is divisible by something then run this, cause my host is a bit tight and wont let me run cronjobs
Arsenik
07-28-2003, 12:19 AM
How would i go about having wierd carracteres printed correctly on the created image? It all works for me but i am creating the image with usernames in it and some use weird carracters like ? and so on... When the image is created that becomes an L with a bar on it.... and so on. :( How can i fix this?
Thanks.
InfiniteWebby
07-28-2003, 09:40 AM
it might be the font, the font that is in use on the sig might not contain the character you want.
As for my problem does anyone know how to work out my problem?
I cant get cron so is it possible to add abit of code to say global.php or functions.php that goes
if current time in minute is divisible by say 60 (everyhour)
then include url/to/signature/generator.php
i am no good with times nor where to put this otherwise i would do it myself
also my boards are probably busy enough for someone to run into this code 90% of the time so it shouldnt be that unreliable.
AmericanWoman
08-13-2003, 03:34 PM
I get the fatal error message, too, and I have PHP 4.3.1 installed. :( What do I do?
Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/local/apache/htdocs/forums/images/sig/signature.php
I've been all excited waiting for my lunch break all day so I could experiment with this. :(
insanctus
08-21-2003, 11:57 AM
Mine keeps same number and does not update. It is like the numbers are stickin although if I change the placement that works just numbers not changing :(
sweet22
08-21-2003, 10:19 PM
i keep getting this:
Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/anima823/public_html/community/signature.php on line 83
insanctus
08-24-2003, 01:52 AM
I finaly got mine all worked out. It is was not seeing admins, so I just added 2 to number so it is accurate. Cool add on.
ragintajin
09-11-2003, 11:08 PM
is there a way to change the font???
Almax1
09-14-2003, 11:45 PM
how do you put the stats side by side ?
horizontally :D
Oblivion Knight
09-17-2003, 05:44 PM
Meh.. I'm having to use Fake Cron to get it to work, but it's all good.. :)
Thanks for sharing.!
insanctus
09-17-2003, 06:37 PM
I just took out the /n in the script since it is same as a return line.
insanctus
09-17-2003, 06:39 PM
i keep getting this:
Your server does not have gd enabled check your php info and you will notice it is not in it. Ask your host to install Gd library.
Almax1
09-17-2003, 07:33 PM
I just took out the /n in the script since it is same as a return line.
what bit of /n code m8 ?? all of it ??
insanctus
09-17-2003, 07:42 PM
$text = "Members: $numbermembers Threads: $totalthreads Posts: $totalposts";
Is how mine looks :)
Hope that helps.
Almax1
09-17-2003, 08:21 PM
does not work at all now :(
insanctus
09-17-2003, 08:23 PM
With $text = "Members: $numbermembers Threads: $totalthreads Posts: $totalposts";
Hmm odd is how I have mine, what is it saying or doing ?
Almax1
09-17-2003, 08:29 PM
it works with the opd code vertically
but when i edit with your code to try & get it horizontal it doesnt show at all :(
hmmm do you have line spacing at 0 in the configure area ?
lost now :P
insanctus
09-17-2003, 08:34 PM
$width = 258;//Width of banner image
$height = 65;//Height of banner image
$left = 5; //Left text-margin
$top = 40; //text-margin from top
$zeilenabstand = 15; //Line-spacing of text
Is mine, notice the top, ya need change it till is right . Myself I used psp to find the pixel location I wanted.
Almax1
09-17-2003, 09:43 PM
$text = "Members: $numbermembers Threads: $totalthreads Posts: $totalposts\n";
fixed it thanx for your help m8
insanctus
09-17-2003, 09:49 PM
n/p man , ack i forgot the \n at end :( sorry about that.
dstruct2k
10-08-2003, 05:12 AM
Brand new version installed... All I get is a white page. The JPEGs aren't updating either.
dstruct2k
10-08-2003, 05:25 AM
Oh, whoops. :o
Don't save PHPs as Unicode. :)
sweet22
10-13-2003, 07:10 PM
i keep getting this error:
Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/anima823/public_html/community/signature.php on line 83
dstruct2k
10-14-2003, 06:06 AM
i keep getting this error:
That's called not having GD2 installed. :)
M@rkus
10-15-2003, 12:15 PM
Now.. i ve followed the discussion all along now.
But there is my problem right now.
Right now my Sig. looks like this:
http://www.e34m5.de/board/signature.php
and the code looks like this:
<?php
error_reporting(7);
//Version 2 - 25.06.2003
$host = "******"; //DB-Servername
$user= "*******"; //DB-Username
$password= "******"; //DB-Password
$database="*******"; //vbulletin database name
$adminemail = "webmaster@e34m.de"; //E-Mail Address where MySQL Error Messages are sent to
$width = 470;//Width of banner image
$height = 62;//Height of banner image
$left = 153; //Left text-margin
$top = 8; //text-margin from top
$zeilenabstand = 15; //Line-spacing of text
$vorlagedatei = "./images/signatur/sig.jpg"; //full path to empty signature image (input image)
$ausgabedatei = "./images/signatur/signatur2.jpg"; //full path to signare image with forum data (output image)
$komprimierung = 95; //Compression of output image
$debug = 0; //debug mode
################ DO NOT EDIT BELOW #################
function mysql_query_eval($query, $database) {
$mysql_eval_error="";
$mysql_eval_result = mysql_query($query, $database) or $mysql_eval_error = mysql_error();
if ($mysql_eval_error) {
if ( $debug == 1 ) {
$letter = "An error was encountered during execution of the query:\n\n";
$letter .= $query."\n\n";
$letter .="The query returned with an errorcode of: \n\n$mysql_eval_error\n\n";
$letter .="To turn this email off set debug=0 in signature.php\n\n";
$email_from = "From: ".$adminemail;
$subject="Subject: Signature Error Report";
$subject=trim($subject);
mail( $email, $subject, $letter, $email_from );
} elseif ( $debug == 2 ) {
dieWell( "MySQL error reported!<p>Query: $query<p>Result: $mysql_eval_error<p>Database handle: $database" );
exit;
}
return FALSE;
} else {
return $mysql_eval_result;
}
}
// Connecting, selecting database
$link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.');
mysql_select_db ("$database")or die("Could not select database");
// get forum members
$querya="SELECT COUNT(*) AS users, MAX(userid) AS max FROM user WHERE usergroupid!=4";
$numa = mysql_query_eval($querya,$link);
$numb = mysql_fetch_array($numa);
$numbermembers=number_format($numb['users']);
mysql_free_result($numa);
// get total posts
$queryb="SELECT COUNT(*) AS posts FROM post";
$posta = mysql_query_eval($queryb,$link);
$postb = mysql_fetch_array($posta);
$totalposts=number_format($postb['posts']);
mysql_free_result($posta);
//get total threads
$queryc="SELECT COUNT(*) AS threads FROM thread";
$threada = mysql_query_eval($queryc,$link);
$threadb = mysql_fetch_array($threada);
$totalthreads=number_format($threadb['threads']);
mysql_free_result($threada);
$text = "Members: $numbermembers\nThreads: $totalthreads\nPosts: $totalposts\n";
$worte = split("\n", $text);
if(is_array($worte)){
$i = 0;
foreach($worte as $wort){
$i++;
$output[$i] = $wort;
}
}
$vorlage = imagecreatefromjpeg("$vorlagedatei");
$img = imagecreatetruecolor($width,$height);
//a png uses ImageColorAllocate instead of ImageColorClosest like jpeg uses
$bg_color = imagecolorallocate ($img, 255, 255, 255); //background white
$text_color = imagecolorallocate ($img, 0, 0, 0); //black text
imagefilledrectangle ($img, 0, 0, $width, $height, $bg_color);
imagecopy ($img, $vorlage, 0, 0, 0, 0, $width, $height); // copy empty banner
imagecolortransparent($img, $bg_color); // set dummybg transparent
// the distance is in pixels and the font # is 1 through 5
$i = 0;
while($i < count($output)){
imagestring($img, 2, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output[$i], $text_color);
$i++;
}
header("Content-Type: image/png");
imagepng($img);
imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
imagedestroy($img); // get the image out of memory
?>
When i want to have the total post etc in my sig. i would change it to the following code:
<?php
error_reporting(7);
//Version 2 - 25.06.2003
$host = "*******"; //DB-Servername
$user= "*********"; //DB-Username
$password= "*******"; //DB-Password
$database="*******"; //vbulletin database name
$adminemail = "webmaster@e34m.de"; //E-Mail Address where MySQL Error Messages are sent to
$width = 470;//Width of banner image
$height = 62;//Height of banner image
$left = 153; //Left text-margin
$top = 8; //text-margin from top
$zeilenabstand = 15; //Line-spacing of text
$vorlagedatei = "./images/signatur/sig.jpg"; //full path to empty signature image (input image)
$ausgabedatei = "./images/signatur/signatur2.jpg"; //full path to signare image with forum data (output image)
$komprimierung = 95; //Compression of output image
$debug = 0; //debug mode
################ DO NOT EDIT BELOW #################
function mysql_query_eval($query, $database) {
$mysql_eval_error="";
$mysql_eval_result = mysql_query($query, $database) or $mysql_eval_error = mysql_error();
if ($mysql_eval_error) {
if ( $debug == 1 ) {
$letter = "An error was encountered during execution of the query:\n\n";
$letter .= $query."\n\n";
$letter .="The query returned with an errorcode of: \n\n$mysql_eval_error\n\n";
$letter .="To turn this email off set debug=0 in signature.php\n\n";
$email_from = "From: ".$adminemail;
$subject="Subject: Signature Error Report";
$subject=trim($subject);
mail( $email, $subject, $letter, $email_from );
} elseif ( $debug == 2 ) {
dieWell( "MySQL error reported!<p>Query: $query<p>Result: $mysql_eval_error<p>Database handle: $database" );
exit;
}
return FALSE;
} else {
return $mysql_eval_result;
}
}
// Connecting, selecting database
$link = mysql_connect ("$host", "$user", "$password") or die ('I cannot connect to the database.');
mysql_select_db ("$database")or die("Could not select database");
// get forum members
$querya="SELECT COUNT(*) AS users, MAX(userid) AS max FROM user WHERE usergroupid!=4";
$numa = mysql_query_eval($querya,$link);
$numb = mysql_fetch_array($numa);
$numbermembers=number_format($numb['users']);
mysql_free_result($numa);
// get total posts
$queryb="SELECT COUNT(*) AS posts FROM post";
$posta = mysql_query_eval($queryb,$link);
$postb = mysql_fetch_array($posta);
$totalposts=number_format($postb['posts']);
mysql_free_result($posta);
//get total threads
$queryc="SELECT COUNT(*) AS threads FROM thread";
$threada = mysql_query_eval($queryc,$link);
$threadb = mysql_fetch_array($threada);
$totalthreads=number_format($threadb['threads']);
mysql_free_result($threada);
//get total online today
// today online hack begin
if ((int)$maxusers[0] <= $totalonline) {
$time = time();
$maxloggedin = "$totalonline " . $time . " " . $maxusers[2] . " " . $maxusers[3];
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
$maxusers[0] = $totalonline;
$maxusers[1] = $time;
}
$todayloggedinusers = "";
$numbertodayonline = 0;
$numbertodayonlineinvisible = 0;
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user
WHERE lastactivity > " . (mktime(0,0,0,date("m"),date("d"),date("Y")) + (($bbuserinfo['timezoneoffset']-$timeoffset)*3600)) . "
ORDER BY username");
while ($todayuser=$DB_site->fetch_array($todayusers)) {
$numbertodayonline++;
$invisibleuser = '';
$userid = $todayuser['userid'];
$lastactivetime = vbdate($timeformat, $todayuser[lastactivity]);
if ($todayuser['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
$numbertodayonlineinvisible++;
continue;
}
if ($todayuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
}
if ($todayuser['usergroupid'] == 6 and $highlightadmin) {
$username = "<b><i>$todayuser[username]</i></b>";
} else if (($mod["$userid"] or $todayuser['usergroupid'] == 5) and $highlightadmin) {
$username = "<b>$todayuser[username]</b>";
} else {
$username = $todayuser['username'];
}
if (!$todayloggedinuser) {
eval("\$todayloggedinuser = \"".gettemplate('forumhome_todayloggedinuser')."\";");
} else {
eval("\$todayloggedinuser .= \", ".gettemplate('forumhome_todayloggedinuser')."\";");
}
}
$DB_site->free_result($todayusers);
if ($bbuserinfo[usergroupid] == 6) {
$todayonline = $numbertodayonline;
} else {
$todayonline = $numbertodayonline - $numbertodayonlineinvisible;
}
if ((int)$maxusers[2] <= $numbertodayonline) {
$time = time();
$maxloggedin = $maxusers[0] . " " . $maxusers[1] . " $numbertodayonline " . $time;
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
$maxusers[2] = $numbertodayonline;
$maxusers[3] = $time;
}
$todayrecordusers = $maxusers[2];
$todayrecorddate = vbdate($dateformat,$maxusers[3]);
$text = "Members: $numbermembers\nThreads: $totalthreads\nPosts: $totalposts\nOnline Today: $numbertodayonline\n";
$worte = split("\n", $text);
if(is_array($worte)){
$i = 0;
foreach($worte as $wort){
$i++;
$output[$i] = $wort;
}
}
$vorlage = imagecreatefromjpeg("$vorlagedatei");
$img = imagecreatetruecolor($width,$height);
//a png uses ImageColorAllocate instead of ImageColorClosest like jpeg uses
$bg_color = imagecolorallocate ($img, 255, 255, 255); //background white
$text_color = imagecolorallocate ($img, 0, 0, 0); //black text
imagefilledrectangle ($img, 0, 0, $width, $height, $bg_color);
imagecopy ($img, $vorlage, 0, 0, 0, 0, $width, $height); // copy empty banner
imagecolortransparent($img, $bg_color); // set dummybg transparent
// the distance is in pixels and the font # is 1 through 5
$i = 0;
while($i < count($output)){
imagestring($img, 2, $left, (($i * $zeilenabstand) - $zeilenabstand + $top), $output[$i], $text_color);
$i++;
}
header("Content-Type: image/png");
imagepng($img);
imagejpeg($img, "$ausgabedatei",$komprimierung); //Write jpg to folder and set compression
imagedestroy($img); // get the image out of memory
?>
But as soon as i upload that new sig-code i get the following ERROR:
Fatal error: Call to a member function on a non-object in /is/htdocs/42170/www.e34m5.de/board/signature2.php on line 77
and the on line 77 in my signature2.php is:
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
What am i doing wrong?!!?
ogden2k
10-28-2003, 03:43 PM
How do I add an option to show how many users are online?
irn-bru
10-29-2003, 12:06 PM
thx m8 :)
irn-bru
10-29-2003, 12:11 PM
cron jobs via php script - phpJobScheduler
http://www.hotscripts.com/Detailed/27136.html
FlyBoy73
11-05-2003, 10:04 PM
Is it possible to run Multiple Banners with this stats hack in each different one? I would like to have about 5 different banners for one of my communities, each focusing on a specific area I want to reach out to..
Thanks,
David
Great hack! I've been looking at this one for awhile, but didn't have GD 2.0+ on my server. I finally spent an hour last night upgrading PHP and GD. I then installed this hack without any issues. Thanks again for this hack!
Intex
01-01-2004, 09:06 AM
* Intex clicks Install. Great hack :).
Anybody have the adjusted code that displays Online users?
y2krazy
01-15-2004, 10:52 PM
My image doesn't seem to be updating itself via the cronjob. Any tips on how to make sure it will update without having to run signature.php to update it manually?
-y2k-
robin_ge
01-29-2004, 03:37 AM
* Intex clicks Install. Great hack :).
Anybody have the adjusted code that displays Online users?
Same here, thanks in advance.
Works on vB3 without any change in code! :D Great hack!
* Intex clicks Install. Great hack :).
Anybody have the adjusted code that displays Online users?
Attached is a text file that has instructions how to add the queries for Online users.
will this work with gif images?
y2krazy
03-29-2004, 08:38 PM
My cronjob doesn't seem to want to work with this...
What do I need to make sure I'm doing right so that it works? Thanks.
-y2k-
DannyBoy8406
04-08-2004, 06:38 AM
anyone know an update for this for VB3?
StepFenz
04-10-2004, 08:33 PM
Hope not everybody is sick and tired of answering the question. But I've thoroughly searched the thread and I couldn't find the answer.
Q: I have GD2 installed (i.e. phpinfo says: GD Version bundled (2.0 compatible)) and I've chmodded my targetdir to 777. But the picture file doesn't show up. I can run the signature.php file and then I see what I would like to see. But I want the image-file.
Can anybody help me? I know there were people in this thread with similar problems and I can see by their signature they've solved that :laugh:
Tnx in advance
Idea: You can easiliy put the picture file on your Windows desktop and have it refreshed as much as you like.
StepFenz
04-11-2004, 01:50 PM
Ok,
I've commented all kinds of lines out to try to focus on the wrong line. I cannot find it.
Problem: I can't generate a picturefile, not a jpg not a png.
But: I can run de php.file, and I can see the png-file, exactly the way I like it. There are no error messages.
System: I have GD2 and php 4.3.0 installed. And chmodded the picturedir to 777. I have Photopost working with GD as well.
These are my last 4 lines:
header("Content-Type: image/png");
imagepng($img);
imagejpeg($img, $ausgabedatei, $komprimierung); //Write jpg to folder and set compression
imagedestroy($img); // get the image out of memory
Firstly: I want to know how to fix this, but secondly: why is the png file swapped into a jpeg? Can I skip that?)
StepFenz
04-13-2004, 04:50 PM
Solved it! Don't ask me how, but it works. In order to improve the interaction on this thread ;-) : I also added the total number of pictures of my photopost-section. Here it is (note that my photopost prefix is pp, if yours is different change that in the query below, eg. you have xx as photopost prefix, change ppphotos into xxphotos):
find:
mysql_free_result($threada);
after that add:
//get total photos
$queryd="SELECT COUNT(*) AS ppphotos FROM ppphotos";
$ppphotosa = mysql_query_eval($queryd,$link);
$ppphotosb = mysql_fetch_array($ppphotosa);
$totalphotos=number_format($ppphotosb['ppphotos']);
mysql_free_result($ppphotosa);
And replace:
$text = "Members: $numbermembers\nThreads: $totalthreads\nPosts: $totalposts\n";
Into:
$text = "Members: $numbermembers\nThreads: $totalthreads\nPosts: $totalposts\nPhoto's: $totalphotos\n";
I like this, because I now have immediately information on my frontpage about the status of all content, including photos.
PranK
04-26-2004, 12:51 PM
this works without any dramas for VB3.
Christian
dstruct2k
04-29-2004, 02:32 PM
this works without any dramas for VB3.
Christian
Mine had to be altered, although it might be because my new host only has GD 1.
Meh, whatever, it works. :)
I quite liked this hack over on Invision boards, and was all excited to see it here...unfortunately, when I call signature.php, all I get are lots of
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in
errors.
Any ideas?
GoTTi
05-02-2004, 04:43 AM
not working for v3 for me...
can ne1 help me with it...
GoTTi
05-04-2004, 03:49 PM
ne1 got this working on vb3??????
DWard
05-24-2004, 12:48 PM
Yer I developed the script for vb3, search for Signature Stats and you should find it :)
Scuzzy
04-07-2007, 02:41 PM
I've been unable to get this to create the jpg when run as a cron job but it will if I call the php script directly... some others here have run into that problem, how did you solve it?
Thanks,
Scuzzy
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.