PDA

View Full Version : Change Block on-click current day events?


Kirt
10-27-2006, 07:42 PM
Is there a way to sync the block calendar with what displays on the blog mode module?

I want users to be able to click on a date in the calendar block and then have the calendar module load that particular date. As it is right now, any date that is clicked on the block loads the current date's events in the blog module.

I haven't made any modifications to the EPC PHP-Nuke Module except to display blog mode instead of the TOC calendar.

ve9gra
10-27-2006, 10:18 PM
It might be possible by futzing with $thisFile to redirect the clicks to the module. Do you have a link to your installation?

Kirt
10-27-2006, 11:15 PM
I can't provide a link because it's installed on an intranet site behind a firewall.

Where do I find the $thisFile variable?

Brian
10-28-2006, 12:30 PM
Adding $thisFile="fileName.php"; before requiring the calendar should update the navigation links to point to the named file.

Kirt
10-30-2006, 06:12 PM
Hmmm ... it's already in there but it seems to be nested in an IF statement. Can you tell me what's going on here or where to move it to?


<?php
if (eregi("block-Calendar.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

ob_start();
echo "<table width=\"100%\"><tr><td><div align=\"left\">";
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
$thisFile="index.php";
}

//required if you're going to use overLib
$OL=1; require ("calendar/calendar.php");

//makes the whole calendar point to a TOC link
unset($epcAltLink); $epcAltLink="modules.php?name=Calendar";

//the line that shows the calendar
require ("calendar/calendar.php");
echo "</div></td></tr></table>";
$content = ob_get_clean();
?>

ve9gra
10-31-2006, 04:21 PM
Your issue is quite a bit deeper than what it seemed at first. You will need to modify the block so that it displays the first part of the Blog mode, then your module will have to be modified to display the 2nd part of the Blog mode. Then when used together, you should be able to redirect the clicks from the calendar in the block to the Blog mode module.

You might run into issues when trying to change the month displayed if the $thisFile variable is modified. That's caused by the way PHP-Nuke handles displaying the /index.php page.