\n"; print " \n"; weathermap_fullview(TRUE); weathermap_versionbox(); include_once($config["base_path"]."/include/bottom_footer.php"); break; case 'viewmap': include_once($config["base_path"]."/include/top_graph_header.php"); print "
\n"; print " \n"; if( isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ) { weathermap_singleview($_REQUEST['id']); } weathermap_versionbox(); include_once($config["base_path"]."/include/bottom_footer.php"); break; default: include_once($config["base_path"]."/include/top_graph_header.php"); print "
\n"; print " \n"; if(read_config_option("weathermap_pagestyle") == 0) { weathermap_thumbview(); } if(read_config_option("weathermap_pagestyle") == 1) { weathermap_fullview(); } weathermap_versionbox(); include_once($config["base_path"]."/include/bottom_footer.php"); break; } function weathermap_cycleview() { } function weathermap_singleview($mapid) { global $colors; $outdir = dirname(__FILE__).'/output/'; $confdir = dirname(__FILE__).'/configs/'; // $map = db_fetch_assoc("select * from weathermap_maps where id=".$mapid); $map = db_fetch_assoc("select weathermap_maps.* from weathermap_auth,weathermap_maps where weathermap_maps.id=weathermap_auth.mapid and active='on' and (userid=".$_SESSION["sess_user_id"]." or userid=0) and weathermap_maps.id=".$mapid); if(sizeof($map)) { $htmlfile = $outdir."weathermap_".$map[0]['id'].".html"; $maptitle = $map[0]['titlecache']; if($maptitle == '') $maptitle= "Map for config file: ".$map[0]['configfile']; html_graph_start_box(1,true); ?> ">

".$maptitle."

"; print ""; if(file_exists($htmlfile)) { include($htmlfile); } else { print "
This map hasn't been created yet."; global $config, $user_auth_realms, $user_auth_realm_filenames; $realm_id2 = 0; if (isset($user_auth_realm_filenames[basename('weathermap-cacti-plugin.php')])) { $realm_id2 = $user_auth_realm_filenames[basename('weathermap-cacti-plugin.php')]; } if ((db_fetch_assoc("select user_auth_realm.realm_id from user_auth_realm where user_auth_realm.us er_id='" . $_SESSION["sess_user_id"] . "' and user_auth_realm.realm_id='$realm_id2'")) || (empty($realm_id2))) { print " (If this message stays here for more than one poller cycle, then check your cacti.log file for errors!)"; } print "
"; } print ""; html_graph_end_box(); } } function weathermap_show_manage_tab() { global $config, $user_auth_realms, $user_auth_realm_filenames; $realm_id2 = 0; if (isset($user_auth_realm_filenames['weathermap-cacti-plugin-mgmt.php'])) { $realm_id2 = $user_auth_realm_filenames['weathermap-cacti-plugin-mgmt.php']; } if ((db_fetch_assoc("select user_auth_realm.realm_id from user_auth_realm where user_auth_realm.user_id='" . $_SESSION["sess_user_id"] . "' and user_auth_realm.realm_id='$realm_id2'")) || (empty($realm_id2))) { print 'Manage Maps'; } } function weathermap_thumbview() { global $colors; $maplist = db_fetch_assoc( "select distinct weathermap_maps.* from weathermap_auth,weathermap_maps where weathermap_maps.id=weathermap_auth.mapid and active='on' and (userid=".$_SESSION["sess_user_id"]." or userid=0) order by sortorder, id"); if(sizeof($maplist) == 1) { $pagetitle = "Network Weathermap"; weathermap_fullview(); } else { $pagetitle = "Network Weathermaps"; html_graph_start_box(2,true); ?> ">
automatically cycle between full-size maps)
Click on thumbnails for a full view (or you can automatically cycle between full-size maps) 0) { $outdir = dirname(__FILE__).'/output/'; $confdir = dirname(__FILE__).'/configs/'; $imageformat = strtolower(read_config_option("weathermap_output_format")); html_graph_start_box(1,true); print ""; foreach ($maplist as $map) { $i++; $thumbfile = $outdir."weathermap_thumb_".$map['id'].".".$imageformat; $thumburl = "output/weathermap_thumb_".$map['id'].".".$imageformat; $maptitle = $map['titlecache']; if($maptitle == '') $maptitle= "Map for config file: ".$map['configfile']; print '
'; if(file_exists($thumbfile)) { print '
'.$maptitle.'
'.$maptitle.''; } else { print "(thumbnail for map ".$map['id']." not created yet)"; } print '
'; } print ""; html_graph_end_box(); } else { print "
You Have No Maps
\n"; } } } function weathermap_fullview($cycle=FALSE) { global $colors; $_SESSION['custom']=false; $maplist = db_fetch_assoc( "select distinct weathermap_maps.* from weathermap_auth,weathermap_maps where weathermap_maps.id=weathermap_auth.mapid and active='on' and (userid=".$_SESSION["sess_user_id"]." or userid=0) order by sortorder, id"); html_graph_start_box(2,true); if(sizeof($maplist) == 1) { $pagetitle = "Network Weathermap"; } else { $pagetitle = "Network Weathermaps"; } ?> ">
automatically cycle between full-size maps) Cycling all available maps. Stop.
0) { $outdir = dirname(__FILE__).'/output/'; $confdir = dirname(__FILE__).'/configs/'; foreach ($maplist as $map) { $i++; $htmlfile = $outdir."weathermap_".$map['id'].".html"; $maptitle = $map['titlecache']; if($maptitle == '') $maptitle= "Map for config file: ".$map['configfile']; print '
'; html_graph_start_box(1,true); ?> ">
This map hasn't been created yet.
"; } print ''; html_graph_end_box(); print ''; } if($cycle) { $refreshtime = read_config_option("weathermap_cycle_refresh"); // OK, so the Cycle plugin does all this with a tag at the bottom of the body // that overrides the one at the top (that Cacti puts there). Unfortunately, that // isn't valid HTML! So here's a Javascript driven way to do it // It has the advantage that the image switching is cleaner, too. // We also do a nice thing of taking the poller-period (5 mins), and the // available maps, and making sure each one gets equal time in the 5 minute period. ?> You Have No Maps\n"; } } function weathermap_versionbox() { global $WEATHERMAP_VERSION, $colors; ; $pagefoot = "Powered by PHP Weathermap version $WEATHERMAP_VERSION"; html_graph_start_box(1,true); ?> ">
WebSVN - weathermap - Blame - Rev 34 - /weathermap-cacti-plugin.php
  jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [weathermap-cacti-plugin.php] - Blame information for rev 34

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1