📄 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 */
/* */
/* Web_Links MODULE */
/* */
/* FILE DETAILS and EXPLANATION: */
/* functions.php - Specific Functions for Module */
/********************************************************************************/
// Include the Module's Functions
include_once "functions.php";
$thumbsize = $usergfxpref/5;
if (!$moduletitle) { $moduletitle = "Web_Links"; }
if (!$modulename) { $modulename = ""._WEBLINKS.""; $modulename = char_dec($modulename);}
if (isset($_GET['lid'])) { $lid = stripslashes($_GET['lid']);}
if (!$lid) { if($id) { $lid = $id; }; }
// Module Content
if ($op=="Visit")
{
if ($lid) { $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$result = $db->sql_query("SELECT * FROM $prefix"._links_links." WHERE lid = '$lid' LIMIT 1");
if ($result) { $row = $db->sql_fetchrow($result);
$url = stripslashes($row["url"]);
$db->sql_query("UPDATE $prefix"._links_links." SET hits = hits+1 WHERE lid='$lid'");
Header("Location: ".$url."");
die;}
}
}
else if ($op=="Latest")
{
if (!$start) { $start=0; }
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._links_links." order by date DESC"));
$result = $db->sql_query("select * from $prefix"._links_links." order by date DESC LIMIT $start,$increment");
$row = $db->sql_fetchrow($result);
$content = "";
if($row)
{
$content = "";
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$description= strtr(strip_tags($row["description"]), $array_correction);
$url = $row["url"];
$id = $row["lid"];
$name = $row["name"];
$hits = $row["hits"];
$rating = $row["linkratingsummary"];
// Display Link and Details
$content .= _B."<a href=\"w2g_modules.php?name=".$moduletitle."&op=Visit&lid=".$id."\" title=\""._VISITTHISSITE."\">".$title."</a>"._B_END._BR;
$content .= "".$description._BR._HITS.": ".$hits." | "._RATING.": ".$linkratingsummary._BR;
} while ($row = $db->sql_fetchrow($result));
$title = ""._NEWLINKS.":";
} else { $title = "- "._NONE." -"; $content = ""; }
$title = char_dec($title);
$content = char_dec($content);
OpenTable(); Title($title);
echo _P_CENTER.$content._P_END;
$query = "&op=".$op."";
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
} else if ($op=="Rated")
{
if (!$start) { $start=0; }
// Display Rated Links
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._links_links." order by linkratingsummary DESC"));
$result = $db->sql_query("select * from $prefix"._links_links." order by linkratingsummary DESC limit $start,$increment");
$row = $db->sql_fetchrow($result);
$content = "";
if($row)
{
$content = "";
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$description= strtr(strip_tags($row["description"]), $array_correction);
$url = $row["url"];
$id = $row["lid"];
$name = $row["name"];
$hits = $row["hits"];
$rating = $row["linkratingsummary"];
// Display Link and Details
$content .= _B."<a href=\"w2g_modules.php?name=".$moduletitle."&op=Visit&lid=".$id."\" title=\""._VISITTHISSITE."\">".$title."</a>"._B_END._BR;
$content .= "".$description._BR._HITS.": ".$hits." | "._RATING.": ".$linkratingsummary._BR;
} while ($row = $db->sql_fetchrow($result));
} else { $content = "- "._NONE." -"; }
$title = ""._WEBLINKS.":";
$title = char_dec($title);
$content = char_dec($content);
OpenTable(); Title($title);
echo _P_CENTER.$content._P_END;
$query = "&op=".$op."";
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
} else if ($op=="Popular")
{
if (!$start) { $start=0; }
// Display Most Visited Links
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._links_links." order by hits DESC"));
$result = $db->sql_query("select * from $prefix"._links_links." order by hits DESC limit $start,$increment");
$row = $db->sql_fetchrow($result);
$content = "";
if($row)
{
$content = "";
do {
$title = strtr(strip_tags($row["title"]), $array_correction);
$description= strtr(strip_tags($row["description"]), $array_correction);
$url = $row["url"];
$id = $row["lid"];
$name = $row["name"];
$hits = $row["hits"];
$rating = $row["linkratingsummary"];
// Display Link and Details
$content .= _B."<a href=\"w2g_modules.php?name=".$moduletitle."&op=Visit&lid=".$id."\" title=\""._VISITTHISSITE."\">".$title."</a>"._B_END._BR;
$content .= "".$description._BR._HITS.": ".$hits." | "._RATING.": ".$linkratingsummary._BR;
} while ($row = $db->sql_fetchrow($result));
} else { $content = "- "._NONE." -"; }
$title = ""._WEBLINKS.":";
$title = char_dec($title);
$content = char_dec($content);
OpenTable(); Title($title);
echo _P_CENTER.$content._P_END;
$query = "&op=".$op."";
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
} else if ($op=="Cat" OR $default_weblinks_cat!=0)
{
if ($default_weblinks_cat!=0 AND (!$id)) { $id = $default_weblinks_cat; }
if ($id){
// Find Category Name
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$result1 = $db->sql_query("select * from $prefix"._links_categories." where cid='$id' limit 1");
$row1 = $db->sql_fetchrow($result1);
$title = strtr(strip_tags($row1["title"]), $array_correction);
$content = strtr(strip_tags($row1["cdescription"]), $array_correction);
$cid = $row1["cid"];
OpenTable();
$title = "".$title."";
$title = char_dec($title);
$content = char_dec($content);
Title($title);
echo _P_CENTER.$content._P_END;
CloseTable();
// Are there Sub-cats?
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._links_categories." where parentid='$cid' order by title asc"));
$result2 = $db->sql_query("select * from $prefix"._links_categories." where parentid='$cid' order by title asc LIMIT $start,$increment");
$row2 = $db->sql_fetchrow($result2);
if ($row2)
{
$content = "";
do {
$subcat_title = strtr(strip_tags($row2["title"]), $array_correction);
$subcat_desc = strtr(strip_tags($row2["cdescription"]), $array_correction);
$subcat_id = $row2["cid"];
$content .= " + <a href=\"w2g_modules.php?name=".$moduletitle."&op=Cat&id=".$subcat_id."\">".$subcat_title."</a> ";
} while ($row2 = $db->sql_fetchrow($result2));
$title = ""._USUBCATEGORIES.":";
OpenTable();
$title = char_dec($title);
$content = char_dec($content);
Title($title);
echo _P_CENTER.$content._P_END;
CloseTable();
}
// Display Links In CATEGORY
if (!$start) { $start=0; }
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$result = $db->sql_query("select * from $prefix"._links_links." where cid = '$cid' order by title ASC limit $start,10");
$links = $db->sql_fetchrow($result);
if($links) {
$content = "";
do {
$title = strtr(strip_tags($links["title"]), $array_correction);
$description= strtr(strip_tags($links["description"]), $array_correction);
$url = $links["url"];
$id = $links["lid"];
$name = $links["name"];
$hits = $links["hits"];
$rating = $links["linkratingsummary"];
// Display Link and Details
$content .= _B."<a href=\"w2g_modules.php?name=".$moduletitle."&op=Visit&lid=".$id."\" title=\""._VISITTHISSITE."\">".$title."</a>"._B_END._BR;
$content .= "".$description."<br/>"._HITS.": ".$hits." | "._RATING.": ".$linkratingsummary."<br/>";
} while ($links = $db->sql_fetchrow($result));
} else { $content = "- "._NONE." -"; }
} else { $content = "- "._NONE." -"; }
$title = ""._WEBLINKS.":";
$title = char_dec($title);
$content = char_dec($content);
OpenTable(); Title($title);
echo _P_CENTER.$content._P_END;
$query = "&op=".$op."";
doPageNavigation($start,$increment,$totalresults,$query);
CloseTable();
} else {
if (!$Web_Links_defaultcat) { $parent_id = 0; } else if ($Web_Links_defaultcat) { $parent_id = $Web_Links_defaultcat; }
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$result2 = $db->sql_query("select * from $prefix"._links_categories." where parentid = '$parent_id' order by title asc");
$row2 = $db->sql_fetchrow($result2);
if ($row2)
{
$content = "";
do {
$cat_title = strip_tags($row2["title"]);
$cat_desc = strtr(strip_tags($row2["cdescription"]), $array_correction);
$cat_id = $row2["cid"];
$content .= "<a href=\"w2g_modules.php?name=".$moduletitle."&op=Cat&id=".$cat_id."\">".$cat_title."</a>"._BR;
} while ($row2 = $db->sql_fetchrow($result2));
} else { $content = "- "._NONE." -"; }
OpenTable();
$title = ""._CATEGORIES."";
$title = char_dec($title);
$content = char_dec($content);
Title($title);
echo _P_CENTER.$content._P_END;
CloseTable();
}
// Options on ALL Pages
OpenTable();
$title = ""._MENUFOR." ".$modulename."";
$content = _P_CENTER."<a href=\"w2g_modules.php?name=".$moduletitle."\">"._CATEGORIES."</a> | <a href=\"w2g_modules.php?name=".$moduletitle."&op=Latest\">"._NEWLINKS."</a> | <a href=\"w2g_modules.php?name=".$moduletitle."&op=Rated\">"._TOPRATED."</a> | <a href=\"w2g_modules.php?name=".$moduletitle."&op=Popular\">"._POPULAR."</a>"._P_END;
$title = char_dec($title);
$content = char_dec($content);
Title($title); echo $content;
CloseTable();
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -