PDA

View Full Version : Create my Own Menu


Watson
10-03-2004, 01:00 PM
What I am looking to do is create a menu that allows me to add in new Links whenever I want.

But is there anyway I could have the link to open a VB page that reads from a html page?

I currently do it with php pages, that read from html files, and it displays it this way. And as i am currently running phpnuke I would like to update over to CMPS, the only problem is I have over 1300 files I would need to convert, so I would rather do it where I can have a vb page read from the html page as I have that many files.

Also I wasnt sure if when I installed the Menu if I would be able to update it with new links by editing the file, or if I would have to reinstall with new links. I am hoping to use most of the other features that are on cmps, but I would really like any help anyone could give me on doing this, as it will be a big changeover for me and my site.

Thanks very much

Watson

Artayick
10-03-2004, 01:47 PM
You can create modules that will allow you to add as many links as you want. You can also add as many custom pages as you want. You will just use the index.php?page=blahblah feature. Tis a great portal..

Our Sponsors
 

Watson
10-03-2004, 02:09 PM
Yeah I have the Portal already, but looking on info on how to create my own Menu, and how to use a custom page reading from HTML :D

Also how would that work if I had the file in a sub directory?

index.php?page&file=blahblah/blahbla?

Or whatever, really looking for someone to MSN me or something over this one, just some quick help to get me on my way, and that would be perfik :D:D

Watson

vorphalack
10-03-2004, 03:05 PM
I think this is what you're looking for:

http://www.vbulletin.org/forum/showthread.php?t=66084

Then you'd just need to create a template. Paste this text into a blank template:

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vba_options[portal_blockbullet] Custom Module 1</b></span></td>
</tr>
<tr>
<td class="$getbgrow" width="100%">

<!-- Begin custom code -->
enter custom code here
<!-- End custom code -->

</td>
</tr>
</table>
<br />
(I have created a template with just this text in it, called adv_portal_copythistext so that I always have it handy to copy and paste into a new template!)

Then where it says "enter custom code here" you can enter your html to build your menu. There is some code you can use to create a nav menu if you want to use that instead:
http://www.vbadvanced.com/forum/showthread.php?t=902
and currently my way of doing it is in the last post (I've since changed it a little, adding the >> in front of my links lol).

Then, once you've created your template (name it adv_portal_uniquename) you go to the CMPS section and add a new module. Instructions for doing so are here:
http://www.vbadvanced.com/membersarea.php?do=viewmanual&productid=4&pageid=2

I don't know how your site is set up, but using the hack I linked to for displaying your html pages might be a little limited in that you probably can't put it in www.yoursite.com/forums/ and link to www.yoursite.com/pages/ - you'll want to read through the thread for more info on that hack.

Our Sponsors
 

vorphalack
10-03-2004, 03:11 PM
Oh wanted to add that the 2nd post in the thread refers to creating a module for each page you have - which would involve creating templates, modules and pages for every page (1300???).

You can see how this works on my site. Using the same template, we have a module included on the front page and I have also created a new page for that module.

Main page:
http://www.nopuppymills.com/index.php?

the new page:
http://www.nopuppymills.com/index.php?page=brochures

I think using that html.php hack that I linked to and then linking to the pages in your own nav menu is going to be the easiest. There are instructions in there on how to give the pages a custom title using the link, and including other types of files too.

(the Articles block on the left side is my nav menu, by the way).

You do have more control over your pages by creating new modules/pages - you can restrict each and every one based on usergroup! But I think you can add whatever restrictions to the html.php file to restrict for all of them if you needed to. For example: the Google ads do not appear for our Premium members :D

Watson
10-03-2004, 03:45 PM
Well what I use atm is phpnuke, and I have my files in loads of different folders. and then more subfolders after that.

As I wouldnt want 1300 files all in the one folder. But I will have a look at what you posted and let you know how I got on.

Oh and see the 2 nav menu's already posted, yours and the 1st 1, I couldnt get any of them to show up :(

Watson
10-03-2004, 05:05 PM
again when I make a new 1 it doesnt show up. I dunno whats wrong and why new modules aint showing up. the permissions are ok, and all that, I just cant get em to show for some reason.

But it looks like this may be what I am looking for, although I will proly need to do quite a bit of editing before I am able to launch the main site, but it could be good :D

Just problems with the showing of modules :(

Watson
10-03-2004, 05:22 PM
Ignore my last posts about it not showing up, I named template wrong

Damn fool :)

ok got my menu's and stuff up, and they show the html pages nicely, but is there anyway I would be able to show these pages and still have the modules around the outside of them?

Or how would I go about doing all of these pages as individuals, could I make the template I created read from the html file? Or would I have to just use the custom template that you posted above, and insert all of my html into the custom code bit? if so it would mean I had a hell of alot of templates heh.

Cheers

Watson

Brian
10-04-2004, 10:29 AM
Take the file that was posted above (http://www.vbulletin.org/forum/showthread.php?t=66084) and open it in a text editor.
First, remove this line:
require_once('./global.php');

Then look for this line:
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');

And replace it with this:
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_generic_shell') . '";');


Upload the html.php file to your forum/modules folder.

Then create a new template named 'adv_portal_generic_shell' with the following content:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] $pagetitle</strong></span></td>
</tr>
<tr>
<td class="$getbgrow" width="100%">

$HTML

</td>
</tr>
</table>
<br />

(You can remove the table and such if you don't want to have a table surrounding the content, just be sure to leave the $HTML variable there.)

Create a new module with the following options:

Module Title: HTML Pages
File to Include: html.php
Active: Yes
Templates Used: adv_portal_generic_shell
(Set the other options as you wish)

I haven't tested this, but it should work fine. :)

Watson
10-05-2004, 06:07 PM
ok mate, I done all that. But where do I put in the Table content, and if a link is clicked on in the table will the modules still show? Also if a link is clicked on in the html pages there also, will the modules still show?

www.bootleg.org.uk/cmps_index.php is the one I am working on the now (the blank module is the one I just added, and the 2 below were ones I was testing. The Oasis Audio link is like a link that will be clicked, to show the stuff in the main part where the news would be, but to display the html page, with the modules)

Still quite new to this type of portal :)

Brian
10-06-2004, 12:31 PM
I'm not sure what you mean by "where do I put the Table content".
If a link in the file is pointing to the CMPS page then the content will still be displayed within the CMPS. If it's just pointing to the HTML file then it will go straight to the HTML file.

Watson
10-06-2004, 04:57 PM
What I mean is, see my links, they go direct to html pages I have created, how do I get them to become CMPS pages? I know it will take alot of editing and stuff. But how do I do that?

Brian
10-07-2004, 10:00 AM
You would need to change the links in each HTML file to point to http://yoursite.com/cmps_index.php?file=XXX.html

Execution_Style
10-08-2004, 12:43 PM
I did all what Brian posted and put the module on the left column. I titled the module 'Links'.

http://www.sep.tngamer.com/cmps_index.php?

The module seems to work but, all the options on the navbar at the top now do not work.

What would I change to correct this?

Brian
10-08-2004, 02:21 PM
Admin CP => vBulletin Options => Site Name / URL / Contact Details => Forum URL

What do you have set for that option?

Execution_Style
10-08-2004, 03:05 PM
Forum URL = http://www.sep.tngamer.com/forums

Homepage URL = http://www.sep.tngamer.com/cmps_index.php

Watson
10-08-2004, 04:21 PM
You would need to change the links in each HTML file to point to http://yoursite.com/cmps_index.php?file=XXX.html

ok I sort of get what you mean here, but where would I put the html files. I tried putting them in the route folder, but it didnt work

I am looking to put them in sub folders, so how would i make the URL point to that mate??

Brian
10-08-2004, 11:18 PM
You would just point the URL to wherever the file is located. If you're not sure how to do that you may want to have a look at some basic HTML tutorials.

Watson
10-09-2004, 02:16 PM
Yeah I did point it to where the files were created, using the above url, with the added, but it doesnt show, and again when I just point it to the normal URL, none of the modules show

Execution_Style
10-09-2004, 08:37 PM
So, should I change my Forum URL to make this work?

ndahiya
11-05-2004, 04:32 PM
Figured it out...

it is cmps_index.php?file=../filename.htm

the "file" variable is with base directory as the forum directory...