Re: Blogs anyone?
Paul and Cuteseal,
Thanks for the pointers.
Paul - I couldn't find a Reply Only forum mod - only a general Admin Options to prevent guests/users from starting topics - which has the same effect on an install wide basis.
cuteseal - very nice. I presume you wrote this? If so, congrats.
I had a few issues with it though - by default, I was getting each topic in the correct (reverse) order, however I was getting the last comment instead of the first post in the thread (if I had followed up to a comment). I solved this by adding a ORDER BY posted in your query on line 266.
Next, line 269 is missing a comment 'Display first paragraph only'
I also wanted to display more than the arbitrary first paragraph, so I changed your preg_split to an explode on 3 new lines (i.e. posts have 2 blank lines between 'summary' and 'body'):
#Display first paragraph only (comment out next four lines to turn off)
#$paragraph = preg_split("/\s*\n+/", $cur_post['message']);
$cur_post['message'] = str_replace("\r", '', $cur_post['message']); // get rid of any CR in a \r\n style newline
$paragraph = explode("\n\n\n", $cur_post['message']);
if (isset($paragraph[1])) {
You can see my first working draft at http://www.pgregg.com
Thanks, I'll prob tweak it more...
Oh, and I didn't want to call it via http:// as that makes an extra hit in the logs, so I ran it by:
$_GET['action']='new';
$_GET['show']=10;
$_GET['fid']=1;
ob_start();
chdir($_SERVER['DOCUMENT_ROOT'] . '/forums');
include("forums/externnews.php");
$blog = ob_get_contents();
ob_end_clean();
$blog = str_replace('img/smilies', 'forums/img/smilies', $blog);
print '<br>'.$blog;
And removed all the calls to exit; in your code (which I think are redundant with the if/else structure you have used).
Again, thanks.
Cheers