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:
![]()
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!
![]()
That is gruesome!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:
![]()
I've made some changes to the code, nothing much, some personal formatting preferences and small stuff
http://74.117.232.136/sig.php
and for source: http://74.117.232.136/sig.php?source=1
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');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: max-age=500, must-revalidate, public');
Shall I just leave you to work that out again?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.
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.
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.
![]()
[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
Shall I just leave you to work that out again?
If you're asking how to implement it, all you have to do is set a couple of headers before you output the image. See my post above. Otherwise I'm not sure what you're asking...![]()
No, I'm talking about maths![]()
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
The software haven't even been released yet and people are consuming it's REST resources. AwesomeI can see the extendability here.
How about an HTML view?
http://xenforo.com/community/members/eriksrocks.103/mini-stats
Or even a JSON view, (will only respond to XHR)
http://xenforo.com/community/members/eriksrocks.103/mini-stats.json
MVC FTW![]()
How about an HTML view?
http://xenforo.com/community/members/eriksrocks.103/mini-stats
Or even a JSON view, (will only respond to XHR)
http://xenforo.com/community/members/eriksrocks.103/mini-stats.json
MVC FTW![]()
You just wrote these today, didn't you?![]()
I've made mine prettier nowneed to tweak it lots though
We use essential cookies to make this site work, and optional cookies to enhance your experience.