Advertisement:

Author Topic: Using SMF SSI to list all posts from a single topic.  (Read 2059 times)

Offline tvfl

  • Semi-Newbie
  • *
  • Posts: 11
Using SMF SSI to list all posts from a single topic.
« on: March 19, 2008, 03:09:30 PM »
Hello,

Basically I want to use a ssi function, to list all posts from a certain topic

The variable topic I want to be able to change

So $topic

It displays all posts with the newest first, and oldest last, with ALL content inside each post, in a a long list.

Thank you

Offline tvfl

  • Semi-Newbie
  • *
  • Posts: 11
Re: Using SMF SSI to list all posts from a single topic.
« Reply #1 on: March 19, 2008, 07:01:21 PM »
So I finally did it


A new question!


I want my posts to be shown to contain links only, how do I do this?

I have this code:

Code: [Select]
$row['body'] = preg_replace(array('~\[quote(.+?)\[/quote\]~i', '~\[code(.+?)\[/code\]~i', '~\[img(.+?)\[/img\]~i'), '', $row['body']);
For stripping tags, but I need code to work out where "http://" and keep all the links only,...

PLEASE HELP!

Offline tvfl

  • Semi-Newbie
  • *
  • Posts: 11
Re: Using SMF SSI to list all posts from a single topic.
« Reply #2 on: March 20, 2008, 08:43:36 PM »
So..

I have done everything I want to so far...

-----
At the moment I have a function using db_query that finds all posts from a topic and displays them.

I keep persistantly getting the error "No database selected" if I click lots of times to view this function.

Specifically on the line
__FILE__, __LINE__

I tried to remove this bit, but the db_query needs the parts...

Is there any explanations for this?

Offline tvfl

  • Semi-Newbie
  • *
  • Posts: 11
Re: Using SMF SSI to list all posts from a single topic.
« Reply #3 on: March 21, 2008, 09:43:22 AM »
Please help!

Offline Spaceman-Spiff

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,524
  • Gender: Male
Re: Using SMF SSI to list all posts from a single topic.
« Reply #4 on: March 24, 2008, 01:29:17 PM »
Hi tvfl,

Did you put your code inside SSI.php, or on a separate file? Try to use the $db_prefix var, as it contains the database name too.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!