function debugNote($row, $field, $data) { global $addon; $rules = $addon['rules']['use_global'] ? $addon['config'] : $addon['rules']; if (preg_match($rules['getmain_regex'], $row[$field], $regs)) { $tooltip_h = $regs[$rules['getmain_match']]; $tooltip = aprint($regs, '', true); } else { $tooltip_h = ''; $tooltip = 'No main match'; } return '<div ' . makeOverlib($tooltip, $tooltip_h) . '>' . $row[$field] . '</div>' . "\n"; }
function aprint($arr, $e = null) { $ret = null; $pre = $e ? "{$e}\t" : ""; $arr = (array) $arr; foreach ($arr as $k => $v) { if (is_array($v)) { $ret .= aprint($v, $k); } else { $ret .= "{$pre}{$k}\t{$v}\n"; } } return $ret; }
/** * fetch insert jobid, fill jobqueue * */ function startAjaxStatusUpdate($id = 0) { global $roster, $addon; $this->_checkEnv(); if (!$this->isAuth) { return array('status' => 103, 'errmsg' => 'Not authorized'); } //return array( 'result' => 'Das ist ein Test', 'status' => 2 ); if (isset($_GET['job_id'])) { $this->jobid = $_GET['job_id']; } if (isset($_POST['job_id'])) { $this->jobid = $_POST['job_id']; } $functions = $this->functions[$this->isMemberList]; $ret = $this->{$functions}['update_status'](); $status = $this->{$functions}['get_ajax_status'](); $this->_debug(1, null, 'Started ajax status update', 'OK'); $result = "\n"; if (count($this->errormessages) > 0) { foreach ($this->errormessages as $message) { $result .= $this->_xmlEncode('errormessage', array('target' => 'ApiSync_error_table'), null, array(array('emesg', array('type' => 'line'), $message['line']), array('emesg', array('type' => 'time'), $message['time']), array('emesg', array('type' => 'file'), $message['file']), array('emesg', array('type' => 'class'), $message['class']), array('emesg', array('type' => 'function'), $message['function']), array('emesg', array('type' => 'info'), $message['info']), array('emesg', array('type' => 'as_status'), $message['status']), array('edata', array('type' => 'args'), aprint($message['args'], '', 1)), array('edata', array('type' => 'ret'), aprint($message['ret'], '', 1)))); } } if ($addon['config']['ApiSync_debuglevel'] > 0 && count($this->debugmessages) > 0) { foreach ($this->debugmessages as $message) { $result .= $this->_xmlEncode('debugmessage', array('target' => 'ApiSync_debug_table'), null, array(array('dmesg', array('type' => 'line'), $message['line']), array('dmesg', array('type' => 'time'), $message['time']), array('dmesg', array('type' => 'file'), $message['file']), array('dmesg', array('type' => 'class'), $message['class']), array('dmesg', array('type' => 'function'), $message['function']), array('dmesg', array('type' => 'info'), $message['info']), array('dmesg', array('type' => 'as_status'), $message['status']), array('ddata', array('type' => 'args'), aprint($message['args'], '', 1)), array('ddata', array('type' => 'ret'), aprint($message['ret'], '', 1)))); } } $result .= $status; if ($ret) { $reloadTime = $addon['config']['ApiSync_reloadwaittime'] * 500; $result .= $this->_xmlEncode('reload', array('reloadTime' => $reloadTime), ''); } $result .= " "; return array('result' => $result, 'status' => 0); }
<input type="hidden" value="10" name="userid"> <input type="hidden" value="2" name="hyipid"> <input type="hidden" value="checkpayment" name="a"> <input type="text" name="payee_account" value="U0189680"/> <input type="text" name="payer_account" value="U3156245"/> <input type="text" name="checkout_amount" value="50"/> <input type="text" name="transaction_currency" value="USD"/> <input type="text" name="batch_number" value="5645654"/> <input type="text" name="transaction_status" value="success"/> <input type="submit" value="post"/> </form> <?php $test = array('bname' => 'fsfs', 'bname3' => 'fsfs', 'bname4' => 'fsfs', 'bname5' => 'fsfs'); $url = realpath(dirname(__FILE__)) . '/log.txt'; $out = fopen($url, "w"); fwrite($out, aprint($test, TRUE)); fclose($out); function aprint($arr, $return = true) { $wrap = '<div style=" white-space:pre; position:absolute; top:10px; left:10px; height:200px; width:100px; overflow:auto; z-index:5000;">'; $wrap = '<pre>'; $txt = preg_replace('/(\\[.+\\])\\s+=>\\s+Array\\s+\\(/msiU', '$1 => Array (', print_r($arr, true)); if ($return) { return $wrap . $txt . '</pre>'; } else { echo $wrap . $txt . '</pre>'; } }
function _showFooter() { global $roster, $addon; ////aprint($this->debugmessages[0]['ret']); $roster->tpl->assign_vars(array('IMAGE_PATH' => $addon['image_path'], 'ARMORYSYNC_VERSION' => $addon['version'] . ' by Ulminia', 'ARMORYSYNC_CREDITS' => $roster->locale->act['armorysync_credits'], 'ERROR' => count($this->errormessages) > 0, 'DEBUG' => $addon['config']['armorysync_debuglevel'], 'DEBUG_DATA' => $addon['config']['armorysync_debugdata'], 'D_START_BORDER' => border('sblue', 'start', 'ArmorySync Debugging ' . ($addon['config']['armorysync_debugdata'] ? 'Infos & Data' : 'Infos'), '100%'), 'E_START_BORDER' => border('sred', 'start', 'ArmorySync Error ' . ($addon['config']['armorysync_debugdata'] ? 'Infos & Data' : 'Infos'), '100%'), 'RUNTIME' => round(format_microtime() - ARMORYSYNC_STARTTIME, 4), 'S_SQL_WIN' => $addon['config']['armorysync_sqldebug'])); $this->_debug(3, null, 'Printed footer', 'OK'); if ($roster->switch_row_class(false) != 1) { $roster->switch_row_class(); } foreach ($this->errormessages as $message) { $roster->tpl->assign_block_vars('e_row', array('FILE' => $message['file'], 'LINE' => $message['line'], 'TIME' => $message['time'], 'CLASS' => $message['class'], 'FUNC' => $message['function'], 'INFO' => $message['info'], 'STATUS' => $message['status'], 'ARGS' => aprint($message['args'], '', 1), 'RET' => aprint($message['ret'], '', 1), 'ROW_CLASS1' => $addon['config']['armorysync_debugdata'] ? 1 : $roster->switch_row_class(), 'ROW_CLASS2' => 1, 'ROW_CLASS3' => 1)); } $roster->tpl->assign_var('E_STOP_BORDER', border('sred', 'end', '', '')); if ($roster->switch_row_class(false) != 1) { $roster->switch_row_class(); } foreach ($this->debugmessages as $message) { $roster->tpl->assign_block_vars('d_row', array('FILE' => $message['file'], 'LINE' => $message['line'], 'TIME' => $message['time'], 'CLASS' => $message['class'], 'FUNC' => $message['function'], 'INFO' => $message['info'], 'STATUS' => $message['status'], 'ARGS' => aprint($message['args'], '', 1), 'RET' => aprint($message['ret'], '', 1), 'ROW_CLASS1' => $addon['config']['armorysync_debugdata'] ? 1 : $roster->switch_row_class(), 'ROW_CLASS2' => 1, 'ROW_CLASS3' => 1)); } $roster->tpl->assign_var('D_STOP_BORDER', border('sblue', 'end', '', '')); if ($addon['config']['armorysync_sqldebug']) { if (count($roster->db->queries) > 0) { foreach ($roster->db->queries as $file => $queries) { if (!preg_match('#[\\\\/]{1}addons[\\\\/]{1}armorysync[\\\\/]{1}inc[\\\\/]{1}[a-z_.]+.php$#', $file)) { continue; } $roster->tpl->assign_block_vars('sql_debug', array('FILE' => substr($file, strlen(ROSTER_BASE)))); foreach ($queries as $query) { $roster->tpl->assign_block_vars('sql_debug.row', array('ROW_CLASS' => $roster->switch_row_class(), 'LINE' => $query['line'], 'TIME' => $query['time'], 'QUERY' => nl2br(htmlentities($query['query'])))); } } $roster->tpl->assign_vars(array('SQL_DEBUG_B_S' => border('sgreen', 'start', $roster->locale->act['sql_queries']), 'SQL_DEBUG_B_E' => border('sgreen', 'end'))); } } $roster->tpl->set_filenames(array('footer' => $addon['basename'] . '/footer.html')); $roster->tpl->display('footer'); }
exit('Detected invalid access to this file!'); } define('ROSTER_FOOTER_INC', true); $totaltime = round(format_microtime() - ROSTER_STARTTIME, 2); $error_report = $roster->error->stop(); // Assign template vars $roster->tpl->assign_vars(array('S_PROCESSTIME' => $roster->config['processtime'], 'S_DEBUG_MODE' => $roster->config['debug_mode'] && is_array($error_report), 'S_SQL_WIN' => $roster->config['sql_window'], 'S_DESCRIBE' => $roster->config['sql_window'] == 2, 'PROCESSTIME' => $totaltime, 'QUERYCOUNT' => $roster->db->query_count, 'ROSTER_PATH' => ROSTER_PATH, 'ROSTER_BODY' => (!empty($roster->config['roster_bg']) ? ' style="background-image:url(' . $roster->config['roster_bg'] . ');"' : '') . (!empty($roster->output['body_attr']) ? ' ' . $roster->output['body_attr'] : ''), 'ROSTER_ONLOAD' => !empty($roster->output['body_onload']) ? $roster->output['body_onload'] : '', 'WEBSITE_ADDRESS' => $roster->config['website_address'], 'HEADER_LOGO' => $roster->config['logo'], 'IMG_URL' => $roster->config['img_url'], 'INTERFACE_URL' => $roster->config['interface_url'], 'ROSTER_VERSION' => $roster->config['version'], 'ROSTER_CREDITS' => sprintf($roster->locale->act['roster_credits'], makelink('credits')))); if ($roster->config['debug_mode']) { if (is_array($error_report)) { foreach ($error_report as $file => $errors) { $roster->tpl->assign_block_vars('php_debug', array('FILE' => substr($file, strlen(ROSTER_BASE)))); foreach ($errors as $error) { $roster->tpl->assign_block_vars('php_debug.row', array('ROW_CLASS' => $roster->switch_row_class(), 'ERROR' => $error)); } } } } if ($roster->config['sql_window']) { if (count($roster->db->queries) > 0) { foreach ($roster->db->queries as $file => $queries) { $roster->tpl->assign_block_vars('sql_debug', array('FILE' => substr($file, strlen(ROSTER_BASE)))); foreach ($queries as $query) { $roster->tpl->assign_block_vars('sql_debug.row', array('ROW_CLASS' => $roster->switch_row_class(), 'LINE' => $query['line'], 'TIME' => $query['time'], 'QUERY' => nl2br(htmlentities($query['query'])) . (empty($query['error']) ? '' : '<hr />' . nl2br(htmlentities($query['error']))), 'DESCRIBE' => aprint($query['describe'], '', true))); } } $roster->tpl->assign_var('L_SQL_QUERIES', $roster->locale->act['sql_queries']); } } $roster->tpl->assign_var('ROSTER_TOOLTIPS', getAllTooltips()); $roster->tpl->set_filenames(array('roster_footer' => 'footer.html')); $roster->tpl->display('roster_footer');
* @package WoWRoster * @subpackage RosterDiag */ if (!defined('IN_ROSTER')) { exit('Detected invalid access to this file!'); } // Set the title for the header $roster->output['title'] = $roster->locale->act['rosterdiag']; // Include the library for RosterDiag include_once ROSTER_LIB . 'rosterdiag.lib.php'; echo '<span class="title_text">' . $roster->locale->act['rosterdiag'] . '</span>'; // Loging in as Admin to allow up- / downgrades && Downloads // If the entire config page is requested, display only THAT if (isset($_GET['printconf']) && $_GET['printconf'] == 1) { echo '<div align="left">'; aprint($roster->config); echo '</div>'; return; } // If a FileDiff is requested, display the header of the file and display Warning / Confirmation if (isset($_POST['filename']) && isset($_POST['downloadsvn'])) { if ($_POST['downloadsvn'] == 'confirmation') { //Do confirmation stuff $filename = $_POST['filename']; if (is_file($filename)) { $md5local = md5_file($filename); } else { $md5local = "Local File does not exist yet"; } $md5remote = urlgrabber(ROSTER_SVNREMOTE . '?getfile=' . $filename . '&mode=md5'); if ($md5remote === false) {
* Created by PhpStorm. * User: Алексей * Date: 24.12.2015 * Time: 20:36 */ $date = range(0, 5); for ($i = 0; $i < count($date); $i++) { $date[$i] = rand(1350979861, time()); echo date('d.m.Y', $date[$i]) . "<br/>"; } foreach ($date as $value) { $day[] = date('d', $value); $month[] = date('n', $value); } $days = min($day); $months = max($month); echo "Наименьший день - " . $days . "<br/>"; echo "Наибольший месяц - " . $months . "<br/>"; asort($date); $selected = array_pop($date); echo "Выбранная дата " . date('d.m.y H:i:s', $selected) . "<br/>"; date_default_timezone_set('America/New_York'); echo "В Нью Йорке " . date('d.m.y H:i:s', $selected) . "<br/>"; aprint($date); /* Library */ function aprint($arr) { echo "<pre>"; print_r($arr); echo "</pre>"; }
function _makeTooltipHTML() { $html_tt = $this->_getCaption(); if (isset($this->attributes['Conjured'])) { $html_tt .= $this->_getConjures(); } if (isset($this->attributes['Heroic'])) { $html_tt .= $this->_getHeroic(); } if (isset($this->attributes['BindType'])) { $html_tt .= $this->_getBindType(); } if (isset($this->attributes['Unique'])) { $html_tt .= $this->_getUnique(); } if ($this->isArmor) { $html_tt .= $this->_getArmor(); } if ($this->isWeapon) { $html_tt .= $this->_getWeapon(); } if ($this->isBag) { $html_tt .= $this->_getBag(); } if (isset($this->attributes['ArmorClass'])) { $html_tt .= $this->_getArmorClass(); } if (isset($this->attributes['GemBonus'])) { $html_tt .= $this->_getGemBonus(); } if (isset($this->attributes['SkillRequired'])) { $html_tt .= $this->_getSkillRequired(); } if (isset($this->attributes['BaseStats'])) { $html_tt .= $this->_getBaseStats(); } if (isset($this->attributes['Enchantment'])) { $html_tt .= $this->_getEnchantment(); } if (isset($this->attributes['TempEnchantment'])) { $html_tt .= $this->_getTempEnchantment(); } if ($this->isSocketable) { $html_tt .= $this->_getSockets(); $html_tt .= $this->_getSocketBonus(); } if (isset($this->attributes['Class'])) { $html_tt .= $this->_getRequiredClasses(); } if (isset($this->attributes['Race'])) { $html_tt .= $this->_getRequiredRaces(); } if (isset($this->attributes['Durability'])) { $html_tt .= $this->_getDurability(); } if (isset($this->attributes['Requires'])) { $html_tt .= $this->_getRequired(); } if (isset($this->attributes['ItemLevel'])) { $html_tt .= $this->_getItemLevel(); } if (isset($this->effects)) { $html_tt .= $this->_getPassiveBonus(); } if (isset($this->attributes['Charges'])) { $html_tt .= $this->_getItemCharges(); } if ($this->isSetPiece) { $html_tt .= $this->_getSetPiece(); $html_tt .= $this->_getSetBonus(); $html_tt .= $this->_getInactiveSetBonus(); } if (isset($this->attributes['MadeBy']['Line'])) { $html_tt .= $this->_getCrafter(); } if (isset($this->attributes['Restrictions'])) { $html_tt .= $this->_getRestrictions(); } if (isset($this->attributes['ItemNote'])) { $html_tt .= $this->_getItemNote(); } if (isset($this->attributes['Source'])) { $html_tt .= $this->_getSource(); } if (isset($this->attributes['Boss'])) { $html_tt .= $this->_getBoss(); } if (isset($this->attributes['DropRate'])) { $html_tt .= $this->_getDropRate(); } if ($this->DEBUG && $this->isParseError || $this->DEBUG == 2) { trigger_error('<table class="border_frame" cellpadding="0" cellspacing="1" width="350"><tr><td>' . $html_tt . '<hr width="80%" /> ' . str_replace("\n", '<br />', $this->tooltip) . '</td></tr></table>' . aprint($this->parsed_item, '', true)); } //echo $html_tt . ( $this->DEBUG ? '<br />Parsed Full' : '' ); $tooltip = '' . $html_tt . ''; return $tooltip; }
function debugPrintAll() { return aprint($this->parsed_item); }
$where = '`guild_id` = "' . $_GET['guild'] . '"'; } elseif (strpos($_GET['guild'], '@') !== FALSE) { list($name, $realm) = explode('@', $_GET['guild']); if (strpos($realm, '-') !== FALSE) { list($region, $realm) = explode('-', $realm, 2); $where = '`guild_name` = "' . $name . '" ' . 'AND `server` = "' . $realm . '" ' . 'AND `region` = "' . strtoupper($region) . '" '; } else { $where = '`guild_name` = "' . $name . '" ' . 'AND `server` = "' . $realm . '" '; } } else { $name = $_GET['guild']; $where = '`guild_name` = "' . $name . '"'; } $sql = "SELECT * FROM `roster_guild` WHERE " . $where . ";"; $siggen = new SigGen($addon, 'bnr'); } $result = $roster->db->query($sql); $array = $roster->db->fetch($result, SQL_ASSOC); foreach ($array as $index => $item) { $siggen->tag->add_tag(array('tag' => $index, 'data' => $item)); } //$siggen->make_image(); if (isset($_GET['test'])) { $siggen->get_image(); $siggen->finish(); } else { print $test_string . '<br/><br/>' . $siggen->tag->parse($test_string); $totaltime = round(format_microtime() - $starttime, 4); echo "<br /><br />{$totaltime}"; aprint($array); }