News:

Wondering if this will always be free?  See why free is better.

Main Menu

Problem Integrating BBS With Website

Started by ThaJester, January 16, 2005, 07:48:11 PM

Previous topic - Next topic

ThaJester

Okay, I'll do my best to explain this as best I can.

What I want to do is delete everything in the index.template.php file between

<body>';

and

// Show the menu here, according to the menu sub template.
template_menu();


and only use a select few parts of it, but include it throughout my website.

In layman's terms, I want to remove everything on the top of the forum index all the way until the Menu buttons and turn it into this

Before attempting this, I read [Unknown]'s little tutorial about integrating your site with your BBS, and switched a few things around to accomplish (or try to) what I'm trying to do.

What I Did...

A) Deleted everything in the index.template.php file between

<body>';

and

// Show the menu here, according to the menu sub template.
template_menu();



B) Created file "header.php" and added the following to it

<?php
global $txt$scripturl$context;

echo 
'<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="703">
  <tr>
   <td width="84"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="140"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="30"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="10"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="170"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="30"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="150"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="10"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="78"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="0" border="0" alt=""></td>
  </tr>
  <tr>
   <td width="84"><img name="topleft" src="community/Themes/YFC/images/header/topleft.jpg" width="84" height="68" border="0" alt=""></td>
   <td colspan="3"><img name="topl" src="community/Themes/YFC/images/header/topl.jpg" width="180" height="68" border="0" alt=""></td>
   <td width="170"><img name="middle" src="community/Themes/YFC/images/header/middle.jpg" width="170" height="68" border="0" alt=""></td>
   <td colspan="3"><img name="topr" src="community/Themes/YFC/images/header/topr.jpg" width="190" height="68" border="0" alt=""></td>
   <td width="78"><img name="topright" src="community/Themes/YFC/images/header/topright.jpg" width="78" height="68" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="68" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="5" width="84"><img name="leftleft" src="community/Themes/YFC/images/header/leftleft.jpg" width="84" height="160" border="0" alt=""></td>
   <td colspan="2"><img name="lefttop" src="community/Themes/YFC/images/header/lefttop.jpg" width="170" height="30" border="0" alt=""></td>
   <td rowspan="2" colspan="2"><img name="middletop" src="community/Themes/YFC/images/header/middletop.jpg" width="180" height="50" border="0" alt=""></td>
   <td colspan="2"><img name="righttop" src="community/Themes/YFC/images/header/righttop.jpg" width="180" height="30" border="0" alt=""></td>
   <td rowspan="5" colspan="2"><img name="rightright" src="community/Themes/YFC/images/header/rightright.jpg" width="88" height="160" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="30" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="3" width="140" background="community/Themes/YFC/images/header/leftmiddle.jpg" align="center">
   <font size="1" face="Arial">'
;
   
// If the user is logged in, display their name and new messages.
  
if ($context['user']['is_logged'])
{
     echo 
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

      
// Only tell them about their messages if they can read their messages!
      
if ($context['allow_pm'])
          echo 
', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
      echo 
'.';

      
// Is the forum in maintenance mode?
      
if ($context['in_maintenance'] && $context['user']['is_admin'])
           echo 
'<br /><b>'$txt[616], '</b>';
  }
  
// Otherwise they're a guest - so politely ask them to register or login.
  
else
       echo 
$txt['welcome_guest'], '<br />';

  echo 
'</font>
   </td>
   <td rowspan="4" width="30"><img name="leftright" src="community/Themes/YFC/images/header/leftright.jpg" width="30" height="130" border="0" alt=""></td>
   <td rowspan="4" width="30"><img name="rightleft" src="community/Themes/YFC/images/header/rightleft.jpg" width="30" height="130" border="0" alt=""></td>
   <td rowspan="3" width="150" background="community/Themes/YFC/images/header/rightmiddle.jpg" align="center">
   <font size="1" face="Arial">'
;

  
// If the user is logged in, display stuff like their name, new messages, etc.
  
if ($context['user']['is_logged'])
  {
      echo 
'
        <a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
        <a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br /><br />
       '
$context['current_time'];
  }
  
// Otherwise they're a guest - so only display the time and date.
  
else
        echo 
$context['current_time'];

echo 
'</font>
   </td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2"><img name="yf" src="community/Themes/YFC/images/header/yf.jpg" width="180" height="50" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="50" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" colspan="2"><img name="middlebottom" src="community/Themes/YFC/images/header/middlebottom.jpg" width="180" height="60" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td width="140"><img name="leftbottom" src="community/Themes/YFC/images/header/leftbottom.jpg" width="140" height="40" border="0" alt=""></td>
   <td width="150"><img name="rightbottom" src="community/Themes/YFC/images/header/rightbottom.jpg" width="150" height="40" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="40" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="9"><img name="bottom" src="community/Themes/YFC/images/header/bottom.jpg" width="702" height="50" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="50" border="0" alt=""></td>
  </tr>
</table>
</div>'
;

?>



which is essentially the page http://www.your-fate.com/ezence/index2.htm with the added PHP to make it actually work.


C) I placed this file in the directory public_html/community/Themes/YFC/


D) I uploaded the images to public_html/community/Themes/YFC/images/header/


E) I created the file index2.php and added the following code just below the <body> tag:

<?php include('community/Themes/YFC/header.php'); ?>



So it should work, in theory... however it doesn't.

The PHP seems to be working, but no text is displayed.

Links:
http://www.your-fate.com/index2.php (index2.php file)
http://www.your-fate.com/community/Themes/YFC/header.php (header.php file)

Hopefully [Unknown] will come by and take a look at this and help me out a little.

Thanks in advance,
Jester
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

ThaJester

Nobody can help me out with this problem?
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

bloc

It looks like an extra single-quote is present in your header.php file.

Look for this:

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br /><br />
', $context['current_time']
';

Now , remove the singlequote in bold red there and try again.

ThaJester

Well, I removed the extra single quote, and it still didn't solve the problem. If you view http://www.your-fate.com/index2.php you'll see I'm still getting this error:

QuoteParse error: parse error, unexpected T_ELSE in /home/jester1/public_html/community/Themes/YFC/header.php on line 74

If you look at the code again, I guess it would be helpful for me to note that in it's original state, the code only contained 1 if/else statement. In order for it to display it as I wanted, I split it into 2. I have only the most basic knowledge of PHP so I'm not sure weather this would produce the error or not. However, since it is saying "unexpected T_ELSE", maybe that's exactly where my problem lies.

I appreciate your help, and I edited my original post and changed the code so that it represents what is currently uploaded.

Hopefully we can get this straightened out.
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

Peter Duggan

#4
Haven't been following this topic (so just diving in cold), but can tell you from a quick look at your latest code that you've still got that single quote after $context['current_time'] that Bloc picked up *and* a semi-colon where you shouldn't have after the closing brace here:

', $context['current_time']';
};


Which should be what you're looking for!

bloc

How about this then? Cleaned up a bit and put all in echo's .

Does it work better?

<?php

echo '<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="703">
  <tr>
   <td width="84"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="140"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="30"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="10"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="170"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="30"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="150"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="10"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="78"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="0" border="0" alt=""></td>
  </tr>
  <tr>
   <td width="84"><img name="topleft" src="community/Themes/YFC/images/header/topleft.jpg" width="84" height="68" border="0" alt=""></td>
   <td colspan="3"><img name="topl" src="community/Themes/YFC/images/header/topl.jpg" width="180" height="68" border="0" alt=""></td>
   <td width="170"><img name="middle" src="community/Themes/YFC/images/header/middle.jpg" width="170" height="68" border="0" alt=""></td>
   <td colspan="3"><img name="topr" src="community/Themes/YFC/images/header/topr.jpg" width="190" height="68" border="0" alt=""></td>
   <td width="78"><img name="topright" src="community/Themes/YFC/images/header/topright.jpg" width="78" height="68" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="68" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="5" width="84"><img name="leftleft" src="community/Themes/YFC/images/header/leftleft.jpg" width="84" height="160" border="0" alt=""></td>
   <td colspan="2"><img name="lefttop" src="community/Themes/YFC/images/header/lefttop.jpg" width="170" height="30" border="0" alt=""></td>
   <td rowspan="2" colspan="2"><img name="middletop" src="community/Themes/YFC/images/header/middletop.jpg" width="180" height="50" border="0" alt=""></td>
   <td colspan="2"><img name="righttop" src="community/Themes/YFC/images/header/righttop.jpg" width="180" height="30" border="0" alt=""></td>
   <td rowspan="5" colspan="2"><img name="rightright" src="community/Themes/YFC/images/header/rightright.jpg" width="88" height="160" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="30" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="3" width="140" background="community/Themes/YFC/images/header/leftmiddle.jpg" align="center">
   <font size="1" face="Arial">'
;
   
// If the user is logged in, display their name and new messages.
  
if ($context['user']['is_logged'])
 {
     echo 
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

      
// Only tell them about their messages if they can read their messages!
      
if ($context['allow_pm'])
          echo 
', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
      echo 
'.';

      
// Is the forum in maintenance mode?
      
if ($context['in_maintenance'] && $context['user']['is_admin'])
           echo 
'<br /><b>'$txt[616], '</b>';
  }
  
// Otherwise they're a guest - so politely ask them to register or login.
  
else
       echo 
$txt['welcome_guest'], '<br />';

  echo 
'</font>
   </td>
   <td rowspan="4" width="30"><img name="leftright" src="community/Themes/YFC/images/header/leftright.jpg" width="30" height="130" border="0" alt=""></td>
   <td rowspan="4" width="30"><img name="rightleft" src="community/Themes/YFC/images/header/rightleft.jpg" width="30" height="130" border="0" alt=""></td>
   <td rowspan="3" width="150" background="community/Themes/YFC/images/header/rightmiddle.jpg" align="center">
   <font size="1" face="Arial">'
;

  
// If the user is logged in, display stuff like their name, new messages, etc.
  
if ($context['user']['is_logged'])
  {
      echo 
'
        <a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
        <a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br /><br />
       '
$context['current_time'];
  }
  
// Otherwise they're a guest - so only display the time and date.
  
else
        echo 
$context['current_time'];

 echo 
'</font>
   </td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2"><img name="yf" src="community/Themes/YFC/images/header/yf.jpg" width="180" height="50" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="50" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" colspan="2"><img name="middlebottom" src="community/Themes/YFC/images/header/middlebottom.jpg" width="180" height="60" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td width="140"><img name="leftbottom" src="community/Themes/YFC/images/header/leftbottom.jpg" width="140" height="40" border="0" alt=""></td>
   <td width="150"><img name="rightbottom" src="community/Themes/YFC/images/header/rightbottom.jpg" width="150" height="40" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="40" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="9"><img name="bottom" src="community/Themes/YFC/images/header/bottom.jpg" width="702" height="50" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="50" border="0" alt=""></td>
  </tr>
</table>
</div>'
;

?>

ThaJester

Peter, tried what you said first and that yielded the same error.

Bloc, I tried what you said, and uploaded it. As you'll see after you view the page, that obviously got rid of the errors but now nothing is displayed as far as the forum information that I'm trying to echo.

Getting closer and closer each time.

Once again, I appreciate the quick help and replies from both of you.
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

bloc

I see. It may need a global $txt and $context in there. If you just put this in on the next line after the "<?php":

global $txt, $scripturl, $context;

Does that help?

Kirby

Try making the include a require or require_once, maybe?

ThaJester

#9
Bloc, same results. Nothing is displayed yet there are no errors either.

Kirby, I understand what you're telling me to do, but where do I add that segment of code to?

Updated code once again.

I'm finding out that copying small pieces of information from the BBS onto your website is a lot harder then I first would've thought. I'm definately learning a lot about PHP though, which is helpful for me, annoying for you guys.

Anyways, thanks. I'll be waiting patiently for our next go-round with this.

Edit: BTW, congrats on your new "SMF Design Team" status, Bloc.
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

Kirby

What I'm saying is, you have the <?php include('community/Themes/YFC/header.php'); ?>, but have you tried making it:
<?php require('community/Themes/YFC/header.php'); ?>

ThaJester

[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

bloc

Quote from: ThaJester on January 18, 2005, 06:43:29 PM
Bloc, same results. Nothing is displayed yet there are no errors either.

Kirby, I understand what you're telling me to do, but where do I add that segment of code to?

Updated code once again.

I'm finding out that copying small pieces of information from the BBS onto your website is a lot harder then I first would've thought. I'm definately learning a lot about PHP though, which is helpful for me, annoying for you guys.

Anyways, thanks. I'll be waiting patiently for our next go-round with this.

Edit: BTW, congrats on your new "SMF Design Team" status, Bloc.

Thank you. :)

I think I have misunderstood you a bit here..i thought you were trying to integrate a page into your forum page. But after reading the thread again it seems you are trying to include parts of the forums userdata into your own stand-alone page!

Is this correct?

If so, then you have to include SSI.php to have any info at all...just placing your files among the forum files will not work.

ThaJester

yes, that's exactly what I'm trying to do. haha.

I'm more then willing to include SSI.php, but how do I do this and where do I put it? Or is there a topic that tells me?
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

Kirby

You put this in your header.php:
require('SSI.php');
;) just be sure to put SSI.php in the same directory (or if you know how put in a few ../s)

Peter Duggan

[README] SSI FAQ's

And try running ssi_examples.php in your own SMF installation (it's in your forum's root directory).

ThaJester

#16
Well, now that I figured that out I guess it's about time to deal with more errors. Jeez, I can't get a break.


Warning: main(/home/jester1/public_html/community/Themes/YFC/Settings.php): failed to open stream: No such file or directory in /home/jester1/public_html/community/Themes/YFC/SSI.php on line 36

Fatal error: main(): Failed opening required '/home/jester1/public_html/community/Themes/YFC/Settings.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jester1/public_html/community/Themes/YFC/SSI.php on line 36


Current code reads:


<?php
require('../../SSI.php'); 

echo 
'<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="703">
  <tr>
   <td width="84"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="140"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="30"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="10"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="170"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="30"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="150"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="10"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="78"><img src="community/Themes/YFC/images/header/spacer.gif" width="10" height="0" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="0" border="0" alt=""></td>
  </tr>
  <tr>
   <td width="84"><img name="topleft" src="community/Themes/YFC/images/header/topleft.jpg" width="84" height="68" border="0" alt=""></td>
   <td colspan="3"><img name="topl" src="community/Themes/YFC/images/header/topl.jpg" width="180" height="68" border="0" alt=""></td>
   <td width="170"><img name="middle" src="community/Themes/YFC/images/header/middle.jpg" width="170" height="68" border="0" alt=""></td>
   <td colspan="3"><img name="topr" src="community/Themes/YFC/images/header/topr.jpg" width="190" height="68" border="0" alt=""></td>
   <td width="78"><img name="topright" src="community/Themes/YFC/images/header/topright.jpg" width="78" height="68" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="68" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="5" width="84"><img name="leftleft" src="community/Themes/YFC/images/header/leftleft.jpg" width="84" height="160" border="0" alt=""></td>
   <td colspan="2"><img name="lefttop" src="community/Themes/YFC/images/header/lefttop.jpg" width="170" height="30" border="0" alt=""></td>
   <td rowspan="2" colspan="2"><img name="middletop" src="community/Themes/YFC/images/header/middletop.jpg" width="180" height="50" border="0" alt=""></td>
   <td colspan="2"><img name="righttop" src="community/Themes/YFC/images/header/righttop.jpg" width="180" height="30" border="0" alt=""></td>
   <td rowspan="5" colspan="2"><img name="rightright" src="community/Themes/YFC/images/header/rightright.jpg" width="88" height="160" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="30" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="3" width="140" background="community/Themes/YFC/images/header/leftmiddle.jpg" align="center">
   <font size="1" face="Arial">'
;
   
// If the user is logged in, display their name and new messages.
  
if ($context['user']['is_logged'])
{
     echo 
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

      
// Only tell them about their messages if they can read their messages!
      
if ($context['allow_pm'])
          echo 
', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
      echo 
'.';

      
// Is the forum in maintenance mode?
      
if ($context['in_maintenance'] && $context['user']['is_admin'])
           echo 
'<br /><b>'$txt[616], '</b>';
  }
  
// Otherwise they're a guest - so politely ask them to register or login.
  
else
       echo 
$txt['welcome_guest'], '<br />';

  echo 
'</font>
   </td>
   <td rowspan="4" width="30"><img name="leftright" src="community/Themes/YFC/images/header/leftright.jpg" width="30" height="130" border="0" alt=""></td>
   <td rowspan="4" width="30"><img name="rightleft" src="community/Themes/YFC/images/header/rightleft.jpg" width="30" height="130" border="0" alt=""></td>
   <td rowspan="3" width="150" background="community/Themes/YFC/images/header/rightmiddle.jpg" align="center">
   <font size="1" face="Arial">'
;

  
// If the user is logged in, display stuff like their name, new messages, etc.
  
if ($context['user']['is_logged'])
  {
      echo 
'
        <a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
        <a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br /><br />
       '
$context['current_time'];
  }
  
// Otherwise they're a guest - so only display the time and date.
  
else
        echo 
$context['current_time'];

echo 
'</font>
   </td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2"><img name="yf" src="community/Themes/YFC/images/header/yf.jpg" width="180" height="50" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="50" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" colspan="2"><img name="middlebottom" src="community/Themes/YFC/images/header/middlebottom.jpg" width="180" height="60" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="20" border="0" alt=""></td>
  </tr>
  <tr>
   <td width="140"><img name="leftbottom" src="community/Themes/YFC/images/header/leftbottom.jpg" width="140" height="40" border="0" alt=""></td>
   <td width="150"><img name="rightbottom" src="community/Themes/YFC/images/header/rightbottom.jpg" width="150" height="40" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="40" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="9"><img name="bottom" src="community/Themes/YFC/images/header/bottom.jpg" width="702" height="50" border="0" alt=""></td>
   <td width="1"><img src="community/Themes/YFC/images/header/spacer.gif" width="1" height="50" border="0" alt=""></td>
  </tr>
</table>
</div>'
;

?>

[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

Kirby

Ahh... it seems that you have to put SSI.php with Settings.php. I have a better idea. Try:

require('../SSI.php');

ThaJester

Seems that SMF doesn't like what I'm trying to do.


Warning: main(): open_basedir restriction in effect. File(../../SSI.php) is not within the allowed path(s): (/home/jester1/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/jester1/public_html/community/Themes/YFC/header.php on line 2

Warning: main(../../SSI.php): failed to open stream: Operation not permitted in /home/jester1/public_html/community/Themes/YFC/header.php on line 2

Warning: main(): open_basedir restriction in effect. File(../../SSI.php) is not within the allowed path(s): (/home/jester1/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/jester1/public_html/community/Themes/YFC/header.php on line 2

Warning: main(../../SSI.php): failed to open stream: Operation not permitted in /home/jester1/public_html/community/Themes/YFC/header.php on line 2

Fatal error: main(): Failed opening required '../../SSI.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jester1/public_html/community/Themes/YFC/header.php on line 2


I updated the code in my last post, not my original post.
and the "../../SSI.php" is no typo, it's two directors up. header.php is in community/Themes/YFC/ and SSI.php is in community/.
[email protected]

Website | Forums | Public Directory

"People's desires a powerful. The stronger they grow the more beyond ones control they become. Perhaps the gap between love and hate is paper thin."
- Kenshin

bloc

Why not instead ditch the header.php file...copy everything there over to your index2.php file and have this at the very top:

require_once('community/SSI.php');

Then you dont have to worry about anything except the path to ssi.php. And it makes for a cleaner setup(lesser files).

BTW, try to do a full path to ssi.php if you get errors.


Advertisement: