public function init()
 {
     $this->localitembase = $this->pdc->get('pdh_localitembase_table');
     if ($this->localitembase !== NULL) {
         return true;
     }
     $objQuery = $this->db->query('SELECT * FROM __plugin_localitembase');
     if ($objQuery) {
         while ($drow = $objQuery->fetchAssoc()) {
             $this->localitembase[(int) $drow['id']] = array('id' => (int) $drow['id'], 'item_gameid' => $drow['item_gameid'], 'quality' => $drow['quality'], 'icon' => $drow['icon'], 'item_name' => $drow['item_name'], 'image' => $drow['image'], 'text' => $drow['text'], 'languages' => $drow['languages'], 'added_date' => (int) $drow['added_date'], 'added_by' => (int) $drow['added_by'], 'update_date' => (int) $drow['update_date'], 'update_by' => (int) $drow['update_by']);
             if ($drow['item_gameid'] != "") {
                 $this->items_by_gameid[$drow['item_gameid']] = (int) $drow['id'];
             }
             $arrNames = unserialize($drow['item_name']);
             foreach ($arrNames as $key => $val) {
                 $this->items_by_name[unsanitize($val)] = (int) $drow['id'];
             }
             $this->pfh->putContent($this->pfh->FolderPath('cache', 'localitembase') . 'item_' . (int) $drow['id'] . '.json', json_encode($this->localitembase[(int) $drow['id']]));
         }
         $this->pdc->put('pdh_localitembase_table', $this->localitembase, null);
         $this->pdc->put('pdh_localitembase_gameid_table', $this->items_by_gameid, null);
         $this->pfh->putContent($this->pfh->FolderPath('cache', 'localitembase') . 'index_gameid.json', json_encode($this->items_by_gameid));
         $this->pdc->put('pdh_localitembase_name_table', $this->items_by_name, null);
         $this->pfh->putContent($this->pfh->FolderPath('cache', 'localitembase') . 'index_name.json', json_encode($this->items_by_name));
     }
 }
Пример #2
0
    function wowautoinviteexport($raid_id, $raid_groups = 0)
    {
        $attendees = registry::register('plus_datahandler')->get('calendar_raids_attendees', 'attendees', array($raid_id));
        $guests = registry::register('plus_datahandler')->get('calendar_raids_guests', 'members', array($raid_id));
        $a_json = array();
        foreach ($attendees as $id_attendees => $d_attendees) {
            $a_json[] = array('name' => unsanitize(registry::register('plus_datahandler')->get('member', 'name', array($id_attendees))), 'status' => $d_attendees['signup_status'], 'class' => autoinvite_eclass(registry::register('plus_datahandler')->get('member', 'classid', array($id_attendees))), 'note' => unsanitize($d_attendees['note']), 'level' => registry::register('plus_datahandler')->get('member', 'level', array($id_attendees)), 'guest' => false, 'group' => $d_attendees['raidgroup']);
        }
        foreach ($guests as $guestsdata) {
            $a_json[] = array('name' => unsanitize($guestsdata['name']), 'status' => false, 'class' => autoinvite_eclass($guestsdata['class']), 'note' => unsanitize($guestsdata['note']), 'level' => 0, 'guest' => true, 'group' => $guestsdata['raidgroup']);
        }
        $json = json_encode($a_json);
        unset($a_json);
        registry::register('template')->add_js('
			genOutput()
			$("input[type=\'checkbox\'], #raidgroup").change(function (){
				genOutput()
			});
		', "docready");
        #http://www.curse.com/addons/wow/auto-invite#t1:description
        #name:eClass:level:inGroup:group:comment
        #name: name of the player
        #eClass: must bes PRIEST, HUNTER, WARRIOR, MAGE, PALADIN, SHAMAN, WARLOCK, ROGUE or DRUID
        #level: can be 0, the mod will read the level then automatically
        #inGroup=1 player is in the current group setup and will be invited by the mod, inGroup=0 player is not in the current group setup (only in the complete list)
        #group='-' no group defined group=1 or group=2 to group=8 number of the group
        #comment=Comment for the player. Use <br> to split it in several lines
        registry::register('template')->add_js('
		function genOutput(){
			var attendee_data = ' . $json . ';
			output = "";

			cb_guests		= ($("#cb_guests").attr("checked")) ? true : false;
			cb_confirmed	= ($("#cb_confirmed").attr("checked")) ? true : false;
			cb_signedin		= ($("#cb_signedin").attr("checked")) ? true : false;
			cb_backup		= ($("#cb_backup").attr("checked")) ? true : false;

			$.each(attendee_data, function(i, item) {
				if((cb_guests && item.guest == true) || (cb_confirmed && !item.guest && item.status == 0) || (cb_signedin && item.status == 1) || (cb_backup && item.status == 3)){
					if($("#raidgroup").length == 0 || $("#raidgroup").val() == "0" || (item.group > 0 && item.group == $("#raidgroup").val())){
						output += item.name + ":" + item.class + ":" + item.level + ":1:-:" +item.note + "\\n";
					}
				}
			});
			$("#attendeeout").html(output);
		}
			');
        if (is_array($raid_groups)) {
            $text = "<dt><label>" . registry::fetch('user')->lang('raidevent_export_raidgroup') . "</label></dt>\n\t\t\t\t\t\t\t\t<dd>\n\t\t\t\t\t\t\t\t\t" . new hdropdown('raidgroup', array('options' => $raid_groups, 'value' => 0, 'id' => 'raidgroup')) . "\n\t\t\t\t\t\t\t\t</dd>\n\t\t\t\t\t\t\t</dl><dl>";
        }
        $text .= "<input type='checkbox' checked='checked' name='confirmed' id='cb_confirmed' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 0));
        $text .= "<input type='checkbox' checked='checked' name='guests' id='cb_guests' value='true'> " . registry::fetch('user')->lang('raidevent_raid_guests');
        $text .= "<input type='checkbox' checked='checked' name='signedin' id='cb_signedin' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 1));
        $text .= "<input type='checkbox' name='backup' id='cb_backup' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 3));
        $text .= "<br/>";
        $text .= "<textarea name='group" . rand() . "' id='attendeeout' cols='60' rows='10' onfocus='this.select()' readonly='readonly'>";
        $text .= "</textarea>";
        $text .= '<br/>' . registry::fetch('user')->lang('rp_copypaste_ig') . "</b>";
        return $text;
    }
Пример #3
0
 public function get_raids($params, $body)
 {
     $isAPITokenRequest = $this->pex->getIsApiTokenRequest();
     if ($this->user->check_pageobjects(array('raids'), 'AND', false) || $isAPITokenRequest) {
         $raidlist = $this->pdh->get('raid', 'id_list');
         $raidlist = $this->pdh->sort($raidlist, 'raid', 'date', 'desc');
         $intNumber = intval($params['get']['number']) > 0 ? intval($params['get']['number']) : false;
         $intStart = intval($params['get']['number']) > 0 ? intval($params['get']['start']) : 0;
         if ($intNumber !== false) {
             $raidlist = $this->pdh->limit($raidlist, $intStart, $intNumber);
         }
         $out = array();
         foreach ($raidlist as $key => $raid_id) {
             $date_raw = $this->pdh->get('raid', 'date', array($raid_id));
             $date_info = $this->pdh->get('raid', 'date', array($raid_id));
             $date_info = date("Y-m-d H:i:s", $date_raw);
             $added_by = $this->pdh->get('raid', 'added_by', array($raid_id));
             $event_name = unsanitize($this->pdh->get('raid', 'event_name', array($raid_id)));
             $event_id = unsanitize($this->pdh->get('raid', 'event', array($raid_id)));
             $raid_note = unsanitize($this->pdh->get('raid', 'note', array($raid_id)));
             $added_by_name = unsanitize($this->pdh->get('user', 'name', array($added_by)));
             $raid_value = $this->pdh->get('raid', 'value', array($raid_id));
             $out['raid:' . $raid_id] = array('id' => $raid_id, 'date' => $date_info, 'date_timestamp' => $date_raw, 'note' => $raid_note, 'event_id' => $event_id, 'event_name' => $event_name, 'added_by_id' => 0, 'added_by_name' => $added_by, 'value' => runden($raid_value));
         }
         return $out;
     } else {
         return $this->pex->error('access denied');
     }
 }
 private function buildURL()
 {
     $url = "http://www.wowprogress.com/";
     $search = array('+', "'", " ");
     $server = urlencode(strtolower(str_replace($search, '-', unsanitize($this->config->get('servername')))));
     $guild = str_replace($search, '+', urlencode(utf8_strtolower(unsanitize($this->config->get('guildtag')))));
     $url .= "guild/" . $this->config->get('uc_server_loc') . "/" . $server . "/" . $guild . "/";
     return $url;
 }
Пример #5
0
    function WoWMacroexport($raid_id, $raid_groups = 0)
    {
        $attendees = registry::register('plus_datahandler')->get('calendar_raids_attendees', 'attendees', array($raid_id));
        $guests = registry::register('plus_datahandler')->get('calendar_raids_guests', 'members', array($raid_id));
        $a_json = array();
        foreach ($attendees as $id_attendees => $d_attendees) {
            $char_server = registry::register('plus_datahandler')->get('member', 'profile_field', array($id_attendees, 'servername'));
            $servername = $char_server != registry::register('config')->get('servername') ? $char_server : false;
            $a_json[] = array('name' => unsanitize(registry::register('plus_datahandler')->get('member', 'name', array($id_attendees))), 'status' => $d_attendees['signup_status'], 'guest' => false, 'group' => $d_attendees['raidgroup'], 'realm' => $servername);
        }
        foreach ($guests as $guestsdata) {
            $a_json[] = array('name' => unsanitize($guestsdata['name']), 'status' => false, 'guest' => true, 'group' => $guestsdata['raidgroup'], 'realm' => false);
        }
        $json = json_encode($a_json);
        unset($a_json);
        registry::register('template')->add_js('
			genOutput()
			$("input[type=\'checkbox\'], #raidgroup").change(function (){
				genOutput()
			});
		', "docready");
        registry::register('template')->add_js('
		function genOutput(){
			var attendee_data = ' . $json . ';
			output = "";

			cb_guests		= ($("#cb_guests").attr("checked")) ? true : false;
			cb_confirmed	= ($("#cb_confirmed").attr("checked")) ? true : false;
			cb_signedin		= ($("#cb_signedin").attr("checked")) ? true : false;
			cb_backup		= ($("#cb_backup").attr("checked")) ? true : false;

			$.each(attendee_data, function(i, item) {
				if((cb_guests && item.guest == true) || (cb_confirmed && !item.guest && item.status == 0) || (cb_signedin && item.status == 1) || (cb_backup && item.status == 3)){
					if($("#raidgroup").length == 0 || $("#raidgroup").val() == "0" || (item.group > 0 && item.group == $("#raidgroup").val())){
						realmdata	 = (item.realm) ? "-" + item.realm : "";
						output		+= "/inv " + item.name + realmdata + "\\n";
					}
				}
			});
			$("#attendeeout").html(output);
		}
			');
        if (is_array($raid_groups)) {
            $text = "<dt><label>" . registry::fetch('user')->lang('raidevent_export_raidgroup') . "</label></dt>\n\t\t\t\t\t\t\t<dd>\n\t\t\t\t\t\t\t\t" . new hdropdown('raidgroup', array('options' => $raid_groups, 'value' => 0, 'id' => 'raidgroup')) . "\n\t\t\t\t\t\t\t</dd>\n\t\t\t\t\t\t</dl><dl>";
        }
        $text .= "<input type='checkbox' checked='checked' name='confirmed' id='cb_confirmed' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 0));
        $text .= "<input type='checkbox' checked='checked' name='guests' id='cb_guests' value='true'> " . registry::fetch('user')->lang('raidevent_raid_guests');
        $text .= "<input type='checkbox' checked='checked' name='signedin' id='cb_signedin' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 1));
        $text .= "<input type='checkbox' name='backup' id='cb_backup' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 3));
        $text .= "<br/>";
        $text .= "<textarea name='group" . rand() . "' id='attendeeout' cols='60' rows='10' onfocus='this.select()' readonly='readonly'>";
        $text .= "</textarea>";
        $text .= '<br/>' . registry::fetch('user')->lang('rp_copypaste_ig') . "</b>";
        return $text;
    }
    function WildstarMacroexport($raid_id)
    {
        $attendees = registry::register('plus_datahandler')->get('calendar_raids_attendees', 'attendees', array($raid_id));
        $guests = registry::register('plus_datahandler')->get('calendar_raids_guests', 'members', array($raid_id));
        $a_json = array();
        foreach ($attendees as $id_attendees => $d_attendees) {
            $a_json[] = array('name' => unsanitize(registry::register('plus_datahandler')->get('member', 'name', array($id_attendees))), 'status' => $d_attendees['signup_status'], 'guest' => false);
        }
        foreach ($guests as $guestsdata) {
            $a_json[] = array('name' => unsanitize($guestsdata['name']), 'status' => false, 'guest' => true);
        }
        $json = json_encode($a_json);
        unset($a_json);
        registry::register('template')->add_js('
			$("#gamelanguage").change(function (){
				genOutput()
			}).trigger("change");
			$("input[type=\'checkbox\']").change(function (){
				genOutput()
			});
		', "docready");
        registry::register('template')->add_js('
		function genOutput(){
			var attendee_data = ' . $json . ';
			output = "";

			cb_guests		= ($("#cb_guests").attr("checked")) ? true : false;
			cb_confirmed	= ($("#cb_confirmed").attr("checked")) ? true : false;
			cb_signedin		= ($("#cb_signedin").attr("checked")) ? true : false;
			cb_backup		= ($("#cb_backup").attr("checked")) ? true : false;
			chat_command	= ($("#gamelanguage").val() == "german") ? "/einladen" : "/invite";

			$.each(attendee_data, function(i, item) {
				if((cb_guests && item.guest == true) || (cb_confirmed && !item.guest && item.status == 0) || (cb_signedin && item.status == 1) || (cb_backup && item.status == 3)){
					output += chat_command+" " + item.name + "\\n";
				}
			});
			$("#attendeeout").html(output);
		}
			');
        $text = registry::fetch('game')->glang('game_language') . ': ' . new hdropdown('language', array('options' => array('german' => 'Deutsch', 'english' => 'English'), 'value' => registry::fetch('config')->get('game_language'), 'id' => 'gamelanguage'));
        $text .= "<input type='checkbox' checked='checked' name='confirmed' id='cb_confirmed' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 0));
        $text .= "<input type='checkbox' checked='checked' name='guests' id='cb_guests' value='true'> " . registry::fetch('user')->lang('raidevent_raid_guests');
        $text .= "<input type='checkbox' checked='checked' name='signedin' id='cb_signedin' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 1));
        $text .= "<input type='checkbox' name='backup' id='cb_backup' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 3));
        $text .= "<br/>";
        $text .= "<textarea name='group" . rand() . "' id='attendeeout' cols='60' rows='10' onfocus='this.select()' readonly='readonly'>";
        $text .= "</textarea>";
        $text .= '<br/>' . registry::fetch('user')->lang('rp_copypaste_ig') . "</b>";
        return $text;
    }
Пример #7
0
 public function get_user_chars($params, $body)
 {
     $isAPITokenRequest = $this->pex->getIsApiTokenRequest();
     if ($this->user->check_auth('po_calendarevent', false) || $isAPITokenRequest) {
         $userid = intval($params['get']['userid']) > 0 ? intval($params['get']['userid']) : $this->user->id;
         //UserChars
         $user_chars = $this->pdh->aget('member', 'name', 0, array($this->pdh->get('member', 'connection_id', array($userid))));
         $mainchar = $this->pdh->get('user', 'mainchar', array($userid));
         $arrRoles = array();
         if (is_array($user_chars)) {
             foreach ($user_chars as $key => $charname) {
                 $roles = $this->pdh->get('roles', 'memberroles', array($this->pdh->get('member', 'classid', array($key))));
                 if (is_array($roles)) {
                     $arrRoles = array();
                     foreach ($roles as $roleid => $rolename) {
                         $arrRoles['role:' . $roleid] = array('id' => $roleid, 'name' => $rolename, 'default' => (int) $this->pdh->get('member', 'defaultrole', array($key)) == $roleid ? 1 : 0);
                     }
                 }
                 //Raidgroups
                 $arrRaidgroups = array();
                 $arrTotalRaidgroups = $this->pdh->aget('raid_groups', 'name', false, array($this->pdh->get('raid_groups', 'id_list')));
                 if (count($arrTotalRaidgroups)) {
                     foreach ($arrTotalRaidgroups as $raidgroupid => $raidgroupname) {
                         $status = $this->pdh->get('raid_groups_members', 'membership_status', array($key, $raidgroupid));
                         if ($status !== false) {
                             $status = $status + 1;
                         } else {
                             $status = count($arrTotalRaidgroups) === 1 ? 1 : 0;
                         }
                         $arrRaidgroups['raidgroup:' . $raidgroupid] = array('id' => $raidgroupid, 'name' => $raidgroupname, 'default' => $this->pdh->get('raid_groups', 'standard', array($raidgroupid)) ? 1 : 0, 'color' => $this->pdh->get('raid_groups', 'color', array($raidgroupid)), 'status' => $status);
                     }
                 }
                 $arrUserChars['char:' . $key] = array('id' => $key, 'name' => unsanitize($charname), 'main' => $key == $mainchar ? 1 : 0, 'class' => $this->pdh->get('member', 'classid', array($key)), 'classname' => $this->pdh->get('member', 'classname', array($key)), 'roles' => $arrRoles, 'raidgroups' => $arrRaidgroups);
             }
         }
         $out['chars'] = $arrUserChars;
         return $out;
     } else {
         return $this->pex->error('access denied');
     }
 }
Пример #8
0
 public function get_events($params, $body)
 {
     $isAPITokenRequest = $this->pex->getIsApiTokenRequest();
     if ($this->user->check_pageobjects(array('events'), 'AND', false) || $isAPITokenRequest) {
         $arrEvents = $this->pdh->get('event', 'id_list');
         $out = array();
         foreach ($arrEvents as $eventid) {
             $out['event:' . $eventid] = array('id' => $eventid, 'name' => unsanitize($this->pdh->get('event', 'name', array($eventid))), 'value' => $this->pdh->get('event', 'value', array($eventid)), 'icon' => $this->env->link . $this->pdh->get('event', 'icon', array($eventid, true)));
             $arrMultidkpPools = $this->pdh->get('event', 'multidkppools', array($eventid));
             foreach ($arrMultidkpPools as $mdkp) {
                 $arrPools['multidkp_pool:' . $mdkp] = array('id' => $mdkp, 'name' => unsanitize($this->pdh->get('multidkp', 'name', array($mdkp))), 'desc' => unsanitize($this->pdh->get('multidkp', 'desc', array($mdkp))));
             }
             $out['event:' . $eventid]['multidkp_pools'] = $arrPools;
             $arrItempoolsForEvent = $this->pdh->get('event', 'itempools', array($eventid));
             foreach ($arrItempoolsForEvent as $itempoolid) {
                 $arrItempools['itempool:' . $itempoolid] = array('id' => $itempoolid, 'name' => unsanitize($this->pdh->get('itempool', 'name', array($itempoolid))), 'desc' => unsanitize($this->pdh->get('itempool', 'desc', array($itempoolid))));
             }
             $out['event:' . $eventid]['itempools'] = $arrItempools;
         }
         return $out;
     } else {
         return $this->pex->error('access denied');
     }
 }
Пример #9
0
 /**
  * Per game data for the calendar Tooltip
  */
 public function calendar_membertooltip($memberid)
 {
     $talents = $this->game->glang('talents');
     $member_data = $this->pdh->get('member', 'array', array($memberid));
     // itemlevel in tooltip
     $this->game->new_object('bnet_armory', 'armory', array($this->config->get('uc_server_loc'), $this->config->get('uc_data_lang')));
     $char_server = $this->pdh->get('member', 'profile_field', array($memberid, 'servername'));
     $servername = $char_server != '' ? $char_server : $this->config->get('servername');
     $chardata = $this->game->obj['armory']->character($member_data['name'], unsanitize($servername), true);
     $itemlevel = isset($chardata['items']['averageItemLevel']) ? $chardata['items']['averageItemLevel'] : '--';
     return array($this->game->glang('talents_tt_1') . ': ' . $this->pdh->geth('member', 'profile_field', array($memberid, 'talent1', true)), $this->game->glang('talents_tt_2') . ': ' . $this->pdh->geth('member', 'profile_field', array($memberid, 'talent2', true)), $this->game->glang('caltooltip_itemlvl') . ': ' . $itemlevel);
 }
Пример #10
0
 /**
  * getRealmData
  * Get the realm data for the specified realm
  *
  * @param  string  $realmname  Name of the realm
  *
  * @return array(type, queue, status, population, name, slug)
  */
 private function getRealmData($realmname)
 {
     // convert the realm name to the API specific handling
     $name = trim($realmname);
     $name = strtolower($name);
     $name = str_replace(array('\'', ' '), array('', '-'), $name);
     // get the cached (do not force) realm data for this realm
     $realmdata = $this->game->obj['armory']->realm(array(unsanitize($name)), false);
     // the data are returned as array with
     // 'realms' => array(array(type, queue, status, population, name, slug))
     // if array contains more than 1 realm, the realm is unknown and all realms are returned
     // by the API, so ignore them
     if (is_array($realmdata) && isset($realmdata['realms']) && is_array($realmdata['realms']) && count($realmdata['realms']) == 1) {
         // extract the realm data for this realm
         return $realmdata['realms'][0];
     }
     // return as unknown
     return array('type' => 'error', 'queue' => '', 'status' => -1, 'population' => 'error', 'name' => $realmname, 'slug' => $name);
 }
Пример #11
0
 public function get_latest_articles($params, $body)
 {
     $isAPITokenRequest = $this->pex->getIsApiTokenRequest();
     //Get Number; default: 10
     $intNumber = intval($params['get']['number']) > 0 ? intval($params['get']['number']) : 10;
     //Get sort direction; default: desc
     $sort = isset($params['get']['sort']) && $params['get']['sort'] == 'asc' ? 'asc' : 'desc';
     $intCategoryID = isset($params['get']['c']) ? intval($params['get']['c']) : 0;
     $user_id = $this->user->id;
     $response = array();
     //Get latest Articles for a specific category
     if ($intCategoryID) {
         $arrArticleIDs = $this->pdh->get('article_categories', 'published_id_list', array($intCategoryID, $user_id, true));
         $arrCategory = $this->pdh->get('article_categories', 'data', array($intCategoryID));
         switch ($arrCategory['sortation_type']) {
             case 4:
             case 3:
                 $arrSortedArticleIDs = $this->pdh->sort($arrArticleIDs, 'articles', 'last_edited', $sort);
                 break;
             case 2:
             case 1:
             default:
                 $arrSortedArticleIDs = $this->pdh->sort($arrArticleIDs, 'articles', 'date', $sort);
         }
     } else {
         //Get global latest articles
         $arrArticleCategoryIDs = $this->pdh->get('article_categories', 'id_list');
         $arrArticleIDs = array();
         foreach ($arrArticleCategoryIDs as $intCategoryID) {
             $arrArticleIDs = array_merge($arrArticleIDs, $this->pdh->get('article_categories', 'published_id_list', array($intCategoryID, $user_id, true)));
         }
         $arrSortedArticleIDs = $this->pdh->sort($arrArticleIDs, 'articles', 'date', $sort);
     }
     if (count($arrSortedArticleIDs)) {
         $arrSortedArticleIDs = $this->pdh->limit($arrSortedArticleIDs, 0, $intNumber);
         foreach ($arrSortedArticleIDs as $intArticleID) {
             $strText = $this->pdh->get('articles', 'text', array($intArticleID));
             $arrContent = preg_split('#<hr(.*)id="system-readmore"(.*)\\/>#iU', xhtml_entity_decode($strText));
             $strText = $this->bbcode->remove_embeddedMedia($this->bbcode->remove_shorttags($arrContent[0]));
             //Replace Image Gallery
             $arrGalleryObjects = array();
             preg_match_all('#<p(.*)class="system-gallery"(.*) data-sort="(.*)" data-folder="(.*)">(.*)</p>#iU', $strText, $arrGalleryObjects, PREG_PATTERN_ORDER);
             if (count($arrGalleryObjects[0])) {
                 include_once $this->root_path . 'core/gallery.class.php';
                 foreach ($arrGalleryObjects[4] as $key => $val) {
                     $strText = str_replace($arrGalleryObjects[0][$key], "", $strText);
                 }
             }
             //Replace Raidloot
             $arrRaidlootObjects = array();
             preg_match_all('#<p(.*)class="system-raidloot"(.*) data-id="(.*)"(.*) data-chars="(.*)">(.*)</p>#iU', $strText, $arrRaidlootObjects, PREG_PATTERN_ORDER);
             if (count($arrRaidlootObjects[0])) {
                 include_once $this->root_path . 'core/gallery.class.php';
                 foreach ($arrRaidlootObjects[3] as $key => $val) {
                     $strText = str_replace($arrRaidlootObjects[0][$key], "", $strText);
                 }
             }
             $category_id = $this->pdh->get('articles', 'category', array($intArticleID));
             $comments = $this->pdh->get('comment', 'filtered_list', array('articles', $intArticleID));
             $arrComments = array();
             if (is_array($comments)) {
                 foreach ($comments as $key => $row) {
                     $avatarimg = $this->pdh->get('user', 'avatarimglink', array($row['userid']));
                     $arrComments['comment:' . $key] = array('username' => unsanitize($row['username']), 'user_avatar' => $this->pfh->FileLink($avatarimg != "" ? $avatarimg : 'images/global/avatar-default.svg', false, 'absolute'), 'date' => $this->time->date('Y-m-d H:i', $row['date']), 'date_timestamp' => $row['date'], 'message' => $this->bbcode->toHTML($row['text']));
                 }
             }
             $arrCommentsOut = array('count' => count($arrComments), 'page' => 'articles', 'attachid' => $intArticleID, 'comments' => $arrComments);
             $arrTags = array();
             $arrArticleTags = $this->pdh->get('articles', 'tags', array($intArticleID));
             if (is_array($arrArticleTags) && count($arrArticleTags) && $arrArticleTags[0] != "") {
                 foreach ($arrArticleTags as $k => $strTag) {
                     $arrTags['tag:' . $k] = $strTag;
                 }
             }
             $response['entries']['entry:' . $intArticleID] = array('id' => $intArticleID, 'title' => unsanitize($this->pdh->get('articles', 'title', array($intArticleID))), 'text' => $strText, 'link' => $this->user->removeSIDfromString($this->env->link . $this->pdh->get('articles', 'path', array($intArticleID))), 'permalink' => $this->env->link . 'index.php?a=' . $intArticleID, 'date' => $this->time->date('Y-m-d H:i', $this->pdh->get('articles', 'date', array($intArticleID))), 'date_timestamp' => $this->pdh->get('articles', 'date', array($intArticleID)), 'author' => unsanitize($this->pdh->geth('articles', 'user_id', array($intArticleID))), 'category_id' => $category_id, 'category' => $this->pdh->get('article_categories', 'name', array($category_id)), 'category_url' => $this->user->removeSIDfromString($this->env->link . $this->pdh->get('article_categories', 'path', array($category_id))), 'tags' => $arrTags, 'comments' => $arrCommentsOut);
         }
     }
     return $response;
 }
Пример #12
0
function unsanitizeInput()
{
    unsanitize($_GET);
    unsanitize($_POST);
    //sanitize($_REQUEST);
}
Пример #13
0
    function CSVpointexport($raid_id, $raid_groups)
    {
        $presets = array(array('name' => 'earned', 'sort' => true, 'th_add' => '', 'td_add' => ''), array('name' => 'spent', 'sort' => true, 'th_add' => '', 'td_add' => ''), array('name' => 'adjustment', 'sort' => true, 'th_add' => '', 'td_add' => ''), array('name' => 'current', 'sort' => true, 'th_add' => '', 'td_add' => ''));
        $arrPresets = array();
        foreach ($presets as $preset) {
            $pre = registry::register('plus_datahandler')->pre_process_preset($preset['name'], $preset);
            if (empty($pre)) {
                continue;
            }
            $arrPresets[$pre[0]['name']] = $pre[0];
        }
        $attendees = registry::register('plus_datahandler')->get('calendar_raids_attendees', 'attendees', array($raid_id));
        $guests = registry::register('plus_datahandler')->get('calendar_raids_guests', 'members', array($raid_id));
        $mdkp = 1;
        //Change here the Multidkp Pool
        $a_json_d = array();
        $a_json_a = array();
        $arrPoints = $arrMember = array();
        foreach ($attendees as $id_attendees => $d_attendees) {
            $arrPoints[] = isset($arrPresets['current']) ? registry::register('plus_datahandler')->get($arrPresets['current'][0], $arrPresets['current'][1], $arrPresets['current'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $id_attendees, '%with_twink%' => intval(registry::register('config')->get('show_twinks')) ? 0 : 1)) : 0;
            $arrMember[] = array('id' => $id_attendees, 'name' => unsanitize(registry::register('plus_datahandler')->get('member', 'name', array($id_attendees))), 'status' => $d_attendees['signup_status'], 'guest' => false, 'group' => $d_attendees['raidgroup'], 'point' => isset($arrPresets['current']) ? registry::register('plus_datahandler')->get($arrPresets['current'][0], $arrPresets['current'][1], $arrPresets['current'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $id_attendees, '%with_twink%' => intval(registry::register('config')->get('show_twinks')) ? 0 : 1)) : 0);
        }
        array_multisort($arrPoints, SORT_NUMERIC, SORT_DESC, $arrMember);
        foreach ($arrMember as $arrData) {
            $a_json_d[] = array('name' => $arrData['name'], 'status' => $arrData['status'], 'guest' => $arrData['guest'], 'point' => $arrData['point'], 'group' => $arrData['group']);
        }
        array_multisort($arrPoints, SORT_NUMERIC, SORT_ASC, $arrMember);
        foreach ($arrMember as $arrData) {
            $a_json_a[] = array('name' => $arrData['name'], 'status' => $arrData['status'], 'guest' => $arrData['guest'], 'point' => $arrData['point'], 'group' => $arrData['group']);
        }
        foreach ($guests as $guestsdata) {
            $a_json_d[] = $a_json_a[] = array('name' => $guestsdata['name'], 'status' => false, 'guest' => true, 'point' => 0, 'group' => $guestsdata['raidgroup']);
        }
        $json_asc = json_encode($a_json_a);
        $json_desc = json_encode($a_json_d);
        unset($a_json);
        registry::register('template')->add_js('
			genOutput()
			$("input[type=\'checkbox\'], #ip_seperator, #dd_sorting, #raidgroup").change(function (){
				genOutput()
			});
		', "docready");
        registry::register('template')->add_js('
		function genOutput(){
			var json_asc		= ' . $json_asc . ';
			var json_desc		= ' . $json_desc . ';
			var attendee_data = ($("#dd_sorting").val() != "asc") ? json_asc : json_desc;
			var data = [];

			ip_seperator	= ($("#ip_seperator").val() != "") ? $("#ip_seperator").val() : ",";
			cb_guests		= ($("#cb_guests").attr("checked")) ? true : false;
			cb_confirmed	= ($("#cb_confirmed").attr("checked")) ? true : false;
			cb_signedin		= ($("#cb_signedin").attr("checked")) ? true : false;
			cb_backup		= ($("#cb_backup").attr("checked")) ? true : false;

			$.each(attendee_data, function(i, item) {
				if((cb_guests && item.guest == true) || (cb_confirmed && !item.guest && item.status == 0) || (cb_signedin && item.status == 1) || (cb_backup && item.status == 3)){
					console.log($("#raidgroup").val());
					if($("#raidgroup").val() == "0" || (item.group > 0 && item.group == $("#raidgroup").val())){
						data.push(item.name + " " + item.point);
					}
				}
			});
			$("#attendeeout").html(data.join(ip_seperator));
		}
			');
        $text = "<dt><label>" . registry::fetch('user')->lang('raidevent_export_seperator') . "</label></dt>\n\t\t\t\t\t\t<dd>\n\t\t\t\t\t\t\t<input type='text' name='seperator' id='ip_seperator' value=',' size='4' />\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</dl><dl>";
        $text .= "<dt><label>" . registry::fetch('user')->lang('raidevent_export_sorting') . "</label></dt>\n\t\t\t\t\t\t<dd>\n\t\t\t\t\t\t\t<select name='sorting' id='dd_sorting'>\n\t\t\t\t\t\t\t\t<option value='desc'>ASC</option>\n\t\t\t\t\t\t\t\t<option value='asc'>DESC</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</dl><dl>";
        $text .= "<dt><label>" . registry::fetch('user')->lang('raidevent_export_raidgroup') . "</label></dt>\n\t\t\t\t\t\t<dd>\n\t\t\t\t\t\t\t" . new hdropdown('raidgroup', array('options' => $raid_groups, 'value' => 0, 'id' => 'raidgroup')) . "\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</dl><dl>";
        $text .= "<input type='checkbox' checked='checked' name='confirmed' id='cb_confirmed' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 0));
        $text .= "<input type='checkbox' checked='checked' name='guests' id='cb_guests' value='true'> " . registry::fetch('user')->lang('raidevent_raid_guests');
        $text .= "<input type='checkbox' checked='checked' name='signedin' id='cb_signedin' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 1));
        $text .= "<input type='checkbox' name='backup' id='cb_backup' value='true'> " . registry::fetch('user')->lang(array('raidevent_raid_status', 3));
        $text .= ' | ' . registry::fetch('user')->lang('raidevent_export_sorting') . " ";
        $text .= "<br/>";
        $text .= "<textarea name='group" . rand() . "' id='attendeeout' cols='60' rows='10' onfocus='this.select()' readonly='readonly'>";
        $text .= "</textarea>";
        $text .= '<br/>' . registry::fetch('user')->lang('rp_copypaste_ig') . "</b>";
        return $text;
    }
Пример #14
0
 public function get_calevents_details($params, $body)
 {
     $isAPITokenRequest = $this->pex->getIsApiTokenRequest();
     if ($this->user->check_auth('po_calendarevent', false) || $isAPITokenRequest) {
         if (intval($params['get']['eventid']) > 0) {
             $event_id = intval($params['get']['eventid']);
             $eventdata = $this->pdh->get('calendar_events', 'data', array($event_id));
             $comments = $this->pdh->get('comment', 'filtered_list', array('viewcalraid', $event_id));
             if (is_array($comments)) {
                 foreach ($comments as $key => $row) {
                     $avatarimg = $this->pdh->get('user', 'avatarimglink', array($row['userid']));
                     $arrComments['comment:' . $key] = array('username' => $row['username'], 'user_avatar' => $this->pfh->FileLink($avatarimg != "" ? $avatarimg : 'images/global/avatar-default.svg', false, 'absolute'), 'date' => $this->time->date('Y-m-d H:i', $row['date']), 'date_timestamp' => $row['date'], 'message' => $this->bbcode->toHTML($row['text']));
                 }
             }
             $raidmode = (int) $this->pdh->get('calendar_events', 'calendartype', array($event_id)) == 1 ? true : false;
             if ($raidmode) {
                 // get the memners
                 $notsigned_filter = $this->config->get('calendar_raid_nsfilter');
                 $this->members = $this->pdh->maget('member', array('userid', 'name', 'classid'), 0, array($this->pdh->sort($this->pdh->get('member', 'id_list', array(in_array('inactive', $notsigned_filter) ? false : true, in_array('hidden', $notsigned_filter) ? false : true, in_array('special', $notsigned_filter) ? false : true, in_array('twinks', $notsigned_filter) ? false : true)), 'member', 'classname')));
                 // get all attendees
                 $this->attendees_raw = $this->pdh->get('calendar_raids_attendees', 'attendees', array($event_id));
                 $attendeeids = is_array($this->attendees_raw) ? array_keys($this->attendees_raw) : array();
                 $this->unsigned = $this->members;
                 foreach ($attendeeids as $mattid) {
                     $att_userid = $this->pdh->get('member', 'userid', array($mattid));
                     $filter_attuserids = $this->pdh->get('member', 'connection_id', array($att_userid));
                     if (is_array($filter_attuserids)) {
                         foreach ($filter_attuserids as $attmemid) {
                             if ($this->pdh->get('calendar_raids_attendees', 'status', array($event_id, $attmemid)) != 4) {
                                 unset($this->unsigned[$attmemid]);
                             }
                         }
                     }
                 }
                 // Guests / rest
                 $this->guests = $this->pdh->get('calendar_raids_guests', 'members', array($event_id));
                 $this->raidcategories = $eventdata['extension']['raidmode'] == 'role' ? $this->pdh->aget('roles', 'name', 0, array($this->pdh->get('roles', 'id_list'))) : $this->game->get_primary_classes(array('id_0'));
                 $this->mystatus = $this->pdh->get('calendar_raids_attendees', 'myattendees', array($event_id, $this->user->id));
                 // Build the attendees aray for this raid by class
                 if (is_array($this->attendees_raw)) {
                     $this->attendees = $this->attendees_count = array();
                     foreach ($this->attendees_raw as $attendeeid => $attendeedata) {
                         $attclassid = isset($eventdata['extension']['raidmode']) && $eventdata['extension']['raidmode'] == 'role' ? $attendeedata['member_role'] : $this->pdh->get('member', 'classid', array($attendeeid));
                         $role_class = $eventdata['extension']['raidmode'] == 'role' ? $attendeedata['member_role'] : $attclassid;
                         $this->attendees[$attendeedata['signup_status']][$role_class][$attendeeid] = $attendeedata;
                         $this->attendees_count[$attendeedata['signup_status']][$attendeeid] = true;
                     }
                 } else {
                     $this->attendees = array();
                 }
                 //The Status & Member data
                 $raidcal_status = $this->config->get('calendar_raid_status');
                 $this->raidstatus_full = $this->raidstatus = array();
                 if (is_array($raidcal_status)) {
                     foreach ($raidcal_status as $raidcalstat_id) {
                         if ($raidcalstat_id != 4) {
                             // do not use the not signed members
                             $this->raidstatus[$raidcalstat_id] = $this->user->lang(array('raidevent_raid_status', $raidcalstat_id));
                         }
                         $this->raidstatus_full[$raidcalstat_id] = $this->user->lang(array('raidevent_raid_status', $raidcalstat_id));
                     }
                 }
                 $arrStatus = array();
                 foreach ($this->raidstatus as $statuskey => $statusname) {
                     $arrClasses = array();
                     foreach ($this->raidcategories as $classid => $classname) {
                         // The characters
                         $arrChars = array();
                         if (isset($this->attendees[$statuskey][$classid]) && is_array($this->attendees[$statuskey][$classid])) {
                             foreach ($this->attendees[$statuskey][$classid] as $memberid => $memberdata) {
                                 //$shownotes_ugroups = $this->acl->get_groups_with_active_auth('u_calendar_raidnotes');
                                 $arrChars['char:' . $memberid] = array('id' => $memberid, 'name' => unsanitize($this->pdh->get('member', 'name', array($memberid))), 'classid' => $this->pdh->get('member', 'classid', array($memberid)), 'signedbyadmin' => $memberdata['signedbyadmin'] ? 1 : 0, 'note' => trim($memberdata['note']) && $this->user->check_group($shownotes_ugroups, false, $this->user->id) ? $memberdata['note'] : '', 'rank' => $this->pdh->get('member', 'rankname', array($memberid)));
                             }
                         }
                         $arrClasses["category" . $classid] = array('id' => $classid, 'name' => $classname, 'color' => $eventdata['extension']['raidmode'] != 'role' ? $this->game->get_class_color($classid) : '', 'count' => isset($this->attendees[$statuskey][$classid]) ? count($this->attendees[$statuskey][$classid]) : 0, 'maxcount' => $eventdata['extension']['raidmode'] == 'none' && $eventdata['extension']['distribution'][$classid] == 0 ? '' : $eventdata['extension']['distribution'][$classid], 'chars' => $arrChars);
                     }
                     $arrStatus['status' . $statuskey] = array('id' => $statuskey, 'name' => $statusname, 'count' => isset($this->attendees_count[$statuskey]) ? count($this->attendees_count[$statuskey]) : 0, 'maxcount' => $eventdata['extension']['attendee_count'], 'categories' => $arrClasses);
                 }
                 // raid guests
                 if (is_array($this->guests) && count($this->guests) > 0) {
                     foreach ($this->guests as $guestid => $guestsdata) {
                         $arrGuests['guest:' . $guestid] = array('id' => $guestid, 'name' => unsanitize($guestsdata['name']), 'classid' => $guestsdata['class'], 'class' => $this->game->get_name('primary', $guestsdata['class']));
                     }
                 }
                 //UserChars
                 $user_chars = $this->pdh->aget('member', 'name', 0, array($this->pdh->get('member', 'connection_id', array($this->user->id))));
                 $mainchar = $this->pdh->get('user', 'mainchar', array($this->user->id));
                 $arrRoles = array();
                 if (is_array($user_chars)) {
                     foreach ($user_chars as $key => $charname) {
                         $roles = $this->pdh->get('roles', 'memberroles', array($this->pdh->get('member', 'classid', array($key))));
                         if (is_array($roles)) {
                             $arrRoles = array();
                             foreach ($roles as $roleid => $rolename) {
                                 $arrRoles['role:' . $roleid] = array('id' => $roleid, 'name' => $rolename, 'signed_in' => $this->mystatus['member_role'] == $roleid ? 1 : 0);
                             }
                         }
                         $arrUserChars['char:' . $key] = array('id' => $key, 'name' => unsanitize($charname), 'signed_in' => $this->mystatus['member_id'] == $key ? 1 : 0, 'main' => $key == $mainchar ? 1 : 0, 'class' => $this->pdh->get('member', 'classid', array($key)), 'roles' => $arrRoles, 'raidgroup' => $this->pdh->get('calendar_raids_attendees', 'raidgroup', array($event_id, $key)));
                     }
                 }
                 $userstatus['status'] = !strlen($this->mystatus['signup_status']) ? -1 : $this->mystatus['signup_status'];
                 $userstatus['status_name'] = $this->mystatus['signup_status'] >= 0 ? $this->raidstatus[$this->mystatus['signup_status']] : '';
                 if ($userstatus['status'] > -1) {
                     $userstatus['char_id'] = $this->mystatus['member_id'];
                     $userstatus['char_class'] = $this->pdh->get('member', 'classid', array($this->mystatus['member_id']));
                     $userstatus['char_name'] = $this->pdh->get('member', 'name', array($this->mystatus['member_id']));
                     $userstatus['raidgroup'] = $this->pdh->get('calendar_raids_attendees', 'raidgroup', array($event_id, $this->mystatus['member_id']));
                     if ($this->mystatus['member_role'] > 0) {
                         $userstatus['char_roleid'] = $this->mystatus['member_role'];
                     }
                     if ($this->mystatus['member_role'] > 0) {
                         $userstatus['char_role'] = $this->pdh->get('roles', 'name', array($this->mystatus['member_role']));
                     }
                 }
                 $arrCommentsOut = array('count' => count($arrComments), 'page' => 'viewcalraid', 'attachid' => $event_id, 'comments' => $arrComments);
                 $arrRaidgroups = array();
                 foreach ($this->pdh->aget('raid_groups', 'name', false, array($this->pdh->get('raid_groups', 'id_list'))) as $raidgroupid => $raidgroupname) {
                     $arrRaidgroups['raidgroup:' . $raidgroupid] = array('id' => $raidgroupid, 'name' => $raidgroupname, 'default' => $this->pdh->get('raid_groups', 'standard', array($raidgroupid)) ? 1 : 0, 'color' => $this->pdh->get('raid_groups', 'color', array($raidgroupid)));
                 }
                 $out = array('type' => $raidmode == 'raid' ? 'raid' : 'event', 'categories' => $eventdata['extension']['raidmode'] == 'role' ? 'roles' : 'classes', 'title' => unsanitize($this->pdh->get('calendar_events', 'name', array($event_id))), 'start' => $this->time->date('Y-m-d H:i', $this->pdh->get('calendar_events', 'time_start', array($event_id))), 'start_timestamp' => $this->pdh->get('calendar_events', 'time_start', array($event_id)), 'end' => $this->time->date('Y-m-d H:i', $this->pdh->get('calendar_events', 'time_end', array($event_id))), 'end_timestamp' => $this->pdh->get('calendar_events', 'time_end', array($event_id)), 'deadline' => $this->time->date('Y-m-d H:i', $eventdata['timestamp_start'] - $eventdata['extension']['deadlinedate'] * 3600), 'deadline_timestamp' => $eventdata['timestamp_start'] - $eventdata['extension']['deadlinedate'] * 3600, 'allDay' => $this->pdh->get('calendar_events', 'allday', array($event_id)) > 0 ? 1 : 0, 'closed' => $this->pdh->get('calendar_events', 'raidstatus', array($event_id)) == 1 ? 1 : 0, 'icon' => $eventdata['extension']['raid_eventid'] ? $this->pdh->get('event', 'icon', array($eventdata['extension']['raid_eventid'], true)) : '', 'note' => unsanitize($this->bbcode->remove_bbcode($this->pdh->get('calendar_events', 'notes', array($event_id, true)))), 'raidleader' => unsanitize($eventdata['extension']['raidleader'] > 0 ? implode(', ', $this->pdh->aget('member', 'name', 0, array($eventdata['extension']['raidleader']))) : ''), 'raidstatus' => $arrStatus, 'user_status' => $userstatus, 'user_chars' => $arrUserChars, 'comments' => $arrCommentsOut, 'calendar' => $eventdata['calendar_id'], 'calendar_name' => $this->pdh->get('calendar_events', 'calendar', array($event_id)), 'raidgroups' => $arrRaidgroups);
             } else {
                 $out = array('type' => $raidmode == 'raid' ? 'raid' : 'event', 'title' => unsanitize($this->pdh->get('calendar_events', 'name', array($event_id))), 'start' => $this->time->date('Y-m-d H:i', $this->pdh->get('calendar_events', 'time_start', array($event_id))), 'start_timestamp' => $this->pdh->get('calendar_events', 'time_start', array($event_id)), 'end' => $this->time->date('Y-m-d H:i', $this->pdh->get('calendar_events', 'time_end', array($event_id))), 'end_timestamp' => $this->pdh->get('calendar_events', 'time_end', array($event_id)), 'allDay' => $this->pdh->get('calendar_events', 'allday', array($event_id)) > 0 ? 1 : 0, 'note' => unsanitize($this->bbcode->remove_bbcode($this->pdh->get('calendar_events', 'notes', array($event_id, true)))), 'calendar' => $eventdata['calendar_id'], 'calendar_name' => $this->pdh->get('calendar_events', 'calendar', array($event_id)));
             }
             return $out;
         } else {
             return $this->pex->error('no event_id given');
         }
     } else {
         return $this->pex->error('access denied');
     }
 }
Пример #15
0
                 if ($v_charfeed['accountWide']) {
                     $class = 'accountwide';
                 }
                 $cnf_output = $v_charfeed['hero'] ? sprintf($this->game->glang('charnf_achievement_hero'), '<a href="' . $bnetLink . '" class="' . $class . '">' . $v_charfeed['title'] . '</a>') : sprintf($this->game->glang('charnf_achievement'), '<a href="' . $bnetLink . '" class="' . $class . '">' . $v_charfeed['title'] . '</a>', $v_charfeed['points']);
                 break;
             case 'bosskill':
                 $cnf_output = sprintf($this->game->glang('charnf_bosskill'), $v_charfeed['quantity'], $v_charfeed['title']);
                 break;
             case 'criteria':
                 $achievCat = $this->game->obj['armory']->getCategoryForAchievement((int) $v_charfeed['achievementID'], $arrCharacterAchievements);
                 $bnetLink = $this->game->obj['armory']->bnlink($chardata['name'], unsanitize($this->config->get('servername')), 'achievements', unsanitize($this->config->get('guildtag'))) . '#' . $achievCat . ':a' . $v_charfeed['achievementID'];
                 $cnf_output = sprintf($this->game->glang('charnf_criteria'), '<b>' . $v_charfeed['criteria'] . '</b>', '<a href="' . $bnetLink . '">' . $v_charfeed['title'] . '</a>');
                 break;
             case 'item':
                 $itemData = $this->game->obj['armory']->item($v_charfeed['itemid']);
                 $item = infotooltip($itemData['name'], $v_charfeed['itemid'], false, false, false, true, array(unsanitize($this->config->get('servername')), $chardata['name']));
                 $cnf_output = sprintf($this->game->glang('charnf_item'), $item);
                 $v_charfeed['icon'] = 'http://eu.media.blizzard.com/wow/icons/18/' . $itemData['icon'] . '.jpg';
                 break;
         }
         $this->tpl->assign_block_vars('charfeed', array('TEXT' => $cnf_output, 'ICON' => $v_charfeed['icon'], 'DATE' => $this->time->nice_date($v_charfeed['timestamp'], 60 * 60 * 24 * 7)));
     }
 }
 // item icons
 foreach ($items as $items_pos => $v_items) {
     foreach ($v_items as $slots) {
         $this->tpl->assign_block_vars('itemicons_' . $items_pos, array('SLOTS' => $slots));
     }
 }
 $this->tpl->assign_array('itemlevel', $items['itemlevel']);
 // boss progress
Пример #16
0
 /**
  * Append Servername to Charname
  * 
  * {@inheritDoc}
  * @see game_generic::handle_export_charnames()
  */
 public function handle_export_charnames($strCharname, $intCharID)
 {
     $char_server = $this->pdh->get('member', 'profile_field', array($intCharID, 'servername'));
     $servername = $char_server != '' ? $char_server : $this->config->get('servername');
     return $strCharname . ($servername != "" ? '-' . unsanitize($servername) : '');
 }
Пример #17
0
<?php

define('EQDKP_INC', true);
define('IN_ADMIN', true);
$eqdkp_root_path = './../../../../../';
include_once $eqdkp_root_path . 'common.php';
$pfh = register('file_handler');
$puf = register('urlfetcher');
$user = register('user');
if ($user->is_signedin()) {
    $pdh = register('pdh');
    $outArray = array();
    $members = $pdh->aget('member', 'name', 0, array($pdh->sort($pdh->get('member', 'id_list', array(false, true, false)), 'member', 'name', 'asc')));
    foreach ($members as $key => $value) {
        $outArray[] = array('id' => $key, 'name' => unsanitize($value));
    }
    echo json_encode(array('status' => 'ok', 'chars' => $outArray));
    die;
}
echo json_encode(array('status' => 'error', 'chars' => array()));
die;
Пример #18
0
function moveFile()
{
    global $MY_ALLOW_MOVE, $MY_MESSAGES, $MY_DOCUMENT_ROOT, $MY_PATH, $refresh_dirs;
    global $MY_ALLOW_EXTENSIONS, $MY_DENY_EXTENSIONS;
    $error = false;
    if (!$MY_ALLOW_MOVE) {
        return _filemanager_nopermtomove;
    }
    $newPath = pathSlashes(checkName($_REQUEST['newpath']));
    if (!is_dir($MY_DOCUMENT_ROOT . $newPath)) {
        return _filemanager_pathnotfound;
    }
    if (isset($_REQUEST['folders']) && is_array($_REQUEST['folders'])) {
        foreach ($_REQUEST['folders'] as $file) {
            $name = checkName(unsanitize($file));
            $oldFile = $MY_DOCUMENT_ROOT . $MY_PATH . $name;
            $newFile = $MY_DOCUMENT_ROOT . $newPath . $name;
            if (is_dir($oldFile)) {
                if (is_dir($newFile)) {
                    $error = $error . '\\n' . alertSanitize(_filemanager_folderalreadyexists . ' (' . $oldFile . ' -> ' . $newFile . ')');
                } else {
                    if (!rename($oldFile, $newFile)) {
                        $error = $error . '\\n' . alertSanitize(_filemanager_renamefailed . ' (' . $oldFile . ' -> ' . $newFile . ')');
                    }
                }
            } else {
                $error = $error . '\\n' . alertSanitize(_filemanager_foldernotfound . ' (' . $oldFile . ')');
            }
        }
    }
    if (isset($_REQUEST['files']) && is_array($_REQUEST['files'])) {
        foreach ($_REQUEST['files'] as $file) {
            $name = checkName(unsanitize($file));
            $oldFile = $MY_DOCUMENT_ROOT . $MY_PATH . $name;
            $newFile = $MY_DOCUMENT_ROOT . $newPath . $name;
            if (is_file($oldFile)) {
                if (is_file($newFile)) {
                    $error = $error . '\\n' . alertSanitize(_filemanager_filealreadyexists . ' (' . $oldFile . ' -> ' . $newFile . ')');
                } else {
                    if (!rename($oldFile, $newFile)) {
                        $error = $error . '\\n' . alertSanitize(_filemanager_renamefailed . ' (' . $oldFile . ' -> ' . $newFile . ')');
                    }
                }
            } else {
                $error = $error . '\\n' . alertSanitize(_filemanager_filenotfound . ' (' . $oldFile . ')');
            }
        }
    }
    $refresh_dirs = true;
    return $error;
}
Пример #19
0
 public function get_data($params, $body)
 {
     $out['eqdkp'] = array('name' => unsanitize($this->config->get('guildtag')), 'guild' => unsanitize($this->config->get('guildtag')), 'dkp_name' => $this->config->get('dkp_name'), 'forum_url' => $this->config->get('cmsbridge_url'), 'language' => $this->config->get('default_lang'));
     $out['game'] = array('name' => $this->config->get('default_game'), 'version' => $this->config->get('game_version'), 'language' => $this->config->get('game_language'), 'server_name' => unsanitize($this->config->get('servername')), 'server_loc' => $this->config->get('uc_server_loc'));
     return $out;
 }
Пример #20
0
    /**
     * Get CMS Userdata of a CMS User.
     * Requires working Bridge Connection.
     * 
     * @param string $name
     * @return mixed
     */
    public function get_userdata($name)
    {
        if (!$this->status || !$this->objBridge) {
            return false;
        }
        $name = unsanitize($name);
        //Clean Username if neccessary
        if (method_exists($this->objBridge, 'convert_username')) {
            $strCleanUsername = $this->objBridge->convert_username($name);
        } else {
            $strCleanUsername = utf8_strtolower($name);
        }
        if ($this->check_query('user')) {
            $strQuery = str_replace("_USERNAME_", "?", $this->check_query('user'));
        } else {
            //Check if there's a user table
            $arrTables = $this->bridgedb->listTables();
            if (!in_array($this->prefix . $this->objBridge->data['user']['table'], $arrTables)) {
                $this->deactivate_bridge();
                return false;
            }
            $salt = $this->objBridge->data['user']['salt'] != '' ? ', ' . $this->objBridge->data['user']['salt'] . ' as salt ' : '';
            $strQuery = "SELECT *, " . $this->objBridge->data['user']['id'] . ' as id, ' . $this->objBridge->data['user']['name'] . ' as name, ' . $this->objBridge->data['user']['password'] . ' as password, ' . $this->objBridge->data['user']['email'] . ' as email' . $salt . '
						FROM ' . $this->prefix . $this->objBridge->data['user']['table'] . ' 
						WHERE LOWER(' . $this->objBridge->data['user']['where'] . ") = ?";
        }
        $objQuery = $this->bridgedb->prepare($strQuery)->execute($strCleanUsername);
        if ($objQuery) {
            $arrResult = $objQuery->fetchAssoc();
            if ($salt == '') {
                $arrResult['salt'] = '';
            }
            return $arrResult;
        }
        return false;
    }
Пример #21
0
    public function perform_step1()
    {
        if ($this->in->get('guildname', '') == '') {
            return '<div class="infobox infobox-large infobox-red clearfix"><i class="fa fa-exclamation-triangle fa-4x pull-left"></i> <span id="error_message_txt>' . $this->game->glang('uc_imp_noguildname') . '</span></div>';
        }
        // generate output
        $guilddata = $this->game->obj['armory']->guild(unsanitize($this->in->get('guildname', '')), unsanitize($this->in->get('servername', $this->config->get('servername'))), true);
        if ($guilddata && !isset($guilddata['status'])) {
            //Suspend all Chars
            if ($this->in->get('delete_old_chars', 0)) {
                $this->pdh->put('member', 'suspend', array('all'));
            }
            $hmtlout = '<div id="guildimport_dataset">
							<div id="controlbox">
								<fieldset class="settings">
									<dl>
										' . $this->game->glang('uc_gimp_loading') . '
									</dl>
									<div id="progressbar"></div>
									</dl>
								</fieldset>
							</div>
							<fieldset class="settings data">
							</fieldset>
						</div>';
            $jsondata = array();
            foreach ($guilddata['members'] as $guildchars) {
                // filter: class
                if ($this->in->get('filter_class', 0) > 0 && $this->game->obj['armory']->ConvertID($guildchars['character']['class'], 'int', 'classes') != $this->in->get('filter_class', 0)) {
                    continue;
                }
                // filter: level
                if ($this->in->get('filter_level', 0) > 0 && $guildchars['character']['level'] < $this->in->get('filter_level', 0)) {
                    continue;
                }
                // filter: rank
                if ($this->in->get('filter_rank', 0) > 0 && ($this->in->get('rank_sort', 0) == 2 && $guildchars['rank'] != $this->in->get('filter_rank', 0) || $this->in->get('rank_sort', 0) == 1 && $guildchars['rank'] >= $this->in->get('filter_rank', 0))) {
                    continue;
                }
                // Build the array
                $jsondata[] = array('thumbnail' => $guildchars['character']['thumbnail'], 'name' => $guildchars['character']['name'], 'class' => $guildchars['character']['class'], 'race' => $guildchars['character']['race'], 'level' => $guildchars['character']['level'], 'gender' => $guildchars['character']['gender'], 'rank' => $guildchars['rank'], 'servername' => $guildchars['character']['realm'], 'guild' => $guildchars['character']['guild']);
            }
            $this->tpl->add_js('
				$( "#progressbar" ).progressbar({
					value: 0
				});
				getData();', 'docready');
            $this->tpl->add_js('
			var guilddataArry = $.parseJSON(\'' . json_encode($jsondata, JSON_HEX_APOS) . '\');
			function getData(i){
				if (!i)
					i=0;
	
				if (guilddataArry.length >= i){
					$.post("guildimporter.php' . $this->SID . '&del=' . ($this->in->get('delete_old_chars', 0) ? 'true' : 'false') . '&sync_rank=' . ($this->in->get('sync_ranks', 0) ? 'true' : 'false') . '&step=2&totalcount="+guilddataArry.length+"&actcount="+i, guilddataArry[i], function(data){
						guilddata = $.parseJSON(data);
						if(guilddata.success == "available"){
							successdata = "<span style=\\"color:orange;\\">' . $this->game->glang('uc_armory_impduplex') . '</span>";
						}else if(guilddata.success == "imported"){
							successdata = "<span style=\\"color:green;\\">' . $this->game->glang('uc_armory_imported') . '</span>";
						}else{
							successdata = "<span style=\\"color:red;\\">' . $this->game->glang('uc_armory_impfailed') . '</span>";
						}
						$("#guildimport_dataset fieldset.data").prepend("<dl><dt><label><img src=\\""+ guilddata.image +"\\" alt=\\"charicon\\" height=\\"84\\" width=\\"84\\" /></label></dt><dd>"+ guilddata.name+"<br/>"+ successdata +"</dd></dl>").children(":first").hide().fadeIn("slow");
						$("#progressbar").progressbar({ value: ((i/guilddataArry.length)*100) })
						if(guilddataArry.length > i+1){
							getData(i+1);
						}else{
							$("#controlbox").html("<dl><div class=\\"infobox infobox-large infobox-green clearfix\\"><i class=\\"fa fa-check fa-4x pull-left\\"></i> ' . $this->game->glang('uc_gimp_header_fnsh') . '</div></dl>").fadeIn("slow");
							return;
						}
					});
				}
			}');
        } else {
            $hmtlout .= '<div class="infobox infobox-large infobox-red clearfix"><i class="fa fa-exclamation-triangle fa-4x pull-left"></i> <span id="error_message_txt">' . $guilddata['reason'] . '</span></div>';
        }
        return $hmtlout;
    }
Пример #22
0
 /**
  * Fetch character information
  * 
  * @param $user		Character Name
  * @param $realm		Realm Name
  * @param $force		Force the cache to update?
  * @return bol
  */
 public function character($user, $realm, $force = false)
 {
     $user = rawurlencode(unsanitize($user));
     $realm = rawurlencode(unsanitize($realm));
     $url = $this->apiurl . 'character/?name.first=' . $user . '&locationdata.world=' . $realm . '&c:resolve=factions(name),appearanceslots(displayname,iconid),equipmentslots(displayname,iconid),achievements(name),statistics';
     $json = $this->get_CachedData('chardata_' . $user . $realm, $force);
     if (!$json && $this->chardataUpdates < $this->_config['maxChardataUpdates']) {
         $json = $this->read_url($url);
         $this->set_CachedData($json, 'chardata_' . $user . $realm);
     }
     $chardata = json_decode($json, true);
     $errorchk = $this->CheckIfError($chardata);
     return !$errorchk ? $chardata : $errorchk;
 }
 private function buildURL($strType = '')
 {
     $url = 'http://www.wowprogress.com/';
     $search = array('+', "'", ' ');
     $server = urlencode(strtolower(str_replace($search, '-', unsanitize($this->config->get('servername')))));
     $guild = str_replace($search, '+', urlencode(utf8_strtolower(unsanitize($this->config->get('guildtag')))));
     $locate = $this->config->get('uc_server_loc');
     $region = $this->config('banner');
     switch ($strType) {
         case 'vertical':
             $url .= 'guild_img/' . $this->config('guild_id') . '/out/type.site/guild_rank.' . $region;
             break;
         case 'horizontal':
             $url .= 'guild_img/' . $this->config('guild_id') . '/out/type.forum/guild_rank.' . $region . '/ach_rank.' . $region;
             break;
         case 'guild':
             $url .= 'guild/' . $locate . '/' . $server . '/' . $guild . '/';
             break;
         default:
             $url .= 'guild/' . $locate . '/' . $server . '/' . $guild . '/' . 'rating.' . $strType . '/json_rank';
             break;
     }
     return $url;
 }
 public function parse($strLog, $intEventID, $intItempoolID)
 {
     if ($objLog = json_decode($strLog)) {
         $strTime = $this->time->date("Y-m-d H:i", intval($objLog->timestamp));
         $intTime = intval($objLog->timestamp);
         $arrRaidList = $this->pdh->get('raid', 'raididsindateinterval', array($intTime, 9999999999.0));
         foreach ($arrRaidList as $raidid) {
             $strNote = $this->pdh->get('raid', 'note', array($raidid));
             if (strpos($strNote, "EPGP-Snapshot") === 0) {
                 return false;
             }
         }
         //Build itemList
         $blnRaidItemList = false;
         $arrItemMembernameServernameList = array();
         $arrItemMemberList = array();
         $arrItemList = array();
         //$objLootItem: 0:timestamp, 1:Charname, 2:item:113834:0:0:0:0:0:0:0:100:0:3:0
         foreach ($objLog->loot as $objLootItem) {
             //Try to check if item was imported, but how? When editing the raid, the item date will be the one from the raid
             //Get all raids between first item and now, and try to find the item with same name, value and buyer
             if ($blnRaidItemList === false) {
                 $intTmpTime = (int) $objLootItem[0];
                 $arrRaidList = $this->pdh->get('raid', 'raididsindateinterval', array($intTmpTime, 9999999999.0));
                 foreach ($arrRaidList as $raidid) {
                     $arrRaidItems = $this->pdh->get('item', 'itemsofraid', array($raidid));
                     foreach ($arrRaidItems as $itemid) {
                         $intBuyerID = $this->pdh->get('item', 'buyer', array($itemid));
                         $char_server = $this->pdh->get('member', 'profile_field', array($intBuyerID, 'servername'));
                         $servername = $char_server != '' ? $char_server : $this->config->get('servername');
                         $strBuyerName = $this->pdh->get('item', 'buyer_name', array($itemid)) . '-' . unsanitize($servername);
                         $arrItemMembernameServernameList[$strBuyerName][] = array('gameid' => $this->pdh->get('item', 'game_itemid', array($itemid)), 'value' => (double) $this->pdh->get('item', 'value', array($itemid)));
                     }
                 }
                 $blnRaidItemList = true;
             }
             $strBuyerName = $objLootItem[1];
             if (strpos($strBuyerName, '-') === false) {
                 $strBuyerName = $strBuyerName . '-' . unsanitize($this->config->get('servername'));
             }
             $strGameID = is_numeric((string) $objLootItem[2]) ? intval($objLootItem[2]) : str_replace('item:', '', (string) $objLootItem[2]);
             $floatValue = (double) $objLootItem[3];
             if (isset($arrItemMembernameServernameList[$strBuyerName])) {
                 $blnNotThere = true;
                 foreach ($arrItemMembernameServernameList[$strBuyerName] as $value) {
                     if ($strGameID == $value['gameid'] && $floatValue == $value['value']) {
                         $blnNotThere = false;
                         break;
                     }
                 }
                 if ($blnNotThere) {
                     $arrItemList[] = array('gameid' => $strGameID, 'value' => $floatValue, 'buyer' => $strBuyerName);
                     $arrItemMemberList[$strBuyerName] += $floatValue;
                 }
             } else {
                 $arrItemList[] = array('gameid' => $strGameID, 'value' => $floatValue, 'buyer' => $strBuyerName);
                 $arrItemMemberList[$strBuyerName] += $floatValue;
             }
         }
         //The members
         $arrMember = array();
         $arrAdjustment = array();
         foreach ($objLog->roster as $objRosterItem) {
             $arrMembername = explode("-", $objRosterItem[0]);
             //TODO: servername
             $strMembername = trim($arrMembername[0]);
             $strServername = isset($arrMembername[1]) && strlen($arrMembername[1]) ? trim($arrMembername[1]) : $this->config->get('servername');
             $strFullMembername = $strMembername . '-' . $strServername;
             $floatEP = (double) $objRosterItem[1];
             $floatGP = (double) $objRosterItem[2];
             //Get MemberID, if none, create member
             $intMemberID = $this->pdh->get('member', 'id', array($strMembername, array('servername' => $strServername)));
             if (!$intMemberID) {
                 //create new Member
                 $data = array('name' => $strMembername, 'lvl' => 0, 'raceid' => 0, 'classid' => 0, 'rankid' => $this->pdh->get('rank', 'default', array()), 'servername' => $strServername);
                 $intMemberID = $this->pdh->put('member', 'addorupdate_member', array(0, $data));
                 $this->pdh->process_hook_queue();
                 $floatCurrentEP = 0;
                 $floatCurrentGP = 0;
             } else {
                 $arrMDKPools = $this->pdh->get('event', 'multidkppools', array($intEventID));
                 $intMultidkpID = $arrMDKPools[0];
                 $floatCurrentEP = $this->pdh->get('epgp', 'ep', array($intMemberID, $intMultidkpID, false, false));
                 $floatCurrentGP = $this->pdh->get('epgp', 'gp', array($intMemberID, $intMultidkpID, false, false));
             }
             $floatAdjustement = $floatEP - $floatCurrentEP;
             if ($floatAdjustement != 0) {
                 //create adjustment
                 $arrAdjustment[] = array('value' => $floatAdjustement, 'member' => $intMemberID, 'reason' => 'EP, Snapshot ' . $strTime);
             }
             $floatGPItem = $floatGP - $floatCurrentGP - (isset($arrItemMemberList[$strFullMembername]) ? $arrItemMemberList[$strFullMembername] : 0);
             //create dummy GP Item
             $arrItem[] = array('value' => (double) $floatGPItem, 'name' => 'GP, Snapshot ' . $strTime, 'gameid' => 0, 'member' => $intMemberID);
             $arrMember[] = $intMemberID;
         }
         //Create raid with value 0
         $raid_upd = $this->pdh->put('raid', 'add_raid', array($intTime, $arrMember, $intEventID, 'EPGP-Snapshot ' . $strTime, 0));
         if ($raid_upd) {
             //Add Adjustments
             foreach ($arrAdjustment as $adj) {
                 if ($adj['value'] == 0) {
                     continue;
                 }
                 $adj_upd[] = $this->pdh->put('adjustment', 'add_adjustment', array($adj['value'], $adj['reason'], $adj['member'], $intEventID, $raid_upd, $intTime));
             }
             $itempoolid = 1;
             foreach ($arrItem as $item) {
                 if ($item['value'] == 0) {
                     continue;
                 }
                 $item_upd[] = $this->pdh->put('item', 'add_item', array($item['name'], $item['member'], $raid_upd, $item['gameid'], $item['value'], $intItempoolID, $intTime));
             }
             //Add Items
             foreach ($arrItemList as $item) {
                 if ($item['value'] == 0) {
                     continue;
                 }
                 $arrMembername = explode("-", $item['buyer']);
                 $strBuyerName = trim($arrMembername[0]);
                 $strBuyerServername = isset($arrMembername[1]) && strlen($arrMembername[1]) ? trim($arrMembername[1]) : $this->config->get('servername');
                 $intMemberID = $this->pdh->get('member', 'id', array($strBuyerName, array('servername' => $strBuyerServername)));
                 if ($intMemberID) {
                     $item_upd[] = $this->pdh->put('item', 'add_item', array('', $intMemberID, $raid_upd, $item['gameid'], $item['value'], $intItempoolID, $intTime));
                 } else {
                 }
             }
             $this->pdh->process_hook_queue();
             return $raid_upd;
         }
     }
     return false;
 }
Пример #25
0
 public function process_data()
 {
     //Latest Articles
     $arrArticles = $this->pdh->get('articles', 'id_list', array());
     $arrArticles = $this->pdh->limit($arrArticles, 0, 25);
     $arrArticles = $this->pdh->sort($arrArticles, 'articles', 'date', 'desc');
     foreach ($arrArticles as $intArticleID) {
         $strText = $this->pdh->get('articles', 'text', array($intArticleID));
         $arrContent = preg_split('#<hr(.*)id="system-readmore"(.*)\\/>#iU', xhtml_entity_decode($strText));
         $strText = $this->bbcode->remove_embeddedMedia($this->bbcode->remove_shorttags($arrContent[0]));
         //Replace Image Gallery
         $arrGalleryObjects = array();
         preg_match_all('#<p(.*)class="system-gallery"(.*) data-sort="(.*)" data-folder="(.*)">(.*)</p>#iU', $strText, $arrGalleryObjects, PREG_PATTERN_ORDER);
         if (count($arrGalleryObjects[0])) {
             include_once $this->root_path . 'core/gallery.class.php';
             foreach ($arrGalleryObjects[4] as $key => $val) {
                 $strText = str_replace($arrGalleryObjects[0][$key], "", $strText);
             }
         }
         //Replace Raidloot
         $arrRaidlootObjects = array();
         preg_match_all('#<p(.*)class="system-raidloot"(.*) data-id="(.*)"(.*) data-chars="(.*)">(.*)</p>#iU', $strText, $arrRaidlootObjects, PREG_PATTERN_ORDER);
         if (count($arrRaidlootObjects[0])) {
             include_once $this->root_path . 'core/gallery.class.php';
             foreach ($arrRaidlootObjects[3] as $key => $val) {
                 $strText = str_replace($arrRaidlootObjects[0][$key], "", $strText);
             }
         }
         $arrNewsList[] = array('date' => $this->pdh->get('articles', 'html_date', array($intArticleID)), 'headline' => $this->pdh->get('articles', 'title', array($intArticleID)), 'content' => '<b><u><a href="' . $this->user->removeSIDfromString($this->env->link . $this->pdh->get('articles', 'path', array($intArticleID))) . '">' . unsanitize($this->pdh->get('articles', 'title', array($intArticleID))) . '</a></u></b><br /> ' . $strText);
     }
     //Next Events List
     $arrRaidIDlist = $this->pdh->get('calendar_events', 'id_list', array(false, $this->time->time));
     $arrRaidIDlist = $this->pdh->sort($arrRaidIDlist, 'calendar_events', 'date', 'asc');
     if (is_array($arrRaidIDlist)) {
         $arrRaidIDlist = array_slice($arrRaidIDlist, 0, 15);
     }
     $arrRaidList = array();
     if (is_array($arrRaidIDlist)) {
         foreach ($arrRaidIDlist as $intRaidID) {
             $ahref_start = (int) $this->pdh->get('calendar_events', 'calendartype', array($intRaidID)) == 1 ? '<a href="' . $this->env->link . $this->routing->build('calendarevent', $this->pdh->get('calendar_events', 'name', array($intRaidID)), $intRaidID, false, true) . '">' : '';
             $ahref_end = (int) $this->pdh->get('calendar_events', 'calendartype', array($intRaidID)) == 1 ? '</a>' : '';
             $arrRaidList[] = array('date' => $this->pdh->get('calendar_events', 'html_date', array($intRaidID)) . ' ' . $this->pdh->get('calendar_events', 'html_time_start', array($intRaidID)), 'headline' => $this->pdh->get('calendar_events', 'name', array($intRaidID)), 'content' => $ahref_start . $this->pdh->get('calendar_events', 'html_date', array($intRaidID)) . ' ' . $this->pdh->get('calendar_events', 'html_time_start', array($intRaidID)) . ': ' . $this->pdh->get('calendar_events', 'name', array($intRaidID)) . $ahref_end);
         }
     }
     $data = array('latest_news' => array('name' => $this->user->lang('news'), 'list' => $arrNewsList), 'next_events' => array('name' => $this->user->lang('massmail_next_events'), 'list' => $arrRaidList));
     //Plugin Hooks
     $arrPluginsHooks = $this->hooks->process('massmail_content');
     if (is_array($arrPluginsHooks)) {
         foreach ($arrPluginsHooks as $plugin => $value) {
             if (is_array($value)) {
                 $data = array_merge($data, $value);
             }
         }
     }
     //Bring the content to template
     if (is_array($data)) {
         foreach ($data as $key => $value) {
             $this->tpl->assign_block_vars('type_row', array('KEY' => 'd' . md5($key), 'NAME' => $value['name']));
             $this->jquery->selectall_checkbox('selall_d' . md5($key), 'cb_d' . md5($key) . '[]', $this->user->data['user_id']);
             if (is_array($value['list'])) {
                 foreach ($value['list'] as $listid => $listvalue) {
                     $this->tpl->assign_block_vars('type_row.content_row', array('DATE' => $listvalue['date'], 'HEADLINE' => $listvalue['headline'], 'CONTENT' => $listvalue['content'], 'ID' => 'd' . md5($key) . '_' . $listid));
                 }
             }
         }
     }
     $this->jquery->tab_header('massmail_content_tabs');
     $this->tpl->assign_vars(array('S_DATA' => true));
 }
Пример #26
0
 public function ajax_getrawarticle()
 {
     $id = $this->in->get('aid', 0);
     $strArticle = $this->pdh->get('articles', 'text', array($id));
     header('Content-type: application/json; charset=utf-8');
     echo json_encode(array('text' => unsanitize($strArticle)));
     exit;
 }
Пример #27
0
    public function perform_step1()
    {
        $hmtlout = '';
        if ($this->in->get('member_id', 0) > 0) {
            // We'll update an existing one...
            $isindatabase = $this->in->get('member_id', 0);
            $isMemberName = $this->pdh->get('member', 'name', array($isindatabase));
            $isServerName = $this->config->get('servername');
            $isServerLoc = $this->config->get('uc_server_loc');
            $is_mine = $this->pdh->get('member', 'userid', array($isindatabase)) == $this->user->data['user_id'] ? true : false;
        } else {
            // Check for existing member name
            $isindatabase = $this->pdh->get('member', 'id', array($this->in->get('charname'), array('servername' => $this->in->get('servername'))));
            $hasuserid = $isindatabase > 0 ? $this->pdh->get('member', 'userid', array($isindatabase)) : 0;
            $isMemberName = $this->in->get('charname');
            $isServerName = $this->in->get('servername');
            $isServerLoc = $this->in->get('server_loc');
            if ($this->user->check_auth('a_charmanager_config', false)) {
                $is_mine = true;
                // We are an administrator, its always mine..
            } else {
                $is_mine = $hasuserid > 0 ? $hasuserid == $this->user->data['user_id'] ? true : false : true;
                // we are a normal user
            }
        }
        if ($is_mine) {
            // Load the Armory Data
            $this->game->obj['armory']->setSettings(array('loc' => $isServerLoc));
            $chardata = $this->game->obj['armory']->character(unsanitize($isMemberName), unsanitize($isServerName), true);
            //new hhidden('server_loc', array('value' => $this->config->get('uc_server_loc')))
            // Basics
            $hmtlout .= new hhidden('member_id', array('value' => $isindatabase));
            $hmtlout .= new hhidden('member_name', array('value' => $isMemberName));
            $hmtlout .= new hhidden('member_level', array('value' => $chardata['level']));
            $hmtlout .= new hhidden('gender', array('value' => $this->game->obj['armory']->ConvertID($chardata['gender'], 'int', 'gender')));
            $hmtlout .= new hhidden('member_race_id', array('value' => $this->game->obj['armory']->ConvertID($chardata['race'], 'int', 'races')));
            $hmtlout .= new hhidden('member_class_id', array('value' => $this->game->obj['armory']->ConvertID($chardata['class'], 'int', 'classes')));
            $hmtlout .= new hhidden('guild', array('value' => $chardata['guild']['name']));
            $hmtlout .= new hhidden('servername', array('value' => $chardata['realm']));
            $hmtlout .= new hhidden('last_update', array('value' => $chardata['lastModified'] / 1000));
            // primary professions
            $hmtlout .= new hhidden('prof1_name', array('value' => $chardata['professions']['primary'][0]['name']));
            $hmtlout .= new hhidden('prof1_value', array('value' => $chardata['professions']['primary'][0]['rank']));
            $hmtlout .= new hhidden('prof2_name', array('value' => $chardata['professions']['primary'][1]['name']));
            $hmtlout .= new hhidden('prof2_value', array('value' => $chardata['professions']['primary'][1]['rank']));
            // talents
            $hmtlout .= new hhidden('talent1', array('value' => $this->game->obj['armory']->ConvertTalent($chardata['talents'][0]['spec']['icon'])));
            $hmtlout .= new hhidden('talent2', array('value' => $this->game->obj['armory']->ConvertTalent($chardata['talents'][1]['spec']['icon'])));
            // health/power bar
            $hmtlout .= new hhidden('health_bar', array('value' => $chardata['stats']['health']));
            $hmtlout .= new hhidden('second_bar', array('value' => $chardata['stats']['power']));
            $hmtlout .= new hhidden('second_name', array('value' => $chardata['stats']['powerType']));
            // viewable Output
            if (!isset($chardata['status'])) {
                $hmtlout .= '
				<div class="infobox infobox-large infobox-red clearfix">
					<i class="fa fa-exclamation-triangle fa-4x pull-left"></i> ' . ($isindatabase ? $this->game->glang('uc_charfound4') : $this->game->glang('uc_charfound3')) . '
				</div>

				<fieldset class="settings mediumsettings">
					<dl>
						<dt><label><img src="' . $this->game->obj['armory']->characterIcon($chardata) . '" name="char_icon" alt="icon" width="44px" height="44px" align="middle" /></label></dt>
						<dd>
							' . sprintf($this->game->glang('uc_charfound'), $isMemberName) . '<br />
							' . sprintf($this->game->glang('uc_charfound2'), $this->time->user_date($chardata['lastModified'] / 1000)) . '
						</dd>
					</dl>
					<dl>';
                if (!$isindatabase) {
                    if ($this->user->check_auth('u_member_conn', false)) {
                        $hmtlout .= '<dt>' . $this->user->lang('overtake_char') . '</dt><dd>' . new hradio('overtakeuser', array('value' => 1)) . '</dd>';
                    } else {
                        $hmtlout .= '<dt>' . $this->user->lang('overtake_char') . '</dt><dd>' . new hradio('overtakeuser', array('value' => 1, 'disabled' => true)) . '</dd>';
                        $hmtlout .= new hhidden('overtakeuser', array('value' => '1'));
                    }
                }
                $hmtlout .= '
					</dl>
					</fieldset>';
                $hmtlout .= '<center>
										<button type="submit" name="submiti"><i class="fa fa-refresh"></i> ' . ($isindatabase ? $this->game->glang('uc_prof_update') : $this->game->glang('uc_prof_import')) . '</button>
									</center>';
            } else {
                $hmtlout .= '<div class="infobox infobox-large infobox-red clearfix">
										<i class="fa fa-exclamation-triangle fa-4x pull-left"></i> <b>WARNING: </b> ' . $chardata['reason'] . '
									</div>';
            }
        } else {
            $hmtlout .= '<div class="infobox infobox-large infobox-red clearfix">
								<i class="fa fa-exclamation-triangle fa-4x pull-left"></i> ' . $this->game->glang('uc_notyourchar') . '
							</div>';
        }
        return $hmtlout;
    }
Пример #28
0
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU Affero General Public License for more details.
 *
 *	You should have received a copy of the GNU Affero General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
// Add css code:
$this->tpl->add_css("\n\t\t#guild_header_wrap {\n\t\t\twidth:100%;\n\t\t}\n\t\t#guild_header_banner_alliance{\n\t\t\twidth:100%;\n\t\t\theight:106px;\n\t\t\tbackground: url('" . $this->server_path . "games/wow/profiles/factions/banner_alliance.jpg') no-repeat scroll 0px 0px transparent;\n\t\t\tmargin-top:30px;\n\t\t}\n\t\t#guild_header_banner_horde{\n\t\t\twidth:100%;\n\t\t\theight:106px;\n\t\t\tbackground: url('" . $this->server_path . "games/wow/profiles/factions/banner_horde.jpg') no-repeat scroll 0px 0px transparent;\n\t\t\tmargin-top:30px;\n\t\t}\t\t\n\t\t#guild_emblem { \n\t\t\theight:200px;\n\t\t\twidth:230px;\n\t\t\tmargin:-30px 0 0 5px;\n\t\t\tfloat:left;\n\t\t}\t\t\n\t\t#guild_name {\n\t\t\tfont-size: 30px; \n\t\t\tcolor: #fff;\n\t\t\tposition:relative; \n\t\t\ttop:10px; \n\t\t\tleft:15px;\n\t\t\tfont-weight:bold;\n\t\t}\n\t\t#guild_realm {\n\t\t\tfont-size: 20px; \n\t\t\tcolor: #FFCC33 ;\n\t\t\tposition:relative; \n\t\t\ttop:30px; \n\t\t\tleft:15px;\n\t\t}\n\t\t\n\t\t#bar_15088, #bar_15077, #bar_15078, #bar_15079, #bar_15080, #bar_15089, #bar_15093{\n\t\t\twidth: 31%;\n\t\t\tfloat: left;\n\t\t\tpadding: 5px;\n\t\t\tcursor: pointer;\n\t\t}\n\t");
$this->tpl->css_file($this->path . 'games/wow/roster/challenge.css');
# Amory Stuff
$guilddata = false;
if ($this->config->get('servername') && $this->config->get('uc_server_loc')) {
    $this->game->new_object('bnet_armory', 'armory', array(unsanitize($this->config->get('uc_server_loc')), $this->config->get('uc_data_lang')));
    $guilddata = $this->game->obj['armory']->guild($this->config->get('guildtag'), $this->config->get('servername'));
    $this->tpl->assign_array('guilddata', $guilddata);
    if ($guilddata && !isset($chardata['status'])) {
        infotooltip_js();
        //Guildnews
        $arrNews = register('pdc')->get('roster_wow.guildnews');
        if (!$arrNews) {
            $arrNews = $this->game->callFunc('parseGuildnews', array($guilddata['news']));
            register('pdc')->put('roster_wow.guildnews', $arrNews, 3600);
        }
        foreach ($arrNews as $news) {
            $this->tpl->assign_block_vars('guildnews', array('TEXT' => $news['text'], 'ICON' => '<img src="' . $news['icon'] . '" alt="" />', 'DATE' => register('time')->nice_date($news['date'], 60 * 60 * 24 * 7)));
        }
        //Achievements
        $arrAchievs = register('pdc')->get('roster_wow.guildachievs');
Пример #29
0
 public function get_profilers($member_id)
 {
     $membername = $this->pdh->get('member', 'name', array($member_id));
     $char_server = $this->pdh->get('member', 'profile_field', array($member_id, 'servername'));
     $servername = $char_server != '' ? $char_server : $this->config->get('servername');
     $output = '';
     $a_profilers = array(1 => array('icon' => $this->server_path . 'games/wow/profiles/profilers/askmrrobot.png', 'name' => 'AskMrRobot.com', 'url' => $this->game->obj['armory']->bnlink(unsanitize($membername), unsanitize($servername), 'askmrrobot')));
     if (is_array($a_profilers)) {
         foreach ($a_profilers as $v_profiler) {
             $output .= '<a href="' . $v_profiler['url'] . '"><img src="' . $v_profiler['icon'] . '" alt="' . $v_profiler['name'] . '" width="20" class="gameicon"/></a> ';
         }
     }
     return $output;
 }
Пример #30
0
 public function export($withMemberItems = false, $withMemberAdjustments = false, $filter = false, $filterid = false, $blnIncludeHTML = false)
 {
     $arrPresets = array();
     foreach ($this->presets as $preset) {
         $pre = $this->pdh->pre_process_preset($preset['name'], $preset);
         if (empty($pre)) {
             continue;
         }
         $arrPresets[$pre[0]['name']] = $pre[0];
     }
     $out = array();
     $out['eqdkp'] = array('name' => unsanitize($this->config->get('guildtag')), 'guild' => unsanitize($this->config->get('guildtag')), 'dkp_name' => $this->config->get('dkp_name'), 'version' => $this->config->get('plus_version'), 'layout' => $this->config->get('eqdkp_layout'), 'base_layout' => $this->pdh->get_eqdkp_base_layout($this->config->get('eqdkp_layout')));
     $out['game'] = array('name' => $this->config->get('default_game'), 'version' => $this->config->get('game_version'), 'language' => $this->config->get('game_language'), 'server_name' => unsanitize($this->config->get('servername')), 'server_loc' => $this->config->get('uc_server_loc'));
     $out['info'] = array('with_twink' => intval($this->config->get('show_twinks')) ? 0 : 1, 'date' => $this->date_created, 'timestamp' => $this->timestamp, 'total_players' => count($this->pdh->get('member', 'id_list')), 'total_items' => count($this->pdh->get('item', 'id_list')));
     $mdkps = $this->pdh->get('multidkp', 'id_list');
     //Alle Member
     $total_points = 0;
     $members = $this->pdh->sort($this->pdh->get('member', 'id_list'), 'member', 'name');
     //Filter here
     if ($filter && $filterid) {
         switch ($filter) {
             case 'user':
                 $members = $this->pdh->sort($this->pdh->get('member', 'connection_id', array($filterid)), 'member', 'name');
                 break;
             case 'character':
                 $members = array($filterid);
                 break;
         }
     }
     if (is_array($members) && count($members) > 0) {
         foreach ($members as $member) {
             $points = array();
             foreach ($mdkps as $mdkp) {
                 $points['multidkp_points:' . $mdkp] = array('multidkp_id' => $mdkp, 'points_current' => isset($arrPresets['current']) ? $this->pdh->get($arrPresets['current'][0], $arrPresets['current'][1], $arrPresets['current'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false, 'points_current_with_twink' => isset($arrPresets['current']) ? $this->pdh->get($arrPresets['current'][0], $arrPresets['current'][1], $arrPresets['current'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false, 'points_earned' => isset($arrPresets['earned']) ? $this->pdh->get($arrPresets['earned'][0], $arrPresets['earned'][1], $arrPresets['earned'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false, 'points_earned_with_twink' => isset($arrPresets['earned']) ? $this->pdh->get($arrPresets['earned'][0], $arrPresets['earned'][1], $arrPresets['earned'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false, 'points_spent' => isset($arrPresets['spent']) ? $this->pdh->get($arrPresets['spent'][0], $arrPresets['spent'][1], $arrPresets['spent'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false, 'points_spent_with_twink' => isset($arrPresets['spent']) ? $this->pdh->get($arrPresets['spent'][0], $arrPresets['spent'][1], $arrPresets['spent'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false, 'points_adjustment' => isset($arrPresets['adjustment']) ? $this->pdh->get($arrPresets['adjustment'][0], $arrPresets['adjustment'][1], $arrPresets['adjustment'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false, 'points_adjustment_with_twink' => isset($arrPresets['adjustment']) ? $this->pdh->get($arrPresets['adjustment'][0], $arrPresets['adjustment'][1], $arrPresets['adjustment'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false);
                 if ($blnIncludeHTML) {
                     $points['multidkp_points:' . $mdkp]['points_current_html'] = isset($arrPresets['current']) ? $this->pdh->geth($arrPresets['current'][0], $arrPresets['current'][1], $arrPresets['current'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false;
                     $points['multidkp_points:' . $mdkp]['points_current_with_twink_html'] = isset($arrPresets['current']) ? $this->pdh->geth($arrPresets['current'][0], $arrPresets['current'][1], $arrPresets['current'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false;
                     $points['multidkp_points:' . $mdkp]['points_earned_html'] = isset($arrPresets['earned']) ? $this->pdh->geth($arrPresets['earned'][0], $arrPresets['earned'][1], $arrPresets['earned'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false;
                     $points['multidkp_points:' . $mdkp]['points_earned_with_twink_html'] = isset($arrPresets['earned']) ? $this->pdh->geth($arrPresets['earned'][0], $arrPresets['earned'][1], $arrPresets['earned'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false;
                     $points['multidkp_points:' . $mdkp]['points_spent_html'] = isset($arrPresets['spent']) ? $this->pdh->geth($arrPresets['spent'][0], $arrPresets['spent'][1], $arrPresets['spent'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false;
                     $points['multidkp_points:' . $mdkp]['points_spent_with_twink_html'] = isset($arrPresets['spent']) ? $this->pdh->geth($arrPresets['spent'][0], $arrPresets['spent'][1], $arrPresets['spent'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false;
                     $points['multidkp_points:' . $mdkp]['points_adjustment_html'] = isset($arrPresets['adjustment']) ? $this->pdh->geth($arrPresets['adjustment'][0], $arrPresets['adjustment'][1], $arrPresets['adjustment'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => false)) : false;
                     $points['multidkp_points:' . $mdkp]['points_adjustment_with_twink_html'] = isset($arrPresets['adjustment']) ? $this->pdh->geth($arrPresets['adjustment'][0], $arrPresets['adjustment'][1], $arrPresets['adjustment'][2], array('%dkp_id%' => $mdkp, '%member_id%' => $member, '%with_twink%' => true)) : false;
                 }
             }
             $items = array();
             if ($withMemberItems) {
                 $item_list = $this->pdh->get('item', 'itemids4memberid', array($member));
                 foreach ($item_list as $item_id) {
                     $game_id = $this->pdh->get('item', 'game_itemid', array($item_id));
                     $items['item:' . $item_id] = array('game_id' => $game_id ? $game_id : 0, 'name' => $this->pdh->get('item', 'name', array($item_id)), 'value' => $this->pdh->get('item', 'value', array($item_id)), 'itempool_id' => $this->pdh->get('item', 'itempool_id', array($item_id)));
                 }
             }
             $out['players']['player:' . $member] = array('id' => $member, 'name' => $this->game->handle_export_charnames(unsanitize($this->pdh->get('member', 'name', array($member))), $member), 'active' => $this->pdh->get('member', 'active', array($member)), 'hidden' => $this->pdh->get('member', 'is_hidden', array($member)), 'main_id' => $this->pdh->get('member', 'mainid', array($member)), 'main_name' => unsanitize($this->pdh->get('member', 'mainname', array($member))), 'class_id' => $this->pdh->get('member', 'classid', array($member)), 'class_name' => $this->pdh->get('member', 'classname', array($member)), 'points' => $points, 'items' => $items);
             if ($withMemberAdjustments) {
                 $adjustments = array();
                 $adj_list = $this->pdh->get('adjustment', 'adjsofmember', array($member));
                 $i = 0;
                 foreach ($adj_list as $adj_id) {
                     $adjustments['adjustment:' . $adj_id] = array('reason' => $this->pdh->get('adjustment', 'reason', array($adj_id)), 'value' => $this->pdh->get('adjustment', 'value', array($adj_id)), 'timestamp' => $this->pdh->get('adjustment', 'date', array($adj_id)), 'event_id' => $this->pdh->get('adjustment', 'event', array($adj_id)));
                     $i++;
                 }
                 $out['players']['player:' . $member]['adjustments'] = $adjustments;
             }
         }
     } else {
         $out['players'] = '';
     }
     //Alle MultiDKP-Konten
     if (is_array($mdkps) && count($mdkps) > 0) {
         foreach ($mdkps as $mdkp) {
             $event_ids = $this->pdh->get('multidkp', 'event_ids', array($mdkp));
             $itempool_ids = $this->pdh->get('multidkp', 'itempool_ids', array($mdkp));
             foreach ($itempool_ids as $pool) {
                 $itempools['itempool_id:' . $pool] = $pool;
             }
             $events = array();
             foreach ($event_ids as $event) {
                 $events['event:' . $event] = array('id' => $event, 'name' => $this->pdh->get('event', 'name', array($event)), 'value' => $this->pdh->get('event', 'value', array($event)));
             }
             $out['multidkp_pools']['multidkp_pool:' . $mdkp] = array('id' => $mdkp, 'name' => unsanitize($this->pdh->get('multidkp', 'name', array($mdkp))), 'desc' => unsanitize($this->pdh->get('multidkp', 'desc', array($mdkp))), 'events' => $events, 'mdkp_itempools' => $itempools);
         }
     } else {
         $out['multidkp_pools'] = '';
     }
     //Alle Itempools
     $itempools = $this->pdh->get('itempool', 'id_list');
     if (is_array($itempools) && count($itempools) > 0) {
         foreach ($itempools as $itempool) {
             $out['itempools']['itempool:' . $itempool] = array('id' => $itempool, 'name' => unsanitize($this->pdh->get('itempool', 'name', array($itempool))), 'desc' => unsanitize($this->pdh->get('itempool', 'desc', array($itempool))));
         }
     } else {
         $out['itempools'] = '';
     }
     return $out;
 }