SSI for 10 last post but more beautifull

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

Previous topic - Next topic

bjp

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.



I also like this way on the right : http://www.redandwhitekop.com/

fabio

<?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


bjp

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 ?

fabio

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.

bjp

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>';         
         
   ?>

fabio

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

bjp

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


[Unknown]

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

-[Unknown]

dailytalk

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:

greyknight17

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.

Advertisement: