ALTER TABLE `bb_forums` CHANGE `allow_dl_topic` `allow_porno_topic` TINYINT( 1 ) NOT NULL DEFAULT '0'; UPDATE `bb_forums` SET `allow_porno_topic` = '0'; выбор порно форумов в админке git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@367 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2012-02-10 11:16:20 +00:00
commit ff904d8ddb
17 changed files with 43 additions and 41 deletions

View file

@ -834,7 +834,7 @@ CREATE TABLE `bb_forums` (
`auth_attachments` tinyint(2) NOT NULL default '0',
`auth_download` tinyint(2) NOT NULL default '0',
`allow_reg_tracker` tinyint(1) NOT NULL default '0',
`allow_dl_topic` tinyint(1) NOT NULL default '0',
`allow_porno_topic` tinyint(1) NOT NULL default '0',
`self_moderated` tinyint(1) NOT NULL default '0',
`forum_parent` smallint(5) unsigned NOT NULL default '0',
`show_on_index` tinyint(1) NOT NULL default '1',

View file

@ -62,7 +62,7 @@ $default_cfg = array_merge($default_cfg_str, $default_cfg_bool, $default_cfg_num
$db_fields_bool = array(
'allow_reg_tracker' => 0, // Allowed forums for registering torrents on tracker
'allow_dl_topic' => 0, // Allowed forums for dl-topics
'allow_porno_topic' => 0, // Allowed forums for dl-topics
'self_moderated' => 0, // Users can move theirs topic to another forum
);

View file

@ -53,7 +53,7 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
// Increase number of revision after update
$bb_cfg['tp_version'] = '2.4 (beta)';
$bb_cfg['tp_release_state'] = 'R366';
$bb_cfg['tp_release_state'] = 'R367';
$bb_cfg['tp_release_date'] = '10-02-2012';
// Database
@ -503,7 +503,6 @@ $banned_user_agents = array(
# 'wget',
);
$bb_cfg['porno_forums'] = ''; // (string) 1,2,3..
$bb_cfg['porno_forums_screenshots_topic_id'] = 52267;
$bb_cfg['trash_forum_id'] = 0; // (int) 27

View file

@ -11,7 +11,7 @@ $row = DB()->fetch_row("SELECT COUNT(*) AS usercount FROM ". BB_USERS ." WHERE u
$data['usercount'] = number_format($row['usercount']);
// newestuser
$row = DB()->fetch_row("SELECT user_id, username FROM ". BB_USERS ." ORDER BY user_id DESC LIMIT 1");
$row = DB()->fetch_row("SELECT user_id, username, user_rank FROM ". BB_USERS ." ORDER BY user_id DESC LIMIT 1");
$data['newestuser'] = $row;
// post/topic count

View file

@ -158,7 +158,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
{
$topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;
$topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $post_info['allow_dl_topic'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL;
$topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL;
$sql = ($mode != "editpost") ? "INSERT INTO " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote)" : "UPDATE " . BB_TOPICS . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
@ -224,7 +224,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
$datastore->update('latest_news');
}
}
if($bb_cfg['show_network_news'])
{
$net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id']));

View file

@ -779,16 +779,6 @@ class user_common
return join(',', $not_auth_forums);
}
/**
* Exclude porn forums
*/
function exclude_porn_forums ()
{
global $bb_cfg;
return ($bb_cfg['porno_forums'] && bf($this->opt, 'user_opt', 'hide_porn_forums')) ? $bb_cfg['porno_forums'] : '';
}
/**
* Get excluded forums
*/
@ -800,9 +790,21 @@ class user_common
{
$excluded[] = $not_auth;
}
if ($porn = $this->exclude_porn_forums())
if(bf($this->opt, 'user_opt', 'hide_porn_forums'))
{
$excluded[] = $porn;
global $datastore;
if (!$forums = $datastore->get('cat_forums'))
{
$datastore->update('cat_forums');
$forums = $datastore->get('cat_forums');
}
foreach($forums['forum'] as $key => $row)
{
if($row['allow_porno_topic']) $excluded[] = $row['forum_id'];
}
}
switch ($return_as)

View file

@ -210,7 +210,7 @@ $template->assign_vars(array(
'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']),
'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']),
'TOTAL_GENDER' => ($bb_cfg['gender']) ? sprintf($lang['USERS_TOTAL_GENDER'], $stats['male'], $stats['female'], $stats['unselect']) : '',
'NEWEST_USER' => sprintf($lang['NEWEST_USER'], '<a href="'. PROFILE_URL . $stats['newestuser']['user_id'] .'">', $stats['newestuser']['username'], '</a>'),
'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])),
// Tracker stats
'TORRENTS_STAT' => ($bb_cfg['tor_stats']) ? sprintf($lang['TORRENTS_STAT'], $stats['torrentcount'], humn_size($stats['size'])) : '',
@ -347,7 +347,7 @@ if ($bb_cfg['show_network_news'])
{
$datastore->update('network_news');
$network_news = $datastore->get('network_news');
}
}
$template->assign_vars(array(
'SHOW_NETWORK_NEWS' => true,

View file

@ -61,8 +61,8 @@ $lang['FORUM_CFG_EXPL'] = 'Forum config';
$lang['BT_SELECT_FORUMS'] = 'Forum options:';
$lang['BT_SELECT_FORUMS_EXPL'] = 'hold down <i>Ctrl</i> while selecting multiple forums';
$lang['ALLOW_REG_TRACKER'] = 'Allowed forums for registering <b>.torrents</b> on tracker';
$lang['ALLOW_DL_TOPIC'] = 'Allow post <b>Download topics</b>';
$lang['ALLOW_REG_TRACKER'] = 'Allowed forums for registering .torrents on tracker';
$lang['ALLOW_PORNO_TOPIC'] = 'Allow post porno topics';
$lang['SHOW_DL_BUTTONS'] = 'Show buttons for manually changing DL-status';
$lang['SELF_MODERATED'] = 'Users can <b>move</b> their topics to another forum';

View file

@ -148,7 +148,7 @@ $lang['POSTED_ARTICLES_TOTAL'] = 'Our users have posted a total of <b>%s</b> art
$lang['REGISTERED_USERS_ZERO_TOTAL'] = 'We have <b>0</b> registered users'; // # registered users
$lang['REGISTERED_USERS_TOTAL'] = 'We have <b>%s</b> registered users'; // # registered users
$lang['USERS_TOTAL_GENDER'] = 'Boys: <b>%d</b>, Girls: <b>%d</b>, Others: <b>%d</b>';
$lang['NEWEST_USER'] = 'The newest registered user is <b>%s%s%s</b>'; // a href, username, /a
$lang['NEWEST_USER'] = 'The newest registered user is <b>%s</b>'; // a href, username, /a
// Tracker stats
$lang['TORRENTS_STAT'] = 'Torrents: <b style="color: blue;">%s</b>,&nbsp; Total size: <b>%s</b>'; // first %s = number of torrents, second %s is the total size.

View file

@ -62,7 +62,7 @@ $lang['BT_SELECT_FORUMS'] = 'Форумы, в которых:';
$lang['BT_SELECT_FORUMS_EXPL'] = 'для выделения нескольких форумов, отмечайте их с нажатой клавишей <i>Ctrl</i>';
$lang['ALLOW_REG_TRACKER'] = 'Разрешена регистрация торрентов на трекере';
$lang['ALLOW_DL_TOPIC'] = 'Разрешено создавать Download топики';
$lang['ALLOW_PORNO_TOPIC'] = 'Разрешено создавать porno топики';
$lang['SHOW_DL_BUTTONS'] = 'Показывать кнопки для изменения DL-статуса';
$lang['SELF_MODERATED'] = 'Автор топика может перенести его в другой форум';

View file

@ -151,7 +151,7 @@ $lang['POSTED_ARTICLES_TOTAL'] = 'Наши пользователи остави
$lang['REGISTERED_USERS_ZERO_TOTAL'] = 'У нас нет зарегистрированных пользователей'; // # registered users
$lang['REGISTERED_USERS_TOTAL'] = 'Всего зарегистрированных пользователей: <b>%s</b>'; // # registered users
$lang['USERS_TOTAL_GENDER'] = 'Парней: <b>%d</b>, Девушек: <b>%d</b>, Не указан: <b>%d</b>';
$lang['NEWEST_USER'] = 'Последний зарегистрированный пользователь: <b>%s%s%s</b>'; // username
$lang['NEWEST_USER'] = 'Последний зарегистрированный пользователь: <b>%s</b>'; // username
// Tracker stats
$lang['TORRENTS_STAT'] = 'Раздач: <b style="color: blue;">%s</b>,&nbsp; Общий размер: <b>%s</b>'; // first %s = number of torrents, second %s is the total size.

View file

@ -758,7 +758,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
//bt
$topic_dl_type = (isset($post_info['topic_dl_type'])) ? $post_info['topic_dl_type'] : 0;
if ($topic_dl_type || $post_info['allow_dl_topic'] || $is_auth['auth_mod'])
if ($topic_dl_type || $post_info['allow_reg_tracker'] || $is_auth['auth_mod'])
{
if (!$topic_type_toggle)
{
@ -769,7 +769,7 @@ if ($topic_dl_type || $post_info['allow_dl_topic'] || $is_auth['auth_mod'])
$dl_type_name = 'topic_dl_type';
$dl_type_val = ($topic_dl_type) ? 1 : 0;
if (!$post_info['allow_dl_topic'] && !$is_auth['auth_mod'])
if (!$post_info['allow_reg_tracker'] && !$is_auth['auth_mod'])
{
$dl_ds = ' disabled="disabled" ';
$dl_hid = '<input type="hidden" name="topic_dl_type" value="'. $dl_type_val .'" />';

View file

@ -13,12 +13,12 @@
<tr class="row2 tCenter">
<td>{L_ALLOW_REG_TRACKER}</td>
<td>{L_SELF_MODERATED}</td>
<td>{L_ALLOW_DL_TOPIC}</td>
<td>{L_ALLOW_PORNO_TOPIC}</td>
</tr>
<tr class="tCenter">
<td>{S_ALLOW_REG_TRACKER}</td>
<td>{S_SELF_MODERATED}</td>
<td>{S_ALLOW_DL_TOPIC}</td>
<td>{S_ALLOW_PORNO_TOPIC}</td>
</tr>
<tr class="row2 tCenter">
<td colspan="3" class="small">{L_BT_SELECT_FORUMS_EXPL}</td>

View file

@ -114,11 +114,11 @@ wbr { display: inline-block; }
/* ---------------------------------- *
Links
* ---------------------------------- */
:link:focus, :visited:focus { color: #444; }
:link { color: #222; text-decoration: none !important; }
:visited { color: #222; text-decoration: none !important; }
:link:hover, :visited:hover { color: #444; text-decoration: underline !important; }
:link:active, :visited:active { color: #444; text-decoration: underline !important; }
:link:focus, :visited:focus { color: #DD6900; }
:link { color: #006699; text-decoration: none !important; }
:visited { color: #006699; text-decoration: none !important; }
:link:hover, :visited:hover { color: #DD6900; text-decoration: underline !important; }
:link:active, :visited:active { color: #DD6900; text-decoration: underline !important; }
.colorAdmin, a.colorAdmin, a.colorAdmin:visited { color: #A00 !important; }
.colorSuperMod, a.colorSuperMod, a.colorSuperMod:visited { color: #0080FF !important; }

View file

@ -207,7 +207,6 @@ ajax.callback.posts = function(data){
</td>
</tr>
<!-- ENDIF -->
<!-- IF $bb_cfg['porno_forums'] -->
<tr>
<td>{L_HIDE_PORN_FORUMS}:</td>
<td>
@ -215,7 +214,6 @@ ajax.callback.posts = function(data){
<label><input type="radio" name="hide_porn_forums" value="0" <!-- IF not HIDE_PORN_FORUMS -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
</td>
</tr>
<!-- ENDIF -->
<!-- IF SHOW_DATEFORMAT -->
<tr>
<td>{L_DATE_FORMAT}:<h6>{L_DATE_FORMAT_EXPLAIN}</h6></td>

View file

@ -133,6 +133,8 @@ if (!$forums = $datastore->get('cat_forums'))
$forums = $datastore->get('cat_forums');
}
if($forums['forum'][$forum_id]['allow_porno_topic']) bb_die('бетатестеры вставте языковые');
if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums']) && $show_subforums)
{
$not_auth_forums = ($bb_cfg['sf_check_view_permissions']) ? $user->get_not_auth_forums(AUTH_VIEW) : '';

View file

@ -20,7 +20,6 @@ $newest = $next_topic_id = 0;
$start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0;
$topic_id = isset($_GET[POST_TOPIC_URL]) ? (int) $_GET[POST_TOPIC_URL] : 0;
$post_id = (!$topic_id && isset($_GET[POST_POST_URL])) ? (int) $_GET[POST_POST_URL] : 0;
$porno_forums = array_flip(explode(',', $bb_cfg['porno_forums']));
// Start session
$user->session_start();
@ -118,6 +117,8 @@ $forum_topic_data =& $t_data;
$topic_id = $t_data['topic_id'];
$forum_id = $t_data['forum_id'];
if($t_data['allow_porno_topic']) bb_die('бетатестеры вставте языковые');
if ($userdata['session_admin'] && !empty($_REQUEST['mod']))
{
if (IS_ADMIN)
@ -487,7 +488,7 @@ if ( $is_auth['auth_mod'] )
$topic_mod .= "<a href=\"modcp.php?" . POST_TOPIC_URL . "=$topic_id&amp;mode=split&amp;sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['SPLIT_TOPIC'] . '" title="' . $lang['SPLIT_TOPIC'] . '" border="0" /></a>&nbsp;';
//bt
if ($t_data['allow_dl_topic'] || $t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL || IS_ADMIN)
if ($t_data['allow_reg_tracker'] || $t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL || IS_ADMIN)
{
if ($t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL)
{
@ -600,7 +601,7 @@ $template->assign_vars(array(
'TOPIC_ID' => $topic_id,
'PAGE_TITLE' => $topic_title,
'TOPIC_TITLE' => wbr($topic_title),
'PORNO_FORUM' => isset($porno_forums[$forum_id]),
'PORNO_FORUM' => ($t_data['allow_porno_topic']),
'REPLY_IMG' => $reply_img,
'SHOW_BOT_NICK' => $bb_cfg['show_bot_nick'],
'T_POST_REPLY' => $reply_alt,
@ -830,7 +831,7 @@ for($i = 0; $i < $total_posts; $i++)
{
$poster_avatar = get_avatar($postrow[$i]['user_avatar'], $postrow[$i]['user_avatar_type'], !bf($postrow[$i]['user_opt'], 'user_opt', 'allow_avatar'));
}
$user_rank = $postrow[$i]['user_rank'];
//