miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
How To miniBB Support Forums / How To /  
 

main_header.html to main_header.shtml

 
 
Page  Page 1 of 2:  1  2  Next »

Author michael1234
Partaker
#1 | Posted: 18 Aug 2006 03:47 
If I simply wanted to rename my main_header.html and main_footer.html file to main_header.shtml and main_footer.shtml to include a SSI include tag, where would I change this in the scripts?

I am not wishing to change anything over to PHP, so I couldn't find the answer to my question.

I saw several posting pertaining to PHP, but I didn't find anything suggesting this change.

I did try to change:

//$includeHeader='main_header.shtml';
//$includeFooter='main_footer.shtml';

and it didn't work. Numerous error messages when doing that.

Suggestions?

Author Paul
Lead Developer 
#2 | Posted: 18 Aug 2006 07:28 
Specify

$includeHeader='./templates/main_header.shtml';
$includeFooter='./templates/main_footer.shtml';

(it should contain full relative or absolute path to the files).

In general, I don't know why you need to use old-fashioned buggy SSI include, if include is already available in PHP. Better rename these files to .php.

One more thing: variables like {$title} etc. inside default templates will not work, when included directly. You need to rewrite all them in PHP styling code, like:

<?=$GLOBALS['title'];?>

or <$php echo $GLOBALS['title']; ?>

and so on for all vars.

Author michael1234
Partaker
#3 | Posted: 18 Aug 2006 12:44 
Thank you for your quick response Paul.

Confirmation:

1. Any template that contains a {tag} needs to be renamed to <$php echo $GLOBALS['tag']; ?> if I go with the .php extension?
(By the way, thanks for the suggestion)

2. Do all of the files in the template folder need to be renamed to .php and any variables like {tag} need to be replaced, or simply rename those files to .php IF they contain a tag?

Author Paul
Lead Developer 
#4 | Posted: 18 Aug 2006 12:46 
1. Not a template needs to be renamed, but every {$variable} should be replaced by <?php echo $GLOBALS['variable']; ?>, if you rename main_header.html to main_header.php and main_footer.html to main_footer.php and specify them as $includeHeader, $includeFooter.

2. Only variables in two mentioned templates should be replaced. Do not rename other files to .php or something else. They are system files, and miniBB won't work without them.

Author michael1234
Partaker
#5 | Posted: 18 Aug 2006 12:57 
Thank you.

Author michael1234
Partaker
#6 | Posted: 18 Aug 2006 13:03 
This is what my page looks like after I:

modify the code in header.html
change the extension to .php, and then
change includeheader and includefooter


<$php echo $GLOBALS['l_sepr'];?><$php echo $GLOBALS['l_menu[0]'];?><$php echo $GLOBALS['l_menu[7]'];?><$php echo $GLOBALS['l_menu[3]'];?><$php echo $GLOBALS['l_menuReg'];?><$php echo $GLOBALS['l_menu[1]'];?><$php echo $GLOBALS['l_menu[5]'];?><$php echo $GLOBALS['l_menu[6]'];?><$php echo $GLOBALS['l_sepr'];?><$php echo $GLOBALS['pmView'];?>

<$php echo $GLOBALS['whosOnline'];?>

It writes exactly like it shows in the code, and the tables are not alligned.

Author michael1234
Partaker
#7 | Posted: 18 Aug 2006 15:02 
Okay Paul,

I was able to fix everything else except for the code below.

<td class="caption2" colspan="2"><b>&nbsp;{$l_sepr}{$l_menu[0]}{$l_menu[7]}{$l_menu[3]}{$l_ menu[2]}{$l_menu[1]}<!--{$l_menu[4]}-->{$l_menu[5]}{$l_menu[6]}{$l_sep r}</b></td>

When I use the <$php echo $GLOBALS , it shows all the code on the website.

When I use the <?=$GLOBALS, it only shows the separators.

What else should I try? I have tried both ways.

This is a copy of the code I am using with main_header.php in the template section.

<td class="caption2" colspan="2"><b>&nbsp;
<?=$GLOBALS['l_sepr'];?>
<?=$GLOBALS['l_menu[0]'];?>
<?=$GLOBALS['l_menu[7]'];?>
<?=$GLOBALS['l_menu[3]'];?>
<?=$GLOBALS['l_menu[2]'];?>
<?=$GLOBALS['l_menu[1]'];?>
<?=$GLOBALS['l_menu[4]'];?>
<?=$GLOBALS['l_menu[5]'];?>
<?=$GLOBALS['l_menu[6]'];?>
<?=$GLOBALS['l_sepr'];?>
</b></td>

Only displays the separators.

Author Paul
Lead Developer 
#8 | Posted: 18 Aug 2006 15:32 
You need to rename .html to .php first and set up these files as I've described. Don't forget to remove commenting slashes // before options... else they will not be enabled!

Author michael1234
Partaker
#9 | Posted: 18 Aug 2006 15:46 
Exactly. I did everything as you described.
I am assuming the code I posted is correct.

That is why I am having a hard time understanding why this isn't working.

I am going to email you the URL.

Thanks,

Michael

Author michael1234
Partaker
#10 | Posted: 18 Aug 2006 16:43 
Would the reason the other options do not display is because there are two brackets versus the one only with the separators?

<?=$GLOBALS['l_sepr'];?> <---- separators show on page... one bracket
<?=$GLOBALS['l_menu[0]'];?> <---- this does not show on the page... two brackets one right sfter globals and before and after 0

<?=$GLOBALS['l_menu[7]'];?>
<?=$GLOBALS['l_menu[3]'];?>
<?=$GLOBALS['l_menu[2]'];?>
<?=$GLOBALS['l_menu[1]'];?>
<?=$GLOBALS['l_menu[4]'];?>
<?=$GLOBALS['l_menu[5]'];?>
<?=$GLOBALS['l_menu[6]'];?>
<?=$GLOBALS['l_sepr'];?>

Author michael1234
Partaker
#11 | Posted: 20 Aug 2006 21:19 
I have tried literrly everything, read manual twice, and still get the same results.

I hope someone can help.

Author Paul
Lead Developer 
#12 | Posted: 22 Aug 2006 08:40 
My fault - haven't provided the code for global arrays :-)

Your syntax is wrong. You have:

<?=$GLOBALS['l_menu[7]'];?> etc.

You should have:

<?=$GLOBALS['l_menu'][7];?> etc.

Author michael1234
Partaker
#13 | Posted: 22 Aug 2006 13:11 
That still did not work.

Here's what it shows on the webpage after changing the code.

Nope, Still not resolved.

After changing the code, it produces this on the main page:

<$php echo $GLOBALS['l_sepr'];?> <$php echo $GLOBALS{'l_menu'][0]'};?> <$php
echo $GLOBALS['l_menu'][7];?> <$php echo $GLOBALS['l_menu'][3];?> <$php echo
$GLOBALS['l_menu'][2];?> <$php echo $GLOBALS['l_menu'][1];?> <$php echo
$GLOBALS['l_menu'][5];?> <$php echo $GLOBALS['l_menu'][6];?> <$php echo
$GLOBALS['l_sepr'];?>

Author michael1234
Partaker
#14 | Posted: 22 Aug 2006 13:30 
Finally worked with this code.

phpecho code did not work.

<?=$GLOBALS['l_sepr'];?>
<?=$GLOBALS['l_menu'][0];?>
<?=$GLOBALS['l_menu'][7];?>
<?=$GLOBALS['l_menu'][3];?>
<?=$GLOBALS['l_menu'][2];?>
<?=$GLOBALS['l_menu'][1];?>
<?=$GLOBALS['l_menu'][4];?>
<?=$GLOBALS['l_menu'][5];?>
<?=$GLOBALS['l_menu'][6];?>
<?=$GLOBALS['l_sepr'];?>

Author Paul
Lead Developer 
#15 | Posted: 22 Aug 2006 13:57 
I recommend you to learn some things from PHP manual. <?php tag shouldn't contain a buck sign before, but a question sign. It's still better to use

<?php echo $GLOBALS['l_menu'][x]; ?>

instead of

<?=$GLOBALS['l_menu'][x]?>

because PHP5 configuration by default doesn't allow it. Anyway, if it works, that the problem is solved.

Page  Page 1 of 2:  1  2  Next » 
How To miniBB Support Forums / How To /
 main_header.html to main_header.shtml
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Private Messaging add-on: allow your miniBB-forums members to communicate with each other.


  ⇑