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:04

Output from scripts as menu items


Poster: simongdawson
Dated: Monday October 13 2003 - 17:09:15 BST

I have two php scripts which output the number of users online and visitors today on my website. Please can anyone tell me the exact coding to use e.g.

aI("etc.etc.etc.etc.");
aI("etc.etc.etc.etc.");

to produce the output from these two scripts as two separate menu items? The installation instructions for them reads:

Adding the script to your pages.

For PHP Pages.

For Users Online.

<? virtual("/online/online.php"); ?>

For Users Today

<? virtual("/online/today/php"); ?>

For HTML pages.

For Users Online

<!--#include virtual="/online/online.php" -->

For Users Today

<!--#include virtual="/online/today.php" -->

Also I have a JavaScript 'ticking' clock script. Please can anyone tell me the exact coding to use e.g.

aI("etc.etc.etc.etc.");

to produce the output from this script as a menu item? The installation instruction for it reads:

// Use the following within your HTML to Start/display your clock
// <script language="JavaScript">dT();</script>


Poster: Hergio
Dated: Tuesday October 14 2003 - 4:08:38 BST

Those files you are including you will have to edit. They output certain data that is written to the page and that displays whatever it is that you want. What you need to do is have those includes set variables to certain values and then use those values in your aI calls.

Say you edit your include so that a variable called $numUsers is created when you include the file. That $numUsers would set to something like 12 or something. Then in an aI to use it, you would do something like
Code:
aI("text=Number of users online: "+ <? echo $numUsers?> + ";url=#;status=Number of users online at the moment;);

I am not great with PHP syntax and how to include things and output variables directly, but thats generally the idea.

Regarding getting your clock to work, its perfectly legal to put script into the text of the menu item and expect it to execute, you just have to do it right. This following line worked fine in my IE:
Code:
aI("text=<script language='JavaScript'>alert('Blah');</script>;url=/menuV5/test.htm;");

And an alert box popped up when the page loaded so you could use:
Code:
aI("text=<script language='JavaScript'>dT();</script>;url=/menuV5/test.htm;");


Give it a try and remember to get all your single and double quotes right, as I have done.

Problem solved


Poster: simongdawson
Dated: Wednesday October 15 2003 - 7:42:41 BST

I have at last sorted things out so that everything (!) is working. See http://www.the-limes.com/milonic5_test.html. In the bottom left hand corner of the screen is a block of stuff all produced by my second menu_data file. It is produced by two php scripts, one javascript, and a linked image from Yahoo Messenger hyperlinked to email me directly.

I renamed menu_data_2.js to menu_data.php. It still works fine, but it allowed me to run php scripts from within it. That incidentally meant I could rename menu_data_1.js to menu_data.js.


Poster: Hergio
Dated: Wednesday October 15 2003 - 21:17:18 BST

Excellent job, I'm glad you were able to figure out how to get your php scripts to to work hand in hand with the menu. Enjoy your Milonic DHTML Menu!!