• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bb_die函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bb_die函数的典型用法代码示例。如果您正苦于以下问题:PHP bb_die函数的具体用法?PHP bb_die怎么用?PHP bb_die使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bb_die函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: insert_cron_job

function insert_cron_job($cron_arr)
{
    $row = DB()->fetch_row("SELECT cron_title, cron_script FROM " . BB_CRON . " WHERE cron_title = '" . $_POST['cron_title'] . "' or cron_script = '" . $_POST['cron_script'] . "' ");
    if ($row) {
        global $lang;
        if ($_POST['cron_script'] == $row['cron_script']) {
            $langmode = $lang['SCRIPT_DUPLICATE'];
        } else {
            $langmode = $lang['TITLE_DUPLICATE'];
        }
        $message = $langmode . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS_ADDED'], "<a href=\"javascript:history.back(-1)\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS'], "<a href=\"admin_cron.php?mode=list\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"index.php?pane=right\">", "</a>");
        bb_die($message);
    }
    $cron_active = $cron_arr['cron_active'];
    $cron_title = $cron_arr['cron_title'];
    $cron_script = $cron_arr['cron_script'];
    $schedule = $cron_arr['schedule'];
    $run_day = $cron_arr['run_day'];
    $run_time = $cron_arr['run_time'];
    $run_order = $cron_arr['run_order'];
    $last_run = $cron_arr['last_run'];
    $next_run = $cron_arr['next_run'];
    $run_interval = $cron_arr['run_interval'];
    $log_enabled = $cron_arr['log_enabled'];
    $log_file = $cron_arr['log_file'];
    $log_sql_queries = $cron_arr['log_sql_queries'];
    $disable_board = $cron_arr['disable_board'];
    $run_counter = $cron_arr['run_counter'];
    DB()->query("INSERT INTO " . BB_CRON . " (cron_active, cron_title, cron_script, schedule, run_day, run_time, run_order, last_run, next_run, run_interval, log_enabled, log_file, log_sql_queries, disable_board, run_counter) VALUES (\n\t{$cron_active}, '{$cron_title}', '{$cron_script}', '{$schedule}', '{$run_day}', '{$run_time}', '{$run_order}', '{$last_run}', '{$next_run}', '{$run_interval}', {$log_enabled}, '{$log_file}', {$log_sql_queries}, {$disable_board}, '{$run_counter}')");
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:30,代码来源:functions_admin_cron.php


示例2: bb_check_post_flood

/**
 * Check to make sure that a user is not making too many posts in a short amount of time.
 */
function bb_check_post_flood()
{
    global $bbdb;
    $user_id = (int) $user_id;
    $throttle_time = bb_get_option('throttle_time');
    if (bb_current_user_can('manage_options') || empty($throttle_time)) {
        return;
    }
    if (bb_is_user_logged_in()) {
        $bb_current_user = bb_get_current_user();
        if (isset($bb_current_user->data->last_posted) && time() < $bb_current_user->data->last_posted + $throttle_time && !bb_current_user_can('throttle')) {
            if (defined('DOING_AJAX') && DOING_AJAX) {
                die(__('Slow down; you move too fast.'));
            } else {
                bb_die(__('Slow down; you move too fast.'));
            }
        }
    } else {
        if (($last_posted = bb_get_transient($_SERVER['REMOTE_ADDR'] . '_last_posted')) && time() < $last_posted + $throttle_time) {
            if (defined('DOING_AJAX') && DOING_AJAX) {
                die(__('Slow down; you move too fast.'));
            } else {
                bb_die(__('Slow down; you move too fast.'));
            }
        }
    }
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:30,代码来源:functions.bb-posts.php


示例3: bb_block_current_user

function bb_block_current_user()
{
    global $bbdb;
    if ($id = bb_get_current_user_info('id')) {
        bb_update_usermeta($id, $bbdb->prefix . 'been_blocked', 1);
    }
    // Just for logging.
    bb_die(__("You've been blocked.  If you think a mistake has been made, contact this site's administrator."));
}
开发者ID:laiello,项目名称:cartonbank,代码行数:9,代码来源:functions.bb-users.php


示例4: topic_info

function topic_info($topic_id)
{
    global $lang;
    $sql = "\n\t\tSELECT\n\t\t\ttor.poster_id, tor.forum_id, tor.attach_id, tor.call_seed_time,\n\t\t\tt.topic_title, sn.seeders\n\t\tFROM      " . BB_BT_TORRENTS . " tor\n\t\tLEFT JOIN " . BB_TOPICS . " t  USING(topic_id)\n\t\tLEFT JOIN " . BB_BT_TRACKER_SNAP . " sn USING(topic_id)\n\t\tWHERE tor.topic_id = {$topic_id}\n\t";
    if (!($torrent = DB()->fetch_row($sql))) {
        bb_die($lang['TOPIC_POST_NOT_EXIST']);
    }
    return $torrent;
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:9,代码来源:callseed.php


示例5: get_config

/**
* Get attachment mod configuration
*/
function get_config()
{
    global $bb_cfg;
    $attach_config = array();
    $sql = 'SELECT * FROM ' . BB_ATTACH_CONFIG;
    if (!($result = DB()->sql_query($sql))) {
        bb_die('Could not query attachment information');
    }
    while ($row = DB()->sql_fetchrow($result)) {
        $attach_config[$row['config_name']] = trim($row['config_value']);
    }
    // We assign the original default board language here, because it gets overwritten later with the users default language
    $attach_config['board_lang'] = trim($bb_cfg['default_lang']);
    return $attach_config;
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:18,代码来源:attachment_mod.php


示例6: send_file_to_browser

function send_file_to_browser($attachment, $upload_dir)
{
    global $bb_cfg, $lang, $userdata;
    $filename = $upload_dir == '' ? $attachment['physical_filename'] : $upload_dir . '/' . $attachment['physical_filename'];
    $gotit = false;
    if (@(!file_exists(@amod_realpath($filename)))) {
        bb_die($lang['ERROR_NO_ATTACHMENT'] . "<br /><br />" . $filename . "<br /><br />" . $lang['TOR_NOT_FOUND']);
    } else {
        $gotit = true;
    }
    // Correct the mime type - we force application/octet-stream for all files, except images
    // Please do not change this, it is a security precaution
    if (!strstr($attachment['mimetype'], 'image')) {
        $attachment['mimetype'] = 'application/octet-stream';
    }
    //bt
    if (!(isset($_GET['original']) && !IS_USER)) {
        include INC_DIR . 'functions_torrent.php';
        send_torrent_with_passkey($filename);
    }
    // Now the tricky part... let's dance
    header('Pragma: public');
    $real_filename = clean_filename(basename($attachment['real_filename']));
    $mimetype = $attachment['mimetype'] . ';';
    $charset = "charset={$bb_cfg['lang'][$userdata['user_lang']]['encoding']};";
    // Send out the Headers
    header("Content-Type: {$mimetype} {$charset} name=\"{$real_filename}\"");
    header("Content-Disposition: inline; filename=\"{$real_filename}\"");
    unset($real_filename);
    // Now send the File Contents to the Browser
    if ($gotit) {
        $size = @filesize($filename);
        if ($size) {
            header("Content-length: {$size}");
        }
        readfile($filename);
    } else {
        bb_die($lang['ERROR_NO_ATTACHMENT'] . "<br /><br />" . $filename . "<br /><br />" . $lang['TOR_NOT_FOUND']);
    }
    exit;
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:41,代码来源:dl.php


示例7: update_table_bool

function update_table_bool($table_name, $key, $field_name, $field_def_val)
{
    // Clear current status
    $sql = "UPDATE {$table_name}\n\t\tSET {$field_name} = {$field_def_val}\n\t\tWHERE 1";
    if (!($result = DB()->sql_query($sql))) {
        bb_die('Could not update ' . $table_name);
    }
    if (isset($_POST[$field_name])) {
        // Get new status
        $in_sql = array();
        foreach ($_POST[$field_name] as $i => $val) {
            $in_sql[] = intval($val);
        }
        // Update status
        if ($in_sql = join(',', $in_sql)) {
            $sql = "UPDATE {$table_name}\n\t\t\t\tSET {$field_name} = 1\n\t\t\t\tWHERE {$key} IN({$in_sql})";
            if (!($result = DB()->sql_query($sql))) {
                bb_die('Could not update ' . $table_name);
            }
        }
    }
    return;
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:23,代码来源:functions_admin_torrent.php


示例8: bb_die

}
if (!bb_current_user_can('edit_post', $post_id)) {
    bb_die(__('Sorry, post is too old.'));
}
bb_check_admin_referer('edit-post_' . $post_id);
if (0 != $bb_post->post_status && 'all' == $_GET['view']) {
    // We're trying to edit a deleted post
    add_filter('bb_is_first_where', 'bb_no_where');
}
// Check possible anonymous user data
$post_author = $post_email = $post_url = '';
if (!bb_get_user(get_post_author_id($post_id))) {
    if (!($post_author = sanitize_user(trim($_POST['author'])))) {
        bb_die(__('Every post needs an author name!'));
    } elseif (!($post_email = sanitize_email(trim($_POST['email'])))) {
        bb_die(__('Every post needs a valid email address!'));
    }
    if (!empty($_POST['url'])) {
        $post_url = esc_url(trim($_POST['url']));
    }
}
// Loop through possible anonymous post data
foreach (array('post_author', 'post_email', 'post_url') as $field) {
    if (!empty(${$field})) {
        $post_data[$field] = ${$field};
    }
}
// Setup topic data
if (bb_is_first($bb_post->post_id) && bb_current_user_can('edit_topic', $bb_post->topic_id)) {
    $post_data['topic_title'] = stripslashes($_POST['topic']);
    $post_data['topic_id'] = $bb_post->topic_id;
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:bb-edit.php


示例9: bb_nonce_ays

function bb_nonce_ays($action)
{
    $title = __('bbPress Failure Notice');
    $html .= "\t<div id='message' class='updated fade'>\n\t<p>" . esc_html(bb_explain_nonce($action)) . "</p>\n\t<p>";
    if (nxt_get_referer()) {
        $html .= "<a href='" . remove_query_arg('updated', esc_url(nxt_get_referer())) . "'>" . __('Please try again.') . "</a>";
    }
    $html .= "</p>\n\t</div>\n";
    $html .= "</body>\n</html>";
    bb_die($html, $title);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:11,代码来源:functions.bb-core.php


示例10: bb_repermalink

<?php

require_once './bb-load.php';
$forum_id = 0;
bb_repermalink();
if (!$forum) {
    bb_die(__('Forum not found.'));
}
$bb_db_override = false;
do_action('bb_forum.php_pre_db', $forum_id);
if (!$bb_db_override) {
    if ($topics = get_latest_topics($forum_id, $page)) {
        bb_cache_last_posts($topics);
    }
    if ($stickies = get_sticky_topics($forum_id, $page)) {
        bb_cache_last_posts($stickies);
    }
}
bb_load_template('forum.php', array('bb_db_override', 'stickies'), $forum_id);
开发者ID:danielcoats,项目名称:schoolpress,代码行数:19,代码来源:forum.php


示例11: bb_die

        bb_die(__('Please enter a topic title'));
    }
    $args = array();
    if (isset($post_author)) {
        $args['topic_poster_name'] = $args['topic_last_poster_name'] = $post_author;
    }
    $topic_id = bb_new_topic($topic, $forum_id, $tags, $args);
} elseif (isset($_POST['topic_id'])) {
    $topic_id = (int) $_POST['topic_id'];
    bb_check_admin_referer('create-post_' . $topic_id);
}
if (bb_is_login_required() && !bb_current_user_can('write_post', $topic_id)) {
    bb_die(__('You are not allowed to post.  Are you logged in?'));
}
if (!topic_is_open($topic_id)) {
    bb_die(__('This topic has been closed'));
}
$post_data = array('post_text' => stripslashes($_POST['post_content']), 'topic_id' => $topic_id);
foreach (array('post_author', 'post_email', 'post_url') as $field) {
    if (!empty(${$field})) {
        $post_data[$field] = ${$field};
    }
}
$post_id = bb_insert_post($post_data);
$tags = trim($_POST['tags']);
bb_add_topic_tags($topic_id, $tags);
$topic = get_topic($topic_id, false);
$link = get_post_link($post_id);
if ($topic->topic_posts) {
    $link = add_query_arg('replies', $topic->topic_posts, $link);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:bb-post.php


示例12: get_topic

<?php

require 'admin-action.php';
$topic_id = (int) $_GET['id'];
$topic = get_topic($topic_id);
if (!$topic) {
    bb_die(__('There is a problem with that topic, pardner.'));
}
if (!bb_current_user_can('close_topic', $topic_id)) {
    nxt_redirect(bb_get_uri(null, null, BB_URI_CONTEXT_HEADER));
    exit;
}
bb_check_admin_referer('close-topic_' . $topic_id);
if (topic_is_open($topic_id)) {
    bb_close_topic($topic_id);
    $message = 'closed';
} else {
    bb_open_topic($topic_id);
    $message = 'opened';
}
if ($sendto = nxt_get_referer()) {
    $sendto = remove_query_arg('message', $sendto);
    $sendto = add_query_arg('message', $message, $sendto);
} else {
    $sendto = get_topic_link($topic_id);
}
bb_safe_redirect($sendto);
exit;
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:28,代码来源:topic-toggle.php


示例13: die

<?php

if (!defined('IN_FORUM')) {
    die('Hacking attempt');
}
if (empty($_GET['u']) || empty($_GET['act_key'])) {
    bb_die('Bad request');
}
$sql = "SELECT user_active, user_id, username, user_email, user_newpasswd, user_lang, user_actkey\n\tFROM " . BB_USERS . "\n\tWHERE user_id = " . intval($_GET[POST_USERS_URL]);
if (!($result = DB()->sql_query($sql))) {
    bb_die('Could not obtain user information');
}
if ($row = DB()->sql_fetchrow($result)) {
    if ($row['user_active'] && trim($row['user_actkey']) == '') {
        bb_die($lang['ALREADY_ACTIVATED']);
    } else {
        if (trim($row['user_actkey']) == trim($_GET['act_key']) && trim($row['user_actkey']) != '') {
            $sql_update_pass = $row['user_newpasswd'] != '' ? ", user_password = '" . md5(md5($row['user_newpasswd'])) . "', user_newpasswd = ''" : '';
            $sql = "UPDATE " . BB_USERS . "\n\t\t\tSET user_active = 1, user_actkey = ''" . $sql_update_pass . "\n\t\t\tWHERE user_id = " . $row['user_id'];
            if (!($result = DB()->sql_query($sql))) {
                bb_die('Could not update users table');
            }
            $message = $sql_update_pass == '' ? $lang['ACCOUNT_ACTIVE'] : $lang['PASSWORD_ACTIVATED'];
            bb_die($message);
        } else {
            bb_die($lang['WRONG_ACTIVATION']);
        }
    }
} else {
    bb_die($lang['NO_SUCH_USER']);
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:31,代码来源:activate.php


示例14: define

<?php

define('IN_FORUM', true);
define('BB_ROOT', './');
require BB_ROOT . 'common.php';
$user->session_start();
set_die_append_msg();
if (!IS_SUPER_ADMIN) {
    bb_die($lang['ONLY_FOR_SUPER_ADMIN']);
}
$confirm = request_var('confirm', '');
if ($confirm) {
    DB()->query("\n\t\tCREATE TEMPORARY TABLE tmp_buf_dlstatus (\n\t\t\tuser_id      mediumint(9)          NOT NULL default '0',\n\t\t\ttopic_id     mediumint(8) unsigned NOT NULL default '0',\n\t\t\tuser_status  tinyint(1)            NOT NULL default '0',\n\t\t\tPRIMARY KEY (user_id, topic_id)\n\t\t) ENGINE = MyISAM\n\t");
    DB()->query("\n\t\tINSERT INTO tmp_buf_dlstatus\n\t\t\t(user_id, topic_id, user_status)\n\t\tSELECT\n\t\t\tuser_id, topic_id, user_status\n\t\tFROM bb_bt_dlstatus_new\n\t");
    DB()->query("\n\t\tREPLACE INTO bb_bt_dlstatus_main\n\t\t\t(user_id, topic_id, user_status)\n\t\tSELECT\n\t\t\tuser_id, topic_id, user_status\n\t\tFROM tmp_buf_dlstatus\n\t");
    DB()->query("DROP TEMPORARY TABLE IF EXISTS tmp_buf_dlstatus");
    DB()->query("RENAME TABLE bb_bt_dlstatus_main TO bb_bt_dlstatus");
    DB()->query("DROP TABLE IF EXISTS bb_bt_dlstatus_mrg");
    DB()->query("DROP TABLE IF EXISTS bb_bt_dlstatus_new");
    bb_die('<h1 style="color: green">База данных обновлена</h1>');
} else {
    $msg = '<form method="POST">';
    $msg .= '<h1 style="color: red">!!! Перед тем как нажать на кнопку, сделайте бекап базы данных !!!</h1><br />';
    $msg .= '<input type="submit" name="confirm" value="Начать обновление Базы Данных (R571)" style="height: 30px; font:bold 14px Arial, Helvetica, sans-serif;" />';
    $msg .= '</form>';
    bb_die($msg);
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:27,代码来源:r571-dl_upgrade.php


示例15: bb_die

            bb_die(__('No forums to update!'));
        }
        if ((int) $_POST['forum_id'] && isset($_POST['forum_name']) && '' !== $_POST['forum_name']) {
            bb_update_forum($_POST);
        }
        foreach (array('action', 'id') as $arg) {
            $sent_from = remove_query_arg($arg, $sent_from);
        }
        bb_safe_redirect(add_query_arg('message', 'updated', $sent_from));
        exit;
        break;
    case 'delete':
        bb_check_admin_referer('delete-forums');
        $forum_id = (int) $_POST['forum_id'];
        $move_topics_forum = (int) $_POST['move_topics_forum'];
        if (!bb_current_user_can('delete_forum', $forum_id)) {
            bb_die(__("You don't have the authority to kill off the forums."));
        }
        if (isset($_POST['move_topics']) && $_POST['move_topics'] != 'delete') {
            bb_move_forum_topics($forum_id, $move_topics_forum);
        }
        if (!bb_delete_forum($forum_id)) {
            bb_die(__('Error occured while trying to delete forum'));
        }
        foreach (array('action', 'id') as $arg) {
            $sent_from = remove_query_arg($arg, $sent_from);
        }
        bb_safe_redirect(add_query_arg('message', 'deleted', $sent_from));
        exit;
        break;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:31,代码来源:bb-forum.php


示例16: absint

<?php

require_once 'admin-action.php';
$topic_id = absint($_POST['topic_id']);
$forum_id = absint($_POST['forum_id']);
if (!is_numeric($topic_id) || !is_numeric($forum_id)) {
    bb_die(__('Invalid topic or forum.'));
}
if (!bb_current_user_can('move_topic', $topic_id, $forum_id)) {
    nxt_redirect(bb_get_uri(null, null, BB_URI_CONTEXT_HEADER));
    exit;
}
bb_check_admin_referer('move-topic_' . $topic_id);
$topic = get_topic($topic_id);
$forum = bb_get_forum($forum_id);
if (!$topic || !$forum) {
    bb_die(__('Your topic or forum caused all manner of confusion'));
}
bb_move_topic($topic_id, $forum_id);
if (!($redirect = nxt_get_referer())) {
    $redirect = get_topic_link($topic_id);
}
bb_safe_redirect($redirect);
exit;
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:24,代码来源:topic-move.php


示例17: default_quota_limit_select

/**
* select default quota limit
*/
function default_quota_limit_select($select_name, $default_quota = 0)
{
    global $lang;
    $sql = 'SELECT quota_limit_id, quota_desc FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit ASC';
    if (!($result = DB()->sql_query($sql))) {
        bb_die('Could not query quota limits table #2');
    }
    $quota_select = '<select name="' . $select_name . '">';
    $quota_name[0]['quota_limit_id'] = 0;
    $quota_name[0]['quota_desc'] = $lang['NO_QUOTA_LIMIT'];
    while ($row = DB()->sql_fetchrow($result)) {
        $quota_name[] = $row;
    }
    DB()->sql_freeresult($result);
    for ($i = 0; $i < sizeof($quota_name); $i++) {
        $selected = $quota_name[$i]['quota_limit_id'] == $default_quota ? ' selected="selected"' : '';
        $quota_select .= '<option value="' . $quota_name[$i]['quota_limit_id'] . '"' . $selected . '>' . $quota_name[$i]['quota_desc'] . '</option>';
    }
    $quota_select .= '</select>';
    return $quota_select;
}
开发者ID:ErR163,项目名称:torrentpier,代码行数:24,代码来源:functions_selects.php


示例18: build_array

 /**
  * Build SQL statement from array (based on same method from phpBB3, idea from Ikonboard)
  *
  * Possible $query_type values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT
  */
 function build_array($query_type, $input_ary, $data_already_escaped = false, $check_data_type_in_escape = true)
 {
     $fields = $values = $ary = $query = array();
     $dont_escape = $data_already_escaped;
     $check_type = $check_data_type_in_escape;
     if (empty($input_ary) || !is_array($input_ary)) {
         $this->trigger_error(__FUNCTION__ . ' - wrong params: $input_ary');
     }
     if ($query_type == 'INSERT') {
         foreach ($input_ary as $field => $val) {
             $fields[] = $field;
             $values[] = $this->escape($val, $check_type, $dont_escape);
         }
         $fields = join(', ', $fields);
         $values = join(', ', $values);
         $query = "({$fields})\nVALUES\n({$values})";
     } else {
         if ($query_type == 'INSERT_SELECT') {
             foreach ($input_ary as $field => $val) {
                 $fields[] = $field;
                 $values[] = $this->escape($val, $check_type, $dont_escape);
             }
             $fields = join(', ', $fields);
             $values = join(', ', $values);
             $query = "({$fields})\nSELECT\n{$values}";
         } else {
             if ($query_type == 'MULTI_INSERT') {
                 foreach ($input_ary as $id => $sql_ary) {
                     foreach ($sql_ary as $field => $val) {
                         $values[] = $this->escape($val, $check_type, $dont_escape);
                     }
                     $ary[] = '(' . join(', ', $values) . ')';
                     $values = array();
                 }
                 $fields = join(', ', array_keys($input_ary[0]));
                 $values = join(",\n", $ary);
                 $query = "({$fields})\nVALUES\n{$values}";
             } else {
                 if ($query_type == 'SELECT' || $query_type == 'UPDATE') {
                     foreach ($input_ary as $field => $val) {
                         $ary[] = "{$field} = " . $this->escape($val, $check_type, $dont_escape);
                     }
                     $glue = $query_type == 'SELECT' ? "\nAND " : ",\n";
                     $query = join($glue, $ary);
                 }
             }
         }
     }
     if (!$query) {
         bb_die('<pre><b>' . __FUNCTION__ . "</b>: Wrong params for <b>{$query_type}</b> query type\n\n\$input_ary:\n\n" . htmlCHR(print_r($input_ary, true)) . '</pre>');
     }
     return "\n" . $query . "\n";
 }
开发者ID:ErR163,项目名称:torrentpier,代码行数:58,代码来源:mysql.php


示例19: basename

<?php

if (!empty($setmodules)) {
    if (IS_SUPER_ADMIN) {
        $module['TP']['TRACKER_CONFIG'] = basename(__FILE__);
    }
    return;
}
require './pagestart.php';
if (!IS_SUPER_ADMIN) {
    bb_die($lang['NOT_ADMIN']);
}
require INC_DIR . 'functions_admin_torrent.php';
$submit = isset($_POST['submit']);
$confirmed = isset($_POST['confirm']);
// All config names with default values
$default_cfg_str = array('off_reason' => 'Tracker is disabled', 'browser_redirect_url' => 'http://demo.torrentpier.me/');
$default_cfg_bool = array('autoclean' => 1, 'off' => 0, 'compact_mode' => 1, 'update_dlstat' => 1, 'limit_active_tor' => 0, 'limit_concurrent_ips' => 0, 'retracker' => 1);
$default_cfg_num = array('numwant' => 50, 'expire_factor' => 4, 'limit_seed_count' => 20, 'limit_leech_count' => 4, 'leech_expire_factor' => 60, 'limit_seed_ips' => 0, 'limit_leech_ips' => 0);
// Set template vars
set_tpl_vars($default_cfg_str, $tr_cfg);
set_tpl_vars_lang($default_cfg_str);
set_tpl_vars_bool($default_cfg_bool, $tr_cfg);
set_tpl_vars_lang($default_cfg_bool);
set_tpl_vars($default_cfg_num, $tr_cfg);
set_tpl_vars_lang($default_cfg_num);
$template->assign_vars(array('IGNORE_REPORTED_IP' => $bb_cfg['ignore_reported_ip'], 'ANNOUNCE_INTERVAL' => $bb_cfg['announce_interval'], 'PASSKEY_KEY' => $bb_cfg['passkey_key'], 'GOLD_SILVER_ENABLED' => $tr_cfg['gold_silver_enabled'], 'DISABLE_SUBMIT' => true, 'S_HIDDEN_FIELDS' => '', 'S_CONFIG_ACTION' => 'admin_bt_tracker_cfg.php'));
print_page('admin_bt_tracker_cfg.tpl', 'admin');
开发者ID:ErR163,项目名称:torrentpier,代码行数:28,代码来源:admin_bt_tracker_cfg.php


示例20: delete_attachment

/**
* Delete Attachment(s) from post(s) (intern)
*/
function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0)
{
    global $bb_cfg;
    // Generate Array, if it's not an array
    if ($post_id_array === 0 && $attach_id_array === 0 && $page === 0) {
        return;
    }
    if ($post_id_array === 0 && $attach_id_array !== 0) {
        $post_id_array = array();
        if (!is_array($attach_id_array)) {
            if (strstr($attach_id_array, ', ')) {
                $attach_id_array = explode(', ', $attach_id_array);
            } else {
                if (strstr($attach_id_array, ',')) {
                    $attach_id_array = explode(',', $attach_id_array);
                } else {
                    $attach_id = intval($attach_id_array);
                    $attach_id_array = array();
                    $attach_id_array[] = $attach_id;
                }
            }
        }
        // Get the post_ids to fill the array
        $p_id = 'post_id';
        $sql = "SELECT {$p_id}\n\t\t\tFROM " . BB_ATTACHMENTS . '
				WHERE attach_id IN (' . implode(', ', $attach_id_array) . ")\n\t\t\tGROUP BY {$p_id}";
        if (!($result = DB()->sql_query($sql))) {
            bb_die('Could not select ids');
        }
        $num_post_list = DB()->num_rows($result);
        if ($num_post_list == 0) {
            DB()->sql_freeresult($result);
            return;
        }
        while ($row = DB()->sql_fetchrow($result)) {
            $post_id_array[] = intval($row[$p_id]);
        }
        DB()->sql_freeresult($result);
    }
    if (!is_array($post_id_array)) {
        if (trim($post_id_array) == '') {
            return;
        }
        if (strstr($post_id_array, ', ')) {
            $post_id_array = explode(', ', $post_id_array);
        } else {
            if (strstr($post_id_array, ',')) {
                $post_id_array = explode(',', $post_id_array);
            } else {
                $post_id = intval($post_id_array);
                $post_id_array = array();
                $post_id_array[] = $post_id;
            }
        }
    }
    if (!sizeof($post_id_array)) {
        return;
    }
    // First of all, determine the post id and attach_id
    if ($attach_id_array === 0) {
        $attach_id_array = array();
        // Get the attach_ids to fill the array
        $whereclause = 'WHERE post_id IN (' . implode(', ', $post_id_array) . ')';
        $sql = 'SELECT attach_id
			FROM ' . BB_ATTACHMENTS . " {$whereclause}\n\t\t\tGROUP BY attach_id";
        if (!($result = DB()->sql_query($sql))) {
            bb_die('Could not select attachment id #1');
        }
        $num_attach_list = DB()->num_rows($result);
        if ($num_attach_list == 0) {
            DB()->sql_freeresult($result);
            return;
        }
        while ($row = DB()->sql_fetchrow($result)) {
            $attach_id_array[] = (int) $row['attach_id'];
        }
        DB()->sql_freeresult($result);
    }
    if (!is_array($attach_id_array)) {
        if (strstr($attach_id_array, ', ')) {
            $attach_id_array = explode(', ', $attach_id_array);
        } else {
            if (strstr($attach_id_array, ',')) {
                $attach_id_array = explode(',', $attach_id_array);
            } else {
                $attach_id = intval($attach_id_array);
                $attach_id_array = array();
                $attach_id_array[] = $attach_id;
            }
        }
    }
    if (!sizeof($attach_id_array)) {
        return;
    }
    $sql_id = 'post_id';
    if (sizeof($post_id_array) && sizeof($attach_id_array)) {
        $sql = 'DELETE FROM ' . BB_ATTACHMENTS . '
//.........这里部分代码省略.........
开发者ID:ErR163,项目名称:torrentpier,代码行数:101,代码来源:functions_delete.php



注:本文中的bb_die函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bb_get_current_user_info函数代码示例发布时间:2022-05-24
下一篇:
PHP bb_delete_topic函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap