function add_log()
{
    global $db, $userdata, $lang, $user_ip;
    $args = func_get_args();
    $mode = array_shift($args);
    $reportee_id = $mode == LOG_USER ? intval(array_shift($args)) : '';
    $forum_id = $mode == LOG_MOD ? intval(array_shift($args)) : '';
    $topic_id = $mode == LOG_MOD ? intval(array_shift($args)) : '';
    $action = array_shift($args);
    $data = !sizeof($args) ? '' : $db->sql_escape(serialize($args));
    switch ($mode) {
        case LOG_ADMIN:
            $sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, log_ip, log_time, log_operation, log_data)
				VALUES (' . LOG_ADMIN . ', ' . $userdata['user_id'] . ", '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
            break;
        case LOG_MOD:
            $sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, forum_id, topic_id, log_ip, log_time, log_operation, log_data)
				VALUES (' . LOG_MOD . ', ' . $userdata['user_id'] . ", {$forum_id}, {$topic_id}, '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
            break;
        case LOG_USER:
            $sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, reportee_id, log_ip, log_time, log_operation, log_data)
				VALUES (' . LOG_USERS . ', ' . $userdata['user_id'] . ", {$reportee_id}, '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
            break;
        case LOG_CRITICAL:
            $sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, log_ip, log_time, log_operation, log_data)
				VALUES (' . LOG_CRITICAL . ', ' . $userdata['user_id'] . ", '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
            break;
        default:
            return;
    }
    if (!$db->sql_query($sql)) {
        message_die(GENERAL_ERROR, $lang['Error_Logs_Table'], '', __LINE__, __FILE__, $sql);
    }
    return;
}
Example #2
0
 function _achievement($l_key)
 {
     global $lang;
     $message = $lang[$l_key] . '<br /><br />' . sprintf($lang['qp_click_return_config'], '<a href="' . append_sid($this->requester . $this->ext) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . $this->ext . '?pane=right') . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
     return;
 }
Example #3
0
function get_integration_settings($set_admin_defaults = FALSE)
{
    global $db, $wpuAbs;
    $config_fields = get_db_schema();
    $wpSettings = array();
    if ($wpuAbs->ver == 'PHPBB3') {
        foreach ($config_fields as $var_name => $field_name) {
            if ($wpuAbs->config('wpu_' . $field_name) !== FALSE) {
                $wpSettings[$var_name] = $wpuAbs->config('wpu_' . $field_name);
                //unset($GLOBALS['config']['wpu_'.$field_name]);
            } elseif ($set_admin_defaults) {
                $wpSettings[$var_name] = set_default($var_name);
            }
        }
        return $wpSettings;
    }
    $sql = 'SELECT * FROM ' . WP_INT_TABLE . ' LIMIT 1';
    if (!($result = $db->sql_query($sql))) {
        //db error -- die
        message_die(GENERAL_ERROR, $lang['WP_DBErr_Retrieve'], __LINE__, __FILE__, $sql);
        return FALSE;
    }
    if (!$db->sql_numrows($result)) {
        // table not populated yet
        return FALSE;
    } else {
        $row = $db->sql_fetchrow($result);
        $fullFieldSet = get_db_schema();
        foreach ($fullFieldSet as $var_name => $field_name) {
            $wpSettings[$var_name] = $row[$field_name];
        }
    }
}
Example #4
0
 function &getServiceInstance($name, $servicedir = NULL)
 {
     global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype;
     static $instances = array();
     static $db;
     if (!isset($db)) {
         require_once dirname(__FILE__) . '/../includes/db/' . $dbtype . '.php';
         $db = new sql_db();
         $db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist);
         if (!$db->db_connect_id) {
             message_die(CRITICAL_ERROR, "Could not connect to the database", $db);
         }
     }
     if (!isset($instances[$name])) {
         if (isset($serviceoverrules[$name])) {
             $name = $serviceoverrules[$name];
         }
         if (!class_exists($name)) {
             if (!isset($servicedir)) {
                 $servicedir = dirname(__FILE__) . '/';
             }
             require_once $servicedir . strtolower($name) . '.php';
         }
         $instances[$name] = call_user_func(array($name, 'getInstance'), $db);
     }
     return $instances[$name];
 }
Example #5
0
 public function send()
 {
     $user_id = $this->in->get('user', 0);
     if ($user_id < 1) {
         $this->core->message($this->user->lang('error_user_not_found'), $this->user->lang('error'), 'red');
     } elseif ($this->in->get('body') == '' || $this->in->get('subject') == '') {
         $this->core->message($this->user->lang('adduser_send_mail_error_fields'), $this->user->lang('error'), 'red');
     } else {
         $strEmail = $this->pdh->get('user', 'email', array($user_id, true));
         $blnPrivacyCheck = $this->pdh->get('user', 'check_privacy', array($user_id, 'userprofile_email'));
         //Permission to send
         if ($blnPrivacyCheck && strlen($strEmail)) {
             $options = array('template_type' => 'input');
             //Set E-Mail-Options
             $this->mail->SetOptions($options);
             $status = $this->mail->SendMail($this->pdh->get('user', 'email', array($user_id)), $this->user->data['user_email'], $this->in->get('subject'), $this->in->get('body'));
             if ($status) {
                 $this->core->message($this->user->lang('adduser_send_mail_suc'), $this->user->lang('success'), 'green');
                 $this->tpl->add_js("jQuery.FrameDialog.closeDialog();");
             } else {
                 $this->core->message($this->user->lang('error_email_send'), $this->user->lang('error'), 'red');
             }
         } else {
             message_die($this->user->lang('noauth'), $this->user->lang('noauth_default_title'), 'access_denied');
         }
     }
 }
function validate_email($email)
{
    global $lang;
    if ($email != '') {
        if (preg_match('/^[a-z0-9&\'\\.\\-_\\+]+@[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)*?[a-z]+$/is', $email)) {
            $sql = "SELECT ban_email\n\t\t\t\tFROM " . BANLIST_TABLE;
            if ($result = DB()->sql_query($sql)) {
                if ($row = DB()->sql_fetchrow($result)) {
                    do {
                        $match_email = str_replace('*', '.*?', $row['ban_email']);
                        if (preg_match('/^' . $match_email . '$/is', $email)) {
                            DB()->sql_freeresult($result);
                            return array('error' => true, 'error_msg' => $lang['Email_banned']);
                        }
                    } while ($row = DB()->sql_fetchrow($result));
                }
            }
            DB()->sql_freeresult($result);
            $sql = "SELECT user_email\n\t\t\t\tFROM " . USERS_TABLE . "\n\t\t\t\tWHERE user_email = '" . str_replace("\\'", "''", $email) . "'";
            if (!($result = DB()->sql_query($sql))) {
                message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
            }
            if ($row = DB()->sql_fetchrow($result)) {
                return array('error' => true, 'error_msg' => $lang['Email_taken']);
            }
            DB()->sql_freeresult($result);
            return array('error' => false, 'error_msg' => '');
        }
    }
    return array('error' => true, 'error_msg' => $lang['Email_invalid']);
}
Example #7
0
function createTables()
{
    global $wowdb, $roster_conf, $wordings;
    // Declare tables needed for RaidTracker
    $create_nodes = 'CREATE TABLE `' . GATHERER_TABLE . '` (
		`id` int(11) NOT NULL auto_increment,
		`number` int(15) NOT NULL,
		`nodeNumber` int(11) NOT NULL,
		`map` varchar(25) NOT NULL,
		`nodeType` varchar(25) NOT NULL,
		`continent` int(3) NOT NULL,
		PRIMARY KEY  (`id`),
		KEY `number` (`number`)
		) ENGINE=MyISAM;';
    // Create tables declared above
    $tables = 0;
    if ($wowdb->query($create_nodes) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $create_nodes)) {
        $tables += 1;
    }
    if ($tables == 1) {
        print message_die('All tables successfully added<br /><br /><a href="' . $script_filename . '">Finish installation</a>', 'Installation Successful', 'syellow');
    } else {
        print message_die('Install failed<br /><br />Please copy the contents of the SQL log and make a post in the Gather Sub-forum at WoWRoster.net', 'Install Error');
    }
}
Example #8
0
 public function __construct()
 {
     global $template, $db, $board_config, $phpbb_seo, $lang;
     global $rcs, $get, $qte;
     $template->assign_vars(array('MARQUEE_TOPIC' => str_replace("%s", $board_config['topics_on_index'], $lang['marquee_topic'])));
     if (!($result = $db->sql_query($this->getFetchSql(), false, 'topics_recent_'))) {
         message_die(GENERAL_ERROR, 'Could not query recent posts marquee information', '', __LINE__, __FILE__);
     }
     if ($rows = $db->sql_fetchrowset($result)) {
         $db->sql_freeresult($result);
     }
     $topics = count($rows) <= $board_config['topics_on_index'] ? count($rows) : $board_config['topics_on_index'];
     for ($i = 0; $i < $topics; ++$i) {
         $topic = $rows[$i];
         $mar_title = $topic["topic_title"];
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN
         if (!isset($phpbb_seo->seo_url['topic'][$topic['topic_id']])) {
             $phpbb_seo->seo_url['topic'][$topic['topic_id']] = $phpbb_seo->format_url($mar_title);
         }
         // www.phpBB-SEO.com SEO TOOLKIT END
         $mar_url = $get->url('viewtopic', array(POST_TOPIC_URL => $topic["topic_id"]));
         $mar_user = $topic["username"];
         $pic = pic_for_topic($topic);
         if ($board_config['allow_smilies']) {
             $topic["topic_title"] = smilies_pass($topic["topic_title"]);
         }
         $topic_title = $topic['topic_title'];
         $qte->attr($topic_title, $topic['topic_attribute']);
         $template->assign_block_vars('marqueerow', array('FOLD_URL' => $pic, 'TOPIC_TITLE' => $topic_title, 'TOPIC_URL' => $get->url('viewtopic', array(POST_TOPIC_URL => $topic["topic_id"]), true), 'POST_URL' => $get->url('viewtopic', array('p' => $topic["post_id"]), true) . '#' . $topic["post_id"], 'STYLE' => $rcs->get_colors($topic), 'USERNAME' => $topic["username"], 'USER_PROF' => $get->url('userlist', array('mode' => 'viewprofile', POST_USERS_URL => $topic["user_id"]), true), 'POST_DATE' => create_date($board_config['default_dateformat'], $topic["post_time"], $board_config['board_timezone'])));
     }
 }
Example #9
0
function send()
{
    if ($x)
    {
        message_die();
    }
}
Example #10
0
    function recup_infos_cat()
    {
        global $db, $phpEx;
        $liste_cat = array();
        $sql = 'SELECT arcade_catid, arcade_parent, arcade_cattitle, arcade_icone, arcade_catorder, arcade_nbelmt   
				FROM ' . AREABB_CATEGORIES_TABLE . ' 
				WHERE salle=' . $this->id_salle . ' 
				ORDER BY arcade_catorder';
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, "Impossible d'accéder à la tables des catégories", '', __LINE__, __FILE__, $sql);
        }
        $i = 0;
        while ($row = $db->sql_fetchrow($result)) {
            $liste_cat[$i]['lien'] = append_sid(NOM_ARCADE . '.' . $phpEx . '?salle=' . $this->id_salle . '&cid=' . $row['arcade_catid']);
            $liste_cat[$i]['nbre_jeux'] = $row['arcade_nbelmt'];
            $liste_cat[$i]['titre'] = $row['arcade_cattitle'];
            $liste_cat[$i]['id'] = $row['arcade_catid'];
            $liste_cat[$i]['icone'] = $row['arcade_icone'];
            $liste_cat[$i]['parent'] = $row['arcade_parent'];
            $liste_cat[$i]['order'] = $row['arcade_catorder'];
            $i++;
        }
        $this->liste_cat = $liste_cat;
        $this->nbre_categorie = sizeof($liste_cat);
    }
 public static function parse($input)
 {
     if (trim($input->head->gameinfo->game) == 'Runes of Magic' and register('config')->get('default_game') != 'rom' or trim($input->head->gameinfo->game) == 'World of Warcraft' and register('config')->get('default_game') != 'wow') {
         message_die(register('user')->lang('wrong_game'));
     }
     $lang = trim($input->head->gameinfo->language);
     #$this->rli->add_data['log_lang'] = substr($lang, 0, 2);
     $xml = $input->raiddata;
     $data = array();
     foreach ($xml->zones->children() as $zone) {
         $data['zones'][] = array(trim($zone->name), (int) trim($zone->enter), (int) trim($zone->leave), (int) trim($zone->difficulty));
     }
     foreach ($xml->bosskills->children() as $bosskill) {
         $data['bosses'][] = array(trim($bosskill->name), (int) trim($bosskill->time), (int) trim($bosskill->difficulty));
     }
     foreach ($xml->members->children() as $xmember) {
         $name = trim($xmember->name);
         $note = isset($xmember->note) ? trim($xmember->note) : '';
         $data['members'][] = array($name, trim($xmember->class), trim($xmember->race), trim($xmember->level), $note);
         foreach ($xmember->times->children() as $time) {
             $attrs = $time->attributes();
             $type = (string) $attrs['type'];
             $extra = isset($attrs['extra']) ? (string) $attrs['extra'] : '';
             $data['times'][] = array($name, (int) $time, $type, $extra);
         }
     }
     foreach ($xml->items->children() as $xitem) {
         $cost = isset($xitem->cost) ? trim($xitem->cost) : '';
         $id = isset($xitem->itemid) ? trim($xitem->itemid) : '';
         $data['items'][] = array(trim($xitem->name), trim($xitem->member), $cost, (int) $id, (int) trim($xitem->time));
     }
     return $data;
 }
Example #12
0
    function duplicate_attachment_pm($switch_attachment, $original_privmsg_id, $new_privmsg_id)
    {
        global $privmsg, $folder;
        if (($privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL) && $folder == 'inbox' && intval($switch_attachment) == 1) {
            $sql = 'SELECT *
			FROM ' . ATTACHMENTS_TABLE . '
			WHERE privmsgs_id = ' . $original_privmsg_id;
            if (!($result = DB()->sql_query($sql))) {
                message_die(GENERAL_ERROR, 'Couldn\'t query Attachment Table', '', __LINE__, __FILE__, $sql);
            }
            if (DB()->num_rows($result) > 0) {
                $rows = DB()->sql_fetchrowset($result);
                $num_rows = DB()->num_rows($result);
                for ($i = 0; $i < $num_rows; $i++) {
                    $sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2) 
					VALUES ( ' . $rows[$i]['attach_id'] . ', ' . $rows[$i]['post_id'] . ', ' . $new_privmsg_id . ', ' . $rows[$i]['user_id_1'] . ', ' . $rows[$i]['user_id_2'] . ')';
                    if (!($result = DB()->sql_query($sql))) {
                        message_die(GENERAL_ERROR, 'Couldn\'t store Attachment for sent Private Message', '', __LINE__, __FILE__, $sql);
                    }
                }
                $sql = "UPDATE " . PRIVMSGS_TABLE . "\n\t\t\t\tSET privmsgs_attachment = 1\n\t\t\t\tWHERE privmsgs_id = " . $new_privmsg_id;
                if (!DB()->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Unable to update Private Message Table.', '', __LINE__, __FILE__, $sql);
                }
            }
        }
    }
Example #13
0
 public function display()
 {
     if ($this->in->get('page', '')) {
         if (is_numeric($this->in->get('page', ''))) {
             $id = $this->in->get('page', '');
         } else {
             $id = $this->pdh->get('pages', 'alias_to_page', array($this->in->get('page', '')));
         }
     } else {
         message_die($this->user->lang('info_invalid_id'), $this->user->lang('info_invalid_id_title'));
     }
     if (!$this->pdh->get('pages', 'page_exists', array($id))) {
         message_die($this->user->lang('info_invalid_id'), $this->user->lang('info_invalid_id_title'));
     }
     if (!$this->pdh->get('pages', 'check_visibility', array($id))) {
         message_die($this->user->lang('noauth_u_information_view'), $this->user->lang('noauth_default_title'));
     }
     $content = $this->pdh->get('pages', 'content', array($id));
     $arrHooks = $this->hooks->process('pages_parse', array('text' => $content), true);
     $content = $arrHooks['text'];
     $myRatings = array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10');
     $users_voted = $this->pdh->get('pages', 'voters', array($id));
     $u_has_voted = !$users_voted[$this->user->data['user_id']] ? false : true;
     $this->tpl->assign_vars(array('PAGE_ID' => $id, 'INFO_PAGE_CONTENT' => $this->bbcode->parse_shorttags(xhtml_entity_decode($content)), 'INFO_PAGE_TITLE' => sanitize($this->pdh->get('pages', 'title', array($id))), 'EDITED' => $this->pdh->get('pages', 'edit_date', array($id)) ? $this->user->lang('info_edit_user') . $this->pdh->get('user', 'name', array($this->pdh->get('pages', 'edit_user', array($id)))) . $this->user->lang('info_edit_date') . $this->time->user_date($this->pdh->get('pages', 'edit_date', array($id)), false, false, true) : '', 'S_IS_ADMIN' => $this->user->check_auth('a_pages_man', false), 'STAR_RATING' => $this->pdh->get('pages', 'voting', array($id)) == '1' ? $this->jquery->StarRating('info_vote', $myRatings, 'pages.php' . $this->SID . '&page=' . sanitize($id) . '&mode=vote', $this->pdh->get('pages', 'rating', array($id)), $u_has_voted) : ''));
     //Comment-System
     if ($this->pdh->get('pages', 'comments', array($id)) == '1') {
         $this->comments->SetVars(array('attach_id' => $id, 'page' => 'custompages', 'auth' => 'a_pages_man'));
         $this->tpl->assign_vars(array('COMMENTS' => $this->comments->Show()));
     }
     $this->core->set_vars(array('page_title' => sanitize($this->pdh->get('pages', 'title', array($id))), 'template_file' => 'pages.html', 'description' => substr(strip_tags($this->bbcode->remove_embeddedMedia($this->bbcode->remove_shorttags(xhtml_entity_decode($content)))), 0, 250), 'image' => register('socialplugins')->getFirstImage(xhtml_entity_decode($content)), 'display' => true));
 }
Example #14
0
    public function display()
    {
        if (!$this->data || $this->data['url'] == '') {
            message_die('URL not found');
        } else {
            $sop = parse_url($this->data['url']);
            $sop = $sop['host'] == $this->env->server_name ? true : false;
            $output = '<div id="wrapper">';
            if (!$sop) {
                $output .= '<!--[IF IE]>
								<iframe id="boardframe" src="' . $this->data['url'] . '" allowtransparency="true" height="' . $this->data['height'] . '" width="100%" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
							<![if ! IE]><!-->
								<iframe id="boardframe" src="' . $this->data['url'] . '" height="' . $this->data['height'] . '" width="100%" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
							<!--><![ENDIF]><![ENDIF]-->';
            } else {
                $this->CreateDynamicIframeJS();
                $output .= '<!--[IF IE]>
								<iframe id="boardframe" src="' . $this->data['url'] . '" allowtransparency="true" width="100%" height="' . $this->data['height'] . '" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
							<![if ! IE]><!-->
								<iframe id="boardframe" src="' . $this->data['url'] . '" width="100%" scrolling="no" marginwidth="0" marginheight="0" height="' . $this->data['height'] . '" frameborder="0" vspace="0" hspace="0"></iframe>
							<!--><![ENDIF]><![ENDIF]-->';
            }
            $output .= '</div>';
            $this->tpl->assign_vars(array('BOARD_OUPUT' => $output));
        }
        $this->core->set_vars(array('page_title' => isset($this->data['title']) ? $this->data['title'] : 'Wrapper', 'page_body' => isset($this->data['window']) && $this->data['window'] == 4 ? 'full' : '', 'template_file' => 'wrapper.html', 'display' => true));
    }
Example #15
0
function generate_smilies_row()
{
    global $db, $board_config, $template;
    $max_smilies = 24;
    switch (SQL_LAYER) {
        case 'mssql':
            $sql = 'SELECT TOP ' . $max_smilies . ' min(emoticon) AS emoticon,
                        min(code) AS code, smile_url
                        FROM ' . SMILIES_TABLE . ' 
                        GROUP BY [smile_url]';
            break;
        default:
            $sql = 'SELECT emoticon, code, smile_url
                        FROM ' . SMILIES_TABLE . ' 
                        GROUP BY smile_url
                        ORDER BY smilies_id LIMIT ' . $max_smilies;
            break;
    }
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql);
    }
    $smilies_count = $db->sql_numrows($result);
    $smilies_data = $db->sql_fetchrowset($result);
    for ($i = 0; $i < $smilies_count; $i++) {
        $template->assign_block_vars('quick_reply.smilies', array('CODE' => $smilies_data[$i]['code'], 'URL' => $board_config['smilies_path'] . '/' . $smilies_data[$i]['smile_url'], 'DESC' => $smilies_data[$i]['emoticon']));
    }
}
 /**
  * display
  * Display the page
  *
  * @param    array  $messages   Array of Messages to output
  */
 public function display($messages = array())
 {
     // -- Messages ------------------------------------------------------------
     if ($messages) {
         foreach ($messages as $name) {
             $this->core->message($name, $this->user->lang('sk_startorder'), 'green');
         }
     }
     $strCurrentLayout = $this->pdh->get_eqdkp_base_layout($this->config->get('eqdkp_layout'));
     if (!in_array($strCurrentLayout, array('sk', 'sk_fixed', 'sk_bottom'))) {
         message_die($this->user->lang('skso_no_sk_layout'));
     }
     $arrMembers = $this->pdh->sort($this->pdh->get('member', 'id_list', array(false, false)), 'member', 'creation_date', 'asc');
     $blnShowTwinks = $this->config->get('show_twinks');
     foreach ($this->pdh->get('multidkp', 'id_list', array()) as $mdkp_id) {
         if ($strCurrentLayout == 'sk') {
             $startList = $this->config->get('sk_startlist_' . $mdkp_id);
         } else {
             $startList = $this->config->get('sk_fix_startlist_' . $mdkp_id);
         }
         if (!$startList) {
             shuffle($arrMembers);
             $startList = $arrMembers;
         }
         $member_hash = array('single' => array(), 'multi' => array());
         foreach ($startList as $intMemberID) {
             if (in_array($intMemberID, $arrMembers)) {
                 $member_hash['single'][] = $intMemberID;
                 $intMainID = $this->pdh->get('member', 'mainid', array($intMemberID));
                 if (!in_array($intMainID, $member_hash['multi'])) {
                     $member_hash['multi'][] = $intMainID;
                 }
             }
         }
         //New Members at the bottom
         foreach ($arrMembers as $intMemberID) {
             if (!in_array($intMemberID, $startList)) {
                 $member_hash['single'][] = $intMemberID;
                 $intMainID = $this->pdh->get('member', 'mainid', array($intMemberID));
                 if (!in_array($intMainID, $member_hash['multi'])) {
                     $member_hash['multi'][] = $intMainID;
                 }
             }
         }
         if ($blnShowTwinks) {
             $arrOutMembers = $member_hash['single'];
         } else {
             $arrOutMembers = $member_hash['multi'];
         }
         $this->tpl->assign_block_vars('tab_row', array('MDKP_NAME' => $this->pdh->get('multidkp', 'name', array($mdkp_id)), 'ID' => $mdkp_id));
         foreach ($arrOutMembers as $key => $memberID) {
             $this->tpl->assign_block_vars('tab_row.member_row', array('ID' => $memberID, 'NAME' => $this->pdh->geth('member', 'name', array($memberID))));
         }
     }
     $this->jquery->Tab_header('mdkp_tabs');
     $this->tpl->add_js("\n\t\t\t\$(\"#profilefield_table tbody\").sortable({\n\t\t\t\tcancel: '.not-sortable, input, select, th',\n\t\t\t\tcursor: 'pointer',\n\t\t\t});\n\t\t", "docready");
     // -- EQDKP ---------------------------------------------------------------
     $this->core->set_vars(array('page_title' => $this->user->lang('skso_change_order'), 'template_path' => $this->pm->get_data('sk_startorder', 'template_path'), 'template_file' => 'admin/settings.html', 'display' => true));
 }
 public function __construct()
 {
     if (!$this->pm->check('guildbank', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('guildbank_not_installed'));
     }
     $handler = array('bid' => array('process' => 'perform_bid', 'csrf' => true, 'check' => 'u_guildbank_auction'));
     parent::__construct('u_guildbank_auction', $handler, array(), null, '', 'auction');
     $this->process();
 }
function set_post_count($user_id, $post_count)
{
    global $db;
    $sql = "UPDATE " . USERS_TABLE . "\n\t\tSET user_posts = {$post_count} \n\t\t\tWHERE user_id = {$user_id}";
    $result = $db->sql_query($sql);
    if (!$result) {
        message_die(GENERAL_ERROR, "Could not update post count", "", __LINE__, __FILE__, $sql);
    }
}
Example #19
0
function subtract_points($user_id, $amount)
{
    global $db;
    $sql = "UPDATE " . USERS_TABLE . "\r\n\t\tSET user_points = user_points - {$amount}\r\n\t\tWHERE user_id = {$user_id}";
    if (!$db->sql_query($sql)) {
        message_die(GENERAL_ERROR, "Could not update user's points", '', __LINE__, __FILE__, $sql);
    }
    return;
}
Example #20
0
 public function parse_string($log)
 {
     $parser = $this->rli->config('parser');
     $path = $this->root_path . 'plugins/raidlogimport/includes/parser/';
     if (is_file($path . $parser . '.parser.class.php')) {
         include_once $path . 'parser.aclass.php';
         include_once $path . $parser . '.parser.class.php';
         if ($parser::$xml) {
             $log = @simplexml_load_string($log);
             if ($log === false) {
                 message_die($this->user->lang('xml_error'));
             }
         }
         $back = $parser::check($log);
         if ($back[1]) {
             $this->raid->flush_data();
             $data = $parser::parse($log);
             foreach ($data as $type => $ddata) {
                 switch ($type) {
                     case 'zones':
                         foreach ($ddata as $args) {
                             call_user_func_array(array($this->raid, 'add_zone'), $args);
                         }
                         break;
                     case 'bosses':
                         foreach ($ddata as $args) {
                             call_user_func_array(array($this->raid, 'add_bosskill'), $args);
                         }
                         break;
                     case 'members':
                         foreach ($ddata as $args) {
                             call_user_func_array(array($this->member, 'add'), $args);
                         }
                         break;
                     case 'times':
                         foreach ($ddata as $args) {
                             call_user_func_array(array($this->member, 'add_time'), $args);
                         }
                         break;
                     case 'items':
                         foreach ($ddata as $args) {
                             call_user_func_array(array($this->item, 'add'), $args);
                         }
                         break;
                 }
             }
             $this->raid->create();
             $this->raid->recalc(true);
             $this->member->finish();
         } else {
             message_die(sprintf($this->user->lang('rli_error_wrong_format'), $parser::$name) . '<br />' . $this->user->lang('rli_miss') . implode(', ', $back[2]));
         }
     } else {
         message_die($this->user->lang('rli_error_no_parser'));
     }
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // plugin installed?
     if (!$this->pm->check('siggenerator', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('sg_plugin_not_installed'));
     }
     $handler = array();
     parent::__construct(false, $handler);
     $this->process();
 }
Example #22
0
 /**
  * Constructor
  */
 public function __construct()
 {
     // plugin installed?
     if (!$this->pm->check('shoutbox', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('sb_plugin_not_installed'));
     }
     $handler = array('sb_delete' => array('process' => 'delete', 'csrf' => true, 'check' => 'a_shoutbox_delete'));
     parent::__construct('u_shoutbox_view', $handler);
     $this->process();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // plugin installed?
     if (!$this->pm->check('guildbank', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('guildbank_not_installed'));
     }
     $handler = array('save' => array('process' => 'save', 'csrf' => true, 'check' => 'a_guildbank_settings'));
     parent::__construct('a_guildbank_settings', $handler);
     $this->process();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     if (!$this->pm->check('awards', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('aw_plugin_not_installed'));
     }
     $this->user->check_auth('a_awards_manage');
     $handler = array('save' => array('process' => 'save', 'check' => 'a_awards_add', 'csrf' => true), 'aid' => array('process' => 'edit', 'check' => 'a_awards_add'));
     parent::__construct(false, $handler, array('manage_achievements', 'name'), null, 'selected_ids[]');
     $this->process();
 }
Example #25
0
 public function __construct()
 {
     $handler = array();
     $this->user->check_auth('u_event_view');
     parent::__construct(false, $handler, array(), null, '', 'event_id');
     if (!in_array($this->url_id, $this->pdh->get('event', 'id_list', array()))) {
         message_die('Invalid event id.');
     }
     $this->process();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // plugin installed?
     if (!$this->pm->check('dynamictemplate', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('dynamictemplate_plugin_not_installed'));
     }
     $handler = array('save' => array('process' => 'save', 'csrf' => true, 'check' => 'a_dynamictemplate_main'));
     parent::__construct('a_dynamictemplate_main', $handler, array('dynamictemplate', 'name'), null, 'field_ids[]');
     $this->process();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     // plugin installed?
     if (!$this->pm->check('statistics', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('st_plugin_not_installed'));
     }
     $handler = array('data' => array('process' => 'ajax_data', 'check' => 'a_statistics_manage'));
     parent::__construct('a_statistics_manage', $handler);
     $this->process();
 }
Example #28
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']);
    }
}
Example #29
0
 /**
  * Constructor
  */
 public function __construct()
 {
     // plugin installed?
     if (!$this->pm->check('guildrequest', PLUGIN_INSTALLED)) {
         message_die($this->user->lang('gr_plugin_not_installed'));
     }
     $handler = array('save' => array('process' => 'save', 'csrf' => true, 'check' => 'a_guildrequest_manage'));
     parent::__construct('a_guildrequest_form', $handler, array('guildrequest_fields', 'name'), null, 'field_ids[]');
     $this->process();
 }
Example #30
0
function bind($username)
{
    global $db, $openid;
    $sql = "update " . USERS_TABLE . "\n    set user_openid = '{$openid}' WHERE username = '******' ";
    if (!($result = $db->sql_query($sql))) {
        message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql);
    } else {
        return $user_id;
    }
}