SimplePortal

Customization => Custom Coding => Topic started by: colby2152 on November 18, 2010, 06:53:24 PM

Title: Blog with Articles?
Post by: colby2152 on November 18, 2010, 06:53:24 PM
I have a custom action and I would like to display blocks on it... no problem, done.  What I want to do is make this action into a blog.  None of the SimplePortal blocks really allow this.  All of them show a list of posts rather than the actual content within the original post.
Title: Re: Blog on Custom Action
Post by: Nathaniel on November 18, 2010, 09:09:27 PM
Use a Custom PHP block then.

The PHP code below is an example of how you can query a message's body then display it. You will need to change the $id_msg variable's value to the relevant message id that you want to show.

Code: [Select]
$id_msg = 1;

global $smcFunc;

$request = $smcFunc['db_query']('', '
SELECT
body
FROM {db_prefix}messages
WHERE id_msg = {int:id_msg}
LIMIT 1',
array(
'id_msg' => $id_msg,
)
);
list($msg) = $smcFunc['db_fetch_row']($request);

echo parse_bbc(censorText($msg), true, $id_msg);

$smcFunc['db_free_result']($request);
Title: Re: Blog on Custom Action
Post by: colby2152 on November 22, 2010, 11:26:48 AM
Hmm, thank you for the code but that isn't sustainable in the long run.  What I would prefer to have is to use the article categories for multiple blogs.
Title: Re: Blog with Articles?
Post by: colby2152 on November 22, 2010, 01:42:26 PM
I changed the subject... what I want to do is have the ability to display articles in places (such as a custom action) other than the Portal.
Title: Re: Blog with Articles?
Post by: colby2152 on November 22, 2010, 05:52:50 PM
Nevermind, I figured it out with the News Block.
SimplePortal 2.3.8 © 2008-2024, SimplePortal