Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: bjp on February 09, 2005, 12:24:50 AM

Title: SSI for 10 last post but more beautifull
Post by: bjp on February 09, 2005, 12:24:50 AM
Sorry for my english.

Hi

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.

(http://www.forum-asie.com/Image6.jpg)

I also like this way on the right : http://www.redandwhitekop.com/
Title: Re: SSI for 10 last post but more beautifull
Post by: fabio on February 09, 2005, 03:12:42 AM
<?php require('PATH TO SSI.php');


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

if (!empty($result))

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

?>

add some css and you are ready

Title: Re: SSI for 10 last post but more beautifull
Post by: bjp on February 09, 2005, 06:25:19 AM
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 ?
Title: Re: SSI for 10 last post but more beautifull
Post by: fabio on February 09, 2005, 07:59:39 AM
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.
Title: Re: SSI for 10 last post but more beautifull
Post by: bjp on February 09, 2005, 08:16:13 AM
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.

Quote<?php
require("SSI.php");

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


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


   echo '
      <table border="0" class="ssi_table">';
   foreach ($posts as $post)
      echo '
         <tr>
            <td align="left" valign="top" nowrap="nowrap">
               [', $post['board']['link'], ']
            </td>
            <td valign="top">
               <a href="', $post['href'], '">', $post['subject'], '</a>
            </td>
            
         </tr>';
   echo '
      </table>';         
         
   ?>
Title: Re: SSI for 10 last post but more beautifull
Post by: fabio on February 09, 2005, 09:16:10 AM
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
Title: Re: SSI for 10 last post but more beautifull
Post by: bjp on February 17, 2005, 10:00:11 AM
I Realy need someone to help me !
Or gib=ve me an exemple class="ssi_table" for 10 last topics
Title: Re: SSI for 10 last post but more beautifull
Post by: bjp on March 09, 2005, 08:50:30 AM
up
Title: Re: SSI for 10 last post but more beautifull
Post by: [Unknown] on March 10, 2005, 04:43:05 AM
I don't understand the question.  What are you asking for an example of?

-[Unknown]
Title: Re: SSI for 10 last post but more beautifull
Post by: dailytalk on March 29, 2009, 09:50:29 AM
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.

Category:
Title of topic:
Last post from: XY
Date of last post:
Title: Re: SSI for 10 last post but more beautifull
Post by: greyknight17 on April 19, 2009, 12:38:14 PM
You can try using SSI (http://docs.simplemachines.org/index.php?topic=789) 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.