📄 w2g_mainfile.php
字号:
<?php
/******************************************************************************/
/* Wap-2-Go Mobile Phone Nuke-Addon */
/* bringing the Advanced Content Management System to Mobile Format */
/* ==========================================================================*/
/* powered by Nuke Database */
/* */
/* Copyright (c) 2007 by Philip Marsh - http://www.wap2go.co.uk */
/* */
/* FILE DETAILS and EXPLANATION: */
/* w2g_mainfile.php - Specific Functions for Mobile Site */
/******************************************************************************/
@include("settings.php");
$w2g_url = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["PHP_SELF"]);
$w2gfurl = $w2g_url;
if (file_exists("config.php")) { include_once("config.php"); }
else if (file_exists("".NUKEDIR."/config.php")) { @include_once("".NUKEDIR."/config.php"); }
else if (file_exists("../config.php")) { @include_once("../config.php"); }
else { echo "ERROR: Cannot find \"config.php\""; }
if (isset($use_cache) AND isset($directory_mode)) {
// Extra Settings For Nuke-Evolution
$evo = 1;
define('NUKE_EVO','2.0.5');
if ($dbtype=="mysql") { $dbtype = 'MySQL'; }
@require_once("includes/db.php");
@require_once("includes/evo/sql_layer.php");
} else {
// PHP-Nuke or other Distribution
@require_once("includes/db.php");
if (file_exists("".NUKEDIR."/includes/sql_layer.php")) { @require_once("".NUKEDIR."/includes/sql_layer.php"); }
else if (file_exists("../includes/sql_layer.php")) { @require_once("../includes/sql_layer.php"); }
}
@require_once("includes/w2g_counter.php");
@require_once("version.php");
// GLOBAL Settings
if (!isset($dbi)) { $dbi = sql_connect($dbhost,$dbuname,$dbpass,$dbname); }
// Fetch Site Configuration
$result = $db->sql_query("SELECT * FROM ".$prefix."_wap2go_config LIMIT 1");
// If Wap-2-Go Core Tables NOT installed, use the standard PHP-NUKE Table
if (!$result) { $result = $db->sql_query("SELECT * FROM ".$prefix."_config LIMIT 1");
$w2g_tables = 0; }
$row = $db->sql_fetchrow($result);
$sitename = $row['sitename'];
$nukeurl = $row['nukeurl'];
$site_logo = $row['site_logo'];
$slogan = $row['slogan'];
$startdate = $row['startdate'];
$adminmail = stripslashes($row['adminmail']);
$anonpost = $row['anonpost'];
$foot1 = $row['foot1'];
$foot2 = $row['foot2'];
$foot3 = $row['foot3'];
$commentlimit = intval($row['commentlimit']);
$anonymous = $row['anonymous'];
$minpass = intval($row['minpass']);
$pollcomm = intval($row['pollcomm']);
$articlecomm = intval($row['articlecomm']);
$broadcast_msg = intval($row['broadcast_msg']);
$my_headlines = intval($row['my_headlines']);
$top = intval($row['top']);
$storyhome = intval($row['storyhome']);
$user_news = intval($row['user_news']);
$oldnum = intval($row['oldnum']);
$ultramode = intval($row['ultramode']);
$banners = intval($row['banners']);
$backend_title = $row['backend_title'];
$backend_language = $row['backend_language'];
// Site Language Settings
$lang = $row['language'];
$locale = $row['locale'];
$multilingual = intval($row['multilingual']);
$useflags = intval($row['useflags']);
$notify = intval($row['notify']);
$notify_email = $row['notify_email'];
$notify_subject = $row['notify_subject'];
$notify_message = $row['notify_message'];
$notify_from = $row['notify_from'];
$moderate = intval($row['moderate']);
$admingraphic = intval($row['admingraphic']);
$httpref = intval($row['httpref']);
$httprefmax = intval($row['httprefmax']);
$CensorMode = intval($row['CensorMode']);
$CensorReplace = $row['CensorReplace'];
$copyright = $row['copyright'];
$Version_Num = floatval($row['Version_Num']);
$domain = str_replace("http://", "", $nukeurl);
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$start_time = $mtime;
$phpEx = "php";
// If Wap-2-Go Tables are Installed, used those settings instead of settings.php
if (!$w2g_tables) {
$default_usergfxpref = intval($row['UserGFXPref']);
$default_htm = intval($row['MarkUPLang']);
$default_imgtype = intval($row['IMGtype']);
$default_theme = $row['Default_Theme'];
$default_userlevel = intval($row['Default_Userlevel']);
$cookie_name = $row['Cookie_Name'];
$homepage_slogan = intval($row['Homepage_Mode']);
$keywords = $row['Keywords'];
$site_logo_height = intval($row['site_logo_height']);
$jpeg_img_qual = intval($row['jpeg_img_qual']);
$default_weblinks_cat = intval($row['default_weblinks_cat']);
$w2g_image_cache = intval($row['w2g_image_cache']);
$w2g_url = trim($row['w2g_url']);
$NUKEDIR = trim($row['nukedir']);
$W2GDIR = trim($row['w2gdir']);
$homepage_title = trim($row['homepage_title']);
}
else { @require_once("settings.php"); }
if ($nukeurl[strlen($nukeurl)-1] == '/') { $nukeurl = substr($nukeurl, 0, -1); }
if ($w2g_url[strlen($w2g_url)-1] == '/') { $w2g_url = substr($w2g_url, 0, -1); }
if ($W2GDIR[strlen($W2GDIR)-1] == '/') { $W2GDIR = substr($W2GDIR, 0, -1); }
if ($NUKEDIR[strlen($NUKEDIR)-1] == '/') { $NUKEDIR = substr($NUKEDIR, 0, -1); }
$nukeurl = trim($nukeurl);
$w2g_url = trim($w2g_url);
$w2gfurl = $w2g_url;
// Register Server Dirs from Database
define("NUKEDIR","".$NUKEDIR."");
define("W2GDIR","".$W2GDIR."");
$iconwidth = 0.32;
@require_once("includes/includes.php");
// wap-2-go Settings
// ======================================================
// These are detected from a cookie, BUT you can manually
// override these settings using the Manual method below:
// ======================================================
// Check for Cookie
if ($_COOKIE[$cookie_name])
{
// If Cookie IS present then retrieve data
$value = explode(":", $_COOKIE[$cookie_name]);
// Settings from cookie data
$usergfxpref = stripslashes($value[0]);
$imgtype = stripslashes($value[1]);
$theme = stripslashes($value[2]);
$htm = stripslashes($value[3]);
// Set Defaults if missing from cookie
if ($usergfxpref=="") { $usergfxpref = $default_usergfxpref; }
if ($htm=="") { $htm = $default_htm; }
if ($theme=="") { $theme = $default_theme; }
if ($imgtype=="") { $imgtype = $default_imgtype; }
}
// If NO Cookie is found then display warning message and set gfx preferences to "0" (Text-Only)
if ($usergfxpref=="") { $usergfxpref = $default_usergfxpref; }
if ($theme=="") { $theme = $default_theme; }
if ($htm=="") { $htm = $default_htm; }
if ($imgtype=="") { $imgtype = $default_imgtype; }
if ($site_logo_height=="") { $site_logo_height = 50; }
if ($jpeg_img_qual=="") { $jpeg_img_qual = 50; }
if ($default_weblinks_cat=="") { $default_weblinks_cat = 0; }
if (!$start) { $start = 0; }
if (!$increment) { $increment = 5; }
// Check Theme Exists!!
if (!file_exists("themes/".$theme."/theme.php")) { $theme = "Wap-2-Go"; }
// Character Correction Array for Text Strings - removes illegal characters
$array_correction = array(
'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -