Advanced SSI FAQ

Started by Tomer, June 24, 2004, 05:47:39 PM

Previous topic - Next topic

DarkNexxus

I apologize if this has been asked, but is there a way to exclude a board or boards while showing the rest?

What I'm looking to output is fairly simple
Topic name with a link to the post
<small font> time and poster (no link back to the poster
Small content line, maybe 10 characters unless there is a way to break the words if they go longer than the width of my column.
Horizontal line to lead into the next post.

What I don't want to add is two forums. One is 73.0 and I can't recall right off the next number, but it's only the two I want to exclude. 73.0 is a public forum, the other is a private one.

cowboytns

2 Questions pertaining to board news...  First, here is what I have for my board news coding:

$array = ssi_boardNews($board = 3.0, $limit = 50, $start = null, $length = 250, $output_method = 'array');
foreach ($array as $news)
{
         echo '
            <a href="', $news['href'], '" title="By: ', $news['poster']['name'], ' - Posted: ', $news['time'], '">
            ', $news['subject'], '
            ', $news['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $news['topic'] . '.from' . $news['newtime'] . ';topicseen#new"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a>', '
            </a><br />';
}



and here is the list that it returns:
Quote
Eagleman, David - Sum: Forty Tales from the Afterlives
Franklin, Benjamin - Autobiography
Patterson, Grenny, McMillan, & Switler - Crucial Confrontations
Patterson, Grenny, McMillan, & Switler - Crucial Conversations
Holmes, Chet - The Ultimate Sales Machine
Gerber, Michael - The E-Myth Revisited
Stein, Mark – How the States Got Their Shapes

Question 1 - the above information is correct however the *new* icon appears after each item even though I have read some of them.  What do I need to fix in the code?

Question 2 - is there a way to sort the list in alphabetical order instead of most recent first order?

Thanks in advance.

The Wizard

Hello:

I would like to create a page that lists all the topics on a board of my choice, turns them into links, and once a link is chosen takes you there and, only shows you the title, and the body.

Below is the code that i have so far -

Quote// Include News Board (12) and limit to 1000 topic
// by The Wizard

$news = ssi_boardNews($board = 12, $limit = 1000, $start = null, $length = null, $output_method = 'array');

foreach ($news as $topic) {

echo ('<a href="'.$topic['href'].'">'.$topic['subject'].'</a></br>');

};

Then i found this -

Quote$array = ssi_boardNews(12, 5, null, 250, 'array');

foreach ($array as $news)
{
echo '
<table border="0" width="100%" align="center" class="ssi_table">
<tr>
<td><b>', $news['subject'], '</b></td>
</tr>
<tr>
<td>', $news['body'], '<br /><br /></td>
</tr>
</table>
<br />';

if (!$news['is_last'])
echo '
<hr width="100%" />
<br />';
}

Does anyone know how to merge the two and pull off what I would like?

Thanks

Leo2

I have problems with including the SSI.php into my pages.
If I use <?php 
readfile
("http://path_to/forum/SSI.php?ssi_function=recentTopics");
?>



it works and gives default recent topics page.

How can I change the data which is displayed. For example, I need to
- change number of topics
- change the way the date is displayed (now it is like Декабрь 12, 2011, 09:36:51 am, but I need just date in short format)
- not display column with boards names

how to transfer this options to the URL SSI.php?ssi_function=recentTopics  ?

The way with including the file and functions
require_once (ROOT.'/forum/SSI.php');
ssi_recentTopics ($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo');

doesn't work for me - it gives me "wrong compression error". I use gzip compression in my site.
Firefox give the wrong compression error, opera displays  � symbols in the place where the file is included and then stops.

if I use readfile instead of include or require it jumps to forum index page.

Advertisement: