PDA

View Full Version : Creating a module: Lost, dazed and confused.


StewardManscat
07-14-2004, 12:26 AM
New to vb and vbadvanced, I have not grokked in fullness.

I'd like the coming events to appear in a little block on my main cmps page.

1. I find code in index.php for querying the databse...


// ### TODAY'S EVENTS #################################################
if ($vboptions['showevents'])
{
... here is the block of code I will steal
}


2. I paste that code snippet into a file by itself, surround it with php markers and save it in the modules directory as ComingEvents.php

3. Similary with templates: I steal a snippet of template code for coming events out of the FORUMHOME template. I create a new template called adv_portal_comingevents.

4. I add my new module in the admin panel. File to include: ComingEvents.php

No output. My cigar remains unlit. Not sure if I am totally out to lunch, or just a hairsbreadth away from what I want.

Looking at the prefabricated modules, I guess I need to add a line at the end of the module to evaluate the template. Such as:


eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_comingevents') . '";');


Now I am stumped because I don't know what 'modid' and 'content' are (or should be).

I understand this is a vague question. I cannot seem to wrap my head around the basic mechanisms here. Just hoping someone can follow my reasoning and suggest where I took the wrong turn.

Many thanks in advance.

Brian
07-14-2004, 11:50 AM
Everything looks about right... You might want to check the page and make sure that the module was enabled on that page. If not and you would like to submit a support ticket via the Memebrs Area here I'll be glad to take a look.

Our Sponsors
 

StewardManscat
07-15-2004, 03:06 PM
Right you are. Module not enabled. Good to know I wasn't completely crazy. I am once again secure in the knowledge I am only mildly crazy.

Many thanks for the prompt and helpful reply.