немного фиксов git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@333 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
pherum83 2011-12-04 21:52:04 +00:00
commit ea87931bff
6 changed files with 37 additions and 40 deletions

View file

@ -47,24 +47,18 @@ switch ($mode)
DB()->query("UPDATE ". BB_TOPICS ." SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1"); DB()->query("UPDATE ". BB_TOPICS ." SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1");
//Обновление кеша новостей на главной //Обновление кеша новостей на главной
if($bb_cfg['show_latest_news'])
{
$news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id']));
if(isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news']) if(isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news'])
{ {
$datastore->enqueue('latest_news'); $datastore->enqueue('latest_news');
$datastore->update('latest_news'); } $datastore->update('latest_news'); }
}
if($bb_cfg['show_network_news'])
{
$net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id'])); $net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id']));
if(isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news']) if(isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news'])
{ {
$datastore->enqueue('network_news'); $datastore->enqueue('network_news');
$datastore->update('network_news'); $datastore->update('network_news');
} }
}
$this->response['topic_id'] = $topic_id; $this->response['topic_id'] = $topic_id;
$this->response['topic_title'] = $new_title; $this->response['topic_title'] = $new_title;

View file

@ -63,8 +63,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.4 (beta)'; $bb_cfg['tp_version'] = '2.4 (beta)';
$bb_cfg['tp_release_state'] = 'R332'; $bb_cfg['tp_release_state'] = 'R333';
$bb_cfg['tp_release_date'] = '03-12-2011'; $bb_cfg['tp_release_date'] = '05-12-2011';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';
@ -572,10 +572,12 @@ $bb_cfg['tor_stats'] = true;
// News // News
$bb_cfg['show_latest_news'] = true; $bb_cfg['show_latest_news'] = true;
$bb_cfg['max_news_title'] = 50;
$bb_cfg['latest_news_count'] = 5; $bb_cfg['latest_news_count'] = 5;
$bb_cfg['latest_news_forum_id'] = '1'; // (string) 1,2,3... $bb_cfg['latest_news_forum_id'] = '1'; // (string) 1,2,3...
// Network News // Network News
$bb_cfg['show_network_news'] = true; $bb_cfg['show_network_news'] = true;
$bb_cfg['max_net_title'] = 50;
$bb_cfg['network_news_count'] = 5; $bb_cfg['network_news_count'] = 5;
$bb_cfg['network_news_forum_id'] = '2'; // (string) 1,2,3... $bb_cfg['network_news_forum_id'] = '2'; // (string) 1,2,3...

View file

@ -146,7 +146,7 @@ if ($bb_cfg['show_latest_news'] AND $news_forum_ids = $bb_cfg['latest_news_forum
// //
// Network_news // Network_news
// //
if ($bb_cfg['show_network_news'] AND $net_forum_ids = intval($bb_cfg['network_news_forum_id'])) if ($bb_cfg['show_network_news'] AND $net_forum_ids = $bb_cfg['network_news_forum_id'])
{ {
$net_count = max($bb_cfg['network_news_count'], 1); $net_count = max($bb_cfg['network_news_count'], 1);

View file

@ -334,7 +334,7 @@ if ($bb_cfg['show_latest_news'])
{ {
$template->assign_block_vars('news', array( $template->assign_block_vars('news', array(
'NEWS_TOPIC_ID' => $news['topic_id'], 'NEWS_TOPIC_ID' => $news['topic_id'],
'NEWS_TITLE' => $news['topic_title'], 'NEWS_TITLE' => str_short($news['topic_title'], $bb_cfg['max_news_title']),
'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', 'false'), 'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', 'false'),
'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']), 'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id']),
)); ));
@ -358,7 +358,7 @@ if ($bb_cfg['show_network_news'])
{ {
$template->assign_block_vars('net', array( $template->assign_block_vars('net', array(
'NEWS_TOPIC_ID' => $net['topic_id'], 'NEWS_TOPIC_ID' => $net['topic_id'],
'NEWS_TITLE' => $net['topic_title'], 'NEWS_TITLE' => str_short($net['topic_title'], $bb_cfg['max_net_title']),
'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', 'false'), 'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', 'false'),
'NEWS_IS_NEW' => is_unread($net['topic_time'], $net['topic_id'], $net['forum_id']), 'NEWS_IS_NEW' => is_unread($net['topic_time'], $net['topic_id'], $net['forum_id']),
)); ));

View file

@ -249,25 +249,19 @@ switch ($mode)
$result = topic_delete($req_topics, $forum_id); $result = topic_delete($req_topics, $forum_id);
//Обновление кеша новостей на главной //Обновление кеша новостей на главной
if($bb_cfg['show_latest_news'])
{
$news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id'])); $news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id']));
if(isset($news_forums[$forum_id]) && $bb_cfg['show_latest_news'] && $result) if(isset($news_forums[$forum_id]) && $bb_cfg['show_latest_news'] && $result)
{ {
$datastore->enqueue('latest_news'); $datastore->enqueue('latest_news');
$datastore->update('latest_news'); $datastore->update('latest_news');
} }
}
if($bb_cfg['show_network_news'])
{
$net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id'])); $net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id']));
if(isset($net_forums[$forum_id]) && $bb_cfg['show_network_news'] && $result) if(isset($net_forums[$forum_id]) && $bb_cfg['show_network_news'] && $result)
{ {
$datastore->enqueue('network_news'); $datastore->enqueue('network_news');
$datastore->update('network_news'); $datastore->update('network_news');
} }
}
$msg = ($result) ? $lang['TOPICS_REMOVED'] : 'No topics were removed'; $msg = ($result) ? $lang['TOPICS_REMOVED'] : 'No topics were removed';
message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); message_die(GENERAL_MESSAGE, return_msg_mcp($msg));
@ -298,6 +292,13 @@ switch ($mode)
$datastore->update('latest_news'); $datastore->update('latest_news');
} }
$net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id']));
if((isset($news_forums[$forum_id]) || isset($news_forums[$new_forum_id])) && $bb_cfg['show_network_news'] && $result)
{
$datastore->enqueue('network_news');
$datastore->update('network_news');
}
$msg = ($result) ? $lang['TOPICS_MOVED'] : $lang['NO_TOPICS_MOVED']; $msg = ($result) ? $lang['TOPICS_MOVED'] : $lang['NO_TOPICS_MOVED'];
message_die(GENERAL_MESSAGE, return_msg_mcp($msg)); message_die(GENERAL_MESSAGE, return_msg_mcp($msg));
} }

View file

@ -732,27 +732,27 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
if( $is_auth['auth_sticky'] ) if( $is_auth['auth_sticky'] )
{ {
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"'; $topic_type_toggle .= '<label><input type="radio" name="topictype" value="' . POST_STICKY . '"';
if ( isset($post_data['topic_type']) && ($post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY) ) if ( isset($post_data['topic_type']) && ($post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY) )
{ {
$topic_type_toggle .= ' checked="checked"'; $topic_type_toggle .= ' checked="checked"';
} }
$topic_type_toggle .= ' /> ' . $lang['POST_STICKY'] . '&nbsp;&nbsp;'; $topic_type_toggle .= ' /> ' . $lang['POST_STICKY'] . '</label>&nbsp;&nbsp;';
} }
if( $is_auth['auth_announce'] ) if( $is_auth['auth_announce'] )
{ {
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"'; $topic_type_toggle .= '<label><input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
if ( isset($post_data['topic_type']) && ($post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE) ) if ( isset($post_data['topic_type']) && ($post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE) )
{ {
$topic_type_toggle .= ' checked="checked"'; $topic_type_toggle .= ' checked="checked"';
} }
$topic_type_toggle .= ' /> ' . $lang['POST_ANNOUNCEMENT'] . '&nbsp;&nbsp;'; $topic_type_toggle .= ' /> ' . $lang['POST_ANNOUNCEMENT'] . '</label>&nbsp;&nbsp;';
} }
if ( $topic_type_toggle != '' ) if ( $topic_type_toggle != '' )
{ {
$topic_type_toggle = $lang['POST_TOPIC_AS'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( (!isset($post_data['topic_type']) || $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL) ? ' checked="checked"' : '' ) . ' /> ' . $lang['POST_NORMAL'] . '&nbsp;&nbsp;' . $topic_type_toggle; $topic_type_toggle = $lang['POST_TOPIC_AS'] . ': <label><input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( (!isset($post_data['topic_type']) || $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL) ? ' checked="checked"' : '' ) . ' /> ' . $lang['POST_NORMAL'] . '</label>&nbsp;&nbsp;' . $topic_type_toggle;
} }
} }
//bt //bt