📄 theme.php
字号:
<?php
/******************************************************************************/
/* Wap-2-Go Mobile Phone Nuke-Addon */
/* bringing the Advanced Content Management System to Mobile Format */
/* ========================================================================= */
/* powered by Nuke SQL Database */
/* */
/* Wap-2-Go Default Theme - v0.6+ */
/* */
/* Copyright (c) 2007 by Philip Marsh - http://www.wap2go.co.uk */
/******************************************************************************/
// ===============================================
// Site-wide Graphics (or TEXT)
// ===============================================
// Settings for resizing images: x=screen width, t=image type - 1=gif, 2=jpg, 3=png
$accesskey = 1;
if ($htm==1) { include_once("themes/".$theme."/html/style.php"); }
else { include_once("themes/".$theme."/wml/style.php"); }
// Site Logo - use $w2g_logo wherever you want logo gfx/text on site
if ($usergfxpref!=="0") { $w2g_logo = "<a href=\"index.php\" title=\"".$sitename."\"";
if ($htm=="1") { $w2g_logo .= " accesskey=\"".$accesskey."\""; }
$w2g_logo .= ">".doimage($site_logo, $sitename)."</a>"; }
else { $w2g_logo = ""._B."<a href=\"index.php\" title=\"".$sitename."\"";
if ($htm=="1") { $w2g_logo .= " accesskey=\"".$accesskey."\""; }
$w2g_logo .= ">".$sitename."</a>"._B_END.""; }
if ($moduletitle=="Forums") { include_once("themes/".$theme."/forums.php"); }
// Theme Functions
// ===============
// HTML Functions defined first, then WML Functions after
// These are pretty self-explanatory:
// themeheader - the theme's header
// themefooter - the theme's footer
if ($htm=="1")
{
/********************************************************************************/
/* HTML THEME FUNCTIONS */
/********************************************************************************/
function themeheader() // Custom THEME Header
{ // HTML Header
global $theme, $w2g_logo, $htm, $nukeurl, $usergfxpref;
$containerwidth = $usergfxpref;
// Include Stylesheet
echo "\n<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" title=\"".$theme."\" href=\"themes/".$theme."/html/style.css\" />\n"
."\n</head>\n<body>\n<div id=\"pagewrap\">\n"
."\n<div id=\"header\">"
."\n "._H1."".$w2g_logo.""._H1_END.""
."\n</div>\n";
echo "\n <div id=\"content\">";
}
function themefooter() // Custom THEME Footer
{ // HTML Footer
global $theme, $w2g_menu, $usergfxpref, $nukeurl, $w2g_url, $imgtype, $w2gfurl;
doMenu();
echo "\n</div>\n"; // End #PAGEWRAP
if ($usergfxpref<160) { $iconwidth = ($usergfxpref-2)/2;
$iconheight = (15/80)*$iconwidth; }
else { $iconwidth = 80; $iconheight = 15; }
if ($usergfxpref!=="0") { echo "\n<div>"
."\n <a href=\"http://jigsaw.w3.org/css-validator/validator?uri=".$w2g_url."/themes/".$theme."/html/style.css\">".doimage("".$w2gfurl."/themes/Wap-2-Go/html/icon-w3c-css.gif", "Valid CSS", $iconwidth)."</a>"
."\n ".doimage("".$w2g_url."/themes/".$theme."/html/icon-w3c-xhtml10.gif", "Valid HTML", $iconwidth).""
."\n</div>\n"; }
}
function doPageTitle() // Custom Page Title
{
global $moduletitle, $modulename, $theme, $w2gfurl, $usergfxpref;
$page = "<a href=\"w2g_modules.php?name=".$moduletitle."\" title=\"".$modulename."\">".$modulename."</a>";
echo "\n <div id=\"pagetitle\">\n ".$page."\n </div>\n";
}
function Title($title)
{
echo "\n "._H2."".$title.""._H2_END."";
}
function OpenModule()
{
global $moduletitle;
echo "\n <div id=\"".$moduletitle."\">";
}
function CloseModule()
{
echo "\n </div>";
}
function OpenTable() // Open a Block for Module or Section Content
{
global $tdcolor, $tdbgcolor, $tdfont, $usergfxpref;
echo "\n <div>\n ";
}
function CloseTable() // Close the Block at end of Content
{
echo "\n </div>";
}
function doBlock ($title, $content) // Displays Provided Information in template layout
{
global $theme;
echo "\n "._H3."".$title.""._H3_END.""
."\n <div align=\"center\">"
."\n ".$content.""
."</div>";
}
function doLeftBlock ($title, $content) // Displays Provided Information in template layout
{
echo "\n "._H3."".$title.""._H3_END.""
."\n <div align=\"left\">"
."\n ".$content.""
."\n </div>";
}
function doStory ($title,$content,$author) // Displays Provided Story Information in template layout
{
global $theme;
echo "\n "._H3."".$title.""._H3_END
."\n <div align=\"justify\" mode=\"wrap\">"
."\n "._SMALL."".$content.""._SMALL_END.""
."\n "._P_RIGHT.""
."\n "._SMALL.""
."\n "._I."Posted By "._B."$author"._B_END.""._I_END.""
."\n "._SMALL_END.""
."\n "._P_END."";
}
function doReview($title,$content,$score,$author,$hits) // Displays Provided Review in template layout
{
echo "\n "._H3."".$title.""._H3_END.""
."\n "._P_JUSTIFY.""
."\n "._SMALL.""
."\n ".$content
."\n "._SMALL_END.""
."\n "._P_END
."\n "._P_CENTER.""._B."Review Details:"._B_END
."\n "._SMALL.""
."\n "._I."Posted By "._B."".$author.""._B_END._I_END."<br/>"
."\n "._I."Score "._B.$score._B_END._I_END."<br/>"
."\n "._I."Hits "._B.$hits._B_END._I_END
."\n "._SMALL_END.P_END;
}
function doMenu() // Display the Site Menu
{
global $theme, $usergfxpref, $thumb, $imgtype, $num_modules, $module, $nukeurl, $w2g_url, $w2gfurl, $moduletitle;
// Determine Number of Columns depending on the screen width...
if($usergfxpref<=50)
{ $ncol = 2;
$talign = "CC";}
else if($usergfxpref<=100)
{ $ncol = 2;
$talign = "CC";}
else if ($usergfxpref<200)
{ $ncol = 3;
$talign = "CCC";}
else { $ncol = 4;
$talign = "CCCC";}
// Calculate Icon Widths from Screen Width and Number of Columns
$iconx = ($usergfxpref-(2*$ncol))/$ncol;
$iconx = explode(".",$iconx);
$iconwidth = $iconx[0];
if ($usergfxpref=="0") {$icons = "|";} else { $icons = ""; }
// Detects Installed Modules and Makes Accessible to the User if Active
$thumbicon = "&x=".$iconwidth."&t=".$imgtype."&f=0";
$thumb = "".$nukeurl."/mobile/includes/w2g_thumbs.php?src=";
for ($i=0;$i<=$num_modules-1;$i++) {
list ($title,$custom_title) = explode(",", $module[$i]);
if ($usergfxpref=="0") { $icons .= "\n <a href=\"w2g_modules.php?name=".$title."\"";
if ($htm=="1" AND $accesskey<10) { $icons .= " accesskey=\"".$accesskey."\""; }
$icons .= ">".$custom_title."</a> |*";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -