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

📄 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           */
/*                                                                            */
/*  Content Mobile for WAP-2-GO                                               */
/*                                                                            */
/*  FILE DETAILS and EXPLANATION:                                             */
/*  functions.php - Specific Functions for Module                             */
/******************************************************************************/
// Include the Module's Functions
include_once "functions.php";
$pid    = $_GET['pid'];
$cid    = $_GET['cid'];
$start  = $_GET['start'];

if (!$start)     { $start = 0; }
if (!$increment) { $increment = 5; }

// Module Content
        if ($pid!="") 
                {
                    // Display Page
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $query = "select * from $prefix"._pages." WHERE pid = '$pid'";
                    $result = $db->sql_query($query);
                    $data = $db->sql_fetchrow($result);
                    $access = $data["active"];
                    if ($userlevel==2) { $access = 1; }
                    if ($access==1)
                        {
                        $pagename   = strtr(strip_tags($data["title"]), $array_correction);
                        $subtitle   = strtr(strip_tags($data["subtitle"]), $array_correction);
                        $pageheader = strtr(strip_tags($data["page_header"]), $array_correction);
                        $text       = strtr(strip_tags($data["text"]), $array_correction);
                        $pagefooter = strtr(strip_tags($data["page_footer"]), $array_correction);
                        $signature  = strtr(strip_tags($data["signature"]), $array_correction);
                        $date   = $data["date"];
                        $hits   = $data["counter"];
                        $lang   = $data["clanguage"];
                        
                        $title = "".$pagename."";
                        $content = "\n        "._B.$subtitle._B_END."<br/><br/>"
                                  ."\n        ".$pageheader."<br/><br/>"
                                  ."\n        ".$text."<br/><br/>"
                                  ."\n        ".$pagefooter."<br/><br/>"
                                  ."\n        ".$signature."<br/><br/>"
                                  ."\n        "._B.$hits._B_END." "._READS."<br/>";

                        $title   = char_dec($title);
                        $content = wordwrap($content,25,"\n",1);
                        $content = char_dec($content);
                        OpenTable();
                            Title($title);
                            echo _P_LEFT.$content._P_END;
                        CloseTable();
                        }
                    else { $title = _ACCESSDENIED;
                           $content = _RESTRICTEDAREA; 
                           $title   = char_dec($title);
                           $content = char_dec($content);
                           OpenTable();
                             Title($title);
                             echo _P_CENTER.$content._P_END;
                           CloseTable(); }
        } else if ($cid!="") 
                {
                    // Display Pages within Category
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $query = "select * from $prefix"._pages." where cid = $cid limit $start,$increment";
                    $totalresults = $db->sql_numrows($db->sql_query($query));
                    $result = $db->sql_query($query);
                    $data = $db->sql_fetchrow($result);
                    $i = 0;
                    $content = "";
                        do {
                            if ($data) {$i = $i+1;
                            $title      = strtr(strip_tags($data["title"]), $array_correction);
                            $subtitle   = strtr(strip_tags($data["subtitle"]), $array_correction);
                            $pid        = $data["pid"];}
                            // Display Page Title and Subtitle
                            if ($i<11) { $content .= ""._B."<a href=\"w2g_modules.php?name=Content&amp;pid=".$pid."\" title=\""._BREAD." ".$title."\">- ".$title."</a>"._B_END." | ".$subtitle."<br/>"; }
                        } while ($data = $db->sql_fetchrow($result));
                    $result = $db->sql_query("select * from $prefix"._pages_categories." where cid = $cid");
                    $data = $db->sql_fetchrow($result);
                        $title = strtr(strip_tags($row["title"]), $array_correction);
                    $title   = char_dec($title);
                    $content = char_dec($content);
                    OpenTable();
                        Title($title);
                        echo _P_LEFT.$content._P_END;
                            $query = "&amp;cid=".$cid."";
                            doPageNavigation($start,$increment,$totalresults,$query);
                    CloseTable();
        } else {
                    // Display All Categories
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $query = "select * from $prefix"._pages_categories." order by title ASC";
                    $totalresults = $db->sql_numrows($db->sql_query($query));
                    $query .= "  LIMIT $start,$increment";
                    $result = $db->sql_query($query);
                    $row = $db->sql_fetchrow($result);
                    $content    = "";
                    $i = 0;
                    if ($row)
                        {
                        do {
                            $i = $i+1;
                            $title      = strtr(strip_tags($row["title"]), $array_correction);
                            $description= strtr(strip_tags($row["description"]), $array_correction);
                            $cid        = $row["cid"];
                            // Display Article Image and then details
                            if ($i<11) {    $content .= _B."<a href=\"w2g_modules.php?name=Content&amp;cid=".$cid."\" title=\"".$title."\">- ".$title."</a>"._B_END." | ".$description."<br/>";   }
                            } while ($row = $db->sql_fetchrow($result));
                        $title = ""._CONTENTCATEGORIES."";
                        $title   = char_dec($title);
                        $content = char_dec($content);
                        OpenTable();
                            Title($title);
                            echo _P_CENTER.$content._P_END;
                            $query = "";
                            doPageNavigation($start,$increment,$totalresults,$query);
                        CloseTable();
                        }
                    else {
                    $content = char_dec(""._MODULENOTACTIVE."");
                    OpenTable();
                        echo _P_CENTER.$content._P_END;
                    CloseTable();  }
                }
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -