Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: tvfl on March 19, 2008, 03:09:30 PM

Title: Using SMF SSI to list all posts from a single topic.
Post by: tvfl 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
Title: Re: Using SMF SSI to list all posts from a single topic.
Post by: tvfl 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:

$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!
Title: Re: Using SMF SSI to list all posts from a single topic.
Post by: tvfl 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?
Title: Re: Using SMF SSI to list all posts from a single topic.
Post by: tvfl on March 21, 2008, 09:43:22 AM
Please help!
Title: Re: Using SMF SSI to list all posts from a single topic.
Post by: Spaceman-Spiff 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.
Title: Re: Using SMF SSI to list all posts from a single topic.
Post by: Eliana Tamerin on March 24, 2008, 02:44:17 PM
There's a mod for this:
http://custom.simplemachines.org/mods/index.php?mod=751