File: 1.14.1a/server/base/screen.inc.php (View as HTML)

  1: <?php // screen.inc.php -- web page screen library
  2: /* -------------------------------------------------------------
  3: This file is part of FreeNATS
  4: 
  5: FreeNATS is (C) Copyright 2008-2011 PurplePixie Systems
  6: 
  7: FreeNATS is free software: you can redistribute it and/or modify
  8: it under the terms of the GNU General Public License as published by
  9: the Free Software Foundation, either version 3 of the License, or
 10: (at your option) any later version.
 11: 
 12: FreeNATS is distributed in the hope that it will be useful,
 13: but WITHOUT ANY WARRANTY; without even the implied warranty of
 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15: GNU General Public License for more details.
 16: 
 17: You should have received a copy of the GNU General Public License
 18: along with FreeNATS.  If not, see www.gnu.org/licenses
 19: 
 20: For more information see www.purplepixie.org/freenats
 21: -------------------------------------------------------------- */
 22: 
 23: $menu=array();
 24: $menu[0]="<a href=http://www.purplepixie.org/freenats/>".$NATS->Lang->Item("homepage")."</a>";
 25: $menu[1]="<a href=monitor.php>".$NATS->Lang->Item("live.monitor")."</a>&nbsp; &nbsp;<a href=main.php>".$NATS->Lang->Item("configuration")."</a>&nbsp; &nbsp;";
 26: $menu[1].="<a href=http://www.purplepixie.org/freenats/support.php target=top>".$NATS->Lang->Item("help")."</a>&nbsp; &nbsp;<a href=logout.php>".$NATS->Lang->Item("logout")."</a>";
 27: $menu[2]=$menu[1]."&nbsp; &nbsp;<a href=admin.php>Admin</a>";
 28: 
 29: $menu[3]="<a href=iphone.php>".$NATS->Lang->Item("iphone")."</a>&nbsp;  &nbsp;<a href=http://www.purplepixie.org/freenats/>".$NATS->Lang->Item("homepage")."</a>";
 30: /*
 31: $pagemenu['main']="<a href=main.php?mode=overview>Overview</a>&nbsp; &nbsp;<a href=main.php?mode=nodes>Nodes</a>&nbsp; &nbsp;";
 32: $pagemenu['main'].="<a href=main.php?mode=groups>Groups</a>&nbsp; &nbsp;<a href=main.php?mode=views>Views &amp; Reports</a>&nbsp; &nbsp;";
 33: $pagemenu['main'].="<a href=pref.php>User Options</a>";
 34: */
 35: $pagemenu=array();
 36: $pagemenu['main']=array(
 37: 	array("overview","main.php?mode=overview",$NATS->Lang->Item("overview")),
 38: 	array("nodes","main.php?mode=nodes",$NATS->Lang->Item("nodes")),
 39: 	array("groups","main.php?mode=groups",$NATS->Lang->Item("groups")),
 40: 	array("views","main.php?mode=views",$NATS->Lang->Item("views.reports")),
 41: 	array("pref","pref.php?mode=pref",$NATS->Lang->Item("user.options")),
 42: 	array("admin","admin.php",$NATS->Lang->Item("system.settings")) );
 43: 	
 44: function PageMenu($name,$mode="")
 45: {
 46: global $pagemenu;
 47: if (($mode=="")&&isset($_REQUEST['mode'])) $mode=$_REQUEST['mode'];
 48: $out="";
 49: $first=true;
 50: foreach($pagemenu[$name] as $opt)
 51: 	{
 52: 	if ($first) $first=false;
 53: 	else $out.=" ";
 54: 	if ($mode!=$opt[0]) $out.="&nbsp;<a href=".$opt[1].">";
 55: 	else $out.="<b style=\"background-color: #ffffff;\">&nbsp;<a href=\"".$opt[1]."\" style=\"color: black; text-decoration: none;\">";
 56: 	$out.=$opt[2];
 57: 	if ($mode!=$opt[0]) $out.="</a>&nbsp; ";
 58: 	else $out.="</a>&nbsp;</b>";
 59: 	}
 60: return $out;
 61: }
 62: 	
 63: $poplist=array();
 64: 
 65: function Screen_Header($title,$menuindex=0,$alertpane=0,$ah="",$pagemenu="",$pagemenumode="")
 66: {
 67: global $menu,$NATS,$NATS_Session;
 68: if ($NATS->Cfg->Get("site.enable.interactive")!=1)
 69: 	{
 70: 	echo "Sorry but FreeNATS interactive is disabled.<br>";
 71: 	echo "<i>site.enable.interactive</i> != 1<br><br>";
 72: 	echo "To resolve this issue your system administrator needs to set the FreeNATS system variable site.enable.interactive to 1.<br><br>";
 73: 	$NATS->Stop();
 74: 	exit();
 75: 	}
 76: if ($menuindex==1) $alertpane=1; // bodge
 77: 
 78: if ( ($menuindex==1) && ($pagemenu=="main") ) $secCheckFirstrun=true;
 79: else $secCheckFirstrun=false; // KLUDGE
 80: 
 81: //if ($NATS_Session->userlevel>9) $menuindex=2; // further bodge!
 82: echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
 83: echo "<html><head><title>FreeNATS: ".$title."</title>\n";
 84: echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
 85: echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\">\n";
 86: /*
 87: echo "<style type=\"text/css\">\n";
 88: require("css/main.css");
 89: echo "\n</style>\n";
 90: */
 91: if ($ah!="") echo $ah;
 92: echo "<script type=\"text/javascript\" src=\"js/freenats.js\"></script>\n";
 93: echo "</head>\n";
 94: 
 95: echo "<body>";
 96: 
 97: echo "<table class=\"maintitle\" cellspacing=0 cellpadding=0>\n";
 98: echo "<tr><td align=left valign=center class=\"mainleft\">\n";
 99: echo "<b class=\"maintitle\">".$title."</b>";
100: if ($pagemenu!="") echo "<br>&nbsp;&nbsp;<b>".PageMenu($pagemenu,$pagemenumode)."</b>";
101: echo "</td>\n";
102: echo "<td class=\"titlelink\" align=right valign=center>\n";
103: echo $menu[$menuindex];
104: echo "&nbsp;</td></tr>\n";
105: //echo "<tr><td align=left valign=bottom><img src=images/e0e0ff.10px.bl.jpg></td>";
106: //echo "</tr>\n";
107: echo "</table>\n";
108: 
109: if ($secCheckFirstrun && ( $NATS->Cfg->Get("site.firstrun.ignore",0) != 1 ) )
110: 	{
111: 	if (file_exists("firstrun.php"))
112: 		{
113: 		echo "<div class=\"sec_warning\">";
114: 		echo "<b>".$NATS->Lang->Item("sec.firstrun")."</b><br />";
115: 		echo $NATS->Lang->Item("sec.firstrun.text")."<br />";
116: 		echo $NATS->Lang->Item("sec.firstrun.ignore")."<BR />";
117: 		echo "<a href=\"http://www.purplepixie.org/freenats/wiki/Firstrun_Warning\" target=\"top\">http://www.purplepixie.org/freenats/wiki/Firstrun_Warning</a>";
118: 		
119: 		echo "</div>";
120: 		}
121: 	}
122: 
123: 
124: if ($alertpane==1)
125: 	{
126: 	$alerts=$NATS->GetAlerts();
127: 	if (is_array($alerts))
128: 		{
129: 		echo "<div class=\"alertpane\" id=\"fn_alertpane\">";
130: 		echo "<b><u>".$NATS->Lang->Item("nats.alerts")."</u></b><br><br>";
131: 		foreach($alerts as $alert)
132: 			{
133: 			echo "&nbsp;<a href=node.php?nodeid=".$alert['nodeid'].">";
134: 			echo "<b class=\"al".$alert['alertlevel']."\">".$alert['nodeid']."</b></a><br>";
135: 			}
136: 		echo "<br>";
137: 		echo "</div>";
138: 		}
139: 	}
140: 
141: }
142: 
143: function Start_Round($title,$width="")
144: {
145: if ($width!="") $w=" width=".$width;
146: else $w="";
147: echo "<table border=0".$w." cellspacing=0 cellpadding=0>\n";
148: echo "<tr><td valign=top align=left width=11 style=\"background-color: #e0e0ff;\"><img src=images/e0e0ff.10px.tl.jpg></td>\n";
149: echo "<td align=left valign=center style=\"background-color: #e0e0ff;\">\n";
150: echo $title;
151: echo "\n</td><td align=right valign=top style=\"background-color: #e0e0ff;\"><img src=images/e0e0ff.10px.tr.jpg></td></tr>\n";
152: echo "<tr><td colspan=3 style=\"border-left: solid 1px #e0e0ff; border-bottom: solid 1px #e0e0ff; border-right: solid 1px #e0e0ff; padding: 5px;\">\n";
153: }
154: 
155: function End_Round()
156: {
157: echo "\n</td></tr>\n";
158: 
159: echo "</table>";
160: }
161: 
162: function Screen_Footer($track_if_enabled=true)
163: {
164: global $NATS,$poplist;
165: echo "<br><br>\n";
166: //$NATS->Cfg->DumpToScreen();
167: echo "<div class=\"nfooter\">";
168: echo "<div class=\"bl\"><div class=\"br\"><div class=\"tl\"><div class=\"tr\">";
169: 
170: echo "<div align=\"left\" class=\"nfootleft\"><a href=http://www.purplepixie.org/freenats/>FreeNATS</a>; &copy; ".$NATS->Lang->Item("copyright")." 2008-2011 ";
171: echo "<a href=http://www.purplepixie.org/>PurplePixie Systems</a>";
172: echo "</div><div class=\"nfootright\">";
173: echo $NATS->Lang->Item("version").": ".$NATS->Version;
174: if ($NATS->Release!="") echo "/".$NATS->Release;
175: echo "&nbsp;&nbsp;</div>";
176: 
177: //echo "Hello";
178: echo "</div></div></div></div>";
179: echo "</div>";
180: if (ini_get("freenats.rpath")==1)
181: 	{
182: 	echo "<i>FreeNATS Virtual Server Powered By <a href=http://www.rpath.org/>rPath</a> LAMP Appliance</i><br>";
183: 	}
184: //echo "<i>This is alpha-test software - we would very much value your ";
185: //echo "<a href=http://www.purplepixie.org/freenats/feedback.php>feedback</a></i><br>";
186: 
187: $autofeedback=false;
188: if ($track_if_enabled)
189: 	{
190: 	$t=$NATS->Cfg->Get("freenats.tracker");
191: 	if ( ($t!="") && ($t>0) )
192: 		{
193: 		$autofeedback=true;
194: 		$usid=$NATS->Cfg->Get("freenats.tracker.usid","");
195: 		if ($usid=="")
196: 			{ // generate usid if not already set
197: 			// usid form XYZ-XYZ-XYZ...
198: 			$allow="abcdef0123456789";
199: 			$allow_len=strlen($allow);
200: 			mt_srand(microtime()*1000000);
201: 			$first_set=1;
202: 			for ($a=0; $a<5; $a++) // blocks
203: 				{
204: 				if ($first_set==1) $first_set=0;
205: 				else $usid.="-";
206: 				for ($b=0; $b<10; $b++)
207: 					{
208: 					$c=mt_rand(0,$allow_len-1);
209: 					$usid.=$allow[$c];
210: 					}
211: 				}
212: 			$NATS->Cfg->Set("freenats.tracker.usid",$usid);
213: 			}
214: 			
215: 		// get some more data
216: 		$sn=explode("/",$_SERVER['SCRIPT_NAME']);
217: 		$script=$sn[count($sn)-1];
218: 		
219: 		// show tracking image
220: 		echo "<img src=\"http://www.purplepixie.org/freenats/report/ping.png.php?data=v=".$NATS->Version."+p=".$script."&type=ping&usid=".$usid."\" width=1 height=1>\n";
221: 		}
222: 	}
223: 
224: //$NATS->PageError("fish","swim in the sea");
225: //$NATS->PageError("dogs","walk on the land");
226: //$autofeedback=true;
227: 
228: if (count($NATS->PageErrors)>0) // page errors reported
229: 	{
230: 	echo "<div class=\"page_error\">\n";
231: 	echo "Errors detected on page: ";
232: 	$url="";
233: 	$counter=0;
234: 	foreach($NATS->PageErrors as $PageError)
235: 		{
236: 		if ($counter>0) $url.="&";
237: 		$url.="code[".$counter."]=".urlencode($PageError['code'])."&desc[".$counter."]=".urlencode($PageError['desc']);
238: 		$counter++;
239: 		}
240: 	$url.="&ver=".$NATS->Version;
241: 		
242: 	echo "<script type=\"text/javascript\">\n";
243: 	echo "function report_error()\n";
244: 	echo "{\n";
245: 	echo "document.getElementById('error_report_result').innerHTML = 'Reporting Now...';\n";
246: 	echo "var s = document.createElement(\"script\");\n";
247: 	echo "s.src = \"http://www.purplepixie.org/freenats/report/error.php?".$url."\";\n";
248: 	echo "document.body.appendChild(s);\n";
249: 	echo "}\n";
250: 	echo "</script>";
251: 		
252: 	echo "<span id=\"error_report_result\">";
253: 	if ($autofeedback)
254: 		{
255: 		echo "Reporting...";
256: 		}
257: 	else
258: 		{
259: 		echo "<a href=\"javascript:report_error();\">Click to report to PurplePixie</a> | ";
260: 		//echo "<a href=\"javascript:displayToggle('error_detail');\">Click to show/hide details</a>";
261: 		}
262: 	echo "</span>&nbsp; ";
263: 	echo "<a href=\"javascript:displayToggle('error_detail');\">Click to show/hide details</a>";
264: 	echo "<div id=\"error_detail\" style=\"display: none;\">\n";
265: 	foreach($NATS->PageErrors as $PageError)
266: 		{
267: 		echo "# ".$PageError['code']." : ".$PageError['desc']."<BR />\n";
268: 		}
269: 	echo "</div>";
270: 	echo "</div>\n";
271: 	
272: 	if ($autofeedback)
273: 		{
274: 		//echo "<script src=\"http://www.purplepixie.org/freenats/report/error.php?".$url."\" type=\"text/javascript\"></script>\n";
275: 		echo "<script type=\"text/javascript\">\n";
276: 		echo "report_error();\n";
277: 		echo "</script>\n";
278: 		}
279: 		
280: 	}
281: 		
282: if ($NATS->Cfg->Get("site.popupmessage")=="1")
283: 	{
284: 	if (count($poplist)>0)
285: 		{
286: 		echo "\n<script type=\"text/javascript\">\n";
287: 		
288: 		foreach($poplist as $pop)
289: 			{
290: 			echo "alert('".$pop."');\n";
291: 			}
292: 			
293: 		echo "</script>\n";
294: 		}
295: 	}
296: echo "\n</body></html>\n";
297: }
298: 
299: function UL_Error($task="")
300: {
301: global $NATS;
302: Screen_Header($NATS->Lang->Item("access.error"));
303: echo "<br>".$NATS->Lang->Item("access.error.detail")." (".$task.").<br><br>";
304: echo "<a href=main.php>".$NATS->Lang->Item("click.continue")."</a><br><br>";
305: Screen_Footer();
306: exit();
307: }
308: 
309: function Session_Error()
310: {
311: global $REQUEST_URI;
312: header("Location: ./?login_msg=Invalid+or+Expired+Session&url=".urlencode($REQUEST_URI));
313: exit();
314: }
315: 
316: function nicedt($ts)
317: {
318: global $NATS;
319: $form="H:i:s d/m/Y";
320: if (isset($NATS)) $form=$NATS->Cfg->Get("site.dtformat","H:i:s d/m/Y");
321: if ($ts<=0) return $NATS->Lang->Item("never");
322: return date($form,$ts);
323: }
324: 
325: function enicedt($ts)
326: {
327: echo nicedt($ts);
328: }
329: 
330: function nicediff($diff)
331: {
332: $hr=0;
333: $mn=0;
334: $se=0;
335: if ($diff>59)
336: 	{
337: 	$mn=round($diff/60,0);
338: 	$se=$diff%60;
339: 	if ($mn>59)
340: 		{
341: 		$hr=round($mn/60,0);
342: 		$mn=$mn%60;
343: 		}
344: 	}
345: else $se=$diff;
346: $s="";
347: if ($hr<10) $s="0";
348: $s.=$hr.":";
349: if ($mn<10) $s.="0";
350: $s.=$mn.":";
351: if ($se<10) $s.="0";
352: $s.=$se;
353: return $s;
354: }
355: 
356: function dtago($ts,$sayago=true)
357: {
358: global $NATS;
359: if ($ts<=0) return $NATS->Lang->Item("never");
360: $now=time();
361: $diff=$now-$ts;
362: $s=nicediff($diff);
363: if ($sayago) $s.=" ".$NATS->Lang->Item("ago");
364: return $s;
365: }
366: 
367: function nicenextx($nextx)
368: {
369: if ($nextx<=0) return "Now";
370: $diff=$nextx-time();
371: if ($diff<0)
372: 	{
373: 	$sign=" ago";
374: 	$diff=0-$diff;
375: 	}
376: else $sign="";
377: return nicediff($diff).$sign;
378: }
379: 
380: function edtago($ts)
381: {
382: echo dtago($ts);
383: }
384: 
385: function smartx($x) // smart handling of unixtime x variables
386: {
387: if ($x==0) return time();	// 0 = now
388: else if ($x<0)				// -z = now - z seconds
389: 	return (time()+$x);		// negative number so +
390: else						// positive number so is a unixtime
391: 	return $x;
392: }
393: 
394: $allowed="00123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@_-.,:&/~%=+(){}[]#?$";
395: 
396: function nices($s)
397: {
398: global $allowed;
399: $o="";
400: for ($a=0; $a<strlen($s); $a++)
401: 	{
402: 	$c=$s[$a];
403: 	if (strpos($allowed,$c)===false)
404: 		{
405: 		// skip it
406: 		}
407: 	else $o.=$c;
408: 	}
409: return $o;
410: }
411: /* // Old Static List Function
412: function ShowIcons()
413: {
414: global $fnIcons,$fnIcon_DefNode,$fnIcon_DefGroup;
415: $c=0;
416: echo "<table border=0>";
417: $cc=0;
418: for ($a=0; $a<count($fnIcons); $a++)
419: 	{
420: 	if ($cc==0) echo "<tr>";
421: 	echo "<td valign=top align=center><img src=icons/".$fnIcons[$a]."><br>".$fnIcons[$a]."<br>";
422: 	if ($a==$fnIcon_DefNode) echo "<i>Node Default</i> ";
423: 	if ($a==$fnIcon_DefGroup) echo "<i>Group Default</i>";
424: 	echo "</td>";
425: 	$cc++;
426: 	if ($cc>=5)
427: 		{
428: 		echo "</tr>";
429: 		$cc=0;
430: 		}
431: 	}
432: if ($cc>0) echo "</tr>";
433: echo "</table>";
434: }
435: */
436: 
437: function GetIcons()
438: {
439: $iconFiles=glob("icons/{*.gif,*.GIF,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png,*.PNG}", GLOB_BRACE);
440: for($a=0;$a<count($iconFiles);$a++)
441: 	$iconFiles[$a]=substr($iconFiles[$a],6);
442: return $iconFiles;
443: }
444: 
445: 
446: function ShowIcons()
447: {
448: global $fnIcons,$fnIcon_DefNode,$fnIcon_DefGroup,$NATS;
449: $c=0;
450: echo "<table border=0>";
451: $cc=0;
452: $iconFiles=GetIcons();
453: for ($a=0; $a<count($iconFiles); $a++)
454: 	{
455: 	$icon=$iconFiles[$a];
456: 	if ($cc==0) echo "<tr>";
457: 	echo "<td valign=top align=center><img src=icons/".$icon."><br>".$icon."<br>";
458: 	if ($icon==$fnIcons[$fnIcon_DefNode]) echo "<i>".$NATS->Lang->Item("node.default")."</i> ";
459: 	if ($a==$fnIcons[$fnIcon_DefGroup]) echo "<i>".$NATS->Lang->Item("group.default")."</i>";
460: 	echo "</td>";
461: 	$cc++;
462: 	if ($cc>=5)
463: 		{
464: 		echo "</tr>";
465: 		$cc=0;
466: 		}
467: 	}
468: if ($cc>0) echo "</tr>";
469: echo "</table>";
470: }
471: 
472: 
473: 
474: function NodeIcon($nodeid)
475: {
476: global $NATS,$fnIcons,$fnIcon_DefNode;
477: $q="SELECT nodeicon FROM fnnode WHERE nodeid=\"".ss($nodeid)."\"";
478: $r=$NATS->DB->Query($q);
479: if ($row=$NATS->DB->Fetch_Array($r)) 
480: 	{
481: 	if ($row['nodeicon']!="") return $row['nodeicon'];
482: 	}
483: return $fnIcons[$fnIcon_DefNode];
484: }
485: 
486: function GroupIcon($groupid)
487: {
488: global $NATS,$fnIcons,$fnIcon_DefGroup;
489: $q="SELECT groupicon FROM fngroup WHERE groupid=\"".ss($groupid)."\"";
490: $r=$NATS->DB->Query($q);
491: if ($row=$NATS->DB->Fetch_Array($r)) 
492: 	{
493: 	if ($row['groupicon']!="") return $row['groupicon'];
494: 	}
495: return $fnIcons[$fnIcon_DefGroup];
496: }
497: 
498: function np_tiny($nodeid,$text=true,$nodename="",$jslink=false)
499: {
500: global $NATS;
501: $al=$NATS->NodeAlertLevel($nodeid);
502: echo "<table class=\"nptiny-al".$al."\">";
503: echo "<tr><td valign=center align=center>";
504: if ($jslink) echo "<a href=\"javascript:nodeClick('".$nodeid."');\">";
505: else echo "<a href=node.php?nodeid=".$nodeid.">";
506: echo "<img src=\"icons/".NodeIcon($nodeid)."\" border=0>";
507: echo "</a>";
508: if ($text)
509: 	{
510: 	if ($nodename=="") $nodename=$nodeid;
511: 	
512: 	//$words=explode(" ",$nodename);
513: 	
514: 	// messy but there you go...
515: 	
516: 	$max_on_line=7;
517: 	$max_lines=2;
518: 	$len=strlen($nodename);
519: 	$out="";
520: 	$linecount=0;
521: 	$charcount=0;
522: 	for ($a=0; $a<$len; $a++)
523: 		{
524: 			
525: 		$char=$nodename[$a];
526: 		
527: 		if ($char==" ")
528: 			{
529: 			$linecount++;
530: 			$charcount=0;
531: 			}
532: 		else $charcount++;
533: 		
534: 		if ($charcount>=$max_on_line) 
535: 			{
536: 			$a=$len+10;
537: 			$out.="..";
538: 			}
539: 		else if ($linecount>=$max_lines) 
540: 			{
541: 			$a=$len+10;
542: 			$out.="..";
543: 			}
544: 		else $out.=$char;
545: 		
546: 		}
547: 	//if ($a==($len+10)) $out.="..";
548: 	$nodename=$out;
549: 	
550: 	$size=10;
551: 		
552: /* -- size-based	
553: 	$len=strlen($nodename);
554: 	if ($len<9) $size=10;
555: 	else if ($len<15) $size=8;
556: 	else if ($len<20) $size=7;
557: 	else
558: 		{
559: 		$size=6;
560: 		$nodename=substr($nodename,0,18)."..";
561: 		}
562: */
563: 	
564: 	echo "<br><b class=\"al".$al."\" style=\"font-size: ".$size."pt;\">".$nodename."</b>";
565: 	}
566: echo "</td></tr></table>";
567: }
568: 
569: function ng_tiny($groupid,$groupname="",$text=true)
570: {
571: global $NATS;
572: // to do - get groupname if not sent but F--- it for now
573: $al=$NATS->GroupAlertLevel($groupid);
574: echo "<table class=\"nptiny-al".$al."\">";
575: echo "<tr><td valign=center align=center>";
576: echo "<a href=group.php?groupid=".$groupid.">";
577: echo "<img src=\"icons/".GroupIcon($groupid)."\" border=0>";
578: echo "</a>";
579: if ($text)
580: 	{
581: 	echo "<br><b class=\"al".$al."\">".$groupname."</b>";
582: 	}
583: echo "</td></tr></table>";
584: }
585: 
586: function ng_big($groupid,$groupname="",$groupdesc="",$groupicon="")
587: {
588: global $NATS;
589: if ($groupicon=="") $groupicon=GroupIcon($groupid);
590: $al=$NATS->GroupAlertLevel($groupid);
591: echo "<table class=\"npbig-al".$al."\">";
592: echo "<tr><td align=left valign=top>";
593: echo "<table class=\"nicetable\" width=300>";
594: echo "<tr><td align=right>".$NATS->Lang->Item("group.name")." :";
595: echo "</td><td align=left><a href=group.php?groupid=".$groupid.">".$groupname."</a></td></tr>";
596: echo "<tr><td align=right>".$NATS->Lang->Item("description")." :";
597: echo "</td><td align=left>".$groupdesc."</td></tr>";
598: echo "<tr><td align=right>".$NATS->Lang->Item("status")."</td><td align=left>";
599: echo "<b class=\"al".$al."\">".oText($al)."</b></td></tr>";
600: echo "</table></td>";
601: //echo "<td align=left valign=top align=right width=60>";
602: //echo "<img src=icons/".GroupIcon($groupid).">";
603: //echo "</td>";
604: echo "</tr>";
605: echo "</table>";
606: }
607: 
608: function np_big($nodeid,$nodename="",$nodedesc="",$nodeicon="",$jslink=false)
609: {
610: global $NATS;
611: if ($nodedesc=="") $nodedesc="&nbsp;";
612: if ($nodeicon=="") $nodeicon=NodeIcon($nodeid);
613: $al=$NATS->NodeAlertLevel($nodeid);
614: echo "<table class=\"npbig-al".$al."\">";
615: echo "<tr><td align=left valign=top>";
616: echo "<table class=\"nicetable\" width=300>";
617: echo "<tr><td align=right>".$NATS->Lang->Item("node.name")." :";
618: if ($nodename=="") $nodename=$nodeid;
619: echo "</td><td align=left>";
620: if ($jslink) echo "<a href=\"javascript:nodeClick('".$nodeid."');\">";
621: else echo "<a href=node.php?nodeid=".$nodeid.">";
622: echo $nodename."</a></td></tr>";
623: echo "<tr><td align=right>".$NATS->Lang->Item("description")." :";
624: echo "</td><td align=left>".$nodedesc."</td></tr>";
625: echo "<tr><td align=right>".$NATS->Lang->item("status")." :</td><td align=left>";
626: echo "<b class=\"al".$al."\">".oText($al)."</b></td></tr>";
627: echo "</table></td>";
628: //echo "<td align=left valign=top align=right width=60>";
629: //echo "<img src=icons/".GroupIcon($groupid).">";
630: //echo "</td>";
631: echo "</tr>";
632: echo "</table>";
633: }
634: 
635: function GetAbsolute($filename="")
636: { // sooooooooo messy but looks like the ONLY FRICKIN' WAY!
637: if ((isset($_SERVER['HTTPS']))&&($_SERVER['HTTPS']!="")) $uri="https://";
638: else $uri="http://";
639: $uri.=$_SERVER['HTTP_HOST'];
640: $uri.=$_SERVER['REQUEST_URI'];
641: $pos=strripos($uri,"/");
642: $rdir=substr($uri,0,$pos+1);
643: return $rdir.$filename;
644: }
645: 
646: 
647: ?>
648: