Advertisement:

Author Topic: SSI for 10 last post but more beautifull  (Read 7037 times)

Offline bjp

  • Jr. Member
  • **
  • Posts: 163
SSI for 10 last post but more beautifull
« 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.



I also like this way on the right : http://www.redandwhitekop.com/
« Last Edit: February 09, 2005, 01:04:43 AM by bjp »

Offline fabio

  • Semi-Newbie
  • *
  • Posts: 43
  • Gender: Male
    • Blue fans
Re: SSI for 10 last post but more beautifull
« Reply #1 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
 

Offline bjp

  • Jr. Member
  • **
  • Posts: 163
Re: SSI for 10 last post but more beautifull
« Reply #2 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 ?

Offline fabio

  • Semi-Newbie
  • *
  • Posts: 43
  • Gender: Male
    • Blue fans
Re: SSI for 10 last post but more beautifull
« Reply #3 on: February 09, 2005, 07:59:39 AM »
Quote
What 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.

Offline bjp

  • Jr. Member
  • **
  • Posts: 163
Re: SSI for 10 last post but more beautifull
« Reply #4 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>';         
         
   ?>

Offline fabio

  • Semi-Newbie
  • *
  • Posts: 43
  • Gender: Male
    • Blue fans
Re: SSI for 10 last post but more beautifull
« Reply #5 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

Offline bjp

  • Jr. Member
  • **
  • Posts: 163
Re: SSI for 10 last post but more beautifull
« Reply #6 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
« Last Edit: February 17, 2005, 10:03:02 AM by bjp »

Offline bjp

  • Jr. Member
  • **
  • Posts: 163
Re: SSI for 10 last post but more beautifull
« Reply #7 on: March 09, 2005, 08:50:30 AM »
up

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: SSI for 10 last post but more beautifull
« Reply #8 on: March 10, 2005, 04:43:05 AM »
I don't understand the question.  What are you asking for an example of?

-[Unknown]

Offline dailytalk

  • Jr. Member
  • **
  • Posts: 208
Re: SSI for 10 last post but more beautifull
« Reply #9 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:

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: SSI for 10 last post but more beautifull
« Reply #10 on: April 19, 2009, 12:38:14 PM »
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.