📄 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://www.wap2go.co.uk */
/* */
/* DOWNLOADS MODULE */
/* */
/* FILE DETAILS and EXPLANATION: */
/* functions.php - Specific Functions for Module */
/********************************************************************************/
// Include the Module's Functions
// include_once "modules/mreviews/functions.php";
$thumbsize = $usergfxpref/5;
$increment = 5;
// Fetch Query Strings
$d_op= $_GET['d_op'];
$cid = $_GET['cid'];
$lid = $_GET['lid'];
$start = $_GET['start'];
if (!$start) { $start=0; }
// Module Content
if ($d_op=="viewdownloaddetails")
{
OpenTable();
$title = ""._DOWNLOADPROFILE.""; Title($title);
CloseTable();
if ($lid)
{
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$result = $db->sql_query("select * from $prefix"._downloads_downloads." where lid = '$lid' LIMIT 1");
$row = $db->sql_fetchrow($result);
// Shorten Content
$content = "";
if($row) {
$c=$start;
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$description= strtr(strip_tags($row["description"]), $array_correction);
$lid = $row["lid"];
$score = $row["downloadratingsummary"];
$score = explode(".",$score);
$filesize = $row["filesize"];
$rating = $score[0];
$hits = $row["hits"];
$url = $row["url"];
$c = $c+1;
// Display Brief Download Details
$content .= _B.$c.". ".$title._B_END._BR
.$description._BR
._DOWNLOADS.": ".$hits." | "
._RATING.": ".$rating." | "
._FILESIZE." "._INBYTES.": ".$filesize
._BR
."<a href=\"".$url."\" title=\""._DOWNLOADNOW."\">"._DOWNLOADNOW."</a>"._BR;
} while ($row = $db->sql_fetchrow($result));
$title = char_dec($title);
$content = char_dec($content);
OpenTable(); Title($title);
echo _P_CENTER.$content._P_END;
CloseTable();
}
else {
OpenTable();
$title = ""._DOWNLOADPROFILE."";
$content = ""._NOMATCHES."";
$title = char_dec($title);
$content = char_dec($content);
Title($title);
echo _P_CENTER.$content.P_END;
CloseTable();}
}
}
else if ($d_op=="NewDownloads")
{
// List Next Most Popular Downloads
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
if ($cid) { $totalresults = $db->sql_numrows($db->sql_query("SELECT title FROM $prefix"._downloads_categories." WHERE cid = '$cid'"));
$result = $db->sql_query("SELECT title FROM $prefix"._downloads_categories." WHERE cid = '$cid' LIMIT $start,$increment");
$row = $db->sql_fetchrow($result);
$category = strtr(strip_tags($row["title"]), $array_correction);
$result = $db->sql_query("SELECT * FROM $prefix"._downloads_downloads." WHERE cid = '$cid' ORDER BY date DESC LIMIT $start,$increment");
$title = ""._NEWDOWNLOADS." : ".$category; Title($title);}
else { $totalresults = $db->sql_numrows($db->sql_query("SELECT * FROM $prefix"._downloads_downloads." ORDER BY date DESC"));
$result = $db->sql_query("SELECT * FROM $prefix"._downloads_downloads." ORDER BY date DESC LIMIT $start,$increment");
$title = ""._NEWDOWNLOADS.""; Title($title);}
$title = char_dec($title);
OpenTable();
echo $title;
CloseTable();
$row = $db->sql_fetchrow($result);
// Shorten Content
$content = "";
if($row)
{
$c=$start;
$c=$start;$c=$c+1;
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$title = ucfirst ($title);
$title = (strlen($title) > 30) ? (substr ($title,0,30)."..."):($title);
$lid = $row["lid"];
$score = $row["downloadratingsummary"];
$score = explode(".",$score);
$rating = $score[0];
$hits = $row["hits"];
$url = $row["url"];
// Display Brief Download Details
$content .= _B.$c.". ".$title._B_END." (".$hits." "._DOWNLOADS.")"._BR
."<a href=\"w2g_modules.php?name=".$modulename."&d_op=viewdownloaddetails&lid=".$lid."\" title=\""._DETAILS."\">"._DETAILS."</a> | <a href=\"".$url."\" title=\""._DOWNLOADNOW."\">"._DOWNLOADNOW."</a>"._BR;
if ($row["title"]) { $c = $c+1; }
} while ($row = $db->sql_fetchrow($result));
$content = char_dec($content);
OpenTable();
echo _P_CENTER.$content._P_END;
$query = "&d_op=".$d_op."";
if ($cid) { $query .= "&cid=".$cid.""; }
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
}
else { $content = ""._NOMATCHES."";
$content = char_dec($content);
OpenTable();
echo _P_CENTER.$content._P_END;
CloseTable();}
}
else if ($d_op=="TopRated")
{
// List Next Most Popular Downloads
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
if ($cid) { $totalresults = $db->sql_numrows($db->sql_query("select title from $prefix"._downloads_categories." WHERE cid = '$cid'"));
$result = $db->sql_query("select title from $prefix"._downloads_categories." WHERE cid = '$cid' LIMIT $start,$increment");
$row = $db->sql_fetchrow($result);
$category = $row["title"];
$result = $db->sql_query("select * from $prefix"._downloads_downloads." WHERE cid = '$cid' order by downloadratingsummary desc LIMIT $start,$increment");
$title = ""._TOPRATED." : ".$category.""; Title($title);}
else { $totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._downloads_downloads." order by downloadratingsummary desc"));
$result = $db->sql_query("select * from $prefix"._downloads_downloads." order by downloadratingsummary desc LIMIT $start,$increment");
$title = ""._TOPRATED.""; Title($title);}
$title = char_dec($title);
OpenTable();
echo $title;
CloseTable();
$row = $db->sql_fetchrow($result);
// Shorten Content
$content = "";
if($row)
{
$c=$start;$c=$c+1;
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$title = ucfirst ($title);
$title = (strlen($title) > 30) ? (substr ($title,0,30)."..."):($title);
$lid = $row["lid"];
$score = $row["downloadratingsummary"];
$score = explode(".",$score);
$rating = $score[0];
$hits = $row["hits"];
$url = $row["url"];
// Display Brief Download Details
$content .= _B.$c.". ".$title._B_END." (".$hits." "._DOWNLOADS.")"._BR
."<a href=\"w2g_modules.php?name=".$modulename."&d_op=viewdownloaddetails&lid=".$lid."\" title=\""._DETAILS."\">"._DETAILS."</a> | <a href=\"".$url."\" title=\""._DOWNLOADNOW."\">"._DOWNLOADNOW."</a>"._BR;
if ($row["title"]) { $c = $c+1; }
} while ($row = $db->sql_fetchrow($result));
OpenTable();
echo _P_CENTER.$content._P_END;
$query = "&d_op=".$d_op."";
if ($cid) { $query .= "&cid=".$cid.""; }
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
}
else { OpenTable();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -