当前位置: 首页>>代码示例>>PHP>>正文


PHP get_extensions函数代码示例

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


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

示例1: message

if (!$download) {
    message($lang_common['No permission']);
}
if (($attachment['extension'] == 'jpg' || $attachment['extension'] == 'jpeg' || $attachment['extension'] == 'gif' || $attachment['extension'] == 'png') && !isset($_GET['download'])) {
    ($hook = get_extensions('attachment_image_view')) ? eval($hook) : null;
    $page_title = array($panther_config['o_board_title'], $lang_attach['Image view'], $attachment['filename']);
    define('PANTHER_ALLOW_INDEX', 1);
    define('PANTHER_ACTIVE_PAGE', 'index');
    require PANTHER_ROOT . 'header.php';
    $tpl = load_template('attachment.tpl');
    echo $tpl->render(array('lang_attach' => $lang_attach, 'lang_common' => $lang_common, 'name' => $attachment['filename'], 'download_link' => panther_link($panther_url['attachment_download'], array($id))));
    require PANTHER_ROOT . 'footer.php';
}
$data = array(':id' => $id);
$db->run('UPDATE ' . $db->prefix . 'attachments SET downloads=downloads+1 WHERE id=:id', $data);
($hook = get_extensions('attachment_before_output')) ? eval($hook) : null;
$db->end_transaction();
$fp = fopen($panther_config['o_attachments_dir'] . $attachment['location'], "rb");
if (!$fp) {
    message($lang_common['Bad request']);
}
$attachment['filename'] = rawurlencode($attachment['filename']);
// send some headers
header('Content-Disposition: attachment; filename=' . $attachment['filename']);
if (strlen($attachment['mime']) > 0) {
    header('Content-Type: ' . $attachment['mime']);
} else {
    header('Content-type: application/octet-stream');
}
header('Pragma: no-cache');
header('Expires: 0');
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:attachment.php

示例2: get_extensions

$start_from = $panther_user['disp_posts'] * ($p - 1);
($hook = get_extensions('online_before_header')) ? eval($hook) : null;
$page_title = array($panther_config['o_board_title'], $lang_online['viewing online']);
define('PANTHER_ACTIVE_PAGE', 'online');
require PANTHER_ROOT . 'header.php';
$bots = $online = array();
$ps = $db->run('SELECT o.user_id, o.ident, o.currently, o.logged, u.group_id FROM ' . $db->prefix . 'online AS o INNER JOIN ' . $db->prefix . 'users AS u ON o.user_id=u.id WHERE o.idle=0');
foreach ($ps as $panther_user_online) {
    if (strpos($panther_user_online['ident'], '[Bot]') !== false) {
        $name = explode('[Bot]', $panther_user_online['ident']);
        if (empty($bots[$name[1]])) {
            $bots[$name[1]] = 1;
        } else {
            ++$bots[$name[1]];
        }
        foreach ($bots as $online_name => $online_id) {
            $ident = $online_name . ' [Bot]';
        }
    } else {
        if ($panther_user_online['user_id'] == 1) {
            $ident = $lang_common['Guest'];
        } else {
            $ident = $panther_user_online['ident'];
        }
    }
    $online[] = array('username' => colourize_group($ident, $panther_user_online['group_id'], $panther_user_online['user_id']), 'location' => generate_user_location($panther_user_online['currently']), 'last_active' => format_time_difference($panther_user_online['logged'], $lang_online));
}
$tpl = load_template('online.tpl');
echo $tpl->render(array('pagination' => paginate($num_pages, $p, $panther_url['online']), 'lang_online' => $lang_online, 'lang_common' => $lang_common, 'users_online' => $online, 'num_pages' => $num_pages));
($hook = get_extensions('online_after_display')) ? eval($hook) : null;
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:online.php

示例3: extensions

    /**
     * Fix teh extensions
     */
    function extensions()
    {
        global $db;
        foreach ($this->db_cleaner->data->extensions as $group => $data) {
            $group_id = 0;
            $existing_extensions = get_extensions($group, $group_id);
            $extensions = array_unique(array_merge($data, $existing_extensions));
            sort($extensions);
            foreach ($extensions as $extension) {
                if (!in_array($extension, $data) && in_array($extension, $existing_extensions)) {
                    // Delete
                    $db->sql_query('DELETE FROM ' . EXTENSIONS_TABLE . '
						WHERE group_id = ' . (int) $group_id . "\n\t\t\t\t\t\t\tAND extension = '" . $db->sql_escape($extension) . '\'');
                } else {
                    if (in_array($extension, $data) && !in_array($extension, $existing_extensions)) {
                        $insert = array('group_id' => $group_id, 'extension' => $extension);
                        $db->sql_query('INSERT INTO ' . EXTENSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $insert));
                    }
                }
            }
        }
    }
开发者ID:napus,项目名称:support-toolkit,代码行数:25,代码来源:database_cleaner_controller.php

示例4: check_forum_login_cookie

if ($cur_poll['password'] != '') {
    check_forum_login_cookie($cur_poll['id'], $cur_poll['password']);
}
$mods_array = $cur_poll['moderators'] != '' ? unserialize($cur_poll['moderators']) : array();
$is_admmod = $panther_user['is_admin'] || ($panther_user['g_moderator'] == '1' && $panther_user['g_global_moderator'] || array_key_exists($panther_user['username'], $mods_array)) ? true : false;
// Make sure we have permission to vote
if (($cur_poll['post_replies'] == '' && $panther_user['g_post_replies'] == '0' || $cur_poll['post_replies'] == '0' || $panther_user['is_guest'] || $cur_poll['closed'] == '1') && !$is_admmod || $cur_poll['archived'] == '1') {
    message($lang_common['No permission'], false, '403 Forbidden');
}
require PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/poll.php';
if (isset($_POST['form_sent'])) {
    confirm_referrer('viewtopic.php');
    $options = $cur_poll['options'] != '' ? unserialize($cur_poll['options']) : array();
    $voters = $cur_poll['voters'] != '' ? unserialize($cur_poll['voters']) : array();
    $votes = $cur_poll['votes'] != '' ? unserialize($cur_poll['votes']) : array();
    ($hook = get_extensions('poll_vote_before_validation')) ? eval($hook) : null;
    if (in_array($panther_user['id'], $voters)) {
        message($lang_poll['Already voted']);
    }
    if ($cur_poll['type'] == '1') {
        $vote = isset($_POST['vote']) ? intval($_POST['vote']) : -1;
        if ($vote < 0) {
            message($lang_common['Bad request'], false, '404 Not Found');
        }
        // Increment the amount of votes for this option
        $votes[$vote] = isset($votes[$vote]) ? $votes[$vote]++ : 1;
    } else {
        $vote = isset($_POST['options']) && is_array($_POST['options']) ? array_map('intval', $_POST['options']) : array();
        if (empty($vote)) {
            message($lang_common['Bad request'], false, '404 Not Found');
        }
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:poll_vote.php

示例5: array

    $can_upload = true;
} else {
    $can_delete = ($is_admmod || $panther_user['g_delete_posts'] == '1') && ($cur_post['delete_files'] == '1' || $cur_post['delete_files'] == '') ? true : false;
    $can_upload = $panther_user['g_attach_files'] == '1' && ($cur_post['upload'] == '1' || $cur_post['upload'] == '') ? true : false;
}
$max_size = 1;
$attachments = array();
if ($can_delete || $can_upload) {
    $max_size = $panther_user['g_max_size'] == '0' && $panther_user['g_attach_files'] == '1' ? $panther_config['o_max_upload_size'] : $panther_user['g_max_size'];
    $data = array(':id' => $id);
    $ps = $db->select('attachments', 'id, owner, filename, extension, size, downloads', $data, 'post_id=:id');
    foreach ($ps as $attachment) {
        $attachments[] = array('id' => $attachment['id'], 'icon' => attach_icon($attachment['extension']), 'link' => panther_link($panther_url['attachment'], array($attachment['id'])), 'name' => $attachment['filename'], 'size' => sprintf($lang_post['Attachment size'], file_size($attachment['size'])), 'downloads' => sprintf($lang_post['Attachment downloads'], forum_number_format($attachment['downloads'])));
    }
}
($hook = get_extensions('edit_before_header')) ? eval($hook) : null;
$page_title = array($panther_config['o_board_title'], $lang_post['Edit post']);
$required_fields = array('req_subject' => $lang_common['Subject'], 'req_message' => $lang_common['Message']);
$focus_element = array('edit', 'req_message');
define('PANTHER_ACTIVE_PAGE', 'index');
require PANTHER_ROOT . 'header.php';
$checkboxes = array();
if ($can_edit_subject && $is_admmod) {
    $checkboxes[] = array('name' => 'stick_topic', 'title' => $lang_common['Stick topic'], 'checked' => isset($_POST['form_sent']) && isset($_POST['stick_topic']) || !isset($_POST['form_sent']) && $cur_post['sticky'] == '1' ? true : false);
}
if ($can_edit_subject && $cur_post['post_polls'] != '0' && $panther_user['g_post_polls'] == '1' && $panther_config['o_polls'] == '1') {
    $checkboxes[] = array('name' => 'add_poll', 'title' => $lang_post['Add poll'], 'checked' => isset($_POST['add_poll']) ? true : false);
}
if ($panther_config['o_smilies'] == '1') {
    $checkboxes[] = array('name' => 'hide_smilies', 'title' => $lang_post['Hide smilies'], 'checked' => isset($_POST['form_sent']) && isset($_POST['hide_smilies']) || !isset($_POST['form_sent']) && $cur_post['hide_smilies'] == '1' ? true : false);
}
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:edit.php

示例6: str_replace

// Fix the request URI (both IIS6 & IIS7 break it)
if (!isset($_SERVER['REQUEST_URI']) || isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) && strpos($_SERVER['REQUEST_URI'], '?') === false) {
    // Workaround for a bug in IIS7
    if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
        $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
    } else {
        if ($panther_config['o_url_type'] == 'default.php') {
            $requested_page = str_replace(array('%26', '%3D', '%2F', '%3F'), array('&', '=', '/', '?'), rawurlencode($_SERVER['PHP_SELF']));
            $_SERVER['REQUEST_URI'] = $requested_page . (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');
        } else {
            // Nothing can be done
            message($lang_common['Request URI error']);
        }
    }
}
($hook = get_extensions('rewrite_before_rewrite')) ? eval($hook) : null;
// If query string is not set properly, create one and set $_GET manually
if ((!isset($_SERVER['QUERY_STRING']) || empty($_SERVER['QUERY_STRING'])) && strpos($_SERVER['REQUEST_URI'], '?') !== false) {
    $_SERVER['QUERY_STRING'] = parse_url('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
    $_SERVER['QUERY_STRING'] = isset($_SERVER['QUERY_STRING']['query']) ? $_SERVER['QUERY_STRING']['query'] : '';
    parse_str($_SERVER['QUERY_STRING'], $_GET);
}
// We determine the path to the script, since we need to separate the path from the data to be rewritten
$path_to_script = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
if (substr($path_to_script, -1) != '/') {
    $path_to_script = $path_to_script . '/';
}
// We create our own request URI with the path removed and only the parts to rewrite included
$request_uri = substr(urldecode($_SERVER['REQUEST_URI']), strlen($path_to_script) - 8);
if (strpos($request_uri, '?') !== false) {
    $request_uri = substr($request_uri, 0, strpos($request_uri, '?'));
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:rewrite.php

示例7: db_json_sync

 // Initialize the admin components
 //-----------------------------------------------------------------
 if (is_admin()) {
     include_once 'core/admin-object.php';
     db_json_sync();
     check_theme_ID();
     prepare_translate_files();
 }
 load_data_types();
 load_framework_libraries();
 //-----------------------------------------------------------------
 // Extensions
 //-----------------------------------------------------------------
 // Get available extensions
 //................................................................
 $extensions = get_extensions();
 // Set filters on get option and update option for extensions
 //................................................................
 foreach ($extensions as $extension_name => $extension_path) {
     $key = $shortname . $extension_name;
     add_filter('pre_option_' . $key, 'theme_option_filter', 10, 1);
     add_action('update_option', 'theme_option_dual_save_filter', 10, 3);
 }
 // Set filters on get option and update option for all forms, which build with FormsBuilder
 //................................................................
 $forms = new FormsBuilder();
 if (!empty($forms->options_pages)) {
     foreach ($forms->options_pages as $key => $value) {
         $key = $shortname . $key;
         add_filter('pre_option_' . $key, 'theme_option_filter', 10, 1);
         add_action('update_option', 'theme_option_dual_save_filter', 10, 3);
开发者ID:ArnaudGuillou,项目名称:SiteESBVolley,代码行数:31,代码来源:load.php

示例8: array_search

                     $abuse['negative'][$rep['poster_id']] = '1';
                 }
             }
         }
         $positive = !empty($abuse['positive']) ? array_search(max(array_values($abuse['positive'])), $abuse['positive']) : '0';
         $negative = !empty($abuse['negative']) ? array_search(max(array_values($abuse['negative'])), $abuse['negative']) : '0';
         $rep_abuse = $positive < $negative ? array('user' => $negative, 'votes' => $abuse['negative'][$negative], 'type' => 'negative') : array('user' => $positive, 'votes' => $abuse['positive'][$positive], 'type' => 'positive');
         if ($rep_abuse['votes'] >= $panther_config['o_rep_abuse'] && $panther_config['o_mailing_list'] != '') {
             require PANTHER_ROOT . 'include/email.php';
             $info = array('message' => array('<abuser>' => $panther_user['username'], '<amount>' => $panther_config['o_rep_abuse'], '<type>' => $rep_abuse['type'], '<user>' => $cur_forum['poster'], '<profile_url>' => panther_link($panther_url['profile_rep_received'], array($rep_abuse['user']))));
             $mail_tpl = $mailer->parse(PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/mail_templates/rep_abuse.tpl', $info);
             $mailer->send($panther_config['o_mailing_list'], $mail_tpl['subject'], $mail_tpl['message']);
         }
     }
 }
 ($hook = get_extensions('reputation_after_rep_abuse')) ? eval($hook) : null;
 // Has the user issue issued the opposite vote? If so, remove it first ...
 $opposite_rep = false;
 $data = array(':uid' => $panther_user['id'], ':id' => $id);
 $ps = $db->select('reputation', 1, $data, 'given_by=:uid AND post_id=:id');
 if ($ps->rowCount()) {
     $opposite_rep = true;
     $vote_add = $vote == '-1' ? '-1' : '+1';
     $data = array(':uid' => $panther_user['id'], ':id' => $id);
     $db->delete('reputation', 'given_by=:uid AND post_id=:id', $data);
     $data = array(':id' => $id);
     $db->run('UPDATE ' . $db->prefix . 'posts SET reputation=reputation' . $vote_add . ' WHERE id=:id', $data);
     $data = array(':id' => $cur_forum['poster_id']);
     $db->run('UPDATE ' . $db->prefix . 'users SET reputation=reputation' . $vote_add . ' WHERE id=:id', $data);
 }
 $insert = array('post_id' => $id, 'given_by' => $panther_user['id'], 'vote' => $vote == '-1' ? '-1' : '1', 'time_given' => time());
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:reputation.php

示例9: array

                if ($panther_config['o_feed_type'] == '2') {
                    $feed = array('type' => 'atom', 'link' => panther_link($panther_url['forum_atom'], array($id)), 'lang' => $lang_common['Atom forum feed']);
                }
            }
            break;
        case 'viewtopic':
            if ($panther_config['o_feed_type'] == '1') {
                $feed = array('type' => 'rss', 'link' => panther_link($panther_url['topic_rss'], array($id)), 'lang' => $lang_common['RSS topic feed']);
            } else {
                if ($panther_config['o_feed_type'] == '2') {
                    $feed = array('type' => 'atom', 'link' => panther_link($panther_url['topic_atom'], array($id)), 'lang' => $lang_common['Atom topic feed']);
                }
            }
            break;
    }
    ($hook = get_extensions('footer_feedsr')) ? eval($hook) : null;
}
// Display debug info (if enabled/defined)
if ($panther_config['o_debug_mode'] == '1') {
    // Calculate script generation time
    $time_diff = sprintf('%.3f', microtime(true) - $panther_start);
    $debug_info = sprintf($lang_common['Querytime'], $time_diff, $db->get_num_queries());
    if (function_exists('memory_get_usage')) {
        $debug_info .= ' - ' . sprintf($lang_common['Memory usage'], file_size(memory_get_usage()));
        if (function_exists('memory_get_peak_usage')) {
            $debug_info .= ' ' . sprintf($lang_common['Peak usage'], file_size(memory_get_peak_usage()));
        }
    }
} else {
    $debug_info = '';
}
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:footer.php

示例10: array

            $type = 'positive';
            break;
        case $cur_announcement['reputation'] < '0':
            $type = 'negative';
            break;
        default:
            $type = 'zero';
            break;
    }
    $cur_announcement['reputation'] = array('type' => $type, 'title' => sprintf($lang_topic['reputation'], forum_number_format($cur_announcement['reputation'])));
}
if ($cur_announcement['g_image'] != '') {
    $image_dir = $panther_config['o_image_group_dir'] != '' ? $panther_config['o_image_group_dir'] : get_base_url() . '/' . $panther_config['o_image_group_path'] . '/';
    $img_size = @getimagesize($panther_config['o_image_group_path'] . '/' . $cur_announcement['group_id'] . '.' . $cur_announcement['g_image']);
    $group_image = array('src' => $image_dir . $cur_announcement['group_id'] . '.' . $cur_announcement['g_image'], 'size' => $img_size[3], 'alt' => $cur_announcement['g_user_title']);
} else {
    $group_image = array();
}
$announcement_type = $afid != '0' ? 'announcement_fid' : 'announcement';
($hook = get_extensions('announcement_before_header')) ? eval($hook) : null;
$page_title = array($panther_config['o_board_title'], $cur_announcement['forum_name'], $cur_announcement['subject']);
define('PANTHER_ACTIVE_PAGE', 'index');
require PANTHER_ROOT . 'header.php';
$render = array('index_link' => panther_link($panther_url['index']), 'lang_common' => $lang_common, 'forum_link' => panther_link($panther_url['forum'], array($cur_announcement['fid'], url_friendly($cur_announcement['forum_name']))), 'announce_link' => panther_link($panther_url[$announcement_type], array($id, $cur_announcement['fid'], url_friendly($cur_announcement['subject']))), 'cur_announcement' => $cur_announcement, 'username' => colourize_group($cur_announcement['username'], $cur_announcement['group_id'], $cur_announcement['user_id']), 'user_title' => get_title($cur_announcement), 'user_avatar' => $user_avatar, 'message' => $parser->parse_message($cur_announcement['message'], 0), 'panther_config' => $panther_config, 'post_actions' => $post_actions, 'user_info' => $user_info, 'user_contacts' => $user_contacts, 'group_image' => $group_image);
if ($cur_announcement['parent']) {
    $render['parent_link'] = panther_link($panther_url['forum'], array($cur_announcement['parent_forum'], url_friendly($cur_announcement['parent'])));
}
$tpl = load_template('announcement.tpl');
echo $tpl->render($render);
($hook = get_extensions('announcement_after_display')) ? eval($hook) : null;
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:announcement.php

示例11: load_template

            require PANTHER_ROOT . 'header.php';
            $tpl = load_template('forgot_password.tpl');
            echo $tpl->render(array('lang_login' => $lang_login, 'form_url' => panther_link($panther_url['request_password']), 'csrf_token' => generate_csrf_token(), 'lang_common' => $lang_common, 'errors' => $errors));
            require PANTHER_ROOT . 'footer.php';
        }
    }
}
if (!$panther_user['is_guest']) {
    header('Location: ' . panther_link($panther_url['index']));
    exit;
}
// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
if (!empty($_SERVER['HTTP_REFERER'])) {
    $redirect_url = validate_redirect($_SERVER['HTTP_REFERER'], null);
}
if (!isset($redirect_url)) {
    $redirect_url = panther_link($panther_url['index']);
} else {
    if (preg_match('%viewtopic\\.php\\?pid=(\\d+)$%', $redirect_url, $matches)) {
        $redirect_url .= '#p' . $matches[1];
    }
}
$page_title = array($panther_config['o_board_title'], $lang_common['Login']);
$required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);
$focus_element = array('login', 'req_username');
($hook = get_extensions('login_before_header')) ? eval($hook) : null;
define('PANTHER_ACTIVE_PAGE', 'login');
require PANTHER_ROOT . 'header.php';
$tpl = load_template('login.tpl');
echo $tpl->render(array('lang_login' => $lang_login, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['login_in']), 'redirect_url' => $redirect_url, 'register' => panther_link($panther_url['register']), 'request_password' => panther_link($panther_url['request_password']), 'errors' => $errors));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:login.php

示例12: extensions

 /**
  * Validate the extensions
  */
 function extensions()
 {
     global $user;
     $user->add_lang('acp/attachments');
     // Build the output
     $last_extension_group = '';
     foreach ($this->db_cleaner->data->extensions as $group => $data) {
         $group_ids = array();
         $existing_extensions = get_extensions($group, $group_ids);
         $extensions = array_unique(array_merge($data, $existing_extensions));
         sort($extensions);
         foreach ($extensions as $extension) {
             if (!in_array($extension, $data) && in_array($extension, $existing_extensions) || in_array($extension, $data) && !in_array($extension, $existing_extensions)) {
                 // Output the table block if it's not been done yet
                 if ($last_extension_group != $group) {
                     $last_extension_group = $group;
                     $this->_section_data[$group] = array('NAME' => user_lang($group), 'TITLE' => 'COLUMNS');
                 }
                 // Add the data
                 $this->_section_data[$group]['ITEMS'][] = array('NAME' => $extension, 'FIELD_NAME' => $group . '_' . $extension, 'MISSING' => !in_array($extension, $existing_extensions) ? true : false);
                 if ($this->_has_changes === false) {
                     $this->_has_changes = true;
                 }
             }
         }
     }
     $this->success_message = 'EXTENSION_GROUPS_SUCCESS';
 }
开发者ID:melvingb,项目名称:phpbb3.1-STK,代码行数:31,代码来源:database_cleaner_views.php

示例13: die

<?php

END_MODULE != 'admin' && die('Access Denied');
load_modules_config();
$view_data['modules'] = $end_module;
$action = $_GET['action'];
$module = $_GET['module'];
$extension = $_GET['extension'];
if ($module) {
    get_extensions('end_' . $module);
    $view_data['page_name'] = $end_module[$module]['name'];
} else {
    get_extensions();
    $view_data['page_name'] = lang('all_extension');
}
if ($action == 'edit') {
    if ($_GET['delete']) {
        if ($ext = $end_extension[$_GET['delete']]) {
            if (end_rmdir(END_ROOT . $ext['path'])) {
                end_exit(lang('delete_success'), 'admin.php?p=extension&action=edit', 1);
            } else {
                end_exit(lang('delete_failed'), 'admin.php?p=extension&action=edit', 3);
            }
        }
    }
} else {
    if ($action == 'running') {
        if ($hid = intval($_GET['pause'])) {
            if (model('hook')->update($hid, array('status' => 'pause'))) {
                $view_data['info'] = lang('Success');
            } else {
开发者ID:WSKINGS,项目名称:chat_tickets,代码行数:31,代码来源:extension.php

示例14: define

 * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
 */
if (!defined('PANTHER')) {
    define('PANTHER_ROOT', __DIR__ . '/');
    require PANTHER_ROOT . 'include/common.php';
}
if ($panther_user['g_read_board'] == '0') {
    message($lang_common['No view'], false, '403 Forbidden');
}
// Load the help.php language file
require PANTHER_ROOT . 'lang/' . $panther_user['language'] . '/help.php';
$page_title = array($panther_config['o_board_title'], $lang_help['Help']);
define('PANTHER_ACTIVE_PAGE', 'help');
require PANTHER_ROOT . 'header.php';
// Display the smiley set
require PANTHER_ROOT . 'include/parser.php';
$smiley_groups = array();
foreach ($parser->smilies as $smiley_text => $smiley_img) {
    $smiley_groups[$smiley_img][] = $smiley_text;
}
($hook = get_extensions('help_before_display')) ? eval($hook) : null;
$ps = $db->select('topics', 'subject, id', array(), '', 'id ASC LIMIT 1');
$cur_topic = $ps->fetch();
$ps = $db->select('posts', 'id', array(), '', 'id ASC LIMIT 1');
$cur_post = $ps->fetchColumn();
$ps = $db->select('users', 'id, username, group_id', array(), 'id>1', 'id ASC LIMIT 1');
$user = $ps->fetch();
$forum = $panther_forums[key($panther_forums)];
$tpl = load_template('help.tpl');
echo $tpl->render(array('lang_help' => $lang_help, 'panther_config' => $panther_config, 'lang_common' => $lang_common, 'base_url' => panther_link($panther_url['index']), 'help_page' => panther_link($panther_url['help'], array('url')), 'topic_link' => panther_link($panther_url['topic'], array($cur_topic['id'], url_friendly($cur_topic['subject']))), 'topic_id' => $cur_topic['id'], 'post_id' => $cur_post, 'post_link' => panther_link($panther_url['post'], array($cur_post)), 'forum_id' => $forum['id'], 'forum_link' => panther_link($panther_url['forum'], array($forum['id'], url_friendly($forum['forum_name']))), 'formatted_username' => colourize_group($user['username'], $user['group_id'], $user['id']), 'username' => $user['username'], 'smiley_path' => $panther_config['o_smilies_dir'] != '' ? $panther_config['o_smilies_dir'] : get_base_url() . '/' . $panther_config['o_smilies_path'] . '/', 'smiley_groups' => $smiley_groups));
$db->end_transaction();
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:help.php

示例15: load_template

                    require PANTHER_ROOT . 'header.php';
                    $tpl = load_template('recent_warnings.tpl');
                    echo $tpl->render(array('lang_warnings' => $lang_warnings, 'lang_common' => $lang_common, 'warnings' => $warnings, 'num_pages' => $num_pages, 'pagination' => paginate($num_pages, $p, $panther_url['warnings_recent'])));
                } else {
                    $ps = $db->select('warning_types', 'id, title, description, points, expiration_time', array(), '', 'points, id');
                    $ps1 = $db->select('warning_levels', 'id, points, period', array(), '', 'points, id');
                    // If neither have been configured
                    if (!$ps->rowCount() && !$ps1->rowCount()) {
                        message($lang_common['Bad request']);
                    }
                    $warning_types = array();
                    foreach ($ps as $cur_type) {
                        $warning_types[] = array('title' => $cur_type['title'], 'description' => $cur_type['description'], 'points' => $cur_type['points']);
                    }
                    $warning_levels = array();
                    foreach ($ps1 as $cur_level) {
                        $ban_title = $cur_level['period'] == '0' ? $lang_warnings['Permanent ban'] : format_expiration_time($cur_level['period']);
                        $warning_levels[] = array('title' => $ban_title, 'points' => $cur_level['points']);
                    }
                    ($hook = get_extensions('view_warnings_before_header')) ? eval($hook) : null;
                    define('PANTHER_ACTIVE_PAGE', 'index');
                    require PANTHER_ROOT . 'header.php';
                    $tpl = load_template('warnings.tpl');
                    echo $tpl->render(array('lang_warnings' => $lang_warnings, 'warning_levels' => $warning_levels, 'warning_types' => $warning_types));
                }
            }
        }
    }
}
$footer_style = 'warnings';
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:warnings.php


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