• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Signature Badge Script

  • Thread starter Thread starter Floris
  • Start date Start date
I have a version that takes an ID too, but I didn't want to post it here for fear of the "OMG that is so cool I'm putting that in MY sig now!" kind of effect. And then my server would look like this:

burnt-server.png


I'm actually considering turning this into a free hosted service where you can customize colors, designs, what you want displayed, etc. And it will have at least minimal caching. :) Development time! :D

We do not want your server to look like that, for sure. But thanks for the sig! I'm actually learning PHP in College and loved looking at your code, it looks so simple and yet does such a useful tool. :)
 
I have a version that takes an ID too, but I didn't want to post it here for fear of the "OMG that is so cool I'm putting that in MY sig now!" kind of effect. And then my server would look like this:

burnt-server.png
That is gruesome!
 
I've made some changes to the code, nothing much, some personal formatting preferences and small stuff :p

http://74.117.232.136/sig.php

and for source: http://74.117.232.136/sig.php?source=1

Nice, the code is formatted much better now. :)

PHP:
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

For anyone who wants to know, this is the proper way to make sure the image isn't cached by the browser. Me being lazy, I didn't include it and just left it up to the browser. :p
If you want to achieve the opposite effect in order to reduce load on your server, you can do something like this:
PHP:
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: max-age=500, must-revalidate, public');

Max-age is in seconds, so if you don't want any browser to request a new copy of the image until five minutes after they got their last copy, you would set max-age to 500. :) However, you should note that you can't force browsers to cache stuff. For some reason, my installation of Firefox on this computer doesn't cache anything, and I don't really know why. :P
 
Nice, the code is formatted much better now. :)

PHP:
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

For anyone who wants to know, this is the proper way to make sure the image isn't cached by the browser. Me being lazy, I didn't include it and just left it up to the browser. :p
If you want to achieve the opposite effect in order to reduce load on your server, you can do something like this:
PHP:
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: max-age=500, must-revalidate, public');

Max-age is in seconds, so if you don't want any browser to request a new copy of the image until five minutes after they got their last copy, you would set max-age to 500. :) However, you should note that you can't force browsers to cache stuff. For some reason, my installation of Firefox on this computer doesn't cache anything, and I don't really know why. :p

One of the main things I noticed was $black, had to move it after $final was defined and change $img to $final, otherwise:

Code:
[Sat Jul 31 15:28:06 2010] [error] [client *removed*] PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, null given in /var/www/html/sig.php
 
No, I'm talking about maths :p

Well I was just providing an example. :P
One of the main things I noticed was $black, had to move it after $final was defined and change $img to $final, otherwise:

Code:
[Sat Jul 31 15:28:06 2010] [error] [client *removed*] PHP Warning:  imagecolorallocate() expects parameter 1 to be resource, null given in /var/www/html/sig.php

Nice catch. :) Updated. :)
 
Top Bottom