Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:03

More info needed about relative paths.


Poster: Rickstre
Dated: Friday November 19 2004 - 16:48:24 GMT

The structure of my site is

http://www.sitename.com
.....htdocs
........root
........libs
..........navbars
.............menu.inc.php

(root and libs are on the same level, but navbars is below libs)

The code in menu.inc.php is:
Quote:
<script type="text/javascript" src="http://www.sitename.com/libs/navbars/milonic_src.js"></script>
<param copyright="JavaScript Menu by Milonic - http://www.milonic.com"></param>

<script type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=http://www.sitename.com/libs/navbars/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=http://www.sitename.com/libs/navbars/mmenudom.js><\/scr"+"ipt>");
-->
</script>
type=text/javascript></SCRIPT>
?>
</head>
<body>
<script language=javascript>
<?
include("$DOCUMENT_ROOT/libs/navbars/menu_data.js.php");
?>
</script>


The menu is called by index.php in "htdocs"

Portion of index.php:
Quote:
<?
if ($frames) {
?>
<html>
<head>
<title>pagename</title>
</head>
.
.... No frames message
.
} else if (!$index) {

?>
<script language="javascript">
<!--
top.location.href='http://www.sitename.com/root/index.php?frames=true';
//-->
</script>
<?
exit;
}
?>
...........html code......
<?
require("$DOCUMENT_ROOT/libs/navbars/menu.inc.php");
?>
..........more HTML code....
"DOCUMENT_ROOT" above = 'http://www.sitename.com"

I also have tried prefixing the milonic_src.js, mmenuns4.js, and mmenudom.js files with all forms of:

http://www.sitename.com/libs/navbars/
/libs/navbars/
/navbars/
and even...http://www.sitename.com/htdocs/libs/navbars/ (though htdocs should not be necessary since this is root).

However, unless I place all files into the directory fron which a menu is called I get a JS error that indicates that the milonic_source.js file (and other js files) was not found pointing to the directory from which the script is run. Indeed if I place the three js files in the directories from which the script is run the menu works. However the relative path seems to be ignored.

I am NOT the original author of the site but now am charged with maintaining it. I cannot see how the line in index.php:
Quote:
top.location.href='http://www.sitename.com/rot/index.php?frames=true';
is causing this problem. But perhaps a guru here can. However this seems to be needed for authentication of the site.

Anyone have a method that can be used to fix this problem? AAARRRAAAGGGHHHH! :!: :!:

BTW since the site on which this is located is password protected if you need the URL I will have to set up a temporary login and password.


Poster: Ruth
Dated: Tuesday November 30 2004 - 2:43:19 GMT

I think you might have to put up something for people to check and see what's happening, since no one has answered. Or you might need a new 'topic' heading to include something about the php coding and calling the menu not working and giving a js error. I'm sorry I can't help because I know nothing about php.

Ruth


Poster: Rickstre
Dated: Tuesday November 30 2004 - 12:17:15 GMT

I found the problem last Friday... The Menu system is running on an Apache server. Apache treats the "libs" directory differently and does not allow external links directly to the "libs" directory. Moved everything to a new directory "common" and all is well!

Rick