您的位置:首页网页设计PHP实例 → 社区php&&mysql三

社区php&&mysql三

时间:2004/11/7 3:27:00来源:本站整理作者:蓝点我要评论(0)

function prev_subj($id){

    $DROOT=getenv('DOCUMENT_ROOT');

    include("sql.php3");

    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  

    $qstr="select id,aid from bbs_subj where id='$id'";

    $rs=mysql_db_query($sql['db'],$qstr);     

    $row=mysql_fetch_array($rs);

    $aid=$row['aid'];

     

    $qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";

    $rs=mysql_db_query($sql['db'],$qstr);

    $pid=$id;     

    while($row=mysql_fetch_array($rs)){

        $tid=$row['id'];     

        if($id==$tid) break;

        $pid=$tid;

    }

     

    return $pid;

}

// 絞

function next_subj($id){

    $DROOT=getenv('DOCUMENT_ROOT');

    include("sql.php3");

    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  

    $qstr="select id,aid from bbs_subj where id='$id'";

    $rs=mysql_db_query($sql['db'],$qstr);     

    $row=mysql_fetch_array($rs);

    $aid=$row['aid'];

     

    $qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";

    $rs=mysql_db_query($sql['db'],$qstr);

    $pid=$id;     

    while($row=mysql_fetch_array($rs)){

        $pid=$row['id'];     

        if($id==$pid) break;

    }

    if($row=mysql_fetch_array($rs)) {

        $pid=$row['id'];

    }

    return $pid;

}



//======================================================================

function viewbar() {

    global $pgno;

    global $PHP_SELF;

    global $aid,$sid;

    //global $OPEN_LIST;

    echo "";

    echo "";

             

    echo "

";

        $nextid=next_subj($sid);

        $previd=prev_subj($sid);

        echo "[夹肈跋]";

        echo "[莱セ絞]";

        echo "[祇穝ゅ彻]";

        echo "[絞]";

        echo "[絞]";

        //echo "[程絞]";

         

    echo "

";     

     

}

//======================================================================

function view() {

    global $PHP_SELF,$aid,$sid,$rid;

    global $c_poster,$c_email;

    //echo "$PHP_SELF,$aid,$sid,$rid,$pgno";

    $type=0; //秨穝杠肈

  if($sid && $rid) {

      addhitviews($sid,$rid);

    $type=1; //莱

    $db_table="bbs_subj";

    if($sid!=$rid)    $db_table="bbs_docs";

    $DROOT=getenv('DOCUMENT_ROOT');

    include("sql.php3");

    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  

    $qstr="select banner from bbs_area where id='$aid'";

    $rs=mysql_db_query($sql['db'],$qstr);

    echo mysql_error();

    $row=mysql_fetch_array($rs);

    $abanner=$row['banner'];

     

    $qsql="SELECT * from $db_table where id='$rid' ";

    $rs=mysql_db_query($sql['db'],$qsql);

    $row=mysql_fetch_array($rs);

    $poster=$row['poster'];

    $pip=$row['pip'];

    $wdate=$row['wdate'];

    $rebanner=$banner=$row['banner'];

    $body=$row['body'];

    $body=htmlspecialchars($body);

    $pbody=ereg_replace("n","
",$body);

    $pbody =preg_replace( "/[www *]([\x0-\xff]*?)[/www *]/", '\1', $pbody );  

    $pbody =preg_replace( "/[www +([a-zA-Z0-9.:/_-]+)]([\x0-\xff]*?)[/www *]/", '\2', $pbody );  

     

    echo "

";

    echo "[$abanner]
";

    echo "$banner

";

    echo "";

            echo "";

            echo "";

                echo "

";

                    echo ":";

                echo "";

                echo "

 

";

            echo "";

            echo "";

                echo "";

                echo "";

            echo "";

            echo "";

                echo "";

                echo "";

            echo "";

            echo "";

            echo "

";

                viewbar();

            echo "

";

            //====ゅ彻==============

            echo "";              echo "

";

                    echo $poster;

                echo "

";

                    echo "ㄓ:";

                echo "
";

                    echo $pip;

                echo "
";

                    echo "ゅ彻ず甧:";

                echo "
";

                            echo $pbody;

                            echo "
";

                echo "

";

            echo "";

                       echo "";

                       echo "";

                    echo "";

                echo "";     

                echo "

";

             

                //=======籔狟ねだㄉ===============

                echo "";                      echo "";                  echo "";                  echo "";                  echo "";                  echo "";                  echo "";                      echo "

";

                        echo "籔狟ねだㄉ硂絞ゅ彻:";

                       echo "
";

                        echo "";

                

                        echo "";

                       echo "

";                 

            echo "";

            echo "";

               echo "";

               echo "";

            echo "";     

            echo "";

            echo "

";

                //=======mail List===============

            echo "";                  echo "";                  echo "";                  echo "";                  echo "";                  echo "";                  echo "";               echo "

";

                echo "璹境o肈尿癚阶:";

               echo "
";

                if(strlen($c_email)) $addmail=$c_email;

                else $addmail="E-mail";

                echo "";

                echo "";

                $qsql="SELECT id from bbs_sml where sid='$sid'";

                $rs=mysql_db_query($sql['db'],$qsql);

                $nums=mysql_num_rows($rs);

                echo "
硂肈ヘ玡璹兢H计:$nums";

               echo "

";     

         

            echo "";

            echo "";

        echo "

";

                viewbar();

            echo "

";

         

         

待续........

         

相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 我的php文件怎么打开_php运算符怎么写 php 如何生成静态页面的函数PHP生成图片缩略图PHP session常见问题集锦及解决办法PHP实现同步远程Mysql

人气排行 DEDE在文章列表文章没有缩略图的不显示图片php+mysq修改用户密码我的php文件怎么打开_如何打开php文件的办法FCKeditor的配置和使用方法使用dedecms建站教程PHP+Ajax实现分页技术图片存储与浏览一例Linux+Apache+PHP+MySQLPHP生成图片缩略图