Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 27

164.132.x.x user
178.63.x.x user
180.76.x.x lgsl
180.76.x.x forum
217.182.x.x forum
217.182.x.x forum
220.181.x.x forum
46.161.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
51.255.x.x forum
51.255.x.x forum
51.255.x.x lgsl
51.255.x.x forum
54.224.x.x forum
68.180.x.x forum
68.180.x.x forum

Last Seen

Dodgeitorelse Wed 21:14
adneycandy Mon 11:03
ESO2017 Fri 04:11
Marylee Jones Fri 02:36
Ericka Burke Fri 01:12

Newest Members

Forums
Richard Perry - GreyCube.com :: Forums :: Live Game Server List
Go to page       >>     
Cool: Dynamic Server Image for LGSL
MadMakz
Mon Sep 21 2009, 05:42PM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
24.12.2011 - NOTICE: X-Mas present: http://www.greycube.com/site/e107_plugins/forum/forum_viewtopic.php?9801.160#post_14420

22.12.2011 - NOTICE: I've pushed a somewhat v1.5 for LSL 5.8+ out today.
THIS DOES NOT MEAN THAT THE MOD'S DEVLOPMENT IS ACTIVE AGAIN!
Changeset: http://hg.cgx24.com/lgsl-dsi/changeset/ef740e4896b6
Download: http://community.spiffytek.com/downloads.php?do=file&id=10
As with 1.4, this is a dev release and has only been tested on stand-alone version!


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!

02.12.2010 - NOTICE: For working download links and latest informations regarding this mod please read this post; http://www.greycube.com/site/e107_plugins/forum/forum_viewtopic.php?12901.post


About:
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+


Changelog:


Preview (Static):


Live & customized:
N/A


Download:
http://community.spiffytek.com/downloads.php?do=cat&id=3

Latest Development Snapshot: N/A

Detailed informations:


Found a bug? Want a Feature? -> http://community.spiffytek.com/forumdisplay.php?f=14

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!

However i´ll still read and post here!

Thanks

Makz

Homepage:
http://community.spiffytek.com/forumdisplay.php?f=14

Related:
Adding images and code to server details page



SpiffyTek
Website
Rich
Mon Sep 21 2009, 10:28PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

Good example to get people started, a couple of tips:

[ code removed as suggestions are in the release ]

A good place for getting TTF fonts is:
http://www.dafont.com
Website
MadMakz
Tue Sep 22 2009, 10:14AM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
actually i thought i made more "mistakes" than this^^ thanks for the tips/fixes!

EDIT: 1st post updated, v1.1 is using fonts now

SpiffyTek
Website
ejik03
Wed Sep 23 2009, 04:49AM
Posts: 9
Joined: Wed Aug 05 2009, 09:59AM
Registered Member #5301
How can I add a screenshot of current map in to this picture? And how i can add server status to picture?

P.S.- Sorry for my bad english
Website
Rich
Wed Sep 23 2009, 05:02AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

EDIT:
Posted code showing how to add the map image.
Website
Rich
Wed Sep 23 2009, 05:21AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

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);

[updated to clarify the problem with pure black]
Website
ejik03
Wed Sep 23 2009, 05:22AM
Posts: 9
Joined: Wed Aug 05 2009, 09:59AM
Registered Member #5301
Thank you))) And how i can add server status? {$misc['text_status']} don't work...
Website
Rich
Wed Sep 23 2009, 05:35AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

misc works for me:
$string0 = "{$misc['text_status']} - {$server['s']['name']}";
Website
MadMakz
Wed Sep 23 2009, 09:53AM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
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 ^^

thanks again for the references!

SpiffyTek
Website
MadMakz
Wed Sep 23 2009, 02:34PM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
v1.2 released
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

1.0 - 21.09.2009 23:28:49
* Made public


Download http://sourcepowered.net/forums/showthread.php?tid=28

SpiffyTek
Website
Rich
Wed Sep 23 2009, 03:06PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

The number of parameters can be confusing, and also the map image can be jpg/png/gif, here is the code needed to add the map to your example.


$im_map_width  = 80;
$im_map_height = 60;
$im_map_posx   = 200;
$im_map_posy   = 30;

$im_map_info = getimagesize($misc['image_map']);
if ($im_map_info[2] == 1) { $im_map = imagecreatefromgif($misc['image_map']);  }
elseif ($im_map_info[2] == 2) { $im_map = imagecreatefromjpeg($misc['image_map']); }
elseif ($im_map_info[2] == 3) { $im_map = imagecreatefrompng($misc['image_map']);  }
imagecopyresampled($im, $im_map, $im_map_posx, $im_map_posy, 0, 0, $im_map_width, $im_map_height, $im_map_info[0], $im_map_info[1]);


It needs to go after the line:
$im = imagecreatefrompng("$bgimg");
( those quotes around $bgimg should not be there )
Website
MadMakz
Wed Sep 23 2009, 05:57PM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
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
Website
Rich
Thu Sep 24 2009, 06:39AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

Looking good

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 )


$im = imagecreatefrompng($bgimg);

$im_map_width  = 80;
$im_map_height = 60;
$im_map_posx   = 200;
$im_map_posy   = 10;

$im_map_info = getimagesize($misc['image_map']);
if ($im_map_info[2] == 1) { $im_map = imagecreatefromgif($misc['image_map']);  }
elseif ($im_map_info[2] == 2) { $im_map = imagecreatefromjpeg($misc['image_map']); }
elseif ($im_map_info[2] == 3) { $im_map = imagecreatefrompng($misc['image_map']);  }

$im_icon_info = getimagesize($misc['icon_game']);
if ($im_icon_info[2] == 1) { $im_icon = imagecreatefromgif($misc['icon_game']); }
elseif ($im_icon_info[2] == 3) { $im_icon = imagecreatefrompng($misc['icon_game']); }
imagecopyresampled($im_map, $im_icon, 4, 4, 0, 0, $im_icon_info[0], $im_icon_info[1], $im_icon_info[0], $im_icon_info[1]);

if ($server['s']['password'])
{
  $im_pass_info = getimagesize($misc['image_map_password']);
  $im_pass = imagecreatefromgif($misc['image_map_password']);
  imagecopyresampled($im_map, $im_pass, 0, 0, 0, 0, $im_map_info[0], $im_map_info[1], $im_pass_info[0], $im_pass_info[1]);
}

imagecopyresampled($im, $im_map, $im_map_posx, $im_map_posy, 0, 0, $im_map_width, $im_map_height, $im_map_info[0], $im_map_info[1]);


So you have all the basic components to do whatever design you like.
Website
Shanekiller
Thu Sep 24 2009, 06:55PM
Posts: 53
Joined: Wed Apr 15 2009, 11:56AM
Registered Member #4989
how would i go about getting this to work on joomla?
Website
Rich
Thu Sep 24 2009, 07:07PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

you just stick the files in /components/com_lgsl/

and use the url /components/com_lgsl/lgsl_files/lgsl_image.php?s=1
Website
Shanekiller
Thu Sep 24 2009, 08:42PM
Posts: 53
Joined: Wed Apr 15 2009, 11:56AM
Registered Member #4989
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
Website
Rich
Thu Sep 24 2009, 10:45PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

componet - components

http://www.gaming2gamers.com/components/com_lgsl/lgsl_files/lgsl_image.php?s=1
Website
Shanekiller
Thu Sep 24 2009, 11:11PM
Posts: 53
Joined: Wed Apr 15 2009, 11:56AM
Registered Member #4989
lol how do i change the color of the text it looks diffrent to me
Website
MadMakz
Fri Sep 25 2009, 06:54AM

Posts: 163
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
see line 111 // TEXTCOLOR in lgsl_image.php

also, i forgot to clean up the text location and move them in the "if" statements, will be done in next version

SpiffyTek
Website
svenx
Fri Sep 25 2009, 11:00AM
Posts: 50
Joined: Wed Jul 15 2009, 06:38PM
Registered Member #5247
Just Awsome,!
Website
Go to page       >>   

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org