本文整理汇总了PHP中unsanitize函数的典型用法代码示例。如果您正苦于以下问题:PHP unsanitize函数的具体用法?PHP unsanitize怎么用?PHP unsanitize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unsanitize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
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: wowautoinviteexport
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: get_raids
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');
}
}
示例4: buildURL
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: WoWMacroexport
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;
}
示例6: WildstarMacroexport
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: get_user_chars
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: get_events
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: calendar_membertooltip
/**
* 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: getRealmData
/**
* 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: get_latest_articles
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: unsanitizeInput
function unsanitizeInput()
{
unsanitize($_GET);
unsanitize($_POST);
//sanitize($_REQUEST);
}
示例13: CSVpointexport
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: get_calevents_details
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)));
}
}
//.........这里部分代码省略.........
示例15: sprintf
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