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