Page 1 of 1

[REQUEST] newsbar

PostPosted: Mon Sep 04, 2006 9:24 am
Author: Skywalker
can someone port this to im?

Code: Select all
################################################################# Mod Title]http://www.phpbbhacks.com#[/url]### This Mod Displays a chosen category horizontally in a "bar" at the top## Of your forums, useful for RSS feeds or forum announcements.#### Installation rated: Easy## Installation time: 5 mins#### Files To Edit: 2## phpbb2/index.php## phpbb2/templates/xxxx/index_body.tpl############################################################################### Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD############################################################################# Released under GPL copyright Richard Fitzgerald#### Notes: The chosen category will be hidden from the main part of the forums##    ##------[ open file: phpbb2/index.php ]-------------------------------#  ##------[Find]------------------------------#  include($phpbb_root_path . 'common.'.$phpEx);  ##-----[After Add (where '2' = category ID of newsbar cat]------------------#  $news = '2';  ##----[Find]---------------#  if ( $display_forums )  ##------[Replace With]----------#  if ( $display_forums AND $cat_id <> $news)  ##-----[FInd]-------------#  if ( $forum_data[$j]['cat_id'] == $cat_id)  ##-----[Replace With]--------------------#  if ( $forum_data[$j]['cat_id'] == $cat_id AND $cat_id <> $news )    ##------[Find]------------------#    message_die(GENERAL_MESSAGE, $lang['No_forums']);}  ##----[After Add]--------------------#  If ($display_forums = true){             if ( $viewcat == $cat_id || $viewcat == -1 )             {                                                             for($j = 0; $j < $total_forums; $j++)                 {IF ($forum_data1[$j]['cat_id'] == $news)                             {                                 $forum_id = $forum_data1[$j]['forum_id'];                           if ( $is_auth_ary[$forum_id]['auth_view'] )                         {                             if ( $forum_data1[$j]['forum_status'] == FORUM_LOCKED )                             {                                 $folder_image = $images['forum_locked'];                                 $folder_alt = $lang['Forum_locked'];                             }                             else                             {                                 $unread_topics = false;                                 if ( $userdata['session_logged_in'] )                                 {                                     if ( !empty($new_topic_data[$forum_id]) )                                     {                                         $forum_last_post_time = 0;                                           while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )                                         {                                             if ( empty($tracking_topics[$check_topic_id]) )                                             {                                                 $unread_topics = true;                                                 $forum_last_post_time = max($check_post_time, $forum_last_post_time);                                               }                                             else                                             {                                                 if ( $tracking_topics[$check_topic_id] <check_post_time> $forum_last_post_time )                                             {                                                 $unread_topics = false;                                             }                                         }                                           if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )                                         {                                             if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )                                             {                                                 $unread_topics = false;                                             }                                         }                                       }                                 }                                   $folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];                                 $folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];                             }                               $posts = $forum_data1[$j]['forum_posts'];                             $topics = $forum_data1[$j]['forum_topics'];                               if ( $forum_data1[$j]['forum_last_post_id'] )                             {                                 $last_post_time = create_date($board_config['default_dateformat'], $forum_data1[$j]['post_time'], $board_config['board_timezone']);                                   $last_post = $last_post_time . '<br>';                                   $last_post .= ( $forum_data1[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data1[$j]['post_username'] != '' ) ? $forum_data1[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a>' . $forum_data1[$j]['username'] . '</a> ';                                                                 $last_post .= '<a><img></a>';                             }                             else                             {                                 $last_post = $lang['No_Posts'];                             }                               if ( count($forum_moderators[$forum_id]) > 0 )                             {                                 $l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];                                 $moderator_list = implode(', ', $forum_moderators[$forum_id]);                             }                             else                             {                                 $l_moderators = ' ';                                 $moderator_list = ' ';                             }                                                                                                                                 //news hack                             $template->assign_block_vars('forumrow1',    array(                                 'ROW_COLOR' => '#' . $row_color,                                 'ROW_CLASS' => $row_class,                                 'FORUM_NAME' => $forum_data1[$j]['forum_name'],                                 'FORUM_DESC' => $forum_data1[$j]['forum_desc'],                                 'LAST_POST' => $last_post,                                 'FORUM_FOLDER_IMG' => $folder_image,                                                                   'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))                             );                           }   }}   }   }    ##--------[Open File: phpbb2/templates/xxxx/index_body.tpl]---------## Do for All Templates  ##-----[Find]-----------------#         <a>{L_SEARCH_UNANSWERED}</a></td>   </tr></table>  ##---------[After Add]--------------#  <table>     <tr>     <td><span>Latest News</span></td>   </tr>     <tr>       <BEGIN>     <td><img></td>     <td><span> <a>{forumrow1.FORUM_NAME}</a><br>     <!-- <td> <span>{forumrow1.LAST_POST}</span></td>-->   <END>     </tr>       </table><br>    ##----[Save and Close Files]---------------#  EOM

Re: [REQUEST] newsbar

PostPosted: Mon Sep 04, 2006 11:41 am
Author: Helter
this does not need to be "ported" as it will work as written. It seems usless though because IM already has a Global anounce mod installed that will do the same thing, but show it on every forum page. this is a "dirty" hack because it requires you to hard code your forum id to your index, and wont allow you to change it from your acp

Re: [REQUEST] newsbar

PostPosted: Mon Sep 04, 2006 2:18 pm
Author: Skywalker
"HelterSkelter";p="14905" wrote:this does not need to be "ported" as it will work as written. It seems usless though because IM already has a Global anounce mod installed that will do the same thing, but show it on every forum page. this is a "dirty" hack because it requires you to hard code your forum id to your index, and wont allow you to change it from your acp


i will create a acp function later, but i installed this mod and on my board it does not show topics from the category witch i entered