PDA

View Full Version : Mouse-overs not complying with anchor


wakalapi
12-03-2005, 11:25 PM
I use a Module to display a full-fledged event calendar with all the bells and whistles and it works flawlessly, mouse-over finds the anchor and opens to the size I told it to. I also use a Block to display a mini-calendar on my homepage, it works OK except it doesn't go where I put the anchor or open as big as I told it to.

WORKS: On this page, the mouse-over tacks itself onto the anchor and opens to the specified size...
http://www.powwowtime.com/modules.php?name=Calendar

DON'T WORK: But on the home page, it opens "defaultly" (i.e. as if I didn't turn on the Anchor option and place the anchor)
http://www.powwowtime.com

I installed "$CSS=1; require("calendar/calendar.php");" into the master header for the site (and tried moving it in other places just to make sure it wasn't causing problems from its current location). Everything I think it's supposed to do, it does beautifully from that location (and all the others). Calendar grids are properly formated in the right colors and sizes.

I installed "$OL=1; require("calendar/calendar.php");" into the appropriate places, where the script will be read only once by the server, during any given page call. I experimented and purposefully produced expected errors. Without it, you get a JavaScript error from the browser and the mouse-overs simply don't work at all. I did notice that placing it fairly directly before the final "require("calendar/calendar.php");" execution call makes the Anchor option work for the Module, and moving ($OL-1..blah blah) to other places within the BODY would still cause mouse-overs to work, but not obey the Anchor location/size.

SO I thought WOW I'll try moving this command as it applies to the homepage all over the fruited plain and back, and no matter where I put it, the best I can do is get the mouse-over function to just basically work error free but NOT obey the Anchor and size specification. Follow?

The Module is based on Ve9gra's download (for which I am quite grateful) and I have it CURRENTLY coded as ("root"/modules/Calendar/index.php):

<?php
/************************************************** **********************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2005 by Gervais Albert */
/* http://www.epctutorials.com */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************** **********************/
if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
$pagetitle = "- $module_name";
function show_calendar(){
global $prefix, $db, $sitename, $admin, $multilingual, $module_name, $admin_file;
include("header.php");
title("The Powwow Time Calendar");
OpenTable();
echo "<table width=\"100%\"><tr>";
echo "<td align=\"center\" valign=\"top\" colspan=\"2\">";
echo "<center><iframe src=\"http://www.powwowtime.com/powwows/lightblue.html\" width=\"728\" height=\"90\" frameborder=\"0\" scrolling=\"no\"></iframe><br><br></center>";
echo "</td></tr>";
echo "<td align=\"center\" valign=\"top\">";
echo "</a>All listings are subject to change, correction or cancellation without notice.";
$LIST=1;
$listMonths=1;
//$noOld=1;
$DF = "M jS, Y (D)";
$template="webpage.php";
$showCat="19";
require("calendar/calendar.php");
echo "</td>";
echo "<td align=\"center\" width=\"180\" valign=\"top\" bgcolor=\"#456789\">";
$OL=1; require("calendar/calendar.php");
require("calendar/plugins/filter.php");
require("calendar/calendar.php");
echo "<br>";
include("rtcol.html");
echo "</td>";
echo "</tr></table>";
echo "<center>"._GOBACK."</center>";

CloseTable();
include("footer.php");
}
show_calendar();

?>

The BLOCK ("root"/blocks/block-ESC_this_week.php)
<?php
ob_start();
// I've also tried "$OL=1 blah blah" in this location with no change in performance//
include("calendar/thisweek.php");
$output = ob_get_contents();
ob_end_clean();
$content = $output;
?>

Obviously points to this concoction I made based on demo.php, called "thisweek.php" for display on the www.powwowtime.com (http://www.powwowtime.com) homepage:
<table width="580" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="280" bgcolor="#FFFFFF" align="center" valign="top" class="dayNamesRow">
<b>Powwow Time Mini Calendar</b><br>
<?php
$noNav="1";
$showTheme="front"; //<<-- by the way this template doesn't actually show
$OL=1; require("calendar/calendar.php");
require("calendar/calendar.php");
?>
</td>
<td width="300" align="right" valign="top">
<iframe src="http://www.powwowtime.com/powwows/drum.html" height="250" width="300" scrolling="no" frameborder="0"></iframe>
</td>
</tr>
<td width="580" align="center" valign="top" colspan="2">
<?php
$LIST=1;
$listWeeks=1;
$DF = "M jS, Y (D)";
$template="thisweek.php";
require("calendar/calendar.php");
?>
</td>
</tr>
</table>

Reading that the $OL-1 line should go up by the BODY tag, I also moved it into the "theme" template and it caused all web pages not to display, I thought that might be a drag for my users so I kiboshed trying that location. Except I did get it to accept there by "escaping" the script:
echo "$OL=1; require(\"calendar/calendar.php\");";

Which made the site's pages load normally, but I can't imagine the script being followed by the PHP compiler when placed this way.

ANCHOR:
I added <a name="escOL">&nbsp;</a> to places where I want my mouse-over pop-ups to start. It works on the Module, it is ignored on the Block. Without it, of course you get a "hey where's the anchor" error (more or less) on the Module and the Block seems to ignore whether it's there or not. The Module contains the JavaScript which looks for it:
<script type="text/JavaScript">
var ol_width=500;
var ol_delay=100;
var ol_fgcolor="#FFFFFF";
var ol_bgcolor="#AAAAAA";
var ol_offsetx=0;
var ol_offsety=0;
var ol_border=1;
var ol_sticky=1;
var ol_anchor="escOL"; var ol_anchoralign="ul"; var ol_vauto=1;
</script>

This code is nowhere to be found in the page source for the Block (as viewed from the Browser's show source function). At this point I'm almost ready to find a way to manually hard-code the script into place and give it a whirl.

Anyway, I'm out of ideas. Anyone like to take a stab here?

ve9gra
12-04-2005, 05:54 AM
I found the code that you're saying is missing... well I found a tiny bit of it <script type="text/JavaScript">
var ol_vauto=1;
</script>
As a workaround, what you could do, is figure out exactly what the $OL=1; section outputs, then place that code in the place where you have the $OL in your thisweek.php and remove the $OL call.

I'm not sure why all the code is not being included, but I do remember seeing this same issue somewhere else on the forum. I'll try to find it, but if I haven't posted again by the time you read this, you can search on the code I've included in this post.

Good luck with it.

ve9gra
12-04-2005, 05:58 AM
Found it...

This first post has the exact same issue, but there was no real resolution to the problem.
http://www.easyphpcalendar.com/forums/showthread.php?t=4302&highlight=var+ol_vauto%3D1%3B

And in this one, there was no problem but someone wanted to implement the overLib popups on only one page (the resolution would be the same as for your problem).
http://www.easyphpcalendar.com/forums/showthread.php?t=4411&highlight=var+ol_vauto%3D1%3B

Hope this will help you through it.

wakalapi
12-04-2005, 10:45 PM
I followed the advice of the second thread and hardcoded this into the thisweek.php template:
<script type="text/JavaScript">
var ol_width=500;
var ol_delay=100;
var ol_fgcolor="#FFFFFF";
var ol_bgcolor="#AAAAAA";
var ol_offsetx=0;
var ol_offsety=0;
var ol_border=1;
var ol_sticky=1;
var ol_anchor="escOL"; var ol_anchoralign="ul"; var ol_vauto=1;
</script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div><script type="text/JavaScript" src="/calendar/overLIB/overlib_mini.js"><!-- overLIB (c) Erik Bosrup --></script><script src="/calendar/overLIB/overlib_anchor.js"></script><form action="/modules.php" method="get" name="FilterForm" id="FilterForm">
<input type="hidden" name="name" value="Calendar">

All is marvelous now. Well, until I find something else to tweak. :computer: