PDA

View Full Version : Omni Slide Menu



egdcltd
02-05-2007, 09:54 PM
1) Script Title: Omni Slide Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/omnislide/index.htm

3) Describe problem:

I'd like to include dynamic information from a MySQL database in the menu. I've seen it done elsewhere, but I have no idea how to go about doing it.

jscheuer1
02-05-2007, 10:45 PM
I'm the author of the menu but, I have no experience with including information from a MySQL database in anything. Do you know that much? If so this could probably get it working for you - The menu's content is fairly straightforward (from menuItems.js linked to the demo page):


menuItems:[ // REQUIRED!!
//[name, link, target, colspan, endrow?] - leave 'link' and 'target' blank to make a header
["Menu"], //create header
["Dynamic Drive", "http://www.dynamicdrive.com", ""],
["What's New", "http://www.dynamicdrive.com/new.htm",""],
["What's Hot", "http://www.dynamicdrive.com/hot.htm", ""],
["Message Forum", "http://www.dynamicdrive.com/forums", ""],
["Submit Script", "http://www.dynamicdrive.com/submitscript.htm", ""],
["Link to Us", "http://www.dynamicdrive.com/link.htm", ""],

All you would need to do should be to change the extension to php or whatever is required on your server, like menuItems.php (be sure to chnage the extension in the call for the script too*) - then you could insert your tokens for the database inside the quotes above, in place of the hard coded text and URL's.


*
<script src="menuItems.php" type="text/javascript">

egdcltd
02-07-2007, 01:59 PM
I know a reasonable amount of PHP; I'll have a go and see how I do.

egdcltd
02-07-2007, 05:08 PM
I can rename the file to a php file, and it still works, but as soon as I add any php, it stops working

jscheuer1
02-07-2007, 07:00 PM
That is almost certainly because the way that the server is interpreting your tokens and the way that they have been inserted into the file is different than you expect or different than is required by the script to function. The output of the file should be similar to the way it would look if hard coded. You may be able to diagnose the cause yourself. To do so, use a browser that will show you the served content of the file (Opera and FF should both do this simply by navigating to the file on your server, if the error is in your PHP code, you may get a PHP error instead). Once you have this as a tool, you may be able to adjust your code to produce the proper/desired result.

If the problem is just in the way you have inserted the tokens, I can help with that. If the problem is that the tokens are returning different values than you expect, you need to rethink when these values are known to the server. They must be known before the file is served. If the problem is invalid or error ridden PHP code, you will need to figure that out yourself and/or take it to the PHP forum.

Give me a link to the PHP version of the file and I will see if anything I can fix for you is evident.

egdcltd
02-08-2007, 07:52 PM
Here's a link to a text version of the php file: http://gamestest.directorygold.com/adr/scripts/menuItems.txt

I haven't added much to the file yet, basically some stuff at the beiginning to try to make it able to get the necessary information.

jscheuer1
02-08-2007, 08:20 PM
It is the PHP version that is more revealing:


Warning: main(./extension.inc): failed to open stream: No such file or directory in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 9

Warning: main(): Failed opening './extension.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 9

Warning: main(./common.): failed to open stream: No such file or directory in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 10

Warning: main(): Failed opening './common.' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 10

Warning: main(./adr/includes/adr_global.): failed to open stream: No such file or directory in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 12

Warning: main(): Failed opening './adr/includes/adr_global.' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 12

Fatal error: Call to undefined function: adr_get_general_config() in /home/directo/public_html/gamestest/adr/scripts/menuItems.php on line 13

These are things that happen before one even gets to the javascript part of the file and are things that you would need the help of PHP folks on.

egdcltd
02-08-2007, 09:25 PM
Hmm, the file is trying to access a lot of scripts it can't find. Might know how to fix that

jscheuer1
02-08-2007, 10:41 PM
Ooops, I sort of assumed you didn't know what you were doing there. My Bad, sorry.

As a clarification, all I did was navigate directly to:

http://gamestest.directorygold.com/adr/scripts/menuItems.php

in Opera to see those errors. FF and possibly even IE would have give similar output.

egdcltd
02-09-2007, 12:30 PM
Well, I fixed those errors by putting in the absolute positions of the files. Now I have an entirely new one. Progress, I suppose.

jscheuer1
02-09-2007, 02:28 PM
Looks like some of that code that you fixed is to prevent people from looking at the source? That or you do have a real problem. You really shouldn't need anything at the beginning of the file other than whatever is required by the server to recognise the file as a PHP file. Usually, this is nothing at all or just a minimal three line declaration but, does vary from server to server.

egdcltd
02-11-2007, 11:54 AM
The code I added is from phpBB. I added it so that the file knew what to access in the database, and it was also supposed to make phpBB realize it wasn't a hacking attempt. Looks like that didn't work.