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. 42
      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;
}
#
function HeadCSS($iCrap = false)
function HeadCSS()
{
$h = "input[type=checkbox] {vertical-align:-2px;}
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.nav {position:relative;}
#n42 td.ts {border-width:1px;border-color:#0022ee;border-style:solid none none none;}
";
if (!$iCrap)
{
$h .= "#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.nav:hover {background:#0099ee;}
#n42 td.nav:hover div.sub {background:#0077ee;visibility:visible;}
";
}
$h .= "h1 {margin-top:20px;float:middle;font-size:20px;}
h1 {margin-top:20px;float:middle;font-size:20px;}
.foot, .push {height:50px;}
.title {background-color:#909090;}
.even {background-color:#cccccc;}

42
pool/page.php

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

Loading…
Cancel
Save