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


PHP panther_link函数代码示例

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


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

示例1: isset

$increase = isset($_POST['auto_increase']) && $_POST['auto_increase'] == '1' ? $start + $limit : $start;
$direction = isset($_POST['direction']) && $_POST['direction'] == '1' ? 'ASC' : 'DESC';
$order = isset($_POST['order']) ? intval($_POST['order']) : 0;
switch ($order) {
    case 1:
        $order = 'a.downloads';
        break;
    case 2:
        $order = 'a.size';
        break;
    case 3:
        $order = 'a.downloads*a.size';
        break;
    case 0:
    default:
        $order = 'a.id';
        break;
}
$data = array(':start' => $start, ':limit' => $limit);
$ps = $db->run('SELECT a.id, a.owner, a.post_id, a.filename, a.extension, a.size, a.downloads, u.username, u.group_id FROM ' . $db->prefix . 'attachments AS a LEFT JOIN ' . $db->prefix . 'users AS u ON u.id=a.owner ORDER BY ' . $order . ' ' . $direction . ' LIMIT :start, :limit', $data);
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Attachments']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('attachments');
$attachments = array();
foreach ($ps as $cur_item) {
    $attachments[] = array('icon' => attach_icon($cur_item['extension']), 'link' => panther_link($panther_url['attachment'], array($cur_item['id'])), 'name' => $cur_item['filename'], 'username' => colourize_group($cur_item['username'], $cur_item['group_id'], $cur_item['owner']), 'post_link' => panther_link($panther_url['post'], array($cur_item['post_id'])), 'post_id' => $cur_item['post_id'], 'size' => file_size($cur_item['size']), 'downloads' => forum_number_format($cur_item['downloads']), 'transfer' => file_size($cur_item['size'] * $cur_item['downloads']), 'id' => $cur_item['id']);
}
$tpl = load_template('admin_attachments.tpl');
echo $tpl->render(array('lang_admin_attachments' => $lang_admin_attachments, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['admin_attachments']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/attachments.php'), 'increase' => $increase, 'start' => $start, 'limit' => $limit, 'order' => $order, 'direction' => $direction, 'attachments' => $attachments));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:attachments.php

示例2: array

            $ps = $db->select('topics', 'num_replies', $topic_data, 'id=:id');
            $num_replies = $ps->fetchColumn();
            $update = array('num_replies' => $num_replies + 1, 'last_post' => $posted, 'last_post_id' => $last_id, 'last_poster' => $poster);
            $db->update('topics', $update, 'id=:id', $topic_data);
            update_search_index('post', $post_id, $post['message']);
            update_forum($post['forum_id']);
            redirect(panther_link($panther_url['admin_deleted']), $lang_admin_deleted['Post approved redirect']);
        }
    } else {
        if ($is_topic_post) {
            permanently_delete_topic($post['topic_id']);
            redirect(panther_link($panther_url['admin_deleted']), $lang_admin_deleted['Topic deleted redirect']);
        } else {
            permanently_delete_post($post_id);
            redirect(panther_link($panther_url['admin_deleted']), $lang_admin_deleted['Post deleted redirect']);
        }
    }
}
$ps = $db->run('SELECT t.id AS topic_id, t.forum_id, p.poster, p.poster_id, p.posted, p.message, p.id AS pid, p.hide_smilies, t.subject, f.forum_name FROM ' . $db->prefix . 'posts AS p LEFT JOIN ' . $db->prefix . 'topics AS t ON p.topic_id=t.id LEFT JOIN ' . $db->prefix . 'forums AS f ON t.forum_id=f.id WHERE p.deleted=1 OR t.deleted=1 ORDER BY p.posted DESC');
require PANTHER_ROOT . 'include/parser.php';
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Deleted']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('deleted');
$posts = array();
foreach ($ps as $cur_post) {
    $posts[] = array('id' => $cur_post['pid'], 'posted' => format_time($cur_post['posted']), 'message' => $parser->parse_message($cur_post['message'], $cur_post['hide_smilies']), 'poster' => $cur_post['poster'] != '' ? array('href' => panther_link($panther_url['profile'], array($cur_post['poster_id'], url_friendly($cur_post['poster']))), 'poster' => $cur_post['poster']) : '', 'forum' => $cur_post['forum_name'] != '' ? array('href' => panther_link($panther_url['forum'], array($cur_post['forum_id'], url_friendly($cur_post['forum_name']))), 'forum_name' => $cur_post['forum_name']) : '', 'topic' => $cur_post['subject'] != '' ? array('href' => panther_link($panther_url['topic'], array($cur_post['topic_id'], url_friendly($cur_post['subject']))), 'subject' => $cur_post['subject']) : '', 'post' => $cur_post['pid'] != '' ? array('href' => panther_link($panther_url['post'], array($cur_post['pid'])), 'post' => sprintf($lang_admin_deleted['Post ID'], $cur_post['pid'])) : '');
}
$tpl = load_template('admin_deleted.tpl');
echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_deleted' => $lang_admin_deleted, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['admin_deleted']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/deleted.php'), 'posts' => $posts));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:deleted.php

示例3: load_template

        }
        $tpl = load_template('search_results.tpl');
        echo $tpl->render(array('forum_actions' => $forum_actions, 'index_link' => panther_link($panther_url['index']), 'lang_common' => $lang_common, 'search_link' => panther_link($panther_url['search']), 'show_as' => $show_as, 'lang_search' => $lang_search, 'lang_topic' => $lang_topic, 'lang_forum' => $lang_forum, 'pagination' => paginate($num_pages, $p, $panther_url['search_pagination'], array($search_id)), 'crumbs_text' => $crumbs_text, 'results' => $results, 'panther_config' => $panther_config));
        require PANTHER_ROOT . 'footer.php';
    } else {
        message($lang_search['No hits']);
    }
}
($hook = get_extensions('search_form_before_header')) ? eval($hook) : null;
$page_title = array($panther_config['o_board_title'], $lang_search['Search']);
$focus_element = array('search', 'keywords');
define('PANTHER_ACTIVE_PAGE', 'search');
require PANTHER_ROOT . 'header.php';
$data = array(':gid' => $panther_user['g_id']);
$categories = $forums = array();
$ps = $db->run('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.password, f.redirect_url, f.parent_forum FROM ' . $db->prefix . 'categories AS c INNER JOIN ' . $db->prefix . 'forums AS f ON c.id=f.cat_id LEFT JOIN ' . $db->prefix . 'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=:gid) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', $data);
foreach ($ps as $cur_forum) {
    if ($cur_forum['password'] != '') {
        if (check_forum_login_cookie($cur_forum['fid'], $cur_forum['password'], true) === false) {
            continue;
        }
    }
    if (!isset($catgeories[$cur_forum['cid']])) {
        // A new category since last iteration?
        $categories[$cur_forum['cid']] = array('name' => $cur_forum['cat_name'], 'id' => $cur_forum['cid']);
    }
    $forums[] = array('parent_forum' => $cur_forum['parent_forum'], 'category_id' => $cur_forum['cid'], 'id' => $cur_forum['fid'], 'name' => $cur_forum['forum_name']);
}
$tpl = load_template('search.tpl');
echo $tpl->render(array('lang_search' => $lang_search, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['search']), 'panther_config' => $panther_config, 'panther_user' => $panther_user, 'search_all_forums' => $panther_config['o_search_all_forums'] == '1' || $panther_user['is_admmod'] ? true : false, 'categories' => $categories, 'forums' => $forums));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:search.php

示例4: foreach

    $topic_count = 0;
    foreach ($ps as $cur_topic) {
        $url_subject = url_friendly($cur_topic['subject']);
        // Preg match is slow!
        if ($panther_config['o_censoring'] == '1') {
            $cur_topic['subject'] = censor_words($cur_topic['subject']);
        }
        $ghost_topic = !is_null($cur_topic['moved_to']) ? true : false;
        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $panther_user['disp_posts']);
        $topics[$cur_topic['id']] = array('count' => ++$topic_count, 'topic_count' => forum_number_format($topic_count + $start_from), 'cur_topic' => $cur_topic, 'topic_poster' => $cur_topic['up_id'] > 1 ? colourize_group($cur_topic['poster'], $cur_topic['up_group_id'], $cur_topic['up_id']) : colourize_group($cur_topic['poster'], PANTHER_GUEST), 'moved_to' => $cur_topic['moved_to'], 'subject' => $cur_topic['subject'], 'sticky' => $cur_topic['sticky'], 'closed' => $cur_topic['closed'], 'topic_link' => panther_link($panther_url['topic'], array($cur_topic['id'], $url_subject)), 'num_pages' => $num_pages_topic, 'pagination' => paginate($num_pages_topic, -1, $panther_url['topic_paginate'], array($cur_topic['id'], $url_subject)), 'new' => !$ghost_topic && $cur_topic['last_post'] > $panther_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$fid]) || $tracked_topics['forums'][$fid] < $cur_topic['last_post']) ? '1' : '0');
        if (is_null($cur_topic['moved_to'])) {
            $topics[$cur_topic['id']]['last_post_avatar'] = generate_avatar_markup($cur_topic['uid'], $cur_topic['email'], $cur_topic['use_gravatar'], array(32, 32));
            $topics[$cur_topic['id']]['last_post_link'] = panther_link($panther_url['post'], array($cur_topic['last_post_id']));
            $topics[$cur_topic['id']]['last_post'] = format_time($cur_topic['last_post']);
            $topics[$cur_topic['id']]['last_poster'] = $cur_topic['uid'] > 1 ? colourize_group($cur_topic['last_poster'], $cur_topic['group_id'], $cur_topic['uid']) : colourize_group($cur_topic['last_poster'], PANTHER_GUEST);
            $topics[$cur_topic['id']]['num_replies'] = forum_number_format($cur_topic['num_replies']);
            if ($panther_config['o_topic_views'] == '1') {
                $topics[$cur_topic['id']]['num_views'] = forum_number_format($cur_topic['num_views']);
            }
        } else {
            $topics[$cur_topic['id']]['topic_link'] = panther_link($panther_url['topic'], array($cur_topic['moved_to'], $url_subject));
        }
        if ($topics[$cur_topic['id']]['new'] == '1') {
            $topics[$cur_topic['id']]['new_link'] = panther_link($panther_url['topic_new_posts'], array($cur_topic['id'], $url_subject));
        }
    }
}
$tpl = load_template('moderate_forum.tpl');
echo $tpl->render(array('lang_common' => $lang_common, 'lang_misc' => $lang_misc, 'lang_forum' => $lang_forum, 'index_link' => panther_link($panther_url['index']), 'forum_link' => panther_link($panther_url['moderate_forum'], array($fid, url_friendly($cur_forum['forum_name']))), 'pagination' => paginate($num_pages, $p, $panther_url['moderate_forum'], array($fid)), 'forum' => $cur_forum, 'form_action' => panther_link($panther_url['moderate_forum'], array($fid)), 'panther_config' => $panther_config, 'csrf_token' => generate_csrf_token(), 'panther_user' => $panther_user, 'topics' => $topics));
($hook = get_extensions('moderate_forum_after_output')) ? eval($hook) : null;
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:moderate.php

示例5: foreach

    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);
}
if ($is_admmod) {
    $checkboxes[] = array('id' => 'silent_edit', 'name' => 'silent', 'title' => $lang_post['Silent edit'], 'checked' => isset($_POST['form_sent']) && isset($_POST['silent']) || !isset($_POST['form_sent']) ? true : false);
}
$render = array('errors' => $errors, 'lang_post' => $lang_post, 'lang_common' => $lang_common, 'preview' => isset($_POST['preview']) ? true : false, 'can_edit_subject' => $can_edit_subject, 'subject' => isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject'], 'can_upload' => $can_upload, 'can_delete' => $can_delete, 'panther_user' => $panther_user, 'max_size' => $max_size, 'attachments' => $attachments, 'is_admmod' => $is_admmod, 'edit_reason' => isset($_POST['edit_reason']) ? $_POST['edit_reason'] : $cur_post['edit_reason'], 'checkboxes' => $checkboxes, 'index_link' => panther_link($panther_url['index']), 'forum_link' => panther_link($panther_url['forum'], array($cur_post['fid'], url_friendly($cur_post['forum_name']))), 'cur_post' => $cur_post, 'topic_link' => panther_link($panther_url['topic'], array($cur_post['tid'], url_friendly($cur_post['subject']))), 'form_action' => panther_link($panther_url['edit_edit'], array($id)), 'csrf_token' => generate_csrf_token(), 'message' => isset($_POST['req_message']) ? $message : $cur_post['message'], 'panther_config' => $panther_config, 'quickpost_links' => array('form_action' => panther_link($panther_url['new_reply'], array($id)), 'csrf_token' => generate_csrf_token('post.php'), 'bbcode' => panther_link($panther_url['help'], array('bbcode')), 'url' => panther_link($panther_url['help'], array('url')), 'img' => panther_link($panther_url['help'], array('img')), 'smilies' => panther_link($panther_url['help'], array('smilies'))));
if (isset($_POST['preview'])) {
    require_once PANTHER_ROOT . 'include/parser.php';
    $render['preview'] = $parser->parse_message($message, $hide_smilies);
}
$tpl = load_template('edit.tpl');
echo $tpl->render($render);
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:edit.php

示例6: define

            define('PANTHER_ACTIVE_PAGE', 'admin');
            require PANTHER_ROOT . 'header.php';
            generate_admin_menu('extensions');
            $tpl = load_template('uninstall_extension.tpl');
            echo $tpl->render(array('extension' => $extension, 'lang_admin_extensions' => $lang_admin_extensions, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['uninstall_extension'], array($file)), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/addons.php')));
        } else {
            $extension_files = array();
            $files = array_diff(scandir(PANTHER_ROOT . PANTHER_ADMIN_DIR . '/extensions'), array('.', '..'));
            foreach ($files as $entry) {
                if (substr($entry, -4) == '.xml') {
                    $extension_files[$entry] = array('title' => substr($entry, 0, -4), 'file' => $entry, 'install_link' => panther_link($panther_url['install_extension'], array(substr($entry, 0, -4))));
                }
            }
            $extensions = array();
            $ps = $db->select('extensions', 'id, title, enabled');
            foreach ($ps as $cur_extension) {
                if (file_exists(PANTHER_ROOT . PANTHER_ADMIN_DIR . '/extensions/' . $cur_extension['id'] . '.xml')) {
                    unset($extension_files[$cur_extension['id'] . '.xml']);
                }
                $extensions[] = array('id' => $cur_extension['id'], 'title' => $cur_extension['title'], 'enabled' => $cur_extension['enabled'], 'enable_link' => $cur_extension['enabled'] ? panther_link($panther_url['disable_extension'], array($cur_extension['id'])) : panther_link($panther_url['enable_extension'], array($cur_extension['id'])), 'uninstall_link' => panther_link($panther_url['uninstall_extension'], array($cur_extension['id'])));
            }
            $page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Extensions']);
            define('PANTHER_ACTIVE_PAGE', 'admin');
            require PANTHER_ROOT . 'header.php';
            generate_admin_menu('extensions');
            $tpl = load_template('admin_extensions.tpl');
            echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_extensions' => $lang_admin_extensions, 'form_action' => panther_link($panther_url['admin_addons']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/addons.php'), 'extensions' => $extensions, 'extension_files' => $extension_files, 'errors' => $errors));
        }
    }
}
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:addons.php

示例7: array

        $checkboxes[] = array('name' => 'hide_smilies', 'checked' => isset($_POST['hide_smilies']) ? true : false, 'title' => $lang_post['Hide smilies']);
    }
}
// Check to see if the topic review is to be displayed
$posts = array();
if ($tid && $panther_config['o_topic_review'] != '0') {
    require_once PANTHER_ROOT . 'include/parser.php';
    $data = array(':id' => $tid);
    $ps = $db->run('SELECT p.poster, p.message, p.hide_smilies, p.posted, u.group_id FROM ' . $db->prefix . 'posts AS p LEFT JOIN ' . $db->prefix . 'users AS u ON (p.poster=u.username) WHERE p.topic_id=:id ORDER BY p.id DESC LIMIT ' . $panther_config['o_topic_review'], $data);
    foreach ($ps as $cur_post) {
        $posts[] = array('username' => colourize_group($cur_post['poster'], $cur_post['group_id']), 'posted' => format_time($cur_post['posted']), 'message' => $parser->parse_message($cur_post['message'], $cur_post['hide_smilies']));
    }
}
$render = array('lang_common' => $lang_common, 'lang_post' => $lang_post, 'posts' => $posts, 'errors' => $errors, 'index_link' => panther_link($panther_url['index']), 'forum_link' => panther_link($panther_url['forum'], array($cur_posting['id'], url_friendly($cur_posting['forum_name']))), 'cur_posting' => $cur_posting, 'POST' => $_POST, 'action' => $action, 'fid' => $fid, 'tid' => $tid, 'csrf_token' => generate_csrf_token(), 'panther_config' => $panther_config, 'message' => isset($_POST['req_message']) ? $orig_message : (isset($quote) ? $quote : ''), 'panther_user' => $panther_user, 'can_upload' => $can_upload, 'checkboxes' => $checkboxes, 'quickpost_links' => array('bbcode' => panther_link($panther_url['help'], array('bbcode')), 'url' => panther_link($panther_url['help'], array('url')), 'img' => panther_link($panther_url['help'], array('img')), 'smilies' => panther_link($panther_url['help'], array('smilies'))));
if (isset($cur_posting['subject'])) {
    $render['topic_link'] = panther_link($panther_url['topic'], array($tid, url_friendly($cur_posting['subject'])));
}
if (isset($_POST['preview'])) {
    require_once PANTHER_ROOT . 'include/parser.php';
    $render['preview'] = $parser->parse_message($message, $hide_smilies);
}
if ($panther_user['is_guest']) {
    $email_form_name = $panther_config['p_force_guest_email'] == '1' ? 'req_email' : 'email';
    $render['username'] = isset($username) ? $username : '';
    $render['email'] = isset($_POST[$email_form_name]) ? $email : '';
    $render['email_form_name'] = $email_form_name;
}
if ($can_upload) {
    $render['max_size'] = $max_size;
}
if (!empty($panther_robots) && $panther_user['g_robot_test'] == '1') {
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:post.php

示例8: message

}
require PANTHER_ROOT . 'include/common_admin.php';
if (!$panther_user['is_admin']) {
    message($lang_common['No permission'], false, '403 Forbidden');
}
if ($panther_user['id'] != '2') {
    if (!is_null($admins[$panther_user['id']]['admin_updates'])) {
        if ($admins[$panther_user['id']]['admin_updates'] == '0') {
            message($lang_common['No permission'], false, '403 Forbidden');
        }
    }
}
check_authentication();
// Load the admin_update.php language file
require PANTHER_ROOT . 'lang/' . $admin_language . '/admin_update.php';
if (version_compare($panther_config['o_cur_version'], $updater->panther_updates['version'], '>=')) {
    message($lang_admin_update['no updates']);
}
$action = isset($_GET['action']) ? $_GET['action'] : '';
if ($action == 'install_update') {
    $updater->download();
    $updater->install();
    exit;
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Update']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('updates');
$tpl = load_template('admin_updates.tpl');
echo $tpl->render(array('lang_admin_update' => $lang_admin_update, 'panther_updates' => $updater->panther_updates, 'released' => format_time($updater->panther_updates['released']), 'updater' => $updater, 'changelog' => $updater->panther_updates['changelog'], 'form_action' => panther_link($panther_url['admin_updates']), 'panther_config' => $panther_config));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:updates.php

示例9: array

            break;
        case 'viewforum':
            if ($panther_config['o_feed_type'] == '1') {
                $feed = array('type' => 'rss', 'link' => panther_link($panther_url['forum_rss'], array($id)), 'lang' => $lang_common['RSS forum feed']);
            } else {
                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()));
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:footer.php

示例10: generate_robots_cache

        }
        generate_robots_cache();
        redirect(panther_link($panther_url['admin_robots']), $lang_admin_robots['Question updated redirect']);
    } else {
        if (isset($_POST['remove'])) {
            confirm_referrer(PANTHER_ADMIN_DIR . '/robots.php');
            $id = intval(key($_POST['remove']));
            $data = array(':id' => $id);
            $db->delete('robots', 'id=:id', $data);
            // Regenerate the robots cache
            if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
                require PANTHER_ROOT . 'include/cache.php';
            }
            generate_robots_cache();
            redirect(panther_link($panther_url['admin_robots']), $lang_admin_robots['Question removed redirect']);
        }
    }
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Robots']);
$focus_element = array('robots', 'new_question');
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('robots');
$robots = array();
$ps = $db->select('robots', 'id, question, answer', array(), '', 'id');
foreach ($ps as $cur_test) {
    $robots[] = array('id' => $cur_test['id'], 'question' => $cur_test['question'], 'answer' => $cur_test['answer']);
}
$tpl = load_template('admin_robots.tpl');
echo $tpl->render(array('lang_admin_robots' => $lang_admin_robots, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['admin_robots']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/robots.php'), 'robots' => $robots));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:robots.php

示例11: foreach

    foreach ($tasks as $cur_file) {
        $options[] = array('option' => substr($cur_file, 0, -4), 'title' => ucwords(str_replace('_', ' ', substr($cur_file, 0, -4))));
    }
    $tpl = load_template('edit_task.tpl');
    echo $tpl->render(array('lang_admin_tasks' => $lang_admin_tasks, 'cur_task' => $cur_task, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['admin_tasks']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/tasks.php'), 'id' => $id, 'tasks' => $options));
} else {
    if (isset($_GET['delete'])) {
        $id = intval($_GET['delete']);
        $data = array(':id' => $id);
        $ps = $db->select('tasks', 1, $data, 'id=:id');
        if (!$ps->rowCount()) {
            message($lang_common['Bad request']);
        }
        $tpl = load_template('delete_task.tpl');
        echo $tpl->render(array('lang_admin_tasks' => $lang_admin_tasks, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['admin_tasks']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/tasks.php'), 'id' => $id));
    } else {
        $configured_tasks = array();
        $ps = $db->select('tasks', 'id, title, minute, hour, day, month, week_day, script, next_run', array(), '', 'id');
        foreach ($ps as $cur_task) {
            $configured_tasks[] = array('minute' => $cur_task['minute'], 'hour' => $cur_task['hour'], 'day' => $cur_task['day'], 'month' => $cur_task['month'], 'week_day' => $cur_task['week_day'], 'delete_link' => panther_link($panther_url['delete_task'], array($cur_task['id'])), 'edit_link' => panther_link($panther_url['edit_task'], array($cur_task['id'])), 'next_run' => format_time($cur_task['next_run']), 'title' => $cur_task['title']);
        }
        $options = array();
        $tasks = array_diff(scandir(PANTHER_ROOT . 'include/tasks'), array('.', '..'));
        foreach ($tasks as $cur_task) {
            $options[] = array('title' => ucwords(str_replace('_', ' ', substr($cur_task, 0, -4))), 'file' => substr($cur_task, 0, -4));
        }
        $tpl = load_template('admin_tasks.tpl');
        echo $tpl->render(array('lang_admin_tasks' => $lang_admin_tasks, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['admin_tasks']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/tasks.php'), 'configured_tasks' => $configured_tasks, 'tasks' => $options));
    }
}
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:tasks.php

示例12: Cache

    // Check for the existence of various PHP opcode caches/optimizers
    if (function_exists('mmcache')) {
        $php_accelerator = '<a href="http://' . $lang_admin_index['Turck MMCache link'] . '">' . $lang_admin_index['Turck MMCache'] . '</a>';
    } else {
        if (isset($_PHPA)) {
            $php_accelerator = '<a href="http://' . $lang_admin_index['ionCube PHP Accelerator link'] . '">' . $lang_admin_index['ionCube PHP Accelerator'] . '</a>';
        } else {
            if (ini_get('apc.enabled')) {
                $php_accelerator = '<a href="http://' . $lang_admin_index['Alternative PHP Cache (APC) link'] . '">' . $lang_admin_index['Alternative PHP Cache (APC)'] . '</a>';
            } else {
                if (ini_get('zend_optimizer.optimization_level')) {
                    $php_accelerator = '<a href="http://' . $lang_admin_index['Zend Optimizer link'] . '">' . $lang_admin_index['Zend Optimizer'] . '</a>';
                } else {
                    if (ini_get('eaccelerator.enable')) {
                        $php_accelerator = '<a href="http://' . $lang_admin_index['eAccelerator link'] . '">' . $lang_admin_index['eAccelerator'] . '</a>';
                    } else {
                        if (ini_get('xcache.cacher')) {
                            $php_accelerator = '<a href="http://' . $lang_admin_index['XCache link'] . '">' . $lang_admin_index['XCache'] . '</a>';
                        } else {
                            $php_accelerator = $lang_admin_index['NA'];
                        }
                    }
                }
            }
        }
    }
    $render = array('PHP_OS' => PHP_OS, 'php_version' => phpversion(), 'phpinfo' => panther_link($panther_url['phpinfo']), 'php_accelerator' => $php_accelerator, 'db_version' => $db->get_version(), 'total_records' => forum_number_format($total_records), 'total_size' => $total_size);
}
$tpl = load_template('admin_statistics.tpl');
echo $tpl->render(array_merge(array('lang_admin_index' => $lang_admin_index, 'server_load' => $server_load, 'num_online' => $num_online, 'panther_user' => $panther_user), $render));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:statistics.php

示例13: array_search

                     $abuse['positive'][$rep['poster_id']] = '1';
                 }
             } else {
                 if (array_key_exists($rep['poster_id'], $abuse['negative'])) {
                     ++$abuse['negative'][$rep['poster_id']];
                 } else {
                     $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);
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:reputation.php

示例14: sprintf

        if (!$ps->rowCount()) {
            $alerts[] = sprintf($lang_admin_index['No restrictions'], panther_link($panther_url['admin_restrictions']));
            break;
        }
    }
    $update_downloaded = file_exists(PANTHER_ROOT . 'include/updates/panther-update-patch-' . $updater->version_friendly($updater->panther_updates['version']) . '.zip') ? true : false;
    if (version_compare($panther_config['o_cur_version'], $updater->panther_updates['version'], '<') && !$update_downloaded) {
        $alerts[] = sprintf($lang_admin_index['New version'], $updater->panther_updates['version'], panther_link($panther_url['admin_updates']));
    }
    if ($update_downloaded) {
        $alerts[] = sprintf($lang_admin_index['update downloaded'], $updater->panther_updates['version'], panther_link($panther_url['admin_updates']));
    }
    $avatar_path = $panther_config['o_avatars_dir'] != '' ? $panther_config['o_avatars_path'] . '/' : PANTHER_ROOT . $panther_config['o_avatars_path'] . '/';
    $smiley_path = $panther_config['o_smilies_dir'] != '' ? $panther_config['o_smilies_path'] . '/' : PANTHER_ROOT . $panther_config['o_smilies_path'] . '/';
    if (!forum_is_writable(FORUM_CACHE_DIR)) {
        $alerts[] = sprintf($lang_admin_index['Alert cache'], FORUM_CACHE_DIR);
    }
    if (!forum_is_writable($avatar_path)) {
        $alerts[] = sprintf($lang_admin_index['Alert avatar'], $avatar_path);
    }
    if (!forum_is_writable($smiley_path)) {
        $alerts[] = sprintf($lang_admin_index['Alert smilies'], $smiley_path);
    }
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Index']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('index');
$tpl = load_template('admin_index.tpl');
echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_index' => $lang_admin_index, 'form_action' => panther_link($panther_url['save_notes']), 'panther_config' => $panther_config, 'upgrade_link' => panther_link($panther_url['check_upgrade']), 'stats_link' => panther_link($panther_url['admin_statistics']), 'alerts' => $alerts));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:index.php

示例15: get_extensions

            $db->update('topics', $update, 'id=:id', $data);
            ($hook = get_extensions('delete_poll_after_deletion')) ? eval($hook) : null;
            redirect(panther_link($panther_url['topic'], array($id, url_friendly($cur_topic['subject']))), $lang_poll['Poll deleted redirect']);
        }
        ($hook = get_extensions('delete_poll_before_header')) ? eval($hook) : null;
        $page_title = array($panther_config['o_board_title'], $lang_poll['Delete poll']);
        define('PANTHER_ACTIVE_PAGE', 'index');
        require PANTHER_ROOT . 'header.php';
        $tpl = load_template('delete_poll.tpl');
        echo $tpl->render(array('lang_poll' => $lang_poll, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['poll_delete'], array($id)), 'csrf_token' => generate_csrf_token()));
    } else {
        if (isset($_GET['reset'])) {
            if (isset($_POST['form_sent'])) {
                confirm_referrer('poll_misc.php');
                $update = array('voters' => '', 'votes' => '');
                $data = array(':id' => $cur_topic['pid']);
                $db->update('polls', $update, 'id=:id', $data);
                redirect(panther_link($panther_url['topic'], array($id, url_friendly($cur_topic['subject']))), $lang_poll['Poll reset redirect']);
            }
            $page_title = array($panther_config['o_board_title'], $lang_poll['Reset poll']);
            define('PANTHER_ACTIVE_PAGE', 'index');
            require PANTHER_ROOT . 'header.php';
            ($hook = get_extensions('reset_poll_before_display')) ? eval($hook) : null;
            $tpl = load_template('reset_poll.tpl');
            echo $tpl->render(array('lang_poll' => $lang_poll, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['poll_reset'], array($id)), 'csrf_token' => generate_csrf_token()));
        } else {
            message($lang_common['Bad request']);
        }
    }
}
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:poll_misc.php


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