Stop data retention! Click here & act! Are you a webmaster and want to participate? Here you can find all necessary material for your website - Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Chris Karakas Online Forum Index Karakas Online
 FAQFAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
How to create a Quick Menu bar with Javascript in PHP-Nuke



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
   Chris Karakas Online Forum Index -> PHP-Nuke Forum RSS Feed of this Forum
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea  View previous topic :: View next topic  
Author Message
jovinas
Sergeant
Sergeant


Joined: 23 Feb 2004
Posts: 21
Location: Melbourne, Australia

PostPosted: Sun May 23, 2004 11:48 pm    Post subject: How to create a Quick Menu bar with Javascript in PHP-Nuke
Reply with quote

I found a nice menu bar (QuickMenu from this site: http://www.opencube.com/samples.html). I tested it in a html page and works very well with practically all browsers.
I’d like to include it in my PHP Nuke Milo page.

The instructions for html say put these 3 lines:

Code:

<script language="JavaScript1.2">dqm__codebase = ""</script>
<script language="JavaScript1.2" src="sample_settings.js"></script>
<script language="JavaScript1.2" src="tdqm_loader.js"></script>


immediately after the body tag. And this line:

Code:

<script language="JavaScript1.2">generate_mainitems()</script>


Where you want the menu be placed in the page. Apart, there are other files that must reside in the same directory.

So far I appended my javascript.php file with this:

Code:

echo "<script language=\"JavaScript1.2\">dqm__codebase =\"\"</script>\n";
   echo "<script language=\"JavaScript1.2\" src=\"sample_settings.js\"></script>\n";
   echo "<script language=\"JavaScript1.2\" src=\"tdqm_loader.js\"></script>\n";


And placed this:

Code:

."<script language=\"JavaScript1.2\">generate_mainitems()</script></td>";


in my Milo theme.

But I can’t make it work, though I’m not getting any error message. Just the menu doesn’t appear anywhere.

Everything that I learned so far is from the “PHP-Nuke: Management and Programming” by Chris Karakas. But obviously there is something that I haven’t understood.
I’ve tried many things and read several chapters related to javascript and now I’m not getting anywhere.
My Nuke it’s not yet published and I test everything in localhost.
Can you help?
Back to top
View user's profile Send private message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Sun May 23, 2004 11:59 pm    Post subject:
Reply with quote

The problem seems to be that the code has to appear in the body of the HTML document, but whatever you put in includes/javascript.php appears in the header.

To make the Javascript code appear in the body, you will have to change the theme.php file of your theme and include the code there. For an example of how to do it, see How to use Javascript in the body of the PHP-Nuke page.

Arrow Note: The PHP-Nuke HOWTO is written by Chris and Claudio, not only by Chris.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jovinas
Sergeant
Sergeant


Joined: 23 Feb 2004
Posts: 21
Location: Melbourne, Australia

PostPosted: Mon May 24, 2004 10:20 pm    Post subject:
Reply with quote

chris wrote:
Open quoteTo make the Javascript code appear in the body, you will have to change the theme.php file of your theme and include the code there. For an example of how to do it, see How to use Javascript in the body of the PHP-Nuke page.

Arrow Note: The PHP-Nuke HOWTO is written by Chris and Claudio, not only by Chris.Close quote

Hi Chris,
Sorry to have forgotten your co-author, Claudio.

I read all the messages related to “How to use Javascript in the body of the PHP-Nuke page” and I made the file ‘menubar. php”:

Code:

<?php
echo "<script language=\"JavaScript1.2\">dqm__codebase =\"\"</script>\n";
   echo "<script language=\"JavaScript1.2\" src=\"sample_settings.js\"></script>\n";
   echo "<script language=\"JavaScript1.2\" src=\"tdqm_loader.js\"></script>\n";
?>


which contains the javascript lines that I should place after the body tag. Then in my “theme.php” I put the instruction:

Code:

 include("themes/milo/menubar.php");


And lower down I made the table where I want to put my menu:

Code:

echo "<table border=\"2\" cellpadding=\"0\" cellspacing=\"0\" width=\"750\" align=\"center\">\n"
        ."<tr><td align=\"center\"><script language=\"JavaScript1.2\">generate_mainitems()</script></td>\n";
    echo "</tr></table>\n";


So far no errors but no menu at all. The table appears empty.

As I said, the menu works perfectly in a html page.

Can you see what’s wrong?
Thanks
Back to top
View user's profile Send private message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Tue May 25, 2004 6:28 am    Post subject:
Reply with quote

You tell it to use two Javascript scripts: sample_settings.js and tdqm_loader.js:

Code:

   echo "<script language=\"JavaScript1.2\" src=\"sample_settings.js\"></script>\n";
   echo "<script language=\"JavaScript1.2\" src=\"tdqm_loader.js\"></script>\n";


This, in plain english means:
Quote:
Open quoteSearch for the http://www.mypage.xx/mynukedir/sample_settings.js and for http://www.mypage.xx/mynukedir/tdqm_loader.js and use them both here. Close quote


i.e. the relative paths (in your case: no path at all) are interpreted as relative to the same path where mainfile.php is in: if mainfile.php is in http://www.mypage.xx/mynukedir/ (the so-called "PHP-Nuke root" directory), then "tdqm_loader.js" is interpreted as "http://www.mypage.xx/mynukedir/tdqm_loader.js".

You must correct this for the script to be able to find those two other scripts it needs.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jovinas
Sergeant
Sergeant


Joined: 23 Feb 2004
Posts: 21
Location: Melbourne, Australia

PostPosted: Tue May 25, 2004 8:18 am    Post subject:
Reply with quote

Quote:
Open quotei.e. the relative paths (in your case: no path at all) are interpreted as relative to the same path where mainfile.php is in: if mainfile.php is in http://www.mypage.xx/mynukedir/ (the so-called "PHP-Nuke root" directory), then "tdqm_loader.js" is interpreted as "http://www.mypage.xx/mynukedir/tdqm_loader.js".

You must correct this for the script to be able to find those two other scripts it needs.Close quote


Thank you very much, Chris.
When I read your message I saw what was the problem. And the menu bar appeared like magic when I put the .js files in the nuke directory where the config.php file resides. Now I understand a little bit more the intricacies of php coding.
All the best.
Back to top
View user's profile Send private message
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea 
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
   Chris Karakas Online Forum Index -> PHP-Nuke Forum
Page 1 of 1
This page contains valid HTML 4.01 Transitional - click here to check it!
This page contains a valid CSS - click here to check it!

 

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group