Beispiel #1
0
 function Abstractify($version, $wpu_version)
 {
     //
     // 	CLASS CONSTRUCTOR
     //	------------------------------
     //
     $version = $version == 'PHPBB3' ? 'PHPBB3' : 'PHPBB2';
     $this->ver = $version;
     $this->wpu_ver = $wpu_version;
     if ('PHPBB3' == $this->ver) {
         define('GENERAL_ERROR', 100);
         define('CRITICAL_ERROR', -100);
         if (!$GLOBALS['user']->data) {
             $GLOBALS['user']->session_begin();
             $GLOBALS['auth']->acl($GLOBALS['user']->data);
             $GLOBALS['user']->setup('mods/wp-united');
         } else {
             $GLOBALS['user']->add_lang('mods/wp-united');
         }
     } else {
         if (!$GLOBALS['userdata']) {
             $GLOBALS['userdata'] = session_pagestart($GLOBALS['user_ip'], PAGE_BLOG);
             init_userprefs($userdata);
         }
         global $lang, $phpEx, $board_config, $phpbb_root_path;
         include $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_wp-united.' . $phpEx;
     }
 }
Beispiel #2
0
 /**
  * Initialize phpBB.
  *
  * @param $args  An associative array, which may contain the following options:
  *    template: Whether the default header and footer should be printed. Defaults to true.
  *    admin: Whether the visitor must be an administrator. Defaults to false.
  *    check_sid: Whether 'sid' parameter should be checked against the visitor's actual SID.
  *               Defaults to true if 'admin' is set to true, otherwise defaults to false.
  *    root: Specify the phpbb root path. Defaults to './'.
  *    page: The page type, as will be shown in the administration panel. Defaults to PAGE_MODERATING
  *    title: The page title.
  */
 public static function init($args = array())
 {
     global $phpbb_root_path, $phpEx, $user_ip, $userdata, $db, $themes_id, $board_config, $template, $theme, $lang, $page_title, $SID, $html_entities_match, $html_entities_replace, $user_ip, $attachment_mod, $unhtml_specialchars_match, $unhtml_specialchars_replace;
     define('IN_PHPBB', true);
     if (isset($args['root'])) {
         $phpbb_root_path = $args['root'];
     } else {
         $phpbb_root_path = './';
     }
     include $phpbb_root_path . 'extension.inc';
     include $phpbb_root_path . 'common.' . $phpEx;
     // Start session management.
     if (!isset($args['page'])) {
         $args['page'] = PAGE_MODERATING;
     }
     $userdata = session_pagestart($user_ip, $args['page']);
     init_userprefs($userdata);
     // Check whether user is admin.
     if ($args['admin'] && $userdata['user_level'] != ADMIN) {
         message_die(GENERAL_MESSAGE, "You are not an administrator.");
     }
     // Check session ID if necessary.
     if (!isset($args['check_sid']) && $args['admin'] || $args['check_sid']) {
         // Session ID check.
         if (!empty($_POST['sid']) || !empty($_GET['sid'])) {
             $sid = !empty($_POST['sid']) ? $_POST['sid'] : $_GET['sid'];
         } else {
             $sid = '';
         }
         if ($sid == '' || $sid != $userdata['session_id']) {
             message_die(GENERAL_ERROR, 'Invalid session.');
         }
     }
     $SID = $userdata['session_id'];
     // Print default header and footer.
     if (isset($args['title'])) {
         $page_title = $args['title'];
     }
     if (!isset($args['template']) || $args['template']) {
         include $phpbb_root_path . 'includes/page_header.' . $phpEx;
     }
     self::$phpBB_args = $args;
 }
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$viewcat = !empty($HTTP_GET_VARS[POST_CAT_URL]) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;
if (isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark'])) {
    $mark_read = isset($HTTP_POST_VARS['mark']) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
} else {
    $mark_read = '';
}
//
// Handle marking posts
//
if ($mark_read == 'forums') {
    if ($userdata['session_logged_in']) {
function topic_review($topic_id, $is_inline_review)
{
    global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
    global $userdata, $user_ip;
    global $orig_word, $replacement_word;
    global $starttime;
    if (!$is_inline_review) {
        if (!isset($topic_id)) {
            message_die(GENERAL_MESSAGE, 'Topic_not_exist');
        }
        //
        // Get topic info ...
        //
        $sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments \n\t\t\tFROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f \n\t\t\tWHERE t.topic_id = {$topic_id}\n\t\t\t\tAND f.forum_id = t.forum_id";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
        }
        if (!($forum_row = $db->sql_fetchrow($result))) {
            message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
        }
        $db->sql_freeresult($result);
        $forum_id = $forum_row['forum_id'];
        $topic_title = $forum_row['topic_title'];
        //
        // Start session management
        //
        $userdata = session_pagestart($user_ip, $forum_id);
        init_userprefs($userdata);
        //
        // End session management
        //
        $is_auth = array();
        $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
        if (!$is_auth['auth_read']) {
            message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']));
        }
    }
    //
    // Define censored word matches
    //
    if (empty($orig_word) && empty($replacement_word)) {
        $orig_word = array();
        $replacement_word = array();
        obtain_word_list($orig_word, $replacement_word);
    }
    //
    // Dump out the page header and load viewtopic body template
    //
    if (!$is_inline_review) {
        $gen_simple_header = TRUE;
        $page_title = $lang['Topic_review'] . ' - ' . $topic_title;
        include $phpbb_root_path . 'includes/page_header.' . $phpEx;
        $template->set_filenames(array('reviewbody' => 'posting_topic_review.tpl'));
    }
    //
    // Go ahead and pull all data for this topic
    //
    $sql = "SELECT u.username, u.user_id, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid\n\t\tFROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt\n\t\tWHERE p.topic_id = {$topic_id}\n\t\t\tAND p.poster_id = u.user_id\n\t\t\tAND p.post_id = pt.post_id\n\t\tORDER BY p.post_time DESC\n\t\tLIMIT " . $board_config['posts_per_page'];
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql);
    }
    //
    // Okay, let's do the loop, yeah come on baby let's do the loop
    // and it goes like this ...
    //
    if ($row = $db->sql_fetchrow($result)) {
        $mini_post_img = $images['icon_minipost'];
        $mini_post_alt = $lang['Post'];
        $i = 0;
        do {
            $poster_id = $row['user_id'];
            $poster = $row['username'];
            $post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
            //
            // Handle anon users posting with usernames
            //
            if ($poster_id == ANONYMOUS && $row['post_username'] != '') {
                $poster = $row['post_username'];
                $poster_rank = $lang['Guest'];
            } elseif ($poster_id == ANONYMOUS) {
                $poster = $lang['Guest'];
                $poster_rank = '';
            }
            $post_subject = $row['post_subject'] != '' ? $row['post_subject'] : '';
            $message = $row['post_text'];
            $bbcode_uid = $row['bbcode_uid'];
            //
            // If the board has HTML off but the post has HTML
            // on then we process it, else leave it alone
            //
            if (!$board_config['allow_html'] && $row['enable_html']) {
                $message = preg_replace('#(<)([\\/]?.*?)(>)#is', '&lt;\\2&gt;', $message);
            }
            if ($bbcode_uid != "") {
                $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message);
            }
            $message = make_clickable($message);
            if (count($orig_word)) {
                $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
                $message = preg_replace($orig_word, $replacement_word, $message);
            }
            if ($board_config['allow_smilies'] && $row['enable_smilies']) {
                $message = smilies_pass($message);
            }
            $message = str_replace("\n", '<br />', $message);
            //
            // 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'];
            $template->assign_block_vars('postrow', array('ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'MINI_POST_IMG' => $mini_post_img, 'POSTER_NAME' => $poster, 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'L_MINI_POST_ALT' => $mini_post_alt));
            $i++;
        } while ($row = $db->sql_fetchrow($result));
    } else {
        message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', '', __LINE__, __FILE__, $sql);
    }
    $db->sql_freeresult($result);
    $template->assign_vars(array('L_AUTHOR' => $lang['Author'], 'L_MESSAGE' => $lang['Message'], 'L_POSTED' => $lang['Posted'], 'L_POST_SUBJECT' => $lang['Post_subject'], 'L_TOPIC_REVIEW' => $lang['Topic_review']));
    if (!$is_inline_review) {
        $template->pparse('reviewbody');
        include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
    }
}
Beispiel #5
0
function generate_smilies($mode, $page_id)
{
    global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
    global $user_ip, $session_length, $starttime;
    global $userdata;
    //-- mod : rank color system ---------------------------------------------------
    //-- add
    global $get;
    //-- fin mod : rank color system -----------------------------------------------
    $inline_columns = 4;
    $inline_rows = 9;
    $window_columns = 8;
    if ($mode == 'window') {
        $userdata = session_pagestart($user_ip, $page_id);
        init_userprefs($userdata);
        $gen_simple_header = TRUE;
        $page_title = $lang['Emoticons'];
        include $phpbb_root_path . 'includes/page_header.' . $phpEx;
        $template->set_filenames(array('smiliesbody' => 'posting_smilies.tpl'));
    } elseif ($mode == 'window_announcement_text') {
        $userdata = session_pagestart($user_ip, $page_id);
        init_userprefs($userdata);
        $gen_simple_header = TRUE;
        $page_title = $lang['Site_Announcement'];
        include $phpbb_root_path . 'includes/page_header.' . $phpEx;
        $template->set_filenames(array('smiliesbody' => 'posting_smilies_announcement_centre_text.tpl'));
    }
    $sql = "SELECT emoticon, code, smile_url   \r\n\t\tFROM " . SMILIES_TABLE . " \r\n\t\tORDER BY smilies_id";
    if ($result = $db->sql_query($sql, false, true)) {
        $num_smilies = 0;
        $rowset = array();
        while ($row = $db->sql_fetchrow($result)) {
            if (empty($rowset[$row['smile_url']])) {
                $rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code']));
                $rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
                $num_smilies++;
            }
        }
        if ($num_smilies) {
            $smilies_count = $mode == 'inline' ? min(19, $num_smilies) : $num_smilies;
            $smilies_split_row = $mode == 'inline' ? $inline_columns - 1 : $window_columns - 1;
            $s_colspan = 0;
            $row = 0;
            $col = 0;
            while (list($smile_url, $data) = @each($rowset)) {
                if (!$col) {
                    $template->assign_block_vars('smilies_row', array());
                }
                $template->assign_block_vars('smilies_row.smilies_col', array('SMILEY_CODE' => $data['code'], 'SMILEY_IMG' => $board_config['smilies_path'] . '/' . $smile_url, 'SMILEY_DESC' => $data['emoticon']));
                $s_colspan = max($s_colspan, $col + 1);
                if ($col == $smilies_split_row) {
                    if ($mode == 'inline' && $row == $inline_rows - 1) {
                        break;
                    }
                    $col = 0;
                    $row++;
                } else {
                    $col++;
                }
            }
            if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns) {
                $template->assign_block_vars('switch_smilies_extra', array());
                $template->assign_vars(array('L_MORE_SMILIES' => $lang['More_emoticons'], 'U_MORE_SMILIES' => append_sid("posting.{$phpEx}?mode=smilies")));
            }
            $template->assign_vars(array('L_EMOTICONS' => $lang['Emoticons'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'S_SMILIES_COLSPAN' => $s_colspan));
        }
    }
    if ($mode == 'window' || $mode == 'window_announcement_text') {
        $template->pparse('smiliesbody');
        include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
    }
}
Beispiel #6
0
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/
define('IN_PHPBB', true);
define('IN_ADR_ZONES', true);
define('IN_ADR_CHARACTER', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'extension.inc';
include_once $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
$userdata = session_pagestart($user_ip, PAGE_ADR);
init_userprefs($userdata);
// End session management
//
$user_id = $userdata['user_id'];
include_once $phpbb_root_path . 'adr/includes/adr_global.' . $phpEx;
// Sorry , only logged users ...
if (!$userdata['session_logged_in']) {
    $redirect = "adr_character.{$phpEx}";
    $redirect .= isset($user_id) ? '&user_id=' . $user_id : '';
    header('Location: ' . append_sid("login.{$phpEx}?redirect={$redirect}", true));
}
// Includes the tpl and the header
adr_template_file('adr_tower_body.tpl');
include_once $phpbb_root_path . 'includes/page_header.' . $phpEx;
// Get the general config and character infos
Beispiel #7
0
<?php

/** 
*
* @package attachment_mod
* @version $Id: uacp.php 192 2007-01-20 15:17:44Z kronos $
* @copyright (c) 2002 Meik Sievertsen
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*/
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
// session id check
$sid = get_var('sid', '');
// Start session management
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
// session id check
if ($sid == '' || $sid != $userdata['session_id']) {
    //message_die(GENERAL_ERROR, 'Invalid_session');
    message_die(GENERAL_ERROR, 'Invalid_session:<br >' . $sid . '<br />' . $userdata['session_id']);
}
// Obtain initial var settings
$user_id = get_var(POST_USERS_URL, 0);
if (!$user_id) {
    message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
// Begin PNphpBB2 Module
// $profiledata = get_userdata($user_id);
$profiledata = phpbb_get_userdata($user_id);
// End PNphpBB2 Module
if ($profiledata['user_id'] != $userdata['user_id'] && $userdata['user_level'] != ADMIN) {
Beispiel #8
0
 *   email                :   fr@php-styles.com
 *   Last update          :   July 2004 - FR
 *
 ***************************************************************************/
/***************************************************************************
 *
 *   This hack is released under the GPL License. 
 *   This hack can be freely used, but not distributed, without permission. 
 *   Intellectual Property is retained by the author listed above. 
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'auction/auction_common.php';
// Start session management
$userdata = session_pagestart($user_ip, AUCTION_ROOM);
init_userprefs($userdata);
// End session management
// Check auction_permission
checkPermission('VIEW_ALL');
//   Information for the standard Who-is-Online-Block
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if ($total_posts == 0) {
    $l_total_post_s = $lang['Posted_articles_zero_total'];
} else {
    if ($total_posts == 1) {
        $l_total_post_s = $lang['Posted_article_total'];
Beispiel #9
0
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
require_once $phpbb_root_path . 'extension.inc';
require_once $phpbb_root_path . 'common.' . $phpEx;
require_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
define('NUM_SHOUT', 20);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SHOUTBOX_MAX);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
switch ($userdata['user_level']) {
    //Costomice this, if you need other permission settings
    // please also make same changes to other shoutbox php files
    case ADMIN:
    case MOD:
        $is_auth['auth_mod'] = 1;
    default:
        $is_auth['auth_read'] = 1;
Beispiel #10
0
<?php

@($userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length));
@init_userprefs($userdata);
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip \n           FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s \n           WHERE u.user_id = s.session_user_id \n                      AND s.session_time >= " . (time() - 300) . "\n           ORDER BY u.username ASC, s.session_ip ASC";
$result = $db->sql_query($sql);
if (!$result) {
    message_die(GENERAL_ERROR, "Couldn't obtain user/online information.", "", __LINE__, __FILE__, $sql);
}
$userlist_ary = array();
$userlist_visible = array();
$logged_visible_online = 0;
$logged_hidden_online = 0;
$guests_online = 0;
$online_userlist = "";
$prev_user_id = 0;
$prev_session_ip = 0;
while ($row = $db->sql_fetchrow($result)) {
    if ($row['session_logged_in']) {
        if ($row['user_id'] != $prev_user_id) {
            $style_color = "";
            if ($row['user_level'] == ADMIN) {
                $row['username'] = '******' . $row['username'] . '</b>';
                $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
            } else {
                if ($row['user_level'] == MOD) {
                    $row['username'] = '******' . $row['username'] . '</b>';
                    $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
                }
            }
            if ($row['user_allow_viewonline']) {
Beispiel #11
0
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = "./";
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . "common.{$phpEx}";
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_LINKS);
init_userprefs($userdata);
require $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_link.' . $phpEx;
//
// Count and forwrad
//
if ($HTTP_GET_VARS['action'] == "go" && $HTTP_GET_VARS['link_id']) {
    $link_id = $HTTP_GET_VARS['link_id'];
    // Secure check
    if (is_numeric($link_id)) {
        $sql = "SELECT link_id, link_url, last_user_ip\n\t\t\tFROM " . LINKS_TABLE . "\n\t\t\tWHERE link_id = '{$link_id}'\n\t\t\tAND link_active = 1";
        if ($result = $db->sql_query($sql)) {
            $row = $db->sql_fetchrow($result);
            if ($link_url = $row['link_url']) {
                if ($user_ip != $row['last_user_ip']) {
                    // Update
Beispiel #12
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 . 'areabb/fonctions/preload.' . $phpEx;
$userdata = session_pagestart($user_ip, PAGE_ARCADES);
init_userprefs($userdata);
//
// Fonction permettant de zipper un dossier.
function zipDir($path, &$zip, $dossier = '')
{
    if (!is_dir($path)) {
        return;
    }
    if (!($dh = @opendir($path))) {
        message_die(GENERAL_ERROR, 'Une erreur s\'est produite sur ' . $path);
        exit;
    }
    while ($file = readdir($dh)) {
        if (is_dir($path . '/' . $file) && $file != '.' && $file != '..') {
            zipDir($path . '/' . $file, $zip, $dossier . '/' . $file);
        } elseif (is_file($path . '/' . $file)) {
            $zip->addFile(file_get_contents($path . '/' . $file), $dossier . '/' . $file);
        }
    }
}
//
// Création du package du jeu demandé
function package_jeu($titre)
Beispiel #13
0
// that review ...
//
if ($mode == 'topicreview') {
    require $phpbb_root_path . 'includes/topic_review.' . $phpEx;
    topic_review($topic_id, false);
    exit;
} else {
    if ($mode == 'smilies') {
        generate_smilies('window', PAGE_POSTING);
        exit;
    }
}
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_POSTING);
init_userprefs($userdata);
//
// End session management
//
//
// Was cancel pressed? If so then redirect to the appropriate
// page, no point in continuing with any further checks
//
if (isset($HTTP_POST_VARS['cancel'])) {
    if ($post_id) {
        $redirect = "viewtopic.{$phpEx}?" . POST_POST_URL . "={$post_id}";
        $post_append = "#{$post_id}";
    } else {
        if ($topic_id) {
            $redirect = "viewtopic.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}";
Beispiel #14
0
 *   email                :   fr@php-styles.com
 *   Last update          :   July 2004 - FR
 *
 ***************************************************************************/
/***************************************************************************
 *
 *   This hack is released under the GPL License. 
 *   This hack can be freely used, but not distributed, without permission. 
 *   Intellectual Property is retained by the author listed above. 
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'auction/auction_common.php';
// Start session management
$userdata = session_pagestart($user_ip, AUCTION_SITEMAP);
init_userprefs($userdata);
// End session management
// Check permissions for auction
checkPermission('VIEW_ALL');
//   Information for the standard Who-is-Online-Block
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if ($total_posts == 0) {
    $l_total_post_s = $lang['Posted_articles_zero_total'];
} else {
    if ($total_posts == 1) {
        $l_total_post_s = $lang['Posted_article_total'];
Beispiel #15
0
if (preg_match("~mainfile.php~i", $PHP_SELF)) {
    Header("Location: index.php");
    die;
}
require_once dirname(__FILE__) . "/mysql.php";
// Make the database connection.
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
if (!$db->db_connect_id) {
    echo "Could not connect to the database<br>";
    exit;
}
// require_once dirname(__FILE__)."/sessions.php";
require_once dirname(__FILE__) . "/functions.php";
require_once dirname(__FILE__) . "/common.php";
// standard session management
$userdata = session_pagestart($user_ip, PAGE_LEONARDO);
// init_userprefs($userdata);
$LEO_lang['ENCODING'] = $langEncodings[$currentlang];
// set page title
$page_title = 'LEONARDO';
//------------------------------------------------------------
$userdata['user_id'] = $user->id;
$userdata['username'] = $user->username;
if (isset($_SESSION['user_id'])) {
    $userdata['user_id'] = $_SESSION['user_id'];
    $userdata['username'] = $_SESSION['username'];
}
function is_user($user)
{
    global $db, $user_prefix, $CONF;
    if (!is_array($user)) {
Beispiel #16
0
 *                               areabb_games.php
 *
 *	Par Saint-Pere le 10 Juillet 2006
 *
 ***************************************************************************/
//
// Start session management
//
define('IN_PHPBB', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'extension.inc';
include_once $phpbb_root_path . 'common.' . $phpEx;
include_once $phpbb_root_path . 'areabb/fonctions/preload.' . $phpEx;
load_function('functions_arcade');
load_lang('arcade');
$userdata = session_pagestart($user_ip, PAGE_GAME);
init_userprefs($userdata);
if (!$userdata['session_logged_in']) {
    message_die(GENERAL_ERROR, $lang['arcade_session_expiree']);
    header($header_location . append_sid('login.' . $phpEx . '?redirect=' . NOM_ARCADE . '.' . $phpEx, true));
    exit;
}
//
// End session management
if (!isset($HTTP_GET_VARS['action']) || $HTTP_GET_VARS['action'] != 'submit_score') {
    message_die(GENERAL_MESSAGE, 'Votre jeu n\'est pas compatible avec AreaBB');
    exit;
}
// Si la personne a déjà soumis un score on le renvoit où il était
if ($userdata['areabb_tps_depart'] == '' || $userdata['areabb_gid'] == '' || $userdata['areabb_variable'] == '') {
    $message = $lang['arcade_partie_terimnee'] . '<br /><br />';
Beispiel #17
0
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
if ($popup != "1") {
    $module_name = basename(dirname(__FILE__));
    require "modules/" . $module_name . "/nukebb.php";
} else {
    $phpbb_root_path = 'modules/Forums/';
}
define('IN_PHPBB', true);
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);
init_userprefs($userdata);
//
// End session management
//
$viewcat = !empty($HTTP_GET_VARS[POST_CAT_URL]) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;
if (isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark'])) {
    $mark_read = isset($HTTP_POST_VARS['mark']) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
} else {
    $mark_read = '';
}
//
// Handle marking posts
//
if ($mark_read == 'forums') {
    if ($userdata['session_logged_in']) {
Beispiel #18
0
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_FAQ);
init_userprefs($userdata);
//
// End session management
//
// Set vars to prevent naughtiness
$faq = array();
//
// Load the appropriate faq file
//
if (isset($HTTP_GET_VARS['mode'])) {
    switch ($HTTP_GET_VARS['mode']) {
        case 'bbcode':
            $lang_file = 'lang_bbcode';
            $l_title = $lang['BBCode_guide'];
            break;
Beispiel #19
0
 *	 it under the terms of the GNU General Public License as published by
 *	 the Free Software Foundation; either version 2 of the License, or
 *	 (at your option) any later version.
 *
 ***************************************************************************/
if (!defined('CPG_NUKE')) {
    exit;
}
global $pagetitle, $module_name;
require_once 'modules/' . $module_name . '/nukebb.php';
require_once 'includes/nbbcode.php';
require_once 'includes/phpBB/functions_search.php';
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SEARCH);
init_userprefs($userdata);
//
// End session management
//
//
// Define initial vars
//
if (isset($_POST['mode']) || isset($_GET['mode'])) {
    $mode = isset($_POST['mode']) ? $_POST['mode'] : $_GET['mode'];
} else {
    $mode = '';
}
if (isset($_POST['search_keywords']) || isset($_GET['search_keywords'])) {
    $search_keywords = isset($_POST['search_keywords']) ? $_POST['search_keywords'] : $_GET['search_keywords'];
} else {
<?php

//-- mod : profile cp ------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
//
// $Id: memberlist.php,v 1.1 2004/08/30 21:30:05 dmaj007 Exp $
//
// FILENAME  : memberlist.php
// STARTED   : Tue Jan 1, 2004
// COPYRIGHT : � 2003, 2004 Project Minerva Team and � 2001, 2003 The phpBB Group
// WWW       : http://www.project-minerva.org/
// LICENCE   : GPL v2.0 [ see /docs/COPYING ]
//
//--------------------------------------------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
//
// End session management
//
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
redirect(append_sid("./profile.{$phpEx}?mode=buddy&sub=memberlist"));
//-- fin mod : profile cp --------------------------------------------------------------------------
$join_sql_table = !$post_id ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 ";
$join_sql = !$post_id ? "t.topic_id = {$topic_id}" : "p.post_id = {$post_id} AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= {$post_id}";
$count_sql = !$post_id ? '' : ", COUNT(p2.post_id) AS prev_posts";
$order_sql = !$post_id ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "\n\tFROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "\n\tWHERE {$join_sql}\n\t\tAND f.forum_id = t.forum_id\n\t\t{$order_sql}";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}
if (!($forum_topic_data = $db->sql_fetchrow($result))) {
    message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$forum_id = intval($forum_topic_data['forum_id']);
//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if (!$is_auth['auth_view'] || !$is_auth['auth_read']) {
    if (!$userdata['session_logged_in']) {
        $redirect = $post_id ? POST_POST_URL . "={$post_id}" : POST_TOPIC_URL . "={$topic_id}";
        $redirect .= $start ? "&start={$start}" : '';
        redirect(append_sid("login.{$phpEx}?redirect=viewtopic.{$phpEx}&{$redirect}", true));
    }
Beispiel #22
0
    $temp_url = append_sid("profile.{$phpEx}?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']);
    $msn_img = $row['user_msnm'] ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : '';
    $msn = $row['user_msnm'] ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';
    $yim_img = $row['user_yim'] ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
    $yim = $row['user_yim'] ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : '';
    $temp_url = append_sid("search.{$phpEx}?search_author=" . urlencode($row['username']) . "&amp;showresults=posts");
    $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $row['username']) . '" title="' . sprintf($lang['Search_user_posts'], $row['username']) . '" border="0" /></a>';
    $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $row['username']) . '</a>';
    return;
}
//
// --------------------------
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_GROUPCP);
init_userprefs($userdata);
//
// End session management
//
$script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
$script_name = $script_name != '' ? $script_name . '/groupcp.' . $phpEx : 'groupcp.' . $phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
$server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
$server_url = $server_protocol . $server_name . $server_port . $script_name;
if (isset($HTTP_GET_VARS[POST_GROUPS_URL]) || isset($HTTP_POST_VARS[POST_GROUPS_URL])) {
    $group_id = isset($HTTP_POST_VARS[POST_GROUPS_URL]) ? intval($HTTP_POST_VARS[POST_GROUPS_URL]) : intval($HTTP_GET_VARS[POST_GROUPS_URL]);
} else {
    $group_id = '';
}
Beispiel #23
0
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
	global $db, $template, $board_config, $theme, $lang, $phpbb_root_path, $nav_links, $gen_simple_header;
	global $userdata, $user_ip, $session_length;
	global $starttime;

	$sql_store = $sql;

	//
	// Get SQL error if we are debugging. Do this as soon as possible to prevent
	// subsequent queries from overwriting the status of sql_error()
	//
	if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
	{
		$sql_error = $db->sql_error();

		$debug_text = '';

		if ( $sql_error['message'] != '' )
		{
			$debug_text .= '<br /><br />SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'];
		}

		if ( $sql_store != '' )
		{
			$debug_text .= "<br /><br />$sql_store";
		}

		if ( $err_line != '' && $err_file != '' )
		{
			$debug_text .= '</br /><br />Line : ' . $err_line . '<br />File : ' . $err_file;
		}
	}

	if( empty($userdata) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) )
	{
		$userdata = session_pagestart($user_ip, PAGE_INDEX);
		init_userprefs($userdata);
	}

	//
	// If the header hasn't been output then do it
	//
	if ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR )
	{
		if ( empty($lang) )
		{
			if ( !empty($board_config['default_lang']) )
			{
				include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.php');
			}
			else
			{
				include($phpbb_root_path . 'language/lang_english/lang_main.php');
			}
		}

		if ( empty($template) )
		{
			$template = new Template($phpbb_root_path . 'templates/' . $board_config['board_template']);
		}
		if ( empty($theme) )
		{
			$theme = setup_style($board_config['default_style']);
		}

		//
		// Load the Page Header
		//
		if ( !defined('IN_ADMIN') )
		{
			include($phpbb_root_path . 'includes/page_header.php');
		}
		else
		{
			include($phpbb_root_path . 'admin/page_header_admin.php');
		}
	}

	switch($msg_code)
	{
		case GENERAL_MESSAGE:
			if ( $msg_title == '' )
			{
				$msg_title = $lang['Information'];
			}
			break;

		case CRITICAL_MESSAGE:
			if ( $msg_title == '' )
			{
				$msg_title = $lang['Critical_Information'];
			}
			break;

		case GENERAL_ERROR:
			if ( $msg_text == '' )
			{
				$msg_text = $lang['An_error_occured'];
			}

			if ( $msg_title == '' )
			{
				$msg_title = $lang['General_Error'];
			}
			break;

		case CRITICAL_ERROR:
			//
			// Critical errors mean we cannot rely on _ANY_ DB information being
			// available so we're going to dump out a simple echo'd statement
			//
			include($phpbb_root_path . 'language/lang_english/lang_main.php');

			if ( $msg_text == '' )
			{
				$msg_text = $lang['A_critical_error'];
			}

			if ( $msg_title == '' )
			{
				$msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
			}
			break;
	}

	//
	// Add on DEBUG info if we've enabled debug mode and this is an error. This
	// prevents debug info being output for general messages should DEBUG be
	// set TRUE by accident (preventing confusion for the end user!)
	//
	if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )
	{
		if ( $debug_text != '' )
		{
			$msg_text = $msg_text . '<br /><br /><b><u>DEBUG MODE</u></b>' . $debug_text;
		}
	}

	if ( $msg_code != CRITICAL_ERROR )
	{
		if ( !empty($lang[$msg_text]) )
		{
			$msg_text = $lang[$msg_text];
		}

		if ( !defined('IN_ADMIN') )
		{
			$template->set_filenames(array(
				'message_body' => 'message_body.tpl')
			);
		}
		else
		{
			$template->set_filenames(array(
				'message_body' => 'admin/admin_message_body.tpl')
			);
		}

		$template->assign_vars(array(
			'MESSAGE_TITLE' => $msg_title,
			'MESSAGE_TEXT' => $msg_text)
		);
		$template->pparse('message_body');

		if ( !defined('IN_ADMIN') )
		{
			include($phpbb_root_path . 'includes/page_tail.php');
		}
		else
		{
			include($phpbb_root_path . 'admin/page_footer_admin.php');
		}
	}
	else
	{
		echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
	}

	exit;
}
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
    die("You can't access this file directly...");
}
$module_name = basename(dirname(__FILE__));
require "modules/" . $module_name . "/nukebb.php";
define('IN_PHPBB', true);
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWONLINE, $nukeuser);
init_userprefs($userdata);
//
// End session management
//
//
// Output page header and load viewonline template
//
$page_title = $lang['Who_is_online'];
include "includes/page_header.php";
$template->set_filenames(array('body' => 'viewonline_body.tpl'));
make_jumpbox('viewforum.' . $phpEx);
$template->assign_vars(array('L_WHOSONLINE' => $lang['Who_is_Online'], 'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 'L_USERNAME' => $lang['Username'], 'L_FORUM_LOCATION' => $lang['Forum_Location'], 'L_LAST_UPDATE' => $lang['Last_updated']));
//
// Forum info
//
 *   Last update          :   July 2004 - FR
 *
 ***************************************************************************/
/***************************************************************************
 *
 *   This hack is released under the GPL License. 
 *   This hack can be freely used, but not distributed, without permission. 
 *   Intellectual Property is retained by the author listed above. 
 *
 ***************************************************************************/
define('IN_PHPBB', 1);
//define('SHOW_ONLINE', true);
$phpbb_root_path = './';
include_once $phpbb_root_path . 'auction/auction_common.php';
// Start session management
$userdata = session_pagestart($user_ip, AUCTION_MYAUCTION);
init_userprefs($userdata);
// End session management
//   Information for the standard Who-is-Online-Block
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if ($total_posts == 0) {
    $l_total_post_s = $lang['Posted_articles_zero_total'];
} else {
    if ($total_posts == 1) {
        $l_total_post_s = $lang['Posted_article_total'];
    } else {
        $l_total_post_s = $lang['Posted_articles_total'];
$join_sql_table = empty($post_id) ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 ";
$join_sql = empty($post_id) ? "t.topic_id = '{$topic_id}'" : "p.post_id = '{$post_id}' AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= '{$post_id}'";
$count_sql = empty($post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts";
$order_sql = empty($post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "\r\n        FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $join_sql_table . "\r\n        WHERE {$join_sql}\r\n                AND f.forum_id = t.forum_id\r\n                {$order_sql}";
if (!($result = $db->sql_query($sql))) {
    message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
}
if (!($forum_topic_data = $db->sql_fetchrow($result))) {
    message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$forum_id = intval($forum_topic_data['forum_id']);
//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id, $nukeuser);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_topic_data);
if (!$is_auth['auth_view'] || !$is_auth['auth_read']) {
    if (!$userdata['session_logged_in']) {
        $redirect = isset($post_id) ? POST_POST_URL . "={$post_id}" : POST_TOPIC_URL . "={$topic_id}";
        $redirect .= isset($start) ? "&start={$start}" : '';
        $header_location = @preg_match("/Microsoft|WebSTAR|Xitami/", $_SERVER["SERVER_SOFTWARE"]) ? "Refresh: 0; URL=" : "Location: ";
        header($header_location . append_sid("login.{$phpEx}?redirect=viewtopic.{$phpEx}&{$redirect}", true));
Beispiel #27
0
$sid = isset($HTTP_POST_VARS['sid']) ? $HTTP_POST_VARS['sid'] : 0;
$refresh = $preview || $submit_search;
$mark_list = !empty($HTTP_POST_VARS['mark']) ? $HTTP_POST_VARS['mark'] : 0;
if (isset($HTTP_POST_VARS['folder']) || isset($HTTP_GET_VARS['folder'])) {
    $folder = isset($HTTP_POST_VARS['folder']) ? $HTTP_POST_VARS['folder'] : $HTTP_GET_VARS['folder'];
    $folder = htmlspecialchars($folder);
    if ($folder != 'inbox' && $folder != 'outbox' && $folder != 'sentbox' && $folder != 'savebox') {
        $folder = 'inbox';
    }
} else {
    $folder = 'inbox';
}
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PRIVMSGS);
init_userprefs($userdata);
//
// End session management
//
//-- mod : pm threshold ----------------------------------------------------------------------------
//-- add
$pm_allow_threshold = isset($board_config['pm_allow_threshold']) ? $board_config['pm_allow_threshold'] : 15;
// V: uh, refactor this a big... erm...
if (!$userdata['session_logged_in']) {
    redirect(append_sid("login.{$phpEx}?redirect=privmsg.{$phpEx}", true));
}
if ($userdata['user_posts'] < $pm_allow_threshold && $userdata['user_level'] != ADMIN) {
    message_die(GENERAL_MESSAGE, 'Not_enough_messages_to_pm');
}
//-- fin mod : pm threshold ------------------------------------------------------------------------
Beispiel #28
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/quiz.' . $phpEx;
require_once $phpbb_root_path . 'includes/openkore.' . $phpEx;
$userdata = session_pagestart($user_ip, PAGE_QUIZ);
init_userprefs($userdata);
/**
 * Thrown when the language ID passed to the quiz model
 * is invalid.
 */
class QuizIllegalLanguageException extends Exception
{
    public function __construct($message = null, $code = 0)
    {
        parent::__construct($message, $code);
    }
}
/**
 * A model for a quiz page.
 * This model holds:
 * - A list of quiz items that the user must answer.
 * - A list of items that the user has correctly answered.
 */
class QuizModel
{
    const NUM_ITEMS = 7;
    /** @invariant $source instanceof QuizSource */
/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWONLINE);
init_userprefs($userdata);
//
// End session management
//
//
// Output page header and load viewonline template
//
$page_title = $lang['Who_is_Online'];
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
$template->set_filenames(array('body' => 'viewonline_body.tpl'));
make_jumpbox('viewforum.' . $phpEx);
$template->assign_vars(array('L_WHOSONLINE' => $lang['Who_is_Online'], 'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 'L_USERNAME' => $lang['Username'], 'L_FORUM_LOCATION' => $lang['Forum_Location'], 'L_LAST_UPDATE' => $lang['Last_updated']));
//
// Forum info
//
Beispiel #30
0
 *   (at your option) any later version.
 *
 ***************************************************************************/
//
// Allow people to reach login page if
// board is shut down
//
define("IN_LOGIN", true);
define('IN_PHPBB', true);
$phpbb_root_path = './';
include $phpbb_root_path . 'extension.inc';
include $phpbb_root_path . 'common.' . $phpEx;
//
// Set page ID for session management
//
$userdata = session_pagestart($user_ip, PAGE_LOGIN);
init_userprefs($userdata);
//
// End session management
//
// 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 = '';
}
if (isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($HTTP_POST_VARS['logout']) || isset($HTTP_GET_VARS['logout'])) {
    if ((isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login'])) && !$userdata['session_logged_in']) {
        $username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : '';
        $username = substr(str_replace("\\'", "'", $username), 0, 25);
        $username = str_replace("'", "\\'", $username);