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

Guests: 17

106.2.x.x news
112.101.x.x comment
112.111.x.x forum
157.56.x.x forum
157.56.x.x news
173.199.x.x forum
175.44.x.x forum
180.76.x.x forum
180.76.x.x forum
185.19.x.x forum
220.250.x.x forum
36.251.x.x forum
50.17.x.x forum
58.22.x.x forum
58.22.x.x forum
66.249.x.x forum
66.249.x.x forum

Last Seen

Rich Sat 10:11
mkden Sat 09:40
Wussie Sat 09:40
Ap1962 Sat 06:52
Jack win Sat 06:16

Newest Members

Forums
icon instead of the online / offline
sanken
Thu Dec 09 2010, 04:44PM
Posts: 10
Joined: Thu Dec 09 2010, 04:39PM
Registered Member #6450
Please help with a problem as the topic

online.png = Online
offline.png = Offline
only lgsl_image.php
What to edit, what to improve.
sorry my google translator
something like a game tracker
MadMakz
Fri Dec 10 2010, 11:25AM

Posts: 154
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
Somewhere in
// DEFINE CREATE IMAGE FROM IMAGE SOURCE

but after
$im = imagecreatefrompng($bgimg);

add
// STATUS
$im_status_img = "path/to/green.png";
if ($pending)  { $im_status_img = "path/to/orange.png"; }
if (!$status)  { $im_status_img = "path/to/red.png"; }
$im_status_info = getimagesize($im_status_img);
if ($im_status_info[2] == 1) { $im_status = imagecreatefromgif($im_status_img);  }
if ($im_status_info[2] == 2) { $im_status = imagecreatefromjpeg($im_status_img); }
if ($im_status_info[2] == 3) { $im_status = imagecreatefrompng($im_status_img);  }


Then extend the types in
// LOCATIONS/TYPES

with
imagecopyresampled($im, $im_status, <where x>, <where y>, 0, 0, <width>, <height>, $im_status_info[0], $im_status_info[1]);


Make sure you set/replace "path/to/???.png" to point to a valid imagesources (gif, jpg, png) and <where x>, <where y> and (desired) <width>, <height> beeing set with correct locations/dimensions.

I haven't tested the code but it follows the sheme how things are done in DSi v1.3 so it should work.
Proper feature will be in v1.4.

Regards

Makz

SpiffyTek
Website
sanken
Fri Dec 10 2010, 01:32PM
Posts: 10
Joined: Thu Dec 09 2010, 04:39PM
Registered Member #6450
only red...

look
MadMakz
Fri Dec 10 2010, 04:44PM

Posts: 154
Joined: Wed Sep 24 2008, 07:46AM
Registered Member #4406
sanken wrote ...

only red...

look


seems $pending and $status are only declared inside a function, somehow i thought it was a global. my mistake, sorry :S
guess we'd need to use $server["b"]["status"] then.

will fix it by tomorrow, it's 22:40 here and i'm chillin.

SpiffyTek
Website
sanken
Sat Dec 11 2010, 10:21AM
Posts: 10
Joined: Thu Dec 09 2010, 04:39PM
Registered Member #6450
ok wait.
sanken
Sun Dec 12 2010, 03:27PM
Posts: 10
Joined: Thu Dec 09 2010, 04:39PM
Registered Member #6450
PLZ Help ME!!
sanken
Wed Dec 15 2010, 08:53AM
Posts: 10
Joined: Thu Dec 09 2010, 04:39PM
Registered Member #6450
No one will help me?
sanken
Tue Jan 04 2011, 08:40AM
Posts: 10
Joined: Thu Dec 09 2010, 04:39PM
Registered Member #6450
I fixed the problem
Somewhere in
// GET THE REQUIRED VARIABLES FROM LGSL
but after
// GET THE REQUIRED VARIABLES FROM LGSL
// Rename status "NO RESPONSE" into "OFFLINE"
if ($misc['text_status']=="NO RESPONSE"){
$misc['text_status'] = "Offline";
}

add
if ($misc['text_status'] == Online){
$stats = imagecreatefromgif('image/online.gif');
}else{
$stats = imagecreatefromgif('image/offline.gif');
}



Then extend the types in
// LOCATIONS/TYPES

with
imagecopy($im, $stats, <where x>, <where y>, 0, 0, <width>, <height>);

Have Fun
KIKOFF
Tue Jan 04 2011, 04:06PM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
Hi sanken, many thanks for this point .
For me work so:

if ($misc['text_status']=="NO RESPONSE"){
  $misc['text_status'] = "Offline";
}else{$misc['text_status'] = "Online";}
if ($misc['text_status'] == Online){
$stats = imagecreatefrompng('image/online.png');
}else{
$stats = imagecreatefrompng('image/offline.png');
}


Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
 

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