社區(php&&mysql)三

來源:互聯網
上載者:User
關鍵字 社區(php&&mysql)三
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 "
";
        viewbar();
      echo "
";
      //====ゅ徹==============
      echo "

";
          echo ":";
        echo "";
        echo "










";       echo " ";         echo " ";       echo " ";       echo " ";         echo " ";         echo " ";       echo " ";       echo " ";         echo " ";         echo " ";       echo " ";       echo "";       echo "
";
          echo $poster;
        echo "
";
          echo "ㄓ:";
        echo "
";
          echo $pip;
        echo "
";
          echo "ゅ徹ず甧:";
        echo "
";
              echo $pbody;
              echo "";
        echo "
";
      echo "
";
      
        //=======籔狟ねだㄉ===============
        echo "

";           echo "";           echo "
";        
      echo "
";
        //=======mail List===============
      echo "

";         echo "";       echo "
";  
    
      echo "
";
        viewbar();
      echo "
";
    
    
待續........
    
  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.