Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Omni Slide Menu

  1. #1
    Join Date
    Aug 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Omni Slide Menu

    1) Script Title: Omni Slide Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...lide/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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

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

    Code:
    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.


    *
    Code:
    <script src="menuItems.php" type="text/javascript">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know a reasonable amount of PHP; I'll have a go and see how I do.

  4. #4
    Join Date
    Aug 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I can rename the file to a php file, and it still works, but as soon as I add any php, it stops working

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Aug 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here's a link to a text version of the php file: http://gamestest.directorygold.com/a.../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.

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Aug 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm, the file is trying to access a lot of scripts it can't find. Might know how to fix that

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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/a.../menuItems.php

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Aug 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, I fixed those errors by putting in the absolute positions of the files. Now I have an entirely new one. Progress, I suppose.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •