diff -r bf5589120afb -r fed61fc8895b plugins/Newsboy.php --- a/plugins/Newsboy.php Mon Jan 21 11:52:07 2008 -0500 +++ b/plugins/Newsboy.php Mon Jan 28 23:02:18 2008 -0500 @@ -237,27 +237,36 @@ { global $db, $session, $paths, $template, $plugins; // Common objects - $news_template = << - - - - - - - - - - -
{TITLE}
- {CONTENT} -
- Posted by {USER_LINK} on {DATE}
- [ {NUM_COMMENTS} comment{COMMENT_S} | {COMMENT_LINK} ] -
- + if ( file_exists( ENANO_ROOT . "/themes/{$template->theme}/newsboy-post.tpl" ) ) + { + $parser = $template->makeParser("newsboy-post.tpl"); + } + else + { + $news_template = << + + + + + + + + + + +
{TITLE}
+ {CONTENT} +
+ Posted by {USER_LINK} on {DATE}
+ [ {NUM_COMMENTS} comment{COMMENT_S} | {COMMENT_LINK} ] +
+ TPLCODE; + $parser = $template->makeParserText($news_template); + } + /* $p = RenderMan::strToPageID(getConfig('main_page')); if ( $p[1] != 'NewsBoy' ) @@ -296,7 +305,15 @@ eval($content); } - echo '

Latest news

'; + if ( file_exists( ENANO_ROOT . "/themes/{$template->theme}/newsboy-portal-pre.tpl" ) ) + { + $parser_pre = $template->makeParser("newsboy-portal-pre.tpl"); + echo $parser_pre->run(); + } + else + { + echo '

Latest news

'; + } $q = $db->sql_unbuffered_query('SELECT p.*, COUNT(c.comment_id) AS num_comments, t.page_text, l.time_id, l.author, u.user_level FROM '.table_prefix.'pages AS p LEFT JOIN '.table_prefix.'comments AS c @@ -319,7 +336,6 @@ if ( $row = $db->fetchrow() ) { $i = 0; - $parser = $template->makeParserText($news_template); do { if ( $i < 5 ) @@ -378,6 +394,12 @@ { echo '

No news items yet.

'; } + if ( file_exists( ENANO_ROOT . "/themes/{$template->theme}/newsboy-portal-post.tpl" ) ) + { + $parser_post = $template->makeParser("newsboy-portal-post.tpl"); + echo $parser_post->run(); + } + if ( $session->user_level >= USER_LEVEL_ADMIN ) { echo '