modcp.php

来自「wap 程序 手器电脑通用」· PHP 代码 · 共 476 行 · 第 1/2 页

PHP
476
字号
<?php
/** 
*
* @package wappyCULT: wap community script
* @version 1.00 2006/09/12 21:53:27 wappy
* @copyright (c) 2004-2006 wappyCULT 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
*/
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");
include("core.php");
connectdb();
$action = $_GET["action"];
$sid = $_GET["sid"];
if(!ismod(getuid_sid($sid)))
  {
    echo "<card id=\"main\" title=\"wappyCULT\">";
      echo "<p align=\"center\">";
      echo "You are not a mod<br/>";
      echo "<br/>";
      echo "<a href=\"index.php\">Home</a>";
      echo "</p>";
      echo "</card>";
    }
if(islogged($sid)==false)
    {
        echo "<card id=\"main\" title=\"wappyCULT\">";
      echo "<p align=\"center\">";
      echo "You are not logged in<br/>";
      echo "Or Your session has been expired<br/><br/>";
      echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</card>";
    }
    addonline(getuid_sid($sid),"Mod CP","");
if($action=="main")
{
    echo "<card id=\"main\" title=\"Mod CP\">";
    echo "<p align=\"center\">";
    echo "<b>Reports</b>";
    echo "</p>";
     echo "<p>";
    $nrpm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE reported='1'"));
    echo "<a href=\"modcp.php?action=rpm&amp;sid=$sid\">&#187;Pr. Messages($nrpm[0])</a><br/>";
    $nrps = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE reported='1'"));
    echo "<a href=\"modcp.php?action=rps&amp;sid=$sid\">&#187;Posts($nrps[0])</a><br/>";
    $nrtp = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE reported='1'"));
    echo "<a href=\"modcp.php?action=rtp&amp;sid=$sid\">&#187;Topics($nrtp[0])</a>";
    echo "</p>";
     echo "<p align=\"center\">";
    echo "<b>Logs</b>";
    echo "</p>";
    
     echo "<p>";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_mlog"));
    if($noi[0]>0){
    $nola = mysql_query("SELECT DISTINCT (action)  FROM ibwf_mlog ORDER BY actdt DESC");

      while($act=mysql_fetch_array($nola))
      {
        $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_mlog WHERE action='".$act[0]."'"));
        echo "<a href=\"modcp.php?action=log&amp;sid=$sid&amp;view=$act[0]\">$act[0]($noi[0])</a><br/>";
      }

    }
    echo "</p>";
  echo "<p align=\"center\">";
  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";
}

/////////////////////////////////Reported PMs

else if($action=="rpm")
{
  $page = $_GET["page"];
    echo "<card id=\"main\" title=\"Mod CP\">";
    echo "<p align=\"center\">";
    echo "<b>Reported PMs</b>";
    echo "</p>";
    echo "<p>";
    echo "<small>";
    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE reported ='1'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 5;
    $num_pages = ceil($num_items/$items_per_page);
    if($page>$num_pages)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;
    $sql = "SELECT id, text, byuid, touid, timesent FROM ibwf_private WHERE reported='1' ORDER BY timesent DESC LIMIT $limit_start, $items_per_page";
    $items = mysql_query($sql);
    while ($item=mysql_fetch_array($items))
    {
      $fromnk = getnick_uid($item[2]);
      $tonick = getnick_uid($item[3]);
      $dtop = date("d m y - H:i:s", $item[4]);
      $text = parsepm($item[1]);
      $flk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[2]\">$fromnk</a>";
      $tlk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$tonick</a>";
      echo "From: $flk To: $tlk<br/>Time: $dtop<br/>";
       echo $text;
       echo "<br/>";
       echo "<a href=\"modproc.php?action=hpm&amp;sid=$sid&amp;pid=$item[0]\">Handle</a><br/><br/>";
    }
    echo "</small>";
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"modcp.php?action=$action&amp;page=$ppage&amp;sid=$sid\">&#171;Prev</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"modcp.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next&#187;</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
      $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
        $rets .= "<anchor>[GO]";
        $rets .= "<go href=\"modcp.php\" method=\"get\">";
        $rets .= "<postfield name=\"action\" value=\"$action\"/>";
        $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
        
        $rets .= "</go></anchor>";

        echo $rets;
    }
    echo "<br/><br/>";
    echo "<a href=\"modcp.php?action=main&amp;sid=$sid\">";
echo "Mod R/L</a><br/>";
  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";
}

/////////////////////////////////Reported Posts

else if($action=="rps")
{
  $page = $_GET["page"];
    echo "<card id=\"main\" title=\"Mod CP\">";
    echo "<p align=\"center\">";
    echo "<b>Reported Posts</b>";
    echo "</p>";
    echo "<p>";
    echo "<small>";
    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE reported ='1'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 5;
    $num_pages = ceil($num_items/$items_per_page);
    if($page>$num_pages)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;
    $sql = "SELECT id, text, tid, uid, dtpost FROM ibwf_posts WHERE reported='1' ORDER BY dtpost DESC LIMIT $limit_start, $items_per_page";
    $items = mysql_query($sql);
    while ($item=mysql_fetch_array($items))
    {
      $poster = getnick_uid($item[3]);
      $tname = htmlspecialchars(gettname($item[3]));
      $dtop = date("d m y - H:i:s", $item[4]);
      $text = parsemsg($item[1]);
      $flk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$item[3]\">$poster</a>";
      $tlk = "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;tid=$item[2]\">$tname</a>";
      echo "Poster: $flk<br/>In: $tlk<br/>Time: $dtop<br/>";
       echo $text;
       echo "<br/>";
       echo "<a href=\"modproc.php?action=hps&amp;sid=$sid&amp;pid=$item[0]\">Handle</a><br/><br/>";
    }
    echo "</small>";
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"modcp.php?action=$action&amp;page=$ppage&amp;sid=$sid\">&#171;Prev</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"modcp.php?action=$action&amp;page=$npage&amp;sid=$sid\">Next&#187;</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
      $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
        $rets .= "<anchor>[GO]";
        $rets .= "<go href=\"modcp.php\" method=\"get\">";
        $rets .= "<postfield name=\"action\" value=\"$action\"/>";
        $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
        $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";

        $rets .= "</go></anchor>";

        echo $rets;
    }
    echo "<br/><br/>";
    echo "<a href=\"modcp.php?action=main&amp;sid=$sid\">";
echo "Mod R/L</a><br/>";
  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";
}

/////////////////////////////////Reported Posts

else if($action=="log")
{
  $page = $_GET["page"];
  $view = $_GET["view"];
    echo "<card id=\"main\" title=\"Mod CP\">";
    echo "<p align=\"center\">";
    echo "<b>$view</b>";
    echo "</p>";
    echo "<p>";
    echo "<small>";
    if($page=="" || $page<=0)$page=1;
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_mlog WHERE  action='".$view."'"));
    $num_items = $noi[0]; //changable
    $items_per_page= 5;
    $num_pages = ceil($num_items/$items_per_page);
    if($page>$num_pages)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;
    $sql = "SELECT  actdt, details FROM ibwf_mlog WHERE action='".$view."' ORDER BY actdt DESC LIMIT $limit_start, $items_per_page";

⌨️ 快捷键说明

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