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

📄 index.php

📁 一个好用的php wap cms portal
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
$popular_pics= 1; // Toggle Popular Pics on(1)/off(0)
$random_pics = 1; // Toggle Random Pics on(1)/off(0)
$recent_pics = 1; // Toggle Recent Pics on(1)/off(0)

/******************************************************************************/
/*  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           */
/*                                                                            */
/*  coppermine Photo Gallery MODULE                                           */
/*                                                                            */
/*  FILE DETAILS and EXPLANATION:                                             */
/*  functions.php - Specific Functions for Module                             */
/******************************************************************************/
// Include the Module's Functions
include_once "modules/coppermine/functions.php";

// Fetch Query Strings
$op = $_GET['op'];
$id = $_GET['id'];
$aid = $_GET['aid'];
$file = $_GET['file'];

// Module Content
$fullwidth = $usergfxpref-10;
// Get Module Config
    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
    $result = $db->sql_query("select value from $prefix"._cpg_config." where name = 'gallery_description' limit 1");
    $row = $db->sql_fetchrow($result);
    $gallery_description = strtr(strip_tags($row["value"]), $array_correction);
// Case op = ViewPic
if ($op=="ViewPic")
                {
                $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                $result = $db->sql_query("select * from $prefix"._cpg_pictures." where pid = '$id' limit 1");
                $row = $db->sql_fetchrow($result);
                if ($row) { 
                        $title  = strtr(strip_tags($row["title"]), $array_correction);
                        $imagepath = $row["filepath"];
                        $image  = $row["filename"];
                        $image  = $image;
                        $image  = $imagepath.$image;
                        $caption   = $row["caption"];
                        $author   = $row["owner_name"];
                        $hits   = $row["hits"];
                        $score  = $row["pic_rating"];
                        $pid    = $row["pid"];
                        $content = "<a href=\"".$nukeurl."/".$image."\" title=\"".VIEW_FS."\">"
                                  ."".doimage("".$nukeurl."/".$image."", $title, $usergfxpref)."</a><br/>"
                                  ."<a href=\"".$nukeurl."/".$image."\" title=\"".VIEW_FS."\">".VIEW_FS."</a> | <a href=\"includes/w2g_thumbs.php?src=".$nukeurl."/".$image."&amp;x=".$usergfxpref."&amp;t=".$imgtype."&amp;f=0&amp;q=".$jpeg_img_qual."\" title=\"".IMAGE." - ".TH_WD.": ".$fullwidth."px\">".IMAGE." (".TH_WD.": ".$usergfxpref."px)</a>"._BR."";
                        $content .= _I.$caption._I_END._BR._BR;
                        $content .= _I."Posted By "._B
                                  ."<a href=\"w2g_modules.php?name=Your_Account&amp;op=userinfo&amp;username=".$author."\">"
                                  .$author."</a>"._B_END._I_END." | "
                                  ._I."Score "._B.$score._B_END._I_END." | "
                                  ._I."Hits "._B.$hits._B_END._I_END;
                    $title   = char_dec($title);
                    $content = char_dec($content);
                    OpenTable();
                        Title($title);
                        echo $content;
                    CloseTable();
                        }
                else { $title = ""._NO_IMG_TO_DISPLAY."";
                       $content = ""._NON_EXIST_AP."";
                    $title   = char_dec($title);
                    $content = char_dec($content);
                        OpenTable();
                            Title($title);
                            echo _P_CENTER.$content._P_END;
                        CloseTable();}
            }
else if ($op=="ViewAlbum") 
                {
                    if ($aid) {
                                $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                                $totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._cpg_pictures." where aid = '$aid' ORDER BY title ASC"));
                                $result = $db->sql_query("select * from $prefix"._cpg_pictures." where aid = '$aid' ORDER BY title ASC limit $start,$increment");
                                $row = $db->sql_fetchrow($result);
                                $thumbsize = ($usergfxpref/2)-2;
                                $thumb      =   "includes/w2g_thumbs.php?src=".$nukeurl."/";
                                $thumbconfig    =   "&amp;x=".$thumbsize."&amp;t=".$imgtype."&amp;f=0";
                                
                                if($row)
                                    {
                                        do {
                                            $title  = strtr(strip_tags($row["title"]), $array_correction);
                                                                                       $imagepath = $row["filepath"];
                                            $image  = $row["filename"];
                                            $image  = "".$imagepath.$image."";
                                            $caption   = strtr(strip_tags($row["caption"]), $array_correction);
                                            $author   = $row["owner_name"];
                                            $hits   = $row["hits"];
                                            $score  = $row["pic_rating"];
                                            $pid    = $row["pid"];
                                            $content = "<a href=\"w2g_modules.php?name=coppermine&amp;op=ViewPic&amp;id=".$pid."\" title=\"".VIEW_FS."\">";
                                            $content .= "".doimage("".$nukeurl."/".$image."", "".VIEW_FS.": ".$title."", $thumbsize)."</a>";
                                            $content .= _BR._I.$caption._I_END;
                                            if (!$title) { $title = $row["filename"]; }
                                            $title = "".$title.":";
                                            $title   = char_dec($title);
                                            $content = char_dec($content);

                                            doAlbumImage($title,$content,$score,$author,$hits);
                                        } while ($row = $db->sql_fetchrow($result));
                                        $query = "&amp;op=ViewAlbum&amp;aid=".$aid."";
                                        doPageNavigation($start,$increment,$totalresults,$query);
                                    }   else    { 
                                            OpenTable();
                                            $title = ""._ERROR."";

                                            $title   = char_dec($title);
                                            $content = char_dec($content);
                                            Title($title); echo _P_CENTER.NON_EXIST_AP._P_END; }
                    }
            }
else if ($op=="Albums")
                {
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $totalresults = $db->sql_numrows($db->sql_query("select * from $prefix"._cpg_albums." where visibility <= '$userlevel' order by title ASC"));
                    $result = $db->sql_query("select * from $prefix"._cpg_albums." where visibility <= '$userlevel' order by title ASC LIMIT $start,$increment");
                    $row = $db->sql_fetchrow($result);
                    $content    = "";
                    if($row)
                        {
                        do {
                            $title  = strtr(strip_tags($row["title"]), $array_correction);
                            $description= strtr(strip_tags($row["description"]), $array_correction);
                            $aid            = $row["aid"];
                                    // Obtain a Thumbnail Image
                                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                                    $result1 = $db->sql_query("select * from $prefix"._cpg_pictures." where aid = '$aid' order by pic_rating DESC limit 1");
                                    $row1 = $db->sql_fetchrow($result1);
                                    $filepath = $row1["filepath"];
                                    $filename = $row1["filename"];
                                    $imageurl = $filepath.$filename;    
                                    $thumbsize = $usergfxpref/8;
                                    $thumb      =   $nukeurl."/mobile/includes/w2g_thumbs.php?src=".$nukeurl."/";
                                    $album_thumb = "".doimage($imageurl, '', $thumbsize)."";
                            $content .= "<a href=\"w2g_modules.php?name=coppermine&amp;op=ViewAlbum&amp;aid=".$aid."\" title=\"Read\">".$album_thumb." ".$title."</a>: ".$description._BR."";
                        } while ($row = $db->sql_fetchrow($result));

                            $title = "".SELECT_ALBUM."";
                            $title   = char_dec($title);
                            $content = char_dec($content);
                            OpenTable();
                                Title($title);
                                echo _P_CENTER.$content._P_END;
                                $query = "&amp;op=Albums";
                                doPageNavigation($start,$increment,$totalresults,$query);
                            CloseTable();
                        }
                    else {  OpenTable();
                                $title = ""._ERROR."";
                                $content = ""._NON_EXIST_AP."";
                                $title   = char_dec($title);
                                $content = char_dec($content);
                                Title($title);
                                echo _P_CENTER.$content._P_END;
                            CloseTable();}
                }
else if ($op=="ViewCat")
                {
                    // Get Category name
                    $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
                    $result = $db->sql_query("select * from $prefix"._cpg_categories." where cid = '$id' limit 1");
                    $row = $db->sql_fetchrow($result);
                    $title = $row["catname"];
                    $content = $row["description"];

⌨️ 快捷键说明

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