Ejemplo n.º 1
0
function authenticate($topic)
{
    global $lang;
    global $is_auth;
    global $userdata;
    $is_auth = auth(AUTH_ALL, $topic->getForumId(), $userdata);
    if (!OUtils::isForumContributor()) {
        message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
    }
}
Ejemplo n.º 2
0
 private function init()
 {
     global $phpEx;
     $template = $this->template;
     $template->set_filenames(array('quiz' => 'quiz.tpl'));
     $queryParams = OUtils::removeKeys(remove_sid($_SERVER['QUERY_STRING']), array('language'));
     if ($this->isIntro) {
         $source = $this->model->getSource();
         $template->assign_block_vars('intro', array('INTRO_TEXT' => $source->getIntroText(), 'RULES_LINK_TEXT' => $source->getRulesLinkText(), 'QUERY_PARAMS' => $queryParams));
     }
     $url = "quiz." . $phpEx . "?" . remove_sid($_SERVER['QUERY_STRING']);
     $template->assign_vars(array('FORM_ACTION' => append_sid($url), 'LANGUAGE' => htmlspecialchars($this->model->getLanguage())));
 }
Ejemplo n.º 3
0
    } else {
        $l_edited_by = '';
    }
    //
    // Again this will be handled by the templating
    // code at some point
    //
    $row_color = !($i % 2) ? $theme['td_color1'] : $theme['td_color2'];
    $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2'];
    if ($i == 0) {
        $advertisement_file = 'templates/ad1.txt';
    } elseif ($i == $total_posts - 1) {
        $advertisement_file = 'templates/ad2.txt';
    } else {
        $advertisement_file = null;
    }
    if (!is_null($advertisement_file)) {
        $topic_advertisement = '<div style="margin-top: 0.5em; margin-bottom: 0.5em">' . file_get_contents($advertisement_file) . "</div>";
    } else {
        $topic_advertisement = '';
    }
    $template->assign_block_vars('postrow', array('ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'POSTER_NAME' => $poster, 'POSTER_RANK' => $poster_rank, 'RANK_IMAGE' => $rank_image, 'POSTER_JOINED' => $poster_joined, 'POSTER_POSTS' => $poster_posts, 'POSTER_FROM' => $poster_from, 'POSTER_AVATAR' => $poster_avatar, 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'SIGNATURE' => $user_sig, 'EDITED_MESSAGE' => $l_edited_by, 'MINI_POST_IMG' => $mini_post_img, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim, 'EDIT_IMG' => $edit_img, 'EDIT' => $edit, 'QUOTE_IMG' => $quote_img, 'QUOTE' => $quote, 'IP_IMG' => $ip_img, 'IP' => $ip, 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, 'L_MINI_POST_ALT' => $mini_post_alt, 'U_MINI_POST' => $mini_post_url, 'U_POST_ID' => $postrow[$i]['post_id'], 'TOPIC_ADVERTISEMENT' => $topic_advertisement));
    display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);
}
if (OUtils::isForumContributor()) {
    $template->assign_block_vars('is_forum_contributor', array());
    $template->assign_vars(array('SID' => $userdata['session_id']));
}
include $phpbb_root_path . 'quick_reply.' . $phpEx;
$template->pparse('body');
include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
Ejemplo n.º 4
0
<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
include $phpbb_root_path . 'includes/bbcode.' . $phpEx;
include $phpbb_root_path . 'includes/functions_admin.' . $phpEx;
require_once $phpbb_root_path . 'includes/openkore.' . $phpEx;
// Obtain initial var settings
$forum_id = OUtils::getIntSetting(POST_FORUM_URL);
$post_id = OUtils::getIntSetting(POST_POST_URL);
$topic_id = OUtils::getIntSetting(POST_TOPIC_URL);
// Start session management
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
// session id check
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid'])) {
    $sid = !empty($HTTP_POST_VARS['sid']) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
} else {
    $sid = '';
}
// session id check
if ($sid == '' || $sid != $userdata['session_id']) {
    message_die(GENERAL_ERROR, 'Invalid_session');
}
// Obtain relevant data
if (!empty($topic_id)) {
    $sql = "SELECT f.forum_id, f.forum_name, f.forum_topics\n\t\tFROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f\n\t\tWHERE t.topic_id = " . $topic_id . "\n\t\t\tAND f.forum_id = t.forum_id";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');