Browse Source

php - LQ iDevice menus

master
kanoi 10 years ago
parent
commit
4f0c7795fe
  1. 53
      pool/page.php
  2. 6
      pool/prime.php

53
pool/page.php

@ -84,6 +84,8 @@ function pghead($script_marker, $name)
{ {
global $page_title; global $page_title;
$iCrap = strpos($_SERVER['HTTP_USER_AGENT'],'iP');
$head = "<!DOCTYPE html>\n"; $head = "<!DOCTYPE html>\n";
$head .= "<html><head><title>$page_title$name</title>"; $head .= "<html><head><title>$page_title$name</title>";
@ -118,10 +120,15 @@ input.tiny {width: 0px; height: 0px; margin: 0px; padding: 0px; outline: none; b
#n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;} #n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;}
#n42 td.navboxr {float: right;} #n42 td.navboxr {float: right;}
#n42 td.nav {position: relative;} #n42 td.nav {position: relative;}
#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;}";
if (!$iCrap)
{
$head .= "
#n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;} #n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;}
#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;}
#n42 td.nav:hover {background:#09e;} #n42 td.nav:hover {background:#09e;}
#n42 td.nav:hover div.sub {background:#07e; visibility: visible;} #n42 td.nav:hover div.sub {background:#07e; visibility: visible;}";
}
$head .= "
h1 {margin-top: 20px; float:middle; font-size: 20px;} h1 {margin-top: 20px; float:middle; font-size: 20px;}
.foot, .push {height: 50px; font-size: 10pt;} .foot, .push {height: 50px; font-size: 10pt;}
.title {background-color: #909090;} .title {background-color: #909090;}
@ -295,34 +302,34 @@ function pgtop($info, $dotop, $user, $douser)
$lhn = $info['now'] - $info['lasthb']; $lhn = $info['now'] - $info['lasthb'];
$lwn = $info['now'] - $info['lastwi']; $lwn = $info['now'] - $info['lastwi'];
if ($lsn < 2) if ($lsn < 2)
$lsc = 'green'; $lsc = 'green.gif';
else else
{ {
if ($lsn < 4) if ($lsn < 4)
$lsc = 'orange'; $lsc = 'orange.png';
else else
$lsc = 'red'; $lsc = 'red.png';
} }
if ($lhn < 3) if ($lhn < 3)
$lhc = 'green'; $lhc = 'green.gif';
else else
{ {
if ($lhn < 6) if ($lhn < 6)
$lhc = 'orange'; $lhc = 'orange.png';
else else
$lhc = 'red'; $lhc = 'red.png';
} }
if ($lwn < 36) if ($lwn < 36)
$lwc = 'green'; $lwc = 'green.gif';
else else
{ {
if ($lwn < 46) if ($lwn < 46)
$lwc = 'orange'; $lwc = 'orange.png';
else else
$lwc = 'red'; $lwc = 'red.png';
} }
$img1 = '<img border=0 src=/'; $img1 = '<img border=0 src=/';
$img2 = '.png>'; $img2 = '>';
$ls = $img1.$lsc.$img2; $ls = $img1.$lsc.$img2;
$lh = $img1.$lhc.$img2; $lh = $img1.$lhc.$img2;
$lw = $img1.$lwc.$img2; $lw = $img1.$lwc.$img2;
@ -405,6 +412,8 @@ function pgtop($info, $dotop, $user, $douser)
# #
function pgmenu($menus) function pgmenu($menus)
{ {
$iCrap = strpos($_SERVER['HTTP_USER_AGENT'],'iP');
$ret = "\n<table cellpadding=0 cellspacing=0 border=0 width=100% id=n42>"; $ret = "\n<table cellpadding=0 cellspacing=0 border=0 width=100% id=n42>";
$ret .= '<tr><td width=100%>'; $ret .= '<tr><td width=100%>';
$ret .= '<table cellpadding=0 cellspacing=0 border=0 width=100%>'; $ret .= '<table cellpadding=0 cellspacing=0 border=0 width=100%>';
@ -420,10 +429,17 @@ function pgmenu($menus)
$side = 'r'; $side = 'r';
continue; continue;
} }
$ret .= "<td class=navbox$side><table cellpadding=0 cellspacing=0 border=0>"; if ($iCrap)
$first = true;
foreach ($submenus as $submenu => $item)
{ {
foreach ($submenus as $submenu => $item)
$ret .= "<td class=nav>".makeLink($item)."$submenu</a></td>";
}
else
{
$ret .= "<td class=navbox$side><table cellpadding=0 cellspacing=0 border=0>";
$first = true;
foreach ($submenus as $submenu => $item)
{
if ($first == true) if ($first == true)
{ {
$first = false; $first = false;
@ -437,10 +453,11 @@ function pgmenu($menus)
$ret .= '<div class=sub><table cellpadding=0 cellspacing=0 border=0 width=100%>'; $ret .= '<div class=sub><table cellpadding=0 cellspacing=0 border=0 width=100%>';
} }
$ret .= "<tr><td class=ts>".makeLink($item,'class=as')."$submenu</a></td></tr>"; $ret .= "<tr><td class=ts>".makeLink($item,'class=as')."$submenu</a></td></tr>";
} }
if ($first == false) if ($first == false)
$ret .= '</table></div></td></tr></table>'; $ret .= '</table></div></td></tr></table>';
$ret .= '</td>'; $ret .= '</td>';
}
} }
$ret .= "</tr></table></td></tr></table>\n"; $ret .= "</tr></table></td></tr></table>\n";
return $ret; return $ret;

6
pool/prime.php

@ -53,7 +53,7 @@ function def_menu()
), ),
'gap' => array( # options not shown 'gap' => array( # options not shown
'API' => 'api'), 'API' => 'api'),
'Help' => array('Help' => 'help', 'Help' => array(
'Payouts' => 'payout')); 'Payouts' => 'payout'));
return $dmenu; return $dmenu;
} }
@ -84,9 +84,7 @@ function check()
'PBlocks' => 'pblocks' 'PBlocks' => 'pblocks'
), ),
'Help' => array( 'Help' => array(
'Payouts' => 'payout', 'Payouts' => 'payout'
'Workers ' => 'workers',
'Blocks' => 'blocks'
) )
); );
tryLogInOut(); tryLogInOut();

Loading…
Cancel
Save