PDA

View Full Version : Include a php file?


joeychgo
06-29-2004, 02:42 PM
OK, my HTML Challenged here.

I have a .php file someone was good enough to make for me that checks and displays a user's usergroup -

How do I place this in a module? (center module)

File is attached

mholtum
06-29-2004, 02:51 PM
upload it to your modules directory. Then select it from the drop down menu when you create a module

Our Sponsors
 

joeychgo
06-29-2004, 02:56 PM
that placed it on the top left corner of the page - not in any module

mholtum
06-29-2004, 02:57 PM
You have to create a Module, then select the php file from the Drop down menu.

Our Sponsors
 

joeychgo
06-29-2004, 03:07 PM
do you mean create a template? cause I created a module and it did what I said before -

mholtum
06-29-2004, 03:13 PM
You must also create a template for the module, sorry I thought you knew that. You have got to both create a template for the contents of the module and then create a module. When creating the Module have it configured to use both the php file (via the drop down) and have it include the template as well.

joeychgo
06-29-2004, 03:15 PM
it doesnt let you both select a template and a file from the drop down menu ???

Brian
06-29-2004, 03:16 PM
http://www.vbadvanced.com/forum/showthread.php?t=1334
http://www.vbadvanced.com/forum/showthread.php?t=1337

Those threads will explain your problem. ;)

joeychgo
06-29-2004, 03:20 PM
Brian, you forget, im a HTML Idiot LOL those threads just confuse me further.......

Brian
06-29-2004, 03:28 PM
At the top of the file, replace this:

require_once('./global.php');


With this:
ob_start();

Then at the bottom, right before the ?> tag, add this:

$string = ob_get_contents();
ob_end_clean();
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_shell') . '";');

Then add a new template called 'adv_portal_shell' (or you can call it whatever you would like, just replace the name in the above code as well) 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] <!-- Module Title Here --></strong></span></td>
</tr>
<tr>
<td class="$getbgrow" width="100%">
$string
</td>
</tr>
</table>
<br />

mholtum
06-29-2004, 03:30 PM
You must create a template to format how the content of the module is displayed. The content of the module is the php file that you select from the drop down.

joeychgo
06-29-2004, 03:57 PM
ok brian, I did all that - but all I get now is a blue title bar ---- ? did I do something wrong?

joeychgo
06-29-2004, 05:21 PM
OK, I figured out what I did wrong - it works now, but there is no longer a blue title bar ---- ?? Just the script and a border -

Brian
06-30-2004, 12:11 PM
You need to change:

<!-- Module Title Here -->

To whatever you would like to appear in that blue bar.

joeychgo
06-30-2004, 12:21 PM
Got it........... Thanks!!!