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