?? index.php
字號:
<?php
/********************************************************************************/
/* Wap-2-Go Mobile Phone Nuke-Addon */
/* bringing the Advanced Content Management System to Mobile Format */
/* =========================================================================== */
/* powered by Nuke SQL Database */
/* */
/* Copyright (c) 2007 by Philip Marsh - http://wap2go.co.uk */
/* */
/* NEWS MODULE */
/* */
/* FILE DETAILS and EXPLANATION: */
/* functions.php - Specific Functions for Module */
/********************************************************************************/
// Include the Module's Functions
include_once "functions.php";
// Fetch Query Strings
$sid = $_GET['sid'];
// Module Content
// Detect What to Display
// Topic
if ($sid!="")
{
// Display Article
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$result = $db->sql_query("select title,hometext,bodytext,time,aid from $prefix"._stories." where sid = '$sid'");
$data = $db->sql_fetchrow($result);
$title = strtr(strip_tags($data["title"]), $array_correction);
if ($htm=="1") { $intro = stripslashes($data["hometext"]);
$body = stripslashes($data["bodytext"]); }
else { $intro = strtr(strip_tags($data["hometext"]), $array_correction);
$body = strtr(strip_tags($data["bodytext"]), $array_correction); }
$author = $data["aid"];
list ($year, $month, $day) = split ('[: -]', $data["time"]);
$tit_name = (strlen($title) > 100) ? (substr($title,0,10)."...") : ($title);
$tit_data = $tit_name." ".$day."/".$month."/".$year;
$content = $intro._BR.$body;
$title = char_dec($title);
$content = char_dec($content);
$content = wordwrap($content,25,"\n",1);
make_clickable($content);
OpenTable(); Title($title);
echo _P_LEFT.$content._P_END;
echo _P_CENTER._NEWSBY.": "._I."<a href=\"w2g_modules.php?name=Your_Account&op=userinfo&username=".$author."\">".$author."</a>"._I_END._P_END;
CloseTable();
$db->sql_query("UPDATE $prefix."._stories." SET counter=counter+1 where sid='$sid'");
}
else
{
// Display Most Recent News Articles
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$totalresults = $db->sql_numrows($db->sql_query("select title, sid from $prefix"._stories." order by sid DESC"));
$result = $db->sql_query("select title, sid from $prefix"._stories." order by sid DESC limit $start,$increment");
$row = $db->sql_fetchrow($result);
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$id = $row["sid"];
$content .= "<a href=\"w2g_modules.php?name=News&sid=".$id."\" title=\""._READMORE."\">- ".$title."</a>"._BR;
} while ($row = $db->sql_fetchrow($result));
mysql_close();
$title = ""._NEWEST.":";
$title = char_dec($title);
$content = char_dec($content);
OpenTable(); Title($title);
echo _P_LEFT.$content._P_END;
$query = "";
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -