Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SSI for 10 last post but more beautifull

Started by bjp, February 09, 2005, 12:24:50 AM

Previous topic - Next topic


Sorry for my english.


I realy need help. I want to display on index site 10 last messages from all my forums. with SSI, I can do it, but it's not very beautifull. I want to get it like this. Can someone help, I'm a newbie.

ps : the picture is real size for large, and as long as need for 10 last subjects.

I also like this way on the right :


<?php require('PATH TO SSI.php');

?> <img src=image.gif> <?
$result = ssi_recentTopics(10, 0, 'array');

if (!empty($result))

   echo '
   foreach ($result as $post)
      echo '
         <li><a href="' . $post[board]['href'] . '">' . $post['board']['name'] . '</a><br><a href="' . $post['href'] . '">' . $post['subject'] . '</a></li>';


add some css and you are ready


thank you, that's kind.

With this, it prints : forum's name + subject title. What about if I need forum's name + 100 first caracteres of the message ?

You have some exemples of css pour SSI ?


QuoteWhat about if I need forum's name + 100 first caracteres of the message ?

i think there isn`t a build in function about this , like ssi_recentTopics for example.


Yes, I have seen. I found this code (basic), but I am not able to make it looks like on the picture of my firt post.


$posts = ssi_recentTopics(10, array(), 'array');

   $array = ssi_recentTopics(10, null, 'array');

   echo '
      <table border="0" class="ssi_table">';
   foreach ($posts as $post)
      echo '
            <td align="left" valign="top" nowrap="nowrap">
               [', $post['board']['link'], ']
            <td valign="top">
               <a href="', $post['href'], '">', $post['subject'], '</a>
   echo '


you don`t mess with the ssi.php. instead smf gives you the option of getting all the data with the array option  (ssi_recentTopics(10, 0, 'array');)

and format them as you want in the page you want them to be displayed

in the page you want to display the posts copy the code i gave you. if you want to change the look of the links or what ever cosmetic changes you want  you do it on that piece of code and not ssi.php


I Realy need someone to help me !
Or gib=ve me an exemple class="ssi_table" for 10 last topics


I don't understand the question.  What are you asking for an example of?



I am actually looking for the same thing. I need a code which can show the following:

Last 3 recent topics per category with teaser of about 150 words.

Title of topic:
Last post from: XY
Date of last post:


You can try using SSI and see if you can do this. Otherwise, I recommend posting in the Mod Request board instead.

Topic locked since it's been abandoned by original poster.