function Cook_cooloff () {
Global $php _self, $aid, $pgno;
Setcookie ("Open_list", 0,time () + 31536000);
Header ("Location: $PHP _self?aid= $aid &pgno= $pgno");
Exit
}
//===============================================================
function Cook_coolon () {
Global $PHP _self, $aid, $pgno;
Setcookie ("Open_list", 1,time () + 31536000);
Header ("Location: $PHP _self?aid= $aid &pgno= $pgno");
Exit
}
function Check_mail ($semail)
{
$str =strchr ($semail, ' @ ');
if ($str = = "") return false;
$str =STRCHR ($semail, ".");
if ($str = = "") return false;
return true;
}
//================================================================
function Addhitviews ($sid, $rid) {
$DROOT =getenv (' document_root ');
Include ("sql.php3");
$db =mysql_connect ($sql [' Host '], $sql [' User '], $sql [' passwd '];
if ($sid = = $rid) $qsql = "SELECT * from BBS_SUBJ where id= ' $rid '";
else $qsql = "SELECT * from Bbs_docs where id= ' $rid '";
$rs =mysql_db_query ($sql [' db '], $qsql);
$row =mysql_fetch_array ($RS);
$views = $row [' views '];
$views + +;
if ($sid = = $rid) $qsql = "UPDATE bbs_subj SET views= ' $views ' where id= ' $rid '";
else $qsql = "UPDATE bbs_docs SET views= ' $views ' where id= ' $rid '";
Mysql_db_query ($sql [' db '], $qsql);
}
//===============================================================
function Mail_list () {
Global $PHP _self, $HTTP _host, $email;
Global $aid, $sid, $rid;
Global $way 1, $way 2;
if (Check_mail ($email)) {
$mailtype = 0; Subscriptions
if (strlen ($way 2)) $mailtype =1;//
$DROOT =getenv (' document_root ');
Include ("sql.php3");
$db =mysql_connect ($sql [' Host '], $sql [' User '], $sql [' passwd '];
if ($mailtype ==0) {//Subscriptions
$qsql = "SELECT * from BBS_SML where sid= ' $sid ' and email= ' $email '";
$rs =mysql_db_query ($sql [' db '], $qsql);
if (mysql_num_rows ($rs) ==0) {//Pro ⊿
$qsql = "INSERT into BBS_SML (sid,email) VALUES (' $sid ', ' $email ')";
$rs =mysql_db_query ($sql [' db '], $qsql);
} else {
echo "
";
}
} else {//subscriptions
$qsql = "SELECT * from BBS_SML where sid= ' $sid ' and email= ' $email '";
$rs =mysql_db_query ($sql [' db '], $qsql);
if (mysql_num_rows ($rs) > 0) {//Worm
$qsql = "DELETE from BBS_SML where sid= ' $sid ' and email= ' $email '";
$rs =mysql_db_query ($sql [' db '], $qsql);
} else {
echo "
";
}
}
} else {
echo "
";
}
echo "
";
}
//===============================================================
function Send_the_doc_to_mail_list ($aid, $sid, $rid) {
Global $PHP _self, $HTTP _host;
$DROOT =getenv (' document_root ');
Include ("sql.php3");
$db =mysql_connect ($sql [' Host '], $sql [' User '], $sql [' passwd '];
if ($sid = = $rid) $qsql = "SELECT * from BBS_SUBJ where id= ' $sid '";
else $qsql = "SELECT * from Bbs_docs where id= ' $rid '";
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.