PDA

View Full Version : modules vs pages


socals
09-01-2004, 12:12 AM
I get the module, but as far as I can see, a Page is a way to display a template, or static content? I don't see how it can connect to a .php file to create dynamic content like a module can?

If I want to create a dynamic content page, I create a module and a new page where I set that module to display. Then I make a link to the new page (with no content) just to show the module linked to a .php file. Is this correct?

As on my website www.globware.com

The "freeware" section is a module and page, and when you click on a specific freeware program that is a different module and page (one module obviously is used to display all the different programs)

My static content page "Installation Files", is just a template (page only).

I'd just like to straighten this out before I go creating all these modules when they are just used on one page. It is nice that most of my content is in modules and I can place them and move them anywhere...

I gotta give my props to Brian for creating such a creative and simple yet powerful mod for vBulletin! It really should be a "package" vBulletin sells to people like myself who want to create an entire website using a template design, not just a forum...

Weird enough, I bought vBulletin just to add a support section for my website, but after I got into the mod community for this product, and finally felt comfortable adding CMPS (which wasn't hard, but my website didn't need a "portal" page), I was blown away by its design and flexability it allowed and decided to throw my entire asp built website out the window to replace it with CMPS.

Brian
09-01-2004, 12:35 PM
Thank you for all the compliments. :)
Instead of adding modules for all of these pages, it would probably be much easier to just wrap the CMPS around the php page instead. If you'll take a look at the user's manual, the last section includes instructions on how to integrate other vB pages with the CMPS.

Our Sponsors
 

socals
09-02-2004, 01:16 AM
Cool, just figured it out. I'm glad I asked now, cause there is alittle bit of re-writting do so, but shouldn't take too long.

Thanks!

I breezed over that section in help cause I thought it was referring to the forum home, not custom pages unrelated to vBulletin.

It would cool if you added an example blank page in your help section for others interested in creating custom content from scratch using CMPS. (php file and template)

I grabbed the custom page example (php & template) from vBulletin.org, then added your code.

Looks so simple now!

AlexSFBay
09-02-2004, 01:30 AM
I grabbed the custom page example (php & template) from vBulletin.org, then added your code.

You should attach the blank template or link to the page on vBulletin.org you found it on so others can use it.

Our Sponsors
 

socals
09-02-2004, 01:54 AM
I was trying to figure out how to make those code boxes!

Here is your basic, custom page & temple.

Original php & template taken from http://www.vbulletin.org/forum/showthread.php?t=62164&highlight=custom+page

test.php


<?php

define('VBA_PORTAL', true);
define('VBA_PAGE', 'TEST');

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'TEST',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################

// ============================================
// Enter the full path to your forum here
// Example: /home/vbadvanced/public_html/forum
// ============================================

chdir('D:\Webs\vbtest\web\forum');

require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

eval('$HTML = "' . fetch_template('TEST') . '";');
print_portal_output($home, $HTML);

?>



TEST template


$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Title</td>
</tr>
<tr>
<td class="alt1">Text</td>
</tr>
</table>

<p>

$footer
</body>
</html>



This would also require a test page in vBa, but only if you want to remove modules from your page. Which you most likely want to do.

Also, make sure you change:

chdir('D:\Webs\vbtest\web\forum');

to your forum directory.

I put all of my custom pages in the home directory, root directory to the forum folder, so the chdir is necessary. I took this from the cmps index file.

AlexSFBay
09-02-2004, 01:58 AM
That's great... thank you so much.

socals
09-02-2004, 02:46 AM
I would also add the vb3 MicroStats hack by TECK at http://www.vbulletin.org/forum/showthread.php?t=62173&highlight=microstats which, when logged in as admin you can see if there are any unchached templates which you forgot to define in the pre-cache template area. It lists the names of the templates for you!

Just got done converting my modules to standard .php files and it seems to be working fine. Thanks for the help, I would have created a mess of modules otherwise!