Exemple #1
0
                    $tracking_topics = !empty($HTTP_COOKIE_VARS[$ft_cfg['cookie_name'] . '_t']) ? unserialize($HTTP_COOKIE_VARS[$ft_cfg['cookie_name'] . '_t']) : array();
                    $tracking_forums = !empty($HTTP_COOKIE_VARS[$ft_cfg['cookie_name'] . '_f']) ? unserialize($HTTP_COOKIE_VARS[$ft_cfg['cookie_name'] . '_f']) : array();
                    if (count($tracking_topics) + count($tracking_forums) == 100 && empty($tracking_topics[$topic_id])) {
                        asort($tracking_topics);
                        unset($tracking_topics[key($tracking_topics)]);
                    }
                    $tracking_topics[$topic_id] = time();
                    setcookie($ft_cfg['cookie_name'] . '_t', serialize($tracking_topics), 0, $ft_cfg['cookie_path'], $ft_cfg['cookie_domain'], $ft_cfg['cookie_secure']);
                }
                $template->assign_vars(array('META' => $return_meta));
                //bt
                $torrent_ext = @$attachment_mod['posting']->extension === TORRENT_EXT || @$attachment_mod['posting']->attachment_extension_list[0] === TORRENT_EXT ? TRUE : FALSE;
                $torrent_attach = $torrent_ext && defined('TORRENT_ATTACH_ID') && 1 == count($attachment_mod['posting']->attachment_list) ? TRUE : FALSE;
                if ($torrent_attach && $ft_cfg['bt_newtopic_auto_reg'] && $mode == 'newtopic' && !$error_msg) {
                    require_once FT_ROOT . 'includes/functions_torrent.php';
                    tracker_register(TORRENT_ATTACH_ID, 'newtopic');
                }
                //bt end
                message_die(GENERAL_MESSAGE, $return_message);
            }
        }
    }
}
//snp
//if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != '' )
if ($refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != '' || $submit && $topic_has_new_posts) {
    $username = !empty($HTTP_POST_VARS['username']) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['username']))) : '';
    $subject = !empty($HTTP_POST_VARS['subject']) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['subject']))) : '';
    $message = !empty($HTTP_POST_VARS['message']) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['message']))) : '';
    $poll_title = !empty($HTTP_POST_VARS['poll_title']) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['poll_title']))) : '';
    $poll_length = isset($HTTP_POST_VARS['poll_length']) ? max(0, intval($HTTP_POST_VARS['poll_length'])) : 0;
Exemple #2
0
    }
}
if (($mode == 'reg' || $mode == 'unreg' || $mode == 'del' || $mode == 'del_move') && !$attach_id) {
    message_die(GENERAL_ERROR, 'Invalid attach_id');
}
// Show users torrent-profile
if ($mode == 'userprofile') {
    redirect(append_sid("profile.php?mode=viewprofile&u={$req_uid}"), TRUE);
}
// check SID
if ($sid == '' || $sid !== $userdata['session_id']) {
    message_die(GENERAL_ERROR, 'Invalid_session');
}
// Register torrent on tracker
if ($mode == 'reg') {
    tracker_register($attach_id, 'request');
    exit;
}
// Unregister torrent from tracker
if ($mode == 'unreg') {
    tracker_unregister($attach_id, 'request');
    exit;
}
// Delete torrent
if ($mode == 'del' && $confirm) {
    delete_torrent($attach_id, 'request');
    $redirect_url = append_sid("viewtopic.php?" . POST_TOPIC_URL . "={$topic_id}");
    redirect($redirect_url);
}
// Delete torrent and move topic
if ($mode == 'del_move' && $confirm) {
 case 'set_gold':
 case 'set_silver':
 case 'unset_silver_gold':
     if ($type == 'set_silver') {
         $tor_type = TOR_TYPE_SILVER;
     } elseif ($type == 'set_gold') {
         $tor_type = TOR_TYPE_GOLD;
     } else {
         $tor_type = 0;
     }
     change_tor_type($attach_id, $tor_type);
     $title = $lang['CHANGE_TOR_TYPE'];
     $url = make_url(TOPIC_URL . $torrent['topic_id']);
     break;
 case 'reg':
     tracker_register($attach_id);
     $url = TOPIC_URL . $torrent['topic_id'];
     break;
 case 'unreg':
     tracker_unregister($attach_id);
     $url = TOPIC_URL . $torrent['topic_id'];
     break;
 case 'del_torrent':
     if (empty($this->request['confirmed'])) {
         $this->prompt_for_confirm($lang['DEL_TORRENT']);
     }
     delete_torrent($attach_id);
     $url = make_url(TOPIC_URL . $torrent['topic_id']);
     break;
 case 'del_torrent_move_topic':
     if (empty($this->request['confirmed'])) {
Exemple #4
0
                    foreach ($count_rowset as $count_row) {
                        if ($count_row['forum_id'] != $forum_id) {
                            $sub_forums[] = $count_row['forum_id'];
                        }
                    }
                    $sub_forums[] = $forum_id;
                    $sub_forums = join(',', $sub_forums);
                    // Подсчет проверенных релизов в форумах раздела
                    $count_checked_releases = DB()->fetch_row("\n\t\t\t\t\t\tSELECT COUNT(*) AS checked_releases\n\t\t\t\t\t\tFROM " . BB_BT_TORRENTS . "\n\t\t\t\t\t\tWHERE poster_id  = " . $userdata['user_id'] . "\n\t\t\t\t\t\t  AND forum_id   IN({$sub_forums})\n\t\t\t\t\t\t  AND tor_status IN(" . TOR_APPROVED . "," . TOR_DOUBTFUL . "," . TOR_TMP . ")\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t", 'checked_releases');
                    if ($count_checked_releases || IS_AM) {
                        tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_NOT_APPROVED);
                    } else {
                        tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_PREMOD);
                    }
                } else {
                    tracker_register(TORRENT_ATTACH_ID, 'newtopic', TOR_NOT_APPROVED);
                }
            }
        }
        // Update atom feed
        update_atom('topic', $topic_id);
        if ($mode == 'reply' && $post_info['topic_status'] == TOPIC_LOCKED) {
            $locked_warn = '
				<div class="warnColor1">
					<b>' . $lang['LOCKED_WARN'] . '</b>
				</div>
				<br /><hr /><br />
			';
            $return_message = $locked_warn . $return_message;
        }
        bb_die($return_message);