Community (php & mysql) 3

Source: Internet
Author: User
Community (php & amp; mysql) three functions 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;
}
// Configure
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 "[folder]";
Echo "[Lai Yun]";
Echo "[zookeeper]";
Echo "[response]";
Echo "[response]";
// Echo "[CHENG Jing]";

Echo"
";

}
// ================================================ ======================================
Function view (){
Global $ PHP_SELF, $ aid, $ sid, $ rid;
Global $ c_poster, $ c_email;
// Echo "$ PHP_SELF, $ aid, $ sid, $ rid, $ pgno ";
$ Type = 0; // Adjust parallel bars
If ($ sid & $ rid ){
Addhitviews ($ sid, $ rid );
$ Type = 1; // Click
$ 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"
";
// ===== Chanchefile ======================
Echo"













";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo"";Echo"
";
Echo ":";
Echo"
";
Echo $ poster;
Echo"
";
Echo "success :";
Echo"
";
Echo $ pip;
Echo"
";
Echo "Success success :";
Echo"
";
Echo $ pbody;
Echo" ";
Echo"
";
Echo"
";

// ======== Commandid already exist ======================
Echo"

";Echo "";Echo"
";
Echo"
";
// ======= Mail List ==========================
Echo"

";Echo "";Echo"
";

Echo"
";
Viewbar ();
Echo"
";


To be Continued ........

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.