Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: GLiO - heinäkuu 25, 2006, 02:47:34 AP

Otsikko: Board News Template
Kirjoitti: GLiO - heinäkuu 25, 2006, 02:47:34 AP
I've searched all kinds of keyword combos for this but I can't seem to find it.

I want to change the way SMF outputs my news to the main page of my website. The board news function that is. Is this something contain deep in the code somewhere or can it be easily changed?

Thanks in advance for your help.
Otsikko: Re: Board News Template
Kirjoitti: Dannii - heinäkuu 25, 2006, 02:56:30 AP
You're using SSI? Just change the output to 'array', and then use the array the function returns however you like.
Otsikko: Re: Board News Template
Kirjoitti: GLiO - heinäkuu 25, 2006, 04:21:33 AP
I'm sorry I don't quite understand what you mean. I'm not familiar with an array or anything. I was hoping there was an HTML file I could tinker with. I want to change the formating of the text and the image and such. Can this be done with the array?
Otsikko: Re: Board News Template
Kirjoitti: Dannii - heinäkuu 25, 2006, 04:47:11 AP
Are you using SSI.php? In php? in shtml?
Otsikko: Re: Board News Template
Kirjoitti: GLiO - heinäkuu 25, 2006, 06:10:24 AP
Yes I am using ssi.php in a .php document.

I've got this on line 1:
<?php require("/home/.olin/glio/cotl/forums/SSI.php"); ?>

and this on the part of the page i have my news showing:
<?php ssi_boardNews($board 8.0$limit 5); ?>

But I wouldn't think any of that would matter. The script has to be pulling out the HTML code to format and make the tables from somewhere, I just want to be able to go in there and change it to what I need it to be.
Otsikko: Re: Board News Template
Kirjoitti: Dannii - heinäkuu 25, 2006, 06:17:34 AP
change it to <?php $new ssi_boardNews($board 8.0$limit 5$output_method 'array'); ?>

Then you can use $new in any code you like. The following is the original foreach ($return as $news)
{
echo '
<div>
<a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b>
<div class="smaller">', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">', $news['body'], '</div>

', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], '
</div>';

if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0;" width="100%" />';
}