############################################################## ## MOD Title: Net News on sidebar for Torrentpier II ## MOD Author: Elder admin@free-torrents.org ## USED CODE FROM: RoadTrain(Last added, top torrents, top users Mod ), Meithar (original code TorrentPier R775 ) ## MOD Adapted for Torrentpier II: krumax < admin@krumax.org > http://krumax.org ## MOD Supplemented for Torrentpier II : chazychaz < chazychazik@gmail.com ## MOD Version: 0.3 ## Описание: Новости в сети как на t.ru, на боковой панели (не требует наличия других модов) ## Installation Level: Easy ## Installation Time: 10 Minutes ## Files To Edit: index.php, config,php, ## includes/datastore/build_cat_forums.php, ## includes/common.php ## templates/default/page_header.tpl ## templates/default/css/main.css ## Included Files: none ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ############################################################## ## For security purposes, please check: http://torrentpier.info/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://torrentpier.info/ http://torrentpier.info/viewtopic.php?f=8&t=3052 ############################################################## ## MOD History: ## 2009-08-06 - Version 0.1.0 ## - initial release ## 2009-10-04 - Version 0.2.0 ## - New feature - news from subforums ## 2013-10-07 -Version 0.3.0 ## - Highlighting of latest news, like standart news and net news ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]--------------------------------- # config.php # #-----[ FIND ]--------------------------------- # $bb_cfg['advert_html_path'] = $bb_cfg['html_path'] .'advert.html'; # # #-----[ AFTER, ADD ]--------------------------------- # // net news $bb_cfg['show_latest_net_news'] = true; # show/hide block on sidebar $bb_cfg['latest_net_news_count'] = xx; # xx - news count on sidebar $bb_cfg['latest_net_news_forum_id'] = 'XXX,YYY,ZZZ'; # XXX,YYY,ZZZ - forum_id(s) like 11,23,14 # #-----[ OPEN ]--------------------------------- # index.php # #-----[ FIND ]--------------------------------- # // Init userdata $user->session_start(); # #-----[ BEFORE, ADD ]--------------------------------- # //Enqueue latest net news if ($bb_cfg['latest_net_news_count']) { $datastore->enqueue('latest_net_news'); } # #-----[ FIND ]--------------------------------- # if ($bb_cfg['birthday']['check_day'] && $bb_cfg['birthday']['enabled']) { # #-----[ BEFORE, ADD ]--------------------------------- # // BEGIN latest net news. // if($bb_cfg['show_latest_net_news']) { if (!$latest_net_news = $datastore->get('latest_net_news')) { $datastore->update('latest_net_news'); $latest_net_news = $datastore->get('latest_net_news'); } $template -> assign_vars(array( 'LASTEST_NET_NEWS' => true, )); foreach ($latest_net_news as $latest_net) { $template -> assign_block_vars('LatestNetNews',array( 'TITLE' => $latest_net['topic_title'], 'TOPIC_ID' => $latest_net['topic_id'], 'NET_NEWS_IS_NEW' => is_unread($latest_net['topic_time'], $latest_net['topic_id'], $latest_net['forum_id']), )) ; } } // // END latest net news // # #-----[ OPEN ]--------------------------------- # includes/datastore/build_cat_forums.php # #-----[ FIND ]--------------------------------- # $this->store('latest_news', $data); } # #-----[ AFTER, ADD ]--------------------------------- # //Store LatestNetNews if ($bb_cfg['show_latest_net_news'] AND $net_news_forum_ids= $bb_cfg['latest_net_news_forum_id']) { $net_news_count = max($bb_cfg['latest_net_news_count'], 1); $data = DB()->fetch_rowset(" SELECT topic_id, topic_time, topic_title, forum_id FROM ". BB_TOPICS ." WHERE forum_id IN ($net_news_forum_ids) AND topic_moved_id = 0 AND is_draft = 0 ORDER BY topic_time DESC LIMIT $net_news_count "); $this->store('latest_net_news', $data); } # #-----[ OPEN ]--------------------------------- # templates/default/page_header.tpl # #-----[ FIND ]--------------------------------- # # #-----[ BEFORE, ADD ]--------------------------------- #
 
Новости в сети
 
# #-----[ OPEN ]--------------------------------- # includes/common.php # #-----[ FIND ]--------------------------------- # 'latest_news' => 'build_cat_forums.php', # #-----[ AFTER, ADD ]--------------------------------- # 'latest_net_news' => 'build_cat_forums', # #-----[ OPEN ]--------------------------------- # templates/default/css/main.css # #-----[ FIND ]--------------------------------- #sidebar1 a { text-decoration: none; color: #005A88; } # #-----[ AFTER, ADD ]--------------------------------- # #sidebar1, .net_news_title { text-overflow: clip:;padding:2px 8px 3px; margin-bottom:2px } .net_news_title a:hover{ color:#800000 !important; } #sidebar1 .new a { color:#ae4f01; font-weight:bold; } # #-----[ SAVE/CLOSE ALL FILES ]--------------------------------- # # EoM