Hi Pavia,
I am not a PHP user. Never tried it even once and I don't have PHP on our server to test. But, if you're willing to try a little more of the blind leading the blind, I'll give it a shot.
I assume that you have the other site's browser detect code in a file called
browserdetect.php and that their browser detection actually works. If it's like other server-side stuff, there's probably some sort of "Include Path" in the PHP configuration, so might want to have that file in whatever your include path is. Note that the path may be relative. If you are in doubt, you can probably override the Include Path by specifying the path in the argument to include(). E.g., if browserdetect.php is in your site's root directory, you could probably do this:
Code: Select all
<?php include('/browserdetect.php'); ?>
Or, you could probably also specify the exact location like this
Code: Select all
<?php include('http://www.yoursite.com/php/browserdetect.php'); ?>
which I imagine would look for the file in
http://www.yoursite.com/php/ -- of course, this is mostly guess work on my part. You may have to play with line 1 of the following code example to get the include file loaded.
As far as loading the scripts and running functions, you will definitely need to distinguish between ns4 and not-ns4 in loading the menu scripts, as well as in the table where you display your main menu.
(1) You should be able to load the menu code for either version at the top of the <body>. Try this at the top of <body>:
Code: Select all
<?php include('browserdetect.php'); ?>
<?php
if ($browser == 'ns4') {
echo '<script language="JavaScript" src="menu_array.js" type="text/javascript"></script>';
echo '<script language="JavaScript" src="mmenu.js" type="text/javascript"></script>';
} else {
echo '<script language="JavaScript" src="milonic_src.js" type="text/javascript"></script>';
echo '<script language="JavaScript" src="mmenudom.js" type="text/javascript"></script>';
echo '<script language="JavaScript" src="menu_data.js" type="text/javascript"></script>';
}
?>
(2) To open the main menu, try this in your table cell:
Code: Select all
<?php
if ($browser == 'ns4') {
echo 'PlaceMenu("mainmenu");'
} else {
echo <<<END
<script language="Javascript">
with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible=1;
orientation="horizontal";
position="relative";
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;showmenu=Samples;");
aI("text=Milonic;showmenu=Milonic;");
aI("text=Partners;showmenu=Partners;");
aI("text=Links;showmenu=Links;");
aI("text=My Milonic;showmenu=My Milonic;");
}
drawMenus();
</script>
END;
}
?>
The echo <<<END construct seems to be a good one for outputting multiple lines to the page. I think you have to make sure that END; appears flush left, on a line by itself, with no extra whitespace. If that doesn't work, you could try echoing each line of code separately, as in the first code example.
Note also that I used "mainmenu" in the PlaceMenu() call... substitute your own v3 main menu name. Also, for the v5 menu, I used the 'Main Menu' code from the v5 table-bound example... substitute your own code.
Don't give up if this doesn't work! Maybe some kind php guru will step in or, if nothing else, we'll muddle through. Let us know how it goes.
Kevin