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

PHP generate_csrf_token函数代码示例

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

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



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

示例1: message

            //Reporting now made fun =)
            if (!stopforumspam_report($panther_config['o_sfs_api'], $cur_post['poster_ip'], $email, $cur_post['poster'], $cur_post['message'])) {
                message($lang_common['Unable to add spam data']);
            }
        }
    }
    if ($is_topic_post) {
        // Delete the topic and all of its posts
        delete_topic($cur_post['tid']);
        update_forum($cur_post['fid']);
        ($hook = get_extensions('delete_after_delete')) ? eval($hook) : null;
        redirect(panther_link($panther_url['forum'], array($cur_post['fid'], url_friendly($cur_post['forum_name']))), $lang_delete['Topic del redirect']);
    } else {
        // Delete just this one post
        delete_post($id, $cur_post['tid']);
        update_forum($cur_post['fid']);
        // Redirect towards the previous post
        $data = array(':tid' => $cur_post['tid'], ':id' => $id);
        $ps = $db->select('posts', 'id', $data, 'topic_id=:tid AND id < :id', 'id DESC LIMIT 1');
        $post_id = $ps->fetchColumn();
        ($hook = get_extensions('delete_after_delete')) ? eval($hook) : null;
        redirect(panther_link($panther_url['post'], array($post_id)), $lang_delete['Post del redirect']);
    }
}
require PANTHER_ROOT . 'include/parser.php';
$page_title = array($panther_config['o_board_title'], $lang_delete['Delete post']);
define('PANTHER_ACTIVE_PAGE', 'index');
require PANTHER_ROOT . 'header.php';
$tpl = load_template('delete.tpl');
echo $tpl->render(array('lang_common' => $lang_common, 'index_link' => panther_link($panther_url['index']), 'forum_link' => panther_link($panther_url['forum'], array($cur_post['fid'], url_friendly($cur_post['forum_name']))), 'post_link' => panther_link($panther_url['post'], array($id)), 'cur_post' => $cur_post, 'lang_delete' => $lang_delete, 'form_action' => panther_link($panther_url['delete'], array($id)), 'csrf_token' => generate_csrf_token(), 'is_topic_post' => $is_topic_post, 'posted' => format_time($cur_post['posted']), 'is_admmod' => $is_admmod, 'panther_config' => $panther_config, 'message' => $parser->parse_message($cur_post['message'], $cur_post['hide_smilies'])));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:delete.php


示例2: define

// temp directory for pclzip
define('PCLZIP_TEMPORARY_DIR', $webDir . '/courses/temp/');
// include_messages
require "{$webDir}/lang/{$language}/common.inc.php";
$extra_messages = "config/{$language_codes[$language]}.inc.php";
if (file_exists($extra_messages)) {
    include $extra_messages;
} else {
    $extra_messages = false;
}
require "{$webDir}/lang/{$language}/messages.inc.php";
if ($extra_messages) {
    include $extra_messages;
}
if (!isset($_SESSION['csrf_token']) || empty($_SESSION['csrf_token'])) {
    $_SESSION['csrf_token'] = generate_csrf_token();
}
if ($upgrade_begin = get_config('upgrade_begin')) {
    if (!defined('UPGRADE')) {
        Session::Messages(sprintf($langUpgradeInProgress, format_time_duration(time() - $upgrade_begin)), 'alert-warning');
        if (!isset($guest_allowed) or !$guest_allowed) {
            redirect_to_home_page();
        }
    }
}
// check if we are admin or power user or manageuser_user
if (isset($_SESSION['is_admin']) and $_SESSION['is_admin']) {
    $is_admin = true;
    $is_power_user = true;
    $is_usermanage_user = true;
    $is_departmentmanage_user = true;
开发者ID:nikosv,项目名称:openeclass,代码行数:31,代码来源:init.php


示例3: array

    }
    // Display all the categories and forums
    $categories = $forums = array();
    $ps = $db->run('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM ' . $db->prefix . 'categories AS c INNER JOIN ' . $db->prefix . 'forums AS f ON c.id = f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position');
    foreach ($ps as $cur_forum) {
        if (!isset($categories[$cur_forum['cid']])) {
            $categories[$cur_forum['cid']] = array('name' => $cur_forum['cat_name'], 'id' => $cur_forum['cid']);
        }
        $forums[] = array('id' => $cur_forum['fid'], 'name' => $cur_forum['forum_name'], 'category_id' => $cur_forum['cid']);
    }
    $tpl = load_template('edit_action.tpl');
    echo $tpl->render(array('lang_admin_moderate' => $lang_admin_moderate, 'lang_admin_common' => $lang_admin_common, 'lang_common' => $lang_common, 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/moderate.php'), 'form_action' => $action == 'add' ? panther_link($panther_url['admin_moderate_add']) : panther_link($panther_url['admin_moderate_edit'], array($id)), 'action' => $cur_action, 'categories' => $categories, 'forums' => $forums));
} else {
    if ($action == 'delete' && $id > '0') {
        $tpl = load_template('delete_action.tpl');
        echo $tpl->render(array('lang_admin_moderate' => $lang_admin_moderate, 'lang_admin_common' => $lang_admin_common, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['admin_moderate_delete'], array($id)), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/moderate.php')));
    } else {
        $ps = $db->select('multi_moderation', 'COUNT(id)');
        $total = $ps->fetchColumn();
        $num_pages = ceil($total / 15);
        if ($page > $num_pages) {
            $page = 1;
        }
        $start_from = 15 * ($page - 1);
        $ps = $db->select('multi_moderation', 'title, id', array(), '', 'id DESC LIMIT ' . $start_from . ', ' . $panther_config['o_disp_topics_default']);
        $actions = array();
        foreach ($ps as $action) {
            $actions[] = array('title' => $action['title'], 'edit_link' => panther_link($panther_url['admin_moderate_edit'], array($action['id'])), 'delete_link' => panther_link($panther_url['admin_moderate_delete'], array($action['id'])));
        }
        $tpl = load_template('admin_moderate.tpl');
        echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_moderate' => $lang_admin_moderate, 'lang_common' => $lang_common, 'add_link' => panther_link($panther_url['admin_moderate_add']), 'pagination' => paginate($num_pages, $page, $panther_url['admin_moderate'] . '?'), 'actions' => $actions));
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:moderate.php


示例4: 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


示例5: generate_csrf_token

?>

      <link rel="icon" href="<?php 
echo IMG_PATH;
?>
favicon.ico">
      <link rel="apple-touch-icon" href="<?php 
echo IMG_PATH;
?>
balise.png">

  </head>
  <body>
    <div id="wrapper">
      <?php 
generate_csrf_token();
?>
      <?php 
if (!($_GET["controller"] == "error" || $_GET["controller"] == "home" && in_array($_GET["action"], array("welcome", "chose_identity")))) {
    include LAYOUT_PATH . "structure.php";
}
?>
      <div id="page-wrapper">
        <?php 
include LAYOUT_PATH . "flash.php";
include VIEW_PATH . (isset($_GET["prefix"]) ? $_GET["prefix"] . "/" : "") . $_GET["controller"] . "/" . $_GET["action"] . ".php";
?>
      </div>
    </div>

    <footer>
开发者ID:aymericbouzy,项目名称:cluedo-solver,代码行数:31,代码来源:application.php


示例6: explode

    }
    $id_list = explode(',', $cur_announcement['forum_id']);
    // Display all the categories and forums
    $categories = $forums = array();
    $ps = $db->run('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM ' . $db->prefix . 'categories AS c INNER JOIN ' . $db->prefix . 'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position');
    foreach ($ps as $cur_forum) {
        if (!isset($categories[$cur_forum['cid']])) {
            $categories[$cur_forum['cid']] = array('cat_name' => $cur_forum['cat_name'], 'id' => $cur_forum['cid']);
        }
        $forums[] = array('id' => $cur_forum['fid'], 'forum_name' => $cur_forum['forum_name'], 'category_id' => $cur_forum['cid'], 'selected' => in_array($cur_forum['fid'], $id_list) ? true : false);
    }
    $tpl = load_template('edit_announcement.tpl');
    echo $tpl->render(array('lang_admin_announcements' => $lang_admin_announcements, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['admin_announcements']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/announcements.php'), 'id' => $id, 'action' => $action, 'cur_announce' => $cur_announcement, 'help_link' => panther_link($panther_url['help'], array('bbcode')), 'categories' => $categories, 'forums' => $forums));
} elseif ($action == 'delete' && $id > 0) {
    $tpl = load_template('delete_announcement.tpl');
    echo $tpl->render(array('lang_admin_announcements' => $lang_admin_announcements, 'lang_common' => $lang_common, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['delete_announcement'], array($id)), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/announcements.php'), 'id' => $id));
} else {
    $announcements = array();
    $ps = $db->run('SELECT a.subject, a.forum_id, a.user_id, u.username, u.group_id, a.id FROM ' . $db->prefix . 'announcements AS a INNER JOIN ' . $db->prefix . 'users AS u ON a.user_id=u.id ORDER BY a.id DESC LIMIT :start, :limit', $data);
    foreach ($ps as $announcement) {
        $forum_names = array();
        $ids = explode(',', $announcement['forum_id']);
        foreach ($ids as $id) {
            $data = array(':id' => $id);
            $ps1 = $db->select('forums', 'forum_name', $data, 'id=:id');
            $forum_names[] = $ps1->fetchColumn();
        }
        $announcements[] = array('edit_link' => panther_link($panther_url['edit_announcement'], array($announcement['id'])), 'delete_link' => panther_link($panther_url['delete_announcement'], array($announcement['id'])), 'subject' => $announcement['subject'], 'poster' => colourize_group($announcement['username'], $announcement['group_id'], $announcement['user_id']));
    }
    $tpl = load_template('admin_announcements.tpl');
    echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_announcements' => $lang_admin_announcements, 'lang_common' => $lang_common, 'pagination' => paginate($num_pages, $page, $panther_url['admin_announcements']), 'add_link' => panther_link($panther_url['add_announcement']), 'announcements' => $announcements));
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:announcements.php


示例7: IN

        for ($i = 0; $i < count($topics['topics']); $i++) {
            $markers[] = '?';
            $data[] = $topics['topics'][$i];
        }
        $db->run('UPDATE ' . $db->prefix . 'topics SET archived=1 WHERE id IN (' . implode(',', $markers) . ')', $data);
        $percentage = round($topics['count'] / $total * 100, 2);
    }
    $update = array('conf_value' => serialize($rules));
    $data = array(':conf_name' => 'o_archive_rules');
    $db->update('config', $update, 'conf_name=:conf_name', $data);
    generate_config_cache();
    $redirect_lang = $panther_config['o_archiving'] == '1' ? sprintf($lang_admin_archive['Archive rules updated'], $topics['count'], $total, $percentage . '%') : $lang_admin_archive['Updated redirect'];
    redirect(panther_link($panther_url['admin_archive']), $redirect_lang);
}
$archive_rules = $panther_config['o_archive_rules'] != '' ? unserialize($panther_config['o_archive_rules']) : array('closed' => 0, 'sticky' => 0, 'time' => 0, 'unit' => 'days', 'forums' => array(0));
$percentage = $ps->rowCount() != 0 ? round($archived / $total * 100, 2) : 0;
$categories = $forums = array();
$ps = $db->run('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM ' . $db->prefix . 'categories AS c INNER JOIN ' . $db->prefix . 'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position');
foreach ($ps as $cur_forum) {
    if (!isset($categories[$cur_forum['cid']])) {
        $categories[$cur_forum['cid']] = array('name' => $cur_forum['cat_name'], 'id' => $cur_forum['cid']);
    }
    $forums[] = array('id' => $cur_forum['fid'], 'selected' => in_array($cur_forum['fid'], $archive_rules['forums']) ? true : false, 'name' => $cur_forum['forum_name'], 'category_id' => $cur_forum['cid']);
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Archive']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('archive');
$tpl = load_template('admin_archive.tpl');
echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_archive' => $lang_admin_archive, 'form_action' => panther_link($panther_url['admin_archive']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/archive.php'), 'archive_lang' => $panther_config['o_archiving'] == '1' ? $lang_admin_archive['Archive enabled'] : $lang_admin_archive['Archive disabled'], 'admin_options' => panther_link($panther_url['admin_options']), 'archived' => $archived, 'percentage' => $percentage, 'archive_rules' => $archive_rules, 'lang_common' => $lang_common, 'categories' => $categories, 'forums' => $forums));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:archive.php


示例8: 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


示例9: 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


示例10: generate_censoring_cache

        }
        generate_censoring_cache();
        redirect(panther_link($panther_url['admin_censoring']), $lang_admin_censoring['Word updated redirect']);
    } else {
        if (isset($_POST['remove'])) {
            confirm_referrer(PANTHER_ADMIN_DIR . '/censoring.php');
            $id = intval(key($_POST['remove']));
            $data = array(':id' => $id);
            $db->delete('censoring', 'id=:id', $data);
            // Regenerate the censoring cache
            if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
                require PANTHER_ROOT . 'include/cache.php';
            }
            generate_censoring_cache();
            redirect(panther_link($panther_url['admin_censoring']), $lang_admin_censoring['Word removed redirect']);
        }
    }
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Censoring']);
$focus_element = array('censoring', 'new_search_for');
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('censoring');
$words = array();
$ps = $db->select('censoring', 'id, search_for, replace_with', array(), '', 'id');
foreach ($ps as $cur_word) {
    $words[] = array('id' => $cur_word['id'], 'search_for' => $cur_word['search_for'], 'replace_with' => $cur_word['replace_with']);
}
$tpl = load_template('admin_censoring.tpl');
echo $tpl->render(array('form_action' => panther_link($panther_url['admin_censoring']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/censoring.php'), 'lang_admin_censoring' => $lang_admin_censoring, 'lang_admin_common' => $lang_admin_common, 'panther_config' => $panther_config, 'link' => panther_link($panther_url['admin_options']), 'words' => $words));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:censoring.php


示例11: message

                if ($cur_cat['name'] == '') {
                    message($lang_admin_categories['Must enter name message']);
                }
                if ($cur_cat['order'] < 0) {
                    message($lang_admin_categories['Must enter integer message']);
                }
                $update = array('cat_name' => $cur_cat['name'], 'disp_position' => $cur_cat['order']);
                $data = array(':id' => intval($cat_id));
                $db->update('categories', $update, 'id=:id', $data);
            }
            // Regenerate the quick jump cache
            if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
                require PANTHER_ROOT . 'include/cache.php';
            }
            generate_quickjump_cache();
            redirect(panther_link($panther_url['admin_categories']), $lang_admin_categories['Categories updated redirect']);
        }
    }
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Categories']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('categories');
$categories = array();
$ps = $db->select('categories', 'id, cat_name, disp_position', array(), '', 'disp_position');
foreach ($ps as $cur_cat) {
    $categories[] = array('id' => $cur_cat['id'], 'name' => $cur_cat['cat_name'], 'disp_position' => $cur_cat['disp_position']);
}
$tpl = load_template('admin_categories.tpl');
echo $tpl->render(array('lang_admin_categories' => $lang_admin_categories, 'lang_admin_common' => $lang_admin_common, 'form_action' => panther_link($panther_url['admin_categories']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/categories.php'), 'admin_forums' => panther_link($panther_url['admin_forums']), 'categories' => $categories));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:categories.php


示例12: message

                            $mailer->send($email, $mail_tpl['subject'], $mail_tpl['message']);
                        }
                        message($lang_login['Forget mail'] . ' ' . $panther_config['o_admin_email'], true);
                    } else {
                        $errors[] = $lang_login['No email match'] . ' ' . $email . '.';
                    }
                }
            }
            $page_title = array($panther_config['o_board_title'], $lang_login['Request pass']);
            $required_fields = array('req_email' => $lang_common['Email']);
            $focus_element = array('request_pass', 'req_email');
            ($hook = get_extensions('forgot_password_before_header')) ? eval($hook) : null;
            define('PANTHER_ACTIVE_PAGE', 'login');
            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 {
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:login.php


示例13: array

        $page_head['next'] = array('href' => panther_link($panther_url['forum_page'], array($id, $p + 1, $url_forum)), 'rel' => 'next');
    }
}
if ($panther_config['o_feed_type'] == '1') {
    $page_head['feed'] = array('href' => panther_link($panther_url['forum_rss'], array($id)), 'rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => $lang_common['RSS forum feed']);
} else {
    if ($panther_config['o_feed_type'] == '2') {
        $page_head['feed'] = array('href' => panther_link($panther_url['forum_atom'], array($id)), 'rel' => 'alternate', 'type' => 'application/atom+xml', 'title' => $lang_common['Atom forum feed']);
    }
}
$forum_actions = array();
if (!$panther_user['is_guest']) {
    $token = generate_csrf_token('viewforum.php');
    if ($panther_config['o_forum_subscriptions'] == '1') {
        if ($cur_forum['is_subscribed']) {
            $forum_actions[] = array('info' => $lang_forum['Is subscribed'], 'href' => panther_link($panther_url['forum_unsubscribe'], array($id, generate_csrf_token('viewforum.php', false))), 'title' => $lang_forum['Unsubscribe']);
        } else {
            $forum_actions[] = array('href' => panther_link($panther_url['forum_subscribe'], array($id, $token)), 'title' => $lang_forum['Subscribe']);
        }
    }
    $forum_actions[] = array('href' => panther_link($panther_url['mark_forum_read'], array($id, $token)), 'title' => $lang_common['Mark forum read']);
}
// Load the cached announcements
if (file_exists(FORUM_CACHE_DIR . 'cache_announcements.php')) {
    require FORUM_CACHE_DIR . 'cache_announcements.php';
} else {
    if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) {
        require PANTHER_ROOT . 'include/cache.php';
    }
    generate_announcements_cache();
    require FORUM_CACHE_DIR . 'cache_announcements.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:viewforum.php


示例14: compress_image

                        compress_image($smiley_path . '/' . $filename . $extensions[0]);
                        @chmod($smiley_path . '/' . $filename . $extensions[0], 0644);
                    } else {
                        message($lang_admin_smilies['Unknown failure']);
                    }
                    redirect(panther_link($panther_url['admin_smilies']), $lang_admin_smilies['Successful Upload']);
                }
            }
        }
    }
}
$page_title = array($panther_config['o_board_title'], $lang_admin_common['Admin'], $lang_admin_common['Smilies']);
define('PANTHER_ACTIVE_PAGE', 'admin');
require PANTHER_ROOT . 'header.php';
generate_admin_menu('smilies');
$emoticons = $options = array();
$ps = $db->select('smilies', 'id, image, code, disp_position', array(), '', 'disp_position');
foreach ($ps as $cur_smiley) {
    foreach ($img_smilies as $img) {
        $options[$cur_smiley['id']][] = $img;
    }
    $emoticons[] = array('id' => $cur_smiley['id'], 'disp_position' => $cur_smiley['disp_position'], 'code' => $cur_smiley['code'], 'image' => $smiley_dir . $cur_smiley['image'], 'file' => $cur_smiley['image']);
}
$smiley_list = $images = array();
foreach ($img_smilies as $id => $img) {
    $smiley_list[] = array('file' => $img, 'image' => $smiley_dir . $img, 'id' => $id);
    $images[] = $img;
}
$tpl = load_template('admin_smilies.tpl');
echo $tpl->render(array('lang_admin_common' => $lang_admin_common, 'lang_admin_smilies' => $lang_admin_smilies, 'form_action' => panther_link($panther_url['admin_smilies']), 'csrf_token' => generate_csrf_token(PANTHER_ADMIN_DIR . '/smilies.php'), 'emoticons' => $emoticons, 'img_smilies' => $img_smilies, 'options' => $options, 'smiley_list' => $smiley_list, 'images' => $images));
require PANTHER_ROOT . 'footer.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:smilies.php


示例15: array

     }
 }
 // This warning type has been deleted
 $data = array(':id' => $warning_details['user_id']);
 $ps = $db->select('users', 'username, group_id', $data, 'id=:id');
 list($username, $group_id) = $ps->fetch(PDO::FETCH_NUM);
 if ($warning_details['date_expire'] == '0') {
     $warning_expires = sprintf($lang_warnings['Expires'], $lang_warnings['Never']);
 } else {
     if ($warning_details['date_expire'] > time()) {
         $warning_expires = sprintf($lang_warnings['Expires'], format_time($warning_details['date_expire']));
     } else {
         $warning_expires = sprintf($lang_warnings['Expired'], format_time($warning_details['date_expire']));
     }
 }
 $render = array('lang_warnings' => $lang_warnings, 'form_action' => panther_link($panther_url['warnings']), 'issued_to' => colourize_group($username, $group_id, $warning_details['user_id']), 'warning_title' => $warning_title, 'issued' => format_time($warning_details['date_issued']), 'warning_expires' => $warning_expires, 'issued_by' => colourize_group($warning_details['issued_by_username'], $warning_details['issuer_gid'], $warning_details['issued_by']), 'details_link' => panther_link($panther_url['warning_details'], array($warning_id)), 'view_link' => panther_link($panther_url['warning_view'], array($warning_details['user_id'])), 'profile_link' => panther_link($panther_url['profile'], array($warning_details['user_id'], url_friendly($username))), 'username' => $username, 'post_id' => $warning_details['post_id'], 'panther_user' => $panther_user, 'panther_config' => $panther_config, 'csrf_token' => generate_csrf_token(), 'user_id' => $warning_details['user_id'], 'warning_id' => $warning_id);
 require PANTHER_ROOT . 'include/parser.php';
 if ($panther_user['is_admmod']) {
     $note_admin = $parser->parse_message($warning_details['note_admin'], 0);
     $render['admin_note'] = $note_admin == '' ? $lang_warnings['No admin note'] : $note_admin;
 }
 if ($panther_config['o_private_messaging'] == '1') {
     $note_pm = $parser->parse_message($warning_details['note_pm'], 0);
     $render['pm_note'] = $note_pm == '' ? $lang_warnings['No message'] : $note_pm;
 }
 if ($warning_details['post_id']) {
     $render['message'] = $parser->parse_message($warning_details['note_post'], 0);
     $render['post_link'] = panther_link($panther_url['post'], array($warning_details['post_id']));
 }
 define('PANTHER_ACTIVE_PAGE', 'index');
 require PANTHER_ROOT . 'header.php';
开发者ID:mtechnik,项目名称:pantherforum,代码行数:31,代码来源:warnings.php


示例16: 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


示例17: 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


示例18: array

            $cur_post = $ps->fetch();
            $data = array(':poster' => $cur_post['poster'], ':posted' => $cur_post['posted'], ':last' => $cur_post['id'], ':id' => $cur_topic['tid']);
            $db->run('UPDATE ' . $db->prefix . 'conversations SET num_replies=num_replies-1, poster=:poster, last_post=:posted, last_post_id=:last WHERE id=:id', $data);
            $link = panther_link($panther_url['pms_post'], array($cur_post['id']));
            $redirect_msg = $lang_delete['Post del redirect'];
        }
        redirect($link, $redirect_msg);
    }
    ($hook = get_extensions('pms_delete_before_header')) ? eval($hook) : null;
    $page_title = array($panther_config['o_board_title'], $lang_common['PM'], $lang_pm['Delete message']);
    define('PANTHER_ALLOW_INDEX', 1);
    define('PANTHER_ACTIVE_PAGE', 'pm');
    require PANTHER_ROOT . 'header.php';
    require PANTHER_ROOT . 'include/parser.php';
    $tpl = load_template('delete_message.tpl');
    echo $tpl->render(array('lang_pm' => $lang_pm, 'lang_delete' => $lang_delete, 'lang_common' => $lang_common, 'form_action' => panther_link($panther_url['pms_delete'], array($pid)), 'message' => $parser->parse_message($cur_topic['message'], $cur_topic['hide_smilies']), 'csrf_token' => generate_csrf_token(), 'poster' => $cur_topic['poster'], 'posted' => format_time($cur_topic['posted']), 'is_topic_post' => $is_topic_post));
    require PANTHER_ROOT . 'footer.php';
} else {
    if ($action == 'blocked') {
        $errors  

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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