Browse Source

php - convert hover menu to click on iOS and others

master
kanoi 9 years ago
parent
commit
57f4058ddf
  1. 11
      pool/inc.php
  2. 30
      pool/page.php

11
pool/inc.php

@ -75,7 +75,7 @@ function jst(){var e=document.getElementById('jst');if(e){e.style.visibility='hi
return $h; return $h;
} }
# #
function HeadCSS($iCrap = false) function HeadCSS()
{ {
$h = "input[type=checkbox] {vertical-align:-2px;} $h = "input[type=checkbox] {vertical-align:-2px;}
form {display:inline-block;} form {display:inline-block;}
@ -106,15 +106,10 @@ input.tiny {width:0px;height:0px;margin:0px;padding:0px;outline:none;border:0px;
#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:#0022ee;border-style:solid none none none;} #n42 td.ts {border-width:1px;border-color:#0022ee;border-style:solid none none none;}
"; #n42 div.sub {left:0px;z-index:42;position:absolute;visibility:hidden;}
if (!$iCrap)
{
$h .= "#n42 div.sub {left:0px;z-index:42;position:absolute;visibility:hidden;}
#n42 td.nav:hover {background:#0099ee;} #n42 td.nav:hover {background:#0099ee;}
#n42 td.nav:hover div.sub {background:#0077ee;visibility:visible;} #n42 td.nav:hover div.sub {background:#0077ee;visibility:visible;}
"; h1 {margin-top:20px;float:middle;font-size:20px;}
}
$h .= "h1 {margin-top:20px;float:middle;font-size:20px;}
.foot, .push {height:50px;} .foot, .push {height:50px;}
.title {background-color:#909090;} .title {background-color:#909090;}
.even {background-color:#cccccc;} .even {background-color:#cccccc;}

30
pool/page.php

@ -153,20 +153,10 @@ function trm_force($html)
return dotrm($html, false); return dotrm($html, false);
} }
# #
function isCrap()
{
if (isset($_SERVER['HTTP_USER_AGENT']))
return strpos($_SERVER['HTTP_USER_AGENT'],'iP');
else
return false;
}
#
function pghead($css_marker, $script_marker, $name) function pghead($css_marker, $script_marker, $name)
{ {
global $page_title; global $page_title;
$iCrap = isCrap();
$head = "<!DOCTYPE html>\n"; $head = "<!DOCTYPE html>\n";
$head .= "<html><head><title>$page_title$name</title>"; $head .= "<html><head><title>$page_title$name</title>";
@ -178,7 +168,7 @@ function pghead($css_marker, $script_marker, $name)
$head .= HeadJS(); $head .= HeadJS();
$head .= "\n</script>\n"; $head .= "\n</script>\n";
$head .= "<style type='text/css'>\n"; $head .= "<style type='text/css'>\n";
$head .= HeadCSS($iCrap); $head .= HeadCSS();
$head .= "\n$css_marker\n</style>\n"; $head .= "\n$css_marker\n</style>\n";
$head .= '<meta name="robots" content="noindex">'; $head .= '<meta name="robots" content="noindex">';
@ -444,8 +434,8 @@ function pgtop($info, $dotop, $user, $douser)
if ($who == false) if ($who == false)
{ {
$top .= '<table cellpadding=0 cellspacing=0 border=0><tr><td>'; $top .= '<table cellpadding=0 cellspacing=0 border=0><tr><td>';
$top .= '<a href=https://' . $_SERVER['SERVER_NAME']; $top .= '<a href="https://' . $_SERVER['SERVER_NAME'];
$top .= '/index.php?Register=1>Login<br>Register</a>'; $top .= '/index.php?Register=1">Login<br>Register</a>';
$top .= '</td></tr></table>'; $top .= '</td></tr></table>';
} }
else else
@ -479,8 +469,6 @@ function pgtop($info, $dotop, $user, $douser)
# #
function pgmenu($menus) function pgmenu($menus)
{ {
$iCrap = isCrap();
$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%>';
@ -496,13 +484,6 @@ function pgmenu($menus)
$side = 'r'; $side = 'r';
continue; continue;
} }
if ($iCrap)
{
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>"; $ret .= "<td class=navbox$side><table cellpadding=0 cellspacing=0 border=0>";
$first = true; $first = true;
foreach ($submenus as $submenu => $item) foreach ($submenus as $submenu => $item)
@ -512,11 +493,11 @@ function pgmenu($menus)
$first = false; $first = false;
if ($submenu == $menu) if ($submenu == $menu)
{ {
$ret .= "<tr><td class=nav>".makeLink($item)."$menu</a>"; $ret .= "<tr><td class=nav onclick=''>".makeLink($item)."$menu</a>";
$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%>';
continue; continue;
} }
$ret .= "<tr><td class=nav><a>$menu</a>"; $ret .= "<tr><td class=nav onclick=''><a>$menu</a>";
$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>";
@ -525,7 +506,6 @@ function pgmenu($menus)
$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;
} }

Loading…
Cancel
Save