HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Opening new windows while using the normal menu.

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#836 (In Topic #208)

Fan in action

Opening new windows while using the normal menu.

A quick "how-to" guide on how to open links on your website's menu's and still keep the "classic" or "original" layout menu system…

First, connect to your FTP server and download which ever menu_left.php file for the appropriate menu…

For example, If you want to use new windows on your public website, then you would need to download <your website>/pages/menu_left.php …. For the admin center simply download the menu_left.php located in your <website>/admincenter/pages/ folder.


Once downloaded, open one in notepad (if you haven't associated .php with a text editor, simply make a shortcut to notepad where your .php files are by using the right click menu > new > shortcut then click and drag the php file over the shortcut and voilà)

Code

&#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62;
function dosomething&#40;&#41; { window.open&#40;&#34;&#34;&#41;; }
//--&#62;
&#60;/script&#62;

Add that code BELOW this:

Code

if &#40;&#33;function_exists&#40;&#34;get_db_forums&#34;&#41;&#41;
   die &#40;&#34;This file may only be included/required from others&#34;&#41;;
?&#62;

But ABOVE this: ('adminmenu' would change depending on the file you're editing…)

Code

&#60;?php
make_expand_menu&#40;&#34;adminmenu&#34;&#41;;
?&#62;


So the final version of the file should look something like this:

Code

&#60;?php /*

 ocPortal &#40;Online Community Portal&#41;
 Copyright &#40;c&#41; Chris Graham et al, 2004

 You may not distribute a modified version of this file.
 See text/license.txt for full licensing information.

*/
if &#40;&#33;function_exists&#40;&#34;get_db_forums&#34;&#41;&#41;
   die &#40;&#34;This file may only be included/required from others&#34;&#41;;
?&#62;

&#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62;

function dosomething&#40;&#41; { window.open&#40;&#34;&#34;&#41;; }

//--&#62;
&#60;/script&#62;


&#60;?php

make_expand_menu&#40;&#34;adminmenu&#34;&#41;;

?&#62;

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#837

Fan in action

Now let's do it so that we can use it to open a page in a NEW window.

You'll see something like this:

Code

&#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62;
function dosomething&#40;&#41; { window.open&#40;&#34;&#34;&#41;; }
//--&#62;
&#60;/script&#62;

Change it so it looks somewhat like so:

Code

&#60;script language=&#34;javascript&#34; type=&#34;text/javascript&#34;&#62;
function somewordhere&#40;&#41; { window.open&#40;&#34;http&#58;//www.domain.com/&#34;&#41;; }
//--&#62;
&#60;/script&#62;

Now, upload the new file in the custom directory of where you got it from.

Basicly, if you got it from <your site>/pages/ then put it in <your site>/custom/
If you got it from <your site>/admincenter/pages/ then put it in <your site>/admincenter/custom/


Edit whichever menu you've just uploaded ("sidebar" or "admincenter" or whatever…)

Add something like so:

Code

Something in a new window = javascript&#58;somewordhere&#40;&#41;;

This basicly tells your browser & ocportal that it should run as a javascript. The menu_left holds the JS code/function and thus will execute whatever you told it to do (in this case, open www.website.com in a new window).

:)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#1160
phT
Avatar

Fan in training

Thx man, Very useful  :D
Back to the top
 
Posted
Rating:
#1164

Fan in action

Np ;)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: