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>
Output from scripts as menu items
- simongdawson
- Super Advanced
- Posts: 49
- Joined: Sun Oct 12, 2003 6:56 am
- Location: UK
- Contact:
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
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:
And an alert box popped up when the page loaded so you could use:
Give it a try and remember to get all your single and double quotes right, as I have done.
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: Select all
aI("text=Number of users online: "+ <? echo $numUsers?> + ";url=#;status=Number of users online at the moment;);
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: Select all
aI("text=<script language='JavaScript'>alert('Blah');</script>;url=/menuV5/test.htm;");
Code: Select all
aI("text=<script language='JavaScript'>dT();</script>;url=/menuV5/test.htm;");
Dave Hergert
Software Engineer
"Helping to make the menu better, one
at a time."
Software Engineer
"Helping to make the menu better, one

- simongdawson
- Super Advanced
- Posts: 49
- Joined: Sun Oct 12, 2003 6:56 am
- Location: UK
- Contact:
Problem solved
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.
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.