Advertisement:

SSI within BoardIndex

Aloittaja mark7144, elokuu 22, 2006, 01:30:24 IP

« edellinen - seuraava »

mark7144

Hi,

I'd like to display the latest news headline at the top of the BoardIndex using SSI but everytime I try and put the code in it breaks with a parse error.

BoardIndex Code:       // Show some statistics next to the link tree if SP1 info is off.
echo '
<table width="100%" cellpadding="3" cellspacing="0">
<tr> <td valign="bottom">', theme_linktree(), ' ', !!!! headline here !!!!, '</td>

<td align="right">';
if (!$settings['show_sp1_info'])


Code to be implemented:
<?php
$array 
ssi_recentTopics(1, array(16141316171819202120222324'array');

foreach (
$array as $recent)
{
  
$subject html_entity_decode($recent['subject']);
  if (
strlen($subject) > 9)
    
$subject htmlentities(substr($subject040)) . '';
  else
    
$subject $recent['subject'];
echo 
'
- <a href="'
$recent['href'], '" >
'
$subject'
'
$recent['new'] ? '' '<img src="http://www.murraysworld.com/img/new-recent.gif" border="0" />''
</a><br/>'
;
}

?>


I also tried implementing it using an include but that seemed to do nothing.

bloc

Did you include('SSI.php'); in the template as well?

mark7144

Lainaus käyttäjältä: Bloc - elokuu 23, 2006, 04:21:31 AP
Did you include('SSI.php'); in the template as well?

Where do I put that and in what file?

And is there no path like your code above?

bloc

At the top of BoardIndex.template..and its normally enough to do that, but some servers require a full path to the SSI.php file. Try both.

mark7144

Thanks I did that but it seems I can't get any php include to work properly for where i want the headline.

For example:

<table width="100%" cellpadding="3" cellspacing="0">
<tr>
<td valign="bottom">', theme_linktree(), ' ', include('test2.php'), '</td>
<td align="right">';
if (!$settings['show_sp1_info'])


test2.php contains:
<?
echo 'moo';
?>


The template doesn't break but it acts as if there is no include.

kegobeer

Try this:


<table width="100%" cellpadding="3" cellspacing="0">
<tr>
<td valign="bottom">', theme_linktree();
include('test2.php');
echo '</td>
<td align="right">';
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")

mark7144

Thanks that worked but I just realised I should of put test2.php in the /messageboard/ dir not themes so that was my fault.

Now I need to see if I can get this SSI to work...

bloc

Yep, thats correct..you need to have your files inside forum folder, not Themes folder. SSI.php is also there, hence the lack of path.

mark7144

#8
Got it all working now, thanks for helping me out guys!

Advertisement: