Community (Php&&mysql) Three

Source: Internet
Author: User
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 "<table width=85% border=0 cellpadding=0 cellspacing=1 align=center align=center ' num ' >";
echo "<tr><td align=center>";
$nextid =next_subj ($SID);
$previd =prev_subj ($SID);
echo "<a href= $PHP _self?aid= $aid &sid= $sid >[ clip 肈";
echo "<a href= #re >[ lai セ 絞]</a>";
echo "<a href= $PHP _self?proc=view&aid= $aid >[only  inbound-がくしゅくしゅしていて";
echo "<a href= $PHP _self?proc=view&aid= $aid &sid= $nextid &rid= $nextid >[ 絞";
echo "<a href= $PHP _self?proc=view&aid= $aid &sid= $previd &rid= $previd >[ 絞";
echo "<a href= $PHP _self?proc=view&pgno= $pgno &aid= $aid &sid= $previd &rid= $previd >[process  絞]< /a> ";

echo "</td>";

echo "</tr></table>";

}
//======================================================================
Function view () {
Global $PHP _self, $aid, $sid, $rid;
Global $c _poster, $c _email;
echo "$PHP _self, $aid, $sid, $rid, $pgno";
$type = 0; 秨 Inbound Bar 肈
if ($sid && $rid) {
Addhitviews ($sid, $rid);
$type = 1;  Lai
$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", "<br>", $body);
$pbody =preg_replace ("/[www *]" ([\x0-\xff]*?) [/www *]/, ' <a href= ' \1 ' target= ' _blank ' >\1</a> ', $pbody);
$pbody =preg_replace ("/[www +" ([a-za-z0-9.:/ _-]+)] ([\x0-\xff]*?) [/www *]/, ' <a href= ' \1 ' target= ' _blank ' >\2</a> ', $pbody);

echo "<center>";
echo "<font color=green size=5><b>[$abanner]<br>";
echo "$banner </b></font></center>";
echo "<table border=0 width=95% align=center cellpadding=1 cellspacing=0 ' class= ' >";
echo "&LT;TR&GT;&LT;TD >";
ViewBar ();
echo "</td></tr>";
echo "<TR><TD>";
====ゅ Beecher ==============
echo "<table border=0 width=100% align=center cellpadding=1 cellspacing=0 ' class= ' >";
echo "<TR>";
echo "<td width= ' align= ' right ' >";
echo ":";
echo "</TD>";
echo "<td align= ' left ' >";
Echo $poster;
echo "</TD>";
echo "</TR>";
echo "<TR>";
echo "<td width= ' align= ' right ' >";
echo "ㄓ:";
echo "</TD>";
echo "<td align= ' left ' >";
Echo $pip;
echo "</TD>";
echo "</TR>";
echo "<TR>";
echo "<td width= ' align= ' right ' valign= ' top ' >";
echo "がくしゅくしゅしていて Beecher ず 甧:";
echo "</TD>";
echo "<td valign= ' class= ' bodycolor ' align= ' left ' >";
Echo $pbody;
echo "echo "</TD>";
echo "</TR>";
echo "</TD></TR>";
echo "</TABLE>";
echo "&LT;TR&GT;&LT;TD >";

======= Tapes  狟 ねだㄉ===============
echo "<table border=0 width=100% align=center cellpadding=3 cellspacing=0 ' class= ' >";
echo "<form name=mtab enctype=multipart/form-data method=post action= $PHP _self?proc=mail_friend>";
echo "<input type= ' hidden ' name=sid value= ' $sid ' > ';
echo "<input type= ' hidden ' name=aid value= ' $aid ' > ';
echo "<input type= ' hidden ' name=rid value= ' $rid ' > ';
echo "<input type= ' hidden ' name=poster value= ' $c _poster ' >";
echo "<input type= ' hidden ' name=email value= ' $c _email ' >";
echo "<TR>";
echo "<td align= ' right ' width=250>";
echo "Tapes  狟 ねだㄉ This test 絞 Beecher:";
echo "</TD>";
echo "<TD>";
echo "<input type= ' TEXT ' name= ' frmail ' size=25 value= ' ねe-mail ' >";

echo "<input type= ' Submit ' value= ' 癳  ' >";
echo "</TD>";
echo "</TR>";
echo "</FORM>";
echo "</TABLE>";
echo "</td></tr>";
echo "&LT;TR&GT;&LT;TD >";
=======mail list===============
echo "<table border=0 width=100% align=center cellpadding=3 cellspacing=0 ' class= ' >";
echo "<form name=mtab enctype=multipart/form-data method=post action= $PHP _self?proc=mail_list>";
echo "<input type= ' hidden ' name=sid value= ' $sid ' > ';
echo "<input type= ' hidden ' name=aid value= ' $aid ' > ';
echo "<input type= ' hidden ' name=rid value= ' $rid ' > ';
echo "<input type= ' hidden ' name=poster value= ' $c _poster ' >";
echo "<input type= ' hidden ' name=email value= ' $c _email ' >";

echo "<tr >";
echo "<td align= ' right ' width=250>";
echo "璹 border O 肈  urine 癚 order:";
echo "</TD>";
echo "<TD>";
if (strlen ($c _email)) $addmail = $c _email;
else $addmail = "e-mail";
echo "<input type= ' TEXT ' name= ' email ' size=25 value= ' $addmail ' >";
echo "<input type= ' Submit ' name= ' way1 ' value= '  璹";
echo "<input type= ' Submit ' name= ' way2 ' value= '  璹";
$qsql = "SELECT id from BBS_SML where sid= ' $sid '";
$rs =mysql_db_query ($sql [' db '], $qsql);
$nums =mysql_num_rows ($RS);
echo "<br> this test  肈 ヘ zhi 璹 to H: $nums";
echo "</TD>";
echo "</TR>";
echo "</FORM>";
echo "</TABLE>";

echo "</td></tr>";
echo "&LT;TR&GT;&LT;TD >";
ViewBar ();
echo "</td></tr>";
echo "</TABLE>";


Cond........


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.