基于mysql的论坛(5)

## manage_read.php
<?php
require ("func.php");
if (check_admin_password()) {
    $board=$jl_forum[board];
    switch ($job){
        case "setgood":
            set_good($jl_forum[board],$uid);
            $work=1;
            break;
        case "setnogood":
            set_no_good($jl_forum[board],$uid);
            $work=1;
            break;
        case "delete":
            del_doc($jl_forum[board],$uid);
            $work=1;
            break;
    }
if (!$word) {
    add_one_hit($board,$id);
}
$sql="select * from $board where id=$id";
$sql_result=mysql_query($sql);
$sum=mysql_num_rows($sql_result);
$sql_row=mysql_fetch_array($sql_result);
$title=$sql_row[title];
$writer=$sql_row[writer];
$cont=$sql_row[cont];
$writetime=$sql_row[writetime];
$hits=$sql_row[hits];
$good=$sql_row[good];
$rootid=$sql_row[id];
$fromip=$sql_row[fromip];
$sql="select * from $board where slaveid=$id";
$sql_result=mysql_query($sql);
if ($sum<>0) {
?>
<html>
<head>
<title><?php echo $title;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script language="javascript">
function sendmsg(name){                window.open("sendmsg.php?name="+name,"","height=200,width=500,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>

</head>

<body bgcolor="#666699">
<?php include "ad.php";?><br>
<hr noshade width="98%" size="1">
<table width="98%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
  <tr bgcolor="#666666">
    <td><font color="#FFcc00"><b>标题:<?php echo $title;?> <font color="#FFFFCC">◎操作:</font></b></font><b><?php echo "<a href="$php_self?job=setgood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转进精华区</font></a></b><font color="#FFcc00"><b> </b></font><b><?php echo "<a href="$php_self?job=delete&uid=$id&id=$rootid">";?><font color="#FFFFFF">删除</font></a></b><font color="#FFcc00"><b><?php
if ($good=="y"){
?> </b></font><b><?php echo "<a href="$php_self?job=setnogood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转出精华区</font></a></b><font color="#FFcc00"><b>  
      <?php
}
?> </b></font></td>
  </tr>
  <tr>
    <td bgcolor="#eeeeee">作者:<?php echo "$writer";?>(<?php echo $writetime;?>,点击:<?php echo $hits;?>) <a href="javascript:sendmsg('<?php echo "$writer";?>')"><img src="image/icon1.gif" width="18" height="17" alt="给作者留言" border="0"></a> <a href="userinfo.php?name=<?php echo $writer;?>"><img src="image/profile.gif" width="16" height="16" alt="察看用户资料" border="0"></a></td>
  </tr>
  <tr>
    <td bgcolor="#ffffef"><?php echo $cont;?></td>
  </tr>
  <tr bgcolor="#e8eee0">
    <td>※ 来源:<?php echo $jl_forum[chinesename];?> [◆FROM:<?php echo $fromip;?>]</td>
  </tr>
</table>
<br>
<?php
if (!$add){
while($sql_row=mysql_fetch_array($sql_result)) {
$good=$sql_row[good];
?>
<table width="98%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
  <tr bgcolor="#015C71">
    <td><font color="#ffffff">标题:<?php echo $sql_row[title];
    $id=$sql_row[id];
    ?> <font color="#FFFFCC">◎操作:</font></b></font><b><?php echo "<a href="$php_self?job=setgood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转进精华区</font></a></b><font color="#FFcc00"><b> </b></font><b><?php echo "<a href="$php_self?job=delete&uid=$id&id=$rootid">";?><font color="#FFFFFF">删除</font></a></b><font color="#FFcc00"><b><?php
if ($good=="y"){
?> </b></font><b><?php echo "<a href="$php_self?job=setnogood&uid=$id&id=$rootid">";?><font color="#FFFFFF">转出精华区</font></a></b><font color="#FFcc00"><b>  
      <?php
}
?> </b></font></td>
  </tr>
  <tr bgcolor="#eeeeee">
    <td>作者:<?php echo "$sql_row[writer]";?>(<?php echo $sql_row[writetime];?>) <a href="javascript:sendmsg('<?php echo "$sql_row[writer]";?>')"><img src="image/icon1.gif" width="18" height="17" alt="给作者留言" border="0"></a> <a href="userinfo.php?name=<?php echo "$sql_row[writer]";?>"><img src="image/profile.gif" width="17" height="16" alt="察看用户资料" border="0"></a></td>
  </tr>
  <tr>
    <td bgcolor="#ffffef"><?php echo $sql_row[cont];?></td>
  </tr>
  <tr bgcolor="#e8eee0">
    <td>※ 来源:<?php echo $jl_forum[chinesename];?> [◆FROM:<?php echo $sql_row[fromip];?>]</td>
  </tr>
</table>
<?php
}
}
?> <br>
<?php include"footer.php";?><br>
</body>
</html>
<?php
}
else {
    echo "此条纪录已经被删除";
}
}
else {
    show_error(1);
}
?>
## modify.php
<?php
require "func.php";
if (check_user_password($jl_forum[name],$jl_forum[password])) {
$name=$jl_forum[name];
$password=$jl_forum[password];
$sql="select * from user where name='$name'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
?>
<html>
<head>
<title>修改资料</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body bgcolor="#FFFFFF" background="image/bg.gif">
<?php include "header.php";?><br>
<hr noshade width="97%" size="1">
<div align="center">修改用户个人资料<br>
  <table width="90%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#336699" bordercolordark="#FFFFFF">
    <tr valign="top">  
      <td colspan="2">  </td>
    </tr>
    <tr>  
      <td colspan="2">  
        <form method="post" action="change.php">
          <table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
            <tr>  
              <td align="right">用户名</td>
              <td><?php echo $name;?></td>
            </tr>
            <tr>  
              <td align="right">密码</td>
              <td>  
                <input type="password" name="pwd1" maxlength="8" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="9" value="<?php echo $password;?>">
                * </td>
            </tr>
            <tr>  
              <td align="right">重复密码</td>
              <td>  
                <input type="password" name="pwd2" maxlength="8" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="9" value="<?php echo $password;?>">
                * </td>
            </tr>
            <tr>  
              <td align="right">Email</td>
              <td>  
                <input type="text" name="email" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[email];?>">
                * </td>
            </tr>
            <tr>  
              <td align="right">性别</td>
              <td>  
                <select name="sex">
                  <option value="秘密" selected>秘密</option>
                  <option value="男">男</option>
                  <option value="女">女</option>
                </select>
              </td>
            </tr>
            <tr>  
              <td align="right">真实性名</td>
              <td>  
                <input type="text" name="realname" size="17" maxlength="16" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[realname];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">地址</td>
              <td>  
                <input type="text" name="address" maxlength="40" size="30" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[address];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">电话</td>
              <td>  
                <input type="text" name="phone" size="22" maxlength="20" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" value="<?php echo $sql_row[phone];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">主页</td>
              <td>  
                <input type="text" name="homepage" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="50" value="<?php echo $sql_row[homepage];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">OICQ</td>
              <td>  
                <input type="text" name="oicq" maxlength="11" style="font-size: 9pt; background-color: #FFFFFF; color: #FF0000; border: 1 solid #000000" size="12" value="<?php echo $sql_row[oicq];?>">
              </td>
            </tr>
            <tr>  
              <td align="right">签名</td>
              <td><?php echo "$sql_row[qm]<br>";?>  
                <textarea name="qm" wrap="VIRTUAL" cols="50"></textarea>
              </td>
            </tr>
            <tr>  
              <td align="right">  </td>
              <td align="center">  
                <input type="submit" name="b2" value="修改">
                <input type="reset" name="Submit2" value="清除" >
              </td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
  </table>
  <div align="center"><br>
  </div>
</div>
<?php include "footer.php";?>
</body>
</html>
<?php
}
else {
    show_error(4);
}
?>
## modify_l.php
<?php
require "func.php";
if ($b1) {
    if (is_user_exits($name) and check_user_password($name,$password)) {
    setcookie ("jl_forum[name]",$name);
    setcookie ("jl_forum[password]",$password);
    redirect2("modify.php");
    }
    else {
        show_error(4);
    }
}
else {
?>
<html>
<head>
<title>main</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/page.css">
</head>

<body bgcolor="#FFFFFF" background="image/bg.gif">
<table width="90%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#FFCC99" bordercolordark="#FFCC99">
  <tr bgcolor="#CCFF99">  
    <td>
      <div align="center"><b>修改资料登陆</b></div>
    </td>
  </tr>
  <tr align="center">  
    <td>
      <form method="post" action="modify_l.php">
        <table width="70%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="38%" align="right">用户名:</td>
            <td width="62%" align="left">
              <input type="text" name="name" size="17" maxlength="16">
            </td>
          </tr>
          <tr>
            <td width="38%" align="right">密码:</td>
            <td width="62%" align="left">
              <input type="password" name="password" size="17" maxlength="16">
            </td>
          </tr>
        </table>
        <input type="submit" name="b1" value="进入">
      </form>
    </td>
  </tr>
  <tr bgcolor="#CCFF99">  
    <td>
      <div align="center"><b>论坛信息</b></div>
    </td>
  </tr>
  <tr valign="top">  
    <td>  
<?php include "info.php";?>
    </td>
  </tr>
</table>
</body>
</html>
<?php
}
?>
## oper.php
<?php
require "func.php";
if (adminok()) {
    if (isset($add_board)) {
        if (isset($name) and isset($chinesename) and !is_board_exits($name)) {
            create_board_table($name,$chinesename);
        }
        else {
            echo "出现错误!(可能版面已经存在)";
            $founderr=1;
        }
    }
    elseif (isset($del_board)) {
        if (isset($board)) {
            drop_board_table($board);
        }
        else {
            echo "出现错误!(请选择要删除的版面)";
            $founderr=1;
        }
    }
    elseif (isset($modify)) {
        if (isset($name) and isset($chinesename)) {
            update_board($name,$chinesename);
        }
        else {
            echo "出现错误!(请填写完整)";
            $founderr=1;
        }
    }
    elseif (isset($add_admin)) {
        if (is_user_exits($name) and isset($board)) {
            add_admin($board,$name);
        }
        else {
            echo "出现错误!(极有可能是用户不存在)";
            $founderr=1;
        }
    }
    elseif (isset($delete_admin)) {
        if (is_user_exits($name)) {
            del_admin($name);
        }
        else {
            echo "出现错误!(极有可能是用户不存在)";
            $founderr=1;
        }
    }
    else {
        echo "你要干什么?";
        $founderr=1;
    }
    if (!$founderr) {
        redirect2("admin.php");
    }
}
else {
    show_error(1);
}
?>

(0)

相关推荐

  • 基于mysql的论坛(3)

    ##################### # func.php ######### #################### <?php require("config.inc.php"); ##### 检查用户是否存在 ##### function is_user_exits($name) {          $name=trim($name);          $name=ereg_replace("'","'",$name);

  • 基于mysql的论坛(5)

    ## manage_read.php <?php require ("func.php"); if (check_admin_password()) {     $board=$jl_forum[board];     switch ($job){         case "setgood":             set_good($jl_forum[board],$uid);             $work=1;             break

  • 基于mysql的论坛(6)

    # post.php <?php require("config.inc.php"); $sql="select * from boardinfo where name='$board'"; $sql_result=mysql_query($sql); $sql_row=mysql_fetch_array($sql_result); ?> <html> <head> <title>发新贴子</title>

  • 基于mysql的论坛(2)

    ################################# ## apply.php #################### ################################# <html> <head> <title>注册用户</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

  • 基于mysql的论坛(4)

    ## index.php <html> <head> <title>论坛</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <frameset cols="125,*" rows="*" border="0" f

  • 基于mysql的论坛(7)

    # sendmsg.php <?php require "func.php"; if ($b1) {     if (is_user_exits($fromname) and check_user_password($fromname,$password)) {         sendmsg();         echo "成功!<br><form method="POST"><input type="bu

  • 基于mysql的论坛(1)

    ############################################### 此篇文章属原创,如有引用,请标明作者信息. 作者:冷情疯子 Email: edincur@yeah.net http://safebase.yeah.net ############################################### ## adduser.php ################################ ###########################

  • 基于Mysql的Sequence实现方法

    团队更换新框架.新的业务全部使用新的框架,甚至是新的数据库--Mysql. 这边之前一直是使用oracle,各种订单号.流水号.批次号啥的,都是直接使用oracle的sequence提供的数字序列号.现在数据库更换成Mysql了,显然以前的老方法不能适用了. 需要新写一个: •分布式场景使用 •满足一定的并发要求 找了一些相关的资料,发现mysql这方面的实现,原理都是一条数据库记录,不断update它的值.然后大部分的实现方案,都用到了函数. 贴一下网上的代码: 基于mysql函数实现 表结构

  • 基于MySql的扩展功能生成全局ID

    本文利用 MySQL的扩展功能 REPLACE INTO 来生成全局id,REPLACE INTO和INSERT的功能一样,但是当使用REPLACE INTO插入新数据行时,如果新插入的行的主键或唯一键(UNIQUE Key)已有的行重复时,已有的行会先被删除,然后再将新数据行插入(REPLACE INTO 是原始操作). 建立类似下面的表: CREATE TABLE `tickets64` ( `id` bigint(20) unsigned NOT NULL auto_increment,

  • PHP基于MySQL数据库实现对象持久层的方法

    本文实例讲述了PHP基于MySQL数据库实现对象持久层的方法.分享给大家供大家参考.具体如下: 心血来潮,做了一下PHP的对象到数据库的简单持久层. 不常用PHP,对PHP也不熟,关于PHP反射的大部分内容都是现学的. 目前功能比较弱,只是完成一些简单的工作,对象之间的关系还没法映射,并且对象的成员只能支持string或者integer两种类型的. 成员变量的值也没有转义一下... 下面就贴一下代码: 首先是数据库的相关定义,该文件定义了数据库的连接属性: <?php /* * Filename

随机推荐