Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: mark7144 - elokuu 22, 2006, 01:30:24 IP

Otsikko: SSI within BoardIndex
Kirjoitti: mark7144 - elokuu 22, 2006, 01:30:24 IP
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.
Otsikko: Re: SSI within BoardIndex
Kirjoitti: bloc - elokuu 23, 2006, 04:21:31 AP
Did you include('SSI.php'); in the template as well?
Otsikko: Re: SSI within BoardIndex
Kirjoitti: mark7144 - elokuu 24, 2006, 03:48:10 IP
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?
Otsikko: Re: SSI within BoardIndex
Kirjoitti: bloc - elokuu 24, 2006, 04:25:30 IP
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.
Otsikko: Re: SSI within BoardIndex
Kirjoitti: mark7144 - elokuu 24, 2006, 07:56:13 IP
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.
Otsikko: Re: SSI within BoardIndex
Kirjoitti: kegobeer - elokuu 24, 2006, 07:58:47 IP
Try this:


<table width="100%" cellpadding="3" cellspacing="0">
<tr>
<td valign="bottom">', theme_linktree();
include('test2.php');
echo '</td>
<td align="right">';
Otsikko: Re: SSI within BoardIndex
Kirjoitti: mark7144 - elokuu 24, 2006, 08:02:47 IP
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...
Otsikko: Re: SSI within BoardIndex
Kirjoitti: bloc - elokuu 24, 2006, 08:11:24 IP
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.
Otsikko: Re: SSI within BoardIndex
Kirjoitti: mark7144 - elokuu 24, 2006, 08:24:38 IP
Got it all working now, thanks for helping me out guys!