News Calendar Panel v1.00
Modified by: xandra
This is a modified version of the Event Calendar Panel from the Event Calendar Infusion made by Giuseppe Nichelini (nick56).
Event Calendar Infusion v1.00
© Giuseppe Nichelini (nick56) 2004
http://www.nichelini.it
giuseppe@nichelini.it
PHP-Fusion Copyright © 2002 - 2005 Nick Jones
Released under the terms & conditions of v2 of the GNU General Public License. For details refer to the included gpl.txt file or visit http://gnu.org
Description:
This is a calendar panel that links to the news page. Each day has a link that takes you to the news page which displays that day's news articles. Two different week layouts are available - Sunday to Saturday or Monday to Sunday.
Questions?
Post them at http://phpfusion-mods.com or http://www.php-fusion.co.uk.
Installation Instructions:
Backup your website before uploading or modifying any files.
Step 1: Upload the contents of the php-files folder to the appropriate directory on your website. If you would like the calendar week to start on Monday instead of Sunday, replace the news_calendar_panel.php file with the one from the alternate_layout folder.
Step 2: If you have not modified the news.php file on your site, you should be able to use the included file without any problems. Check the mod folder to see if there is a folder that corresponds with your php-fusion version number. If so, upload the news.php file from that folder to the appropriate directory on your site and installation will be complete. If there is no news.php file included for your specific php-fusion version or you have modified the one on your site, you will need to modify your existing file using the mod instructions below.
Step 3: Go to panels admin and add a new panel. Name it something appropriate, then select news_calendar_panel from the file selection list. Choose a side to display it on, then save it. Return to panels admin and enable the panel.
Mod Instructions:
The instructions below are for PHP-Fusion v6.00.300, but may work on earlier or later versions.
Open news.php
Find...
$rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")");
REPLACE with...
if (isnum($nd)&& isnum($nm) && isnum($ny)) {
$startdate = mktime(0, 0, 0, $nm, $nd, $ny);
$enddate = mktime(0, 0, 0, $nm, $nd + 1, $ny) - 1;
$date_search = "((news_datestamp>='$startdate' AND news_datestamp<='$enddate' AND news_start='0') OR (news_start>='$startdate' AND news_start<='$enddate' AND news_start<=".time().")) AND (news_end='0' OR news_end>=".time().")";
} else {
$date_search = "(news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")";
}
$rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND ".$date_search);
Find...
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
REPLACE with...
WHERE ".groupaccess('news_visibility')." AND $date_search
Change Log: