PHP in overlib

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
gustavhelgi
Posts: 16
Joined: Thu Nov 13, 2008 10:43 am

PHP in overlib

Post by gustavhelgi »

Hi guys,

I´m trying to have a php page shown in hover which will give more information about the device.

I´ve seen that Howie as mentioned that you must use an image in OVERLIBGRAPH. However if you look at "Show off your Weathermap" the user tbaror shows off his weathermap were his hover shows Open-AudIT and SB eventlog.

So i´m wondering is this possible ?

Regards,

Gustav
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

OVERLIBGRAPH must be an image, but there is also NOTES that can be any text. It can't be PHP code though - I would guess the other person has something that slots new text into the map config, or uses an iframe tag to embed it.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
gustavhelgi
Posts: 16
Joined: Thu Nov 13, 2008 10:43 am

Post by gustavhelgi »

Hi.

And thanks for the info.

I´ve now gotten iframeoverlib to work so that i can overlib a php page. However how would i go about adding for example a new variable in the configuration f.ex

NODE Test
OverlibPage nwm-hover.php?ip=10.10.10.10 $WIDHT $HEIGHT





It would be identical to OverlibGraph but insted of setting:

onmouseover="return overlib('<img src=htt
p://url.to/image.png>',DELAY,250,CAPTION,'node');"

We would do :
onmouseover="return overlib(OLiframeContent('nwm-hover.php?ip=10.10.10.10', $WIDHT, $HEIGHT, 'if2', 1, 'auto'),
WIDTH,$WIDHT, TEXTPADDING,0, BORDER,2, STICKY,DRAGGABLE,CLOSECLICK,CAPTIONPADDING,4, CAPTION,'Example with iframe', MIDX,0, MIDY,90, STATUS,'Example with iframe content, a capt
ion and a Close link');"

And then add staticly to the top:

<script type="text/javascript" src="overlibmws.js"></script>
<script type="text/javascript" src="overlibmws_draggable.js"></script>
<script type="text/javascript" src="overlibmws_filter.js"></script>
<script type="text/javascript" src="overlibmws_overtwo.js"></script>
<script type="text/javascript" src="overlibmws_scroll.js"></script>
<script type="text/javascript" src="overlibmws_shadow.js"></script>
<script type="text/javascript" src="iframecontentmws.js"></script>



Would it be a lot of hassle ? Do you have any pointers..as in were it is implemented ? Or is there a better solution ?
gustavhelgi
Posts: 16
Joined: Thu Nov 13, 2008 10:43 am

Post by gustavhelgi »

Hi,

any one have any ideas about this ?
Elian
Posts: 5
Joined: Fri Feb 12, 2010 3:50 pm

Post by Elian »

I'm doing some tricky thing to do that. Its like an overlib injection :)

Check my weathermap configuration:

NODE node02128
LABEL TEST
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=18
OVERLIBCAPTION Test Caption',STICKY,CLOSECLICK,DRAGGABLE,ALTCUT,'
NOTES <iframe width=\"700px\" height=\"650px\" src=\"test.php?local_graph_id=60\"></iframe>
OVERLIBGRAPH
POSITION 400 150

You also have to load overlib_draggable.js into weathermap-cacti-plugin.php.

Elian.
robertoakira1
Posts: 4
Joined: Wed May 11, 2011 7:17 am

Re: PHP in overlib

Post by robertoakira1 »

Hi Elian,

Can you explain how you added the "overlib_draggable.js" in weathermap-cacti-plugin.php? This configuration is working for you?

Can you help me?

Thanks.
Elian
Posts: 5
Joined: Fri Feb 12, 2010 3:50 pm

Re: PHP in overlib

Post by Elian »

Sorry for the late response.

Yes, is working for me. You have to add in Line 109:

Code: Select all

 print "<script type=\"text/javascript\" src=\"overlib.js\"><!-- overLIB (c) Erik Bosrup --></script> \n";
print "<script type=\"text/javascript\" src=\"overlib_draggable.js\"><!-- overLIB (c) Erik Bosrup --></script> \n"; 
Let me know if you need help.

Elian.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests