Advertisement:

Author Topic: Problem Integrating BBS With Website  (Read 18738 times)

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Problem Integrating BBS With Website
« on: January 16, 2005, 07:48:11 PM »
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

Code: [Select]
<body>';
and

Code: [Select]
// 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

Code: [Select]
<body>';
and

Code: [Select]
// Show the menu here, according to the menu sub template.
template_menu();


B) Created file "header.php" and added the following to it
Code: [Select]
<?php
global $txt$scripturl$context;

echo &
#39;<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">&#39;;
   // If the user is logged in, display their name and new messages.
  
if ($context[&#39;user&#39;][&#39;is_logged&#39;])
{
     echo 
$txt[&#39;hello_member&#39;], &#39; <b>&#39;, $context[&#39;user&#39;][&#39;name&#39;], &#39;</b>&#39;;

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

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

  
echo &#39;</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">&#39;;

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

echo &#39;</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>&#39;;

?>


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:

Code: [Select]
<?php include(&#39;community/Themes/YFC/header.php&#39;); ?>


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
« Last Edit: January 18, 2005, 06:44:07 PM by ThaJester »
jester@your-fate.com

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

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #1 on: January 17, 2005, 06:31:44 PM »
Nobody can help me out with this problem?
jester@your-fate.com

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

  • Guest
Re: Problem Integrating BBS With Website
« Reply #2 on: January 17, 2005, 07:27:20 PM »
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.

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #3 on: January 17, 2005, 08:36:46 PM »
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:

Quote
Parse 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.
jester@your-fate.com

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

Offline Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,663
  • Gender: Male
    • Peat Stack or Pete's Tack?
Re: Problem Integrating BBS With Website
« Reply #4 on: January 17, 2005, 08:44:30 PM »
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:

Code: [Select]
', $context['current_time']';
};

Which should be what you're looking for!
« Last Edit: January 17, 2005, 09:07:22 PM by Peter Duggan »

bloc

  • Guest
Re: Problem Integrating BBS With Website
« Reply #5 on: January 17, 2005, 09:05:15 PM »
How about this then? Cleaned up a bit and put all in echo's .

Does it work better?

Code: [Select]
<?php

echo &#39;<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">&#39;;
   // If the user is logged in, display their name and new messages.
  
if ($context[&#39;user&#39;][&#39;is_logged&#39;])
 
{
     echo 
$txt[&#39;hello_member&#39;], &#39; <b>&#39;, $context[&#39;user&#39;][&#39;name&#39;], &#39;</b>&#39;;

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

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

  
echo &#39;</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">&#39;;

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

 
echo &#39;</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>&#39;;

?>

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #6 on: January 17, 2005, 09:17:25 PM »
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.
jester@your-fate.com

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

  • Guest
Re: Problem Integrating BBS With Website
« Reply #7 on: January 18, 2005, 04:06:31 AM »
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":

Code: [Select]
global $txt, $scripturl, $context;
Does that help?

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Problem Integrating BBS With Website
« Reply #8 on: January 18, 2005, 09:31:48 AM »
Try making the include a require or require_once, maybe?

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #9 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.
« Last Edit: January 18, 2005, 06:47:30 PM by ThaJester »
jester@your-fate.com

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

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Problem Integrating BBS With Website
« Reply #10 on: January 18, 2005, 06:51:48 PM »
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'); ?>

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #11 on: January 18, 2005, 06:55:32 PM »
I just did, and nothing changed. =\
jester@your-fate.com

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

  • Guest
Re: Problem Integrating BBS With Website
« Reply #12 on: January 18, 2005, 06:58:51 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.

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #13 on: January 18, 2005, 07:03:20 PM »
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?
jester@your-fate.com

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

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Problem Integrating BBS With Website
« Reply #14 on: January 18, 2005, 07:07:31 PM »
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)

Offline Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,663
  • Gender: Male
    • Peat Stack or Pete's Tack?
Re: Problem Integrating BBS With Website
« Reply #15 on: January 18, 2005, 07:10:24 PM »
[README] SSI FAQ's

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

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #16 on: January 18, 2005, 07:54:05 PM »
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.

Code: [Select]
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:

Code: [Select]
<?php
require(&#39;../../SSI.php&#39;); 

echo &#39;<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">&#39;;
   // If the user is logged in, display their name and new messages.
  
if ($context[&#39;user&#39;][&#39;is_logged&#39;])
{
     echo 
$txt[&#39;hello_member&#39;], &#39; <b>&#39;, $context[&#39;user&#39;][&#39;name&#39;], &#39;</b>&#39;;

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

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

  
echo &#39;</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">&#39;;

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

echo &#39;</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>&#39;;

?>

« Last Edit: January 18, 2005, 08:08:06 PM by ThaJester »
jester@your-fate.com

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

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Problem Integrating BBS With Website
« Reply #17 on: January 18, 2005, 07:56:54 PM »
Ahh... it seems that you have to put SSI.php with Settings.php. I have a better idea. Try:

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

Offline ThaJester

  • Semi-Newbie
  • *
  • Posts: 31
  • Gender: Male
  • Webmaster/Graphics Designer
    • Your Fate
Re: Problem Integrating BBS With Website
« Reply #18 on: January 18, 2005, 08:07:25 PM »
Seems that SMF doesn't like what I'm trying to do.

Code: [Select]
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/.
jester@your-fate.com

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

  • Guest
Re: Problem Integrating BBS With Website
« Reply #19 on: January 18, 2005, 08:12:03 PM »
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.