⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.php

📁 一个好用的php wap cms portal
💻 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             */
/*                                                                              */
/*  mREVIEWS MODULE                                                             */
/*                                                                              */
/*  FILE DETAILS and EXPLANATION:                                               */
/*  functions.php - Specific Functions for Module                               */
/********************************************************************************/ 
// Include the Module's Functions
// include_once "modules/mreviews/functions.php";
$thumbsize = $usergfxpref/2;
if (isset($_GET["func"])) { $func = htmlentities($_GET["func"]); }
if (isset($_GET["cid"]))  { $cid  = htmlentities($_GET["cid"]); }
if (isset($_GET["gid"]))  { $gid  = htmlentities($_GET["gid"]); }
if (!$start)     { $start = 0; }
if (!$limit)     { $limit = 5; }
if (!$increment) { $increment = 5; }

// Module Content
if ($func) {
  if ($func=="play")
        {
        if ($gid)
                {
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $result = $db->sql_query("select * from $prefix"._flashgames_games." where gid = '$gid'");
                    $data = $db->sql_fetchrow($result);

                    $title     = strtr(strip_tags($data["gname"]), $array_correction);
                    $content   = strtr(strip_tags($data["gdescription"]), $array_correction);
                    $author    = strtr(strip_tags($data["gauthorname"]), $array_correction);
                    $authorurl = strtr(strip_tags($data["gauthorurl"]), $array_correction);
                    $gfilename = strtr(strip_tags($data["gfilename"]), $array_correction);
                    $gwidth    = $data["gwidth"];
                    $gheight   = $data["gheight"];
                    $gcolor    = $data["gcolor"];
                    $hits      = $data["hits"];
                    $ratings   = $data["gratings"];
                    $score     = $data["gscore"];

                    $gwidth = $usergfxpref-10;
                    $gheight = $gwidth;
if ($htm==1) {      $content = _P_CENTER."<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
                                  codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0\"
                                  id=\"$gname - http://www.xbox-hq.com\" width=\"$gwidth\" height=\"$gheight\"><param name=\"movie\" value=\"modules/$module_name/games/$gfilename?gid=$gid&uname=$uname&pn_gid=$gid&pn_uname=$uname&pn_domain=$domain&pn_license=$glicensekey&pn_checksum=$checksumis&pn_script=modules.php?&pn_modvar=name&pn_modvalue=Flash_Games\">
                                  <param name=\"quality\" value=\"high\">
                                  <embed name=\"$gname - http://www.xbox-hq.com\" src=\"$nukeurl/modules/$moduletitle/games/$gfilename?gid=$gid&uname=$uname&pn_gid=$gid&pn_uname=$uname&pn_domain=$domain&pn_license=$glicensekey&pn_checksum=$checksumis&pn_script=modules.php?&pn_modvar=name&pn_modvalue=Flash_Games\"
                                  quality=\"high\" width=\"$gwidth\" height=\"$gheight\"
                                  type=\"application/x-shockwave-flash\"></embed>
                                  </object>"._P_END;
} else {            $content = _P_CENTER._WMLCONTENTWARNING._P_END; }

                        if ($usergfxpref!=0) { $content.= _P_CENTER.$gameimage._P_END; }
                        $content.= _P_CENTER._FGMENU_AUTHORNAME.": "._B.$author._B_END." | "._FGAMES_SCORE.": "._B.$score._B_END."/5 | "._FGAMES_PLAYED." ".$hits." "._FGAMES_TIMES._P_END;
                        $content .= _P_CENTER."If the game does not display above, please <a href=\"$nukeurl/modules/$moduletitle/games/$gfilename\">try this link</a>."._P_END;
                    $title  = char_dec($title);
                    $content  = char_dec($content);
                    OpenTable();
                    Title($title);
                    echo $content;
                    CloseTable();
                }   
        else    {
                OpenTable();
                    $title = ""._MERROR.""; Title($title);
                    echo _P_CENTER._MNORESULTS._P_END;
                CloseTable();
                }
        }
  else if ($func=="view")
        {
        if ($gid)
                {
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $result = $db->sql_query("select * from $prefix"._flashgames_games." where gid = '$gid'");
                    $data = $db->sql_fetchrow($result);

                    $title     = strtr(strip_tags($data["gname"]), $array_correction);
                    $content   = strtr(strip_tags($data["gdescription"]), $array_correction);
                    $author    = strtr(strip_tags($data["gauthorname"]), $array_correction);
                    $authorurl = strtr(strip_tags($data["gauthorurl"]), $array_correction);
                    $gamefile  = strtr(strip_tags($data["gfilename"]), $array_correction);
                    $gwidth    = $data["gwidth"];
                    $gheight   = $data["gheight"];
                    $hits      = $data["hits"];
                    $ratings   = $data["gratings"];
                    $score     = $data["gscore"];
                    if ($data["gimage"]) { $gameimage = $data["gimage"];
                                           $imagesize = $usergfxpref/4;
                                           $gameimage = "<a href=\"w2g_modules.php?name=".$moduletitle."&amp;func=play&amp;gid=".$gid."\" title=\""._FGAMES_PLAY." ".$title."\">".doimage("".$nukeurl."/modules/".$moduletitle."/images/screenshot/".$gameimage."", ""._IMAGE."", $usergfxpref)."</a><br/><a href=\"w2g_modules.php?name=".$moduletitle."&amp;func=play&amp;gid=".$gid."\" title=\""._FGAMES_PLAY." ".$title."\">"._FGAMES_PLAY." ".$title."</a>"; }
                    else                 { $gameimage = "<a href=\"w2g_modules.php?name=".$moduletitle."&amp;func=play&amp;gid=".$gid."\" title=\""._FGAMES_PLAY." ".$title."\">"._FGAMES_PLAY." ".$title."</a>"; }
                    $content = _P_CENTER.$content._P_END;
                        if ($usergfxpref!=0) { $content.= _P_CENTER.$gameimage._P_END; }
                        $content.= _P_CENTER._FGMENU_AUTHORNAME.": "._B.$author._B_END." | "._FGAMES_SCORE.": "._B.$score._B_END."/5 | "._FGAMES_PLAYED." ".$hits." "._FGAMES_TIMES._P_END;
                    $title  = char_dec($title);
                    $content  = char_dec($content);
                    OpenTable();
                    Title($title);
                    echo $content;
                    CloseTable();
                }
        else if ($cid){
                // Find Category Name
                $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                $result1 = $db->sql_query("SELECT * FROM $prefix"._flashgames_cat." WHERE cid = '$cid' LIMIT 1");
                $row1 = $db->sql_fetchrow($result1);
                $title      = strtr(strip_tags($row1["cname"]), $array_correction);
                $content    = strtr(strip_tags($row1["cdescription"]), $array_correction);

                $title    = char_dec($title);
                $content  = char_dec($content);
                OpenTable();
                    Title($title);
                    echo _P_CENTER.$content._P_END;
                CloseTable();

                $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                $totalresults = $db->sql_numrows($db->sql_query("SELECT * FROM $prefix"._flashgames_games." WHERE gcid = '$cid' ORDER BY gname ASC"));
                $result = $db->sql_query("SELECT * FROM $prefix"._flashgames_games." WHERE gcid = '$cid' ORDER BY gname ASC limit $start,$increment");
                $row = $db->sql_fetchrow($result);

                // Shorten Content
                if($row)
                    {
                    $content    = "";
                    do {
                       $shortened  = strtr(strip_tags($row["gname"]), $array_correction);
                       $rtitle     = ucfirst ($shortened);
                       $tit        = (strlen($rtitle) > 20) ? (substr ($rtitle,0,35)."..."):($rtitle);
                       $id         = $row["gid"];
                       $score      = $row["gscore"];
                            
                       // Display Article Image and then details
                       $content .= _B."<a href=\"w2g_modules.php?name=".$moduletitle."&amp;func=view&amp;gid=".$id."\" title=\""._MREVIEW.": ".$tit."\">- ".$tit."</a>"._B_END." Score: "._B.$score._B_END."/5"._BR;
                    } while ($row = $db->sql_fetchrow($result));
                    $content  = char_dec($content);
                    OpenTable();
                       echo _P_CENTER.$content._P_END;
                       $query = "&amp;func=view&amp;cid=".$cid."";
                       doPageNavigation($start,$increment,$totalresults,$query);
                    CloseTable();
                    }
                 }
        else    {
                OpenTable();
                    $title = ""._MERROR.""; Title($title);
                    echo _P_CENTER._MNORESULTS._P_END;
                CloseTable();
                }
        }
} else {
            $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
            $totalresults = $db->sql_numrows($db->sql_query("SELECT * FROM $prefix"._flashgames_cat." ORDER BY cname ASC"));
            $result2 = $db->sql_query("SELECT * FROM $prefix"._flashgames_cat." ORDER BY cname ASC LIMIT $start,$increment");
            $row2 = $db->sql_fetchrow($result2);
            if ($row2)
                {
                    $content = "";                              
                    do {
                        $subcat_title   = strtr(strip_tags($row2["cname"]), $array_correction);
                        $subcat_desc    = strtr(strip_tags($row2["cdescription"]), $array_correction);
                        $subcat_id      = $row2["cid"];
                        $subcat_image   = $row2["cimage"];
                        $content .= "".doimage("".$nukeurl."/modules/".$moduletitle."/images/cat/".$subcat_image."", $subcat_title, $thumbsize)._BR
                                   ."<a href=\"w2g_modules.php?name=".$moduletitle."&amp;func=view&amp;cid=".$subcat_id."\">"
                                   ."".$subcat_title."</a>"._BR;
                    } while ($row2 = $db->sql_fetchrow($result2));
                $title = ""._FGMENU_BROWSE."";

                $title    = char_dec($title);
                $content  = char_dec($content);
                OpenTable();
                    Title($title);
                    echo _P_CENTER.$content._P_END;
                    $query = "";
                    doPageNavigation($start,$increment,$totalresults,$query);
                CloseTable();
                }
}
// Options on ALL Pages
OpenTable();
    $title   = ""._MENUFOR." ".$modulename."";
    $content = _P_CENTER."<a href=\"w2g_modules.php?name=$moduletitle\">"._FGMENU_BROWSE."</a> | <a href=\"w2g_modules.php?name=$moduletitle&amp;op=Rated\">"._FGAMES_10RATED."</a> | <a href=\"w2g_modules.php?name=$moduletitle&amp;op=Popular\">"._FGAMES_TOP10GAMES."</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 + -