Disable forum within a specified period of time

Source: Internet
Author: User

Title: Disable forum within a certain period of time
Author: Li Yingjiang
Date: 2006-10-12 14:32:44
Reprinted Please retain the author content: http://www.cgsir.com

Today, I heard from my colleagues that they want to disable the company's internal network forum during working hours. I thought about how to use the date function. You can set the followingCodeInclude it on the forum page to be closed!

Source code file: closebbs. php

<? PHP
/*******************
* Regularly close the Forum
*******************/
// Obtain the current time string
$ Currenttime = Date (HIS );

// The BBS closing time in the morning is-
If (intval ($ currenttime) >=083000 & intval ($ currenttime) <= 120000 ){
Echo "Dear friends, the Forum is closed during working hours! ";
Exit (0 );
}
 
// The BBS closing time in the afternoon is-
Else if (intval ($ currenttime) >=130000 & intval ($ currenttime) <= 170000 ){
Echo "Dear friends, the Forum is closed during working hours! ";
Exit (0 );
}
?>

Forum homepage: Add the following code at the beginning of index. php

<? PHP
Include ("closebbs. php ");
?>
 

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.