Joined: 18 Jun 2006 Posts: 1110 Location: Kiel (54.4247,10.1721)
Posted: Wed Oct 25, 2006 9:34 Post subject: DD-WRT Uptime in Signature Image
Hi Folks,
since I've been asked about my signature including the uptime from some dd-wrt nodes I am now publishing the striped down rubbish code I hacked in 20min just to give php-newbies a starting point.
The script is <40 lines, no comments and whatnot, check out php.net to get more information.
To use this script you need a php (gd enabled) capaple webserver that can reach the dd-wrt nodes and the info sites enabled.
Please replace AAA.BBB.CCC.DDD and EEE.FFF.GGG.HHH with the IPs of you devices, delete last two $wrt54g_data lines or add more if you have fewer/more devices you whish to monitor.
I know that I left out the different colors and whatnot but thats something you can add yourself... This ist just to get a grip...
To add comments go to the firs line and add $output[] = "My deviced:"; for top info or somewhere near $font = 2; for bottom notes...
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Wed Oct 25, 2006 13:39 Post subject:
Also make sure you have Info Site-page set to enabled
Nice piece of code btw. _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Wed Aug 22, 2007 2:32 Post subject:
hello
i already hosted the php script you have on the forum
its hosted here http://moreins.hyperphp.com/dd-wrt-sig/
im having trouble getting the png image. my router has the infosite enabled and is visible from the outside (you can check it out here: http://andresm.dnsalias.com)
i would really appreciate if you can help me out with this. it would be awesome if i get it to work.
here is the code im using. it the same exact one that you posted on the forum.
i would really appreciate if you give me any clue of why its not working the php script...im sooo frustrated right now...
im having problems with this, one is i dont know what variables dd-wrt gives off, and theres something wrong with the code
Code:
$splitted = split(', load',$splitted[1]);
something is wrong there, the split is suppose to start a new line if it stretches too far as im guessing, that line never shows, also theres no memory variable, im wondering how to do it like this guy
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Sun Apr 27, 2008 1:16 Post subject:
jbarbieri, i have tried your code and works great.
the thing is that, in order to access the image, i need to type the php file. i was wondering on how can i access the image by going to the png or gif file.
in my ftp server, i created a folder called router. inside of it, there is only one file (sig.php). and i can access by typing this
http://moreins.x10hosting.com/router/sig.php
Joined: 06 Apr 2007 Posts: 545 Location: New Hampshire
Posted: Mon Apr 28, 2008 12:37 Post subject:
I just renamed the php file to png....and added a .htaccess file in the directory:
Code:
Options +All
AddType application/x-httpd-php gif
Or for PNG:
Code:
Options +All
AddType application/x-httpd-php png
This tells apache to treat gif files as php files, so it executes...the only downside, any gif file in that directory will try to execute as php.....so make sure you dont have any others, or just put the gif/png file in a directory on its own. _________________
Linksys EA6500v2 | 5GHz 1st Floor AP | Advanced Tomato 1.28.0000 -2.9-131 K26ARM USB AIO-64K
Netgear WNR2000v3 | 2nd Floor AP | DD-WRT v3.0-r27805 std
ur at the wrong place
go here http://moreins.x10hosting.com/router/
thats were i have the actual files and where im having the issue. (the ones i showed you in the screenshots)
this is what i get when i try to access the png file (http://moreins.x10hosting.com/router/sig.png)
php code has always worked. but only if i access it as a php. i want to have a png or gif image i could access.
hope u can help me _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod
Joined: 18 Nov 2006 Posts: 320 Location: Cali, Colombia
Posted: Mon Apr 28, 2008 20:08 Post subject:
jbarbieri wrote:
just try changing it to a .gif and change the .htaccess too.
i already did that in order to try if gif would work.
no luck at all
do i need to have both php and png files in the same folder? _________________ WRT54GS v2.1 > v24-sp2 (01/01/09) mega
WRT54GS v5 > v24-sp2 (01/01/09) micro
PPTP, WDS link and SD Mod