13.04.2011 - NOTICE: This module is now discontinued and no longer under active development or support. You're free to fork its code or maybe somone writes a similar mod from scratch. I no longer have the time, need and effort to work on this module. Latest and last code will remain on Mercurial at http://hg.cgx24.com/lgsl-dsi/src/62594cb6ca79. Thanks to everyone who was using my module and made it so popular. Also thanks to the many feedbacks!
wrote ... Basic Dynamic Server Image Status addon for LGSL by MadMakz (http://madmakz.com) for The Source Powered Network (http://sourcepowered.net/). Tested & written for LGSL v5.5+
Notes: Since i´m a lazy guy i´m not going to update threads across the world, so check the Download Link to find the always latest version of this addon!
Another tip, some fonts ( such as 'pixel fonts' ) look better without anti-aliasing ( edge smoothing ) and it can be turned off by making the font color a negative value.
For example: $text_color0 = 0 - $text_color0; So 12 would become -12.
Or directly on the function: imagettftext($im,11,0,10,14,$text_color0,$text_font0,$string0); To: imagettftext($im,11,0,10,14,-$text_color0,$text_font0,$string0);
The catch is it does not work on pure black ( can't have negative zero ) So instead you have to use the next nearest: $text_color0 = ImageColorAllocate($im,1,1,1);
yup, status works fine (see my live example). i´m trying to get a mapimage in now, get´s a little tricky for me since i need to resize it first... beside i need to fin a good location ^^
wrote ... 1.2 - 23.09.2009 20:23:41 * Two image sizes, small & normal (def.), available. Call via lgsl_files/lgsl_image.php?s=X&type=X (replace X) * Coupple of code changes & cleanups * .htaccess for mod_rewrite included. Call via s_X.png or s_X-X.png (replace X), second X is to define image type * Shows server current status (inspired by ejik03) * More code comments
1.1 - 22.09.2009 17:06:06 * Changed some code by using Perry´s suggestions * Fonts (TTF) are used for Text generation now
huge thanks man! didn´t knew it´s that easy, now when i see it it´s pretty simple actually :/
here´s what i´ve done with it (live)
(i borrowed the background from an licenced gameserver admin panel i use and modified the server name area so i can put longer text, rest is automaticaly stripped to fit in box) SpiffyTek
On of the advantages of an image is, if your short on space for the server name you can always rotate the text 270 degrees and put it down the side ( like gametracker )
Here is some updated code which adds the padlock and game icon to the map image before it is resized and added to the background ( apply the icon directly to the background if it becomes to small )
Hi? yea i did that then i went to http://www.gaming2gamers.com/componet/com_lgsl/lgsl_files/lgsl_image.php?s=1 and it doesnt work what did i do wrong?.. it redirects me to the frontpage