本文整理汇总了PHP中die_quietly函数的典型用法代码示例。如果您正苦于以下问题:PHP die_quietly函数的具体用法?PHP die_quietly怎么用?PHP die_quietly使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了die_quietly函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pageNames
/**
* Value function to select starting page
*/
function pageNames()
{
global $roster;
$input_field = '<select name="config_default_page">' . "\n";
$select_one = 1;
// --[ Fetch button list from DB ]--
$query = "SELECT `mb`.*, `a`.`basename`\r\n\t\tFROM `" . $roster->db->table('menu_button') . "` AS mb\r\n\t\tLEFT JOIN `" . $roster->db->table('addon') . "` AS a\r\n\t\tON `mb`.`addon_id` = `a`.`addon_id`\r\n\t\tWHERE `scope` IN ('util','realm','guild')\r\n\t\tORDER BY `mb`.`title`;";
$result = $roster->db->query($query);
if (!$result) {
die_quietly('Could not fetch menu buttons from table');
}
while ($row = $roster->db->fetch($result)) {
if ($row['addon_id'] != '0' && !isset($roster->locale->act[$row['title']])) {
// Include addon's locale files if they exist
foreach ($roster->multilanguages as $lang) {
$roster->locale->add_locale_file(ROSTER_ADDONS . $row['basename'] . DIR_SEP . 'locale' . DIR_SEP . $lang . '.php', $lang);
}
}
list($title) = explode('|', isset($roster->locale->act[$row['title']]) ? $roster->locale->act[$row['title']] : $row['title']);
$title = $roster->locale->act[$row['scope']] . ' - ' . $title;
if ($row['addon_id'] != 0) {
$row['url'] = $row['scope'] . '-' . $row['basename'] . (empty($row['url']) ? '' : '-' . $row['url']);
}
if ($row['url'] == $roster->config['default_page'] && $select_one) {
$input_field .= ' <option value="' . $row['url'] . '" selected="selected">-[ ' . $title . ' ]-</option>' . "\n";
$select_one = 0;
} else {
$input_field .= ' <option value="' . $row['url'] . '">' . $title . '</option>' . "\n";
}
}
$input_field .= '</select>';
$roster->db->free_result($result);
return $input_field;
}
示例2: _getGuildEvents
function _getGuildEvents()
{
global $roster, $addon;
$query = "SELECT ";
$query .= "asevent.id ";
$query .= "FROM `" . $roster->db->table('event', 'assessment') . "` AS asevent ";
$query .= "LEFT JOIN `" . $roster->db->table('groupmembers', 'assessment') . "` AS asmembers ";
$query .= "ON asmembers.eventId = asevent.id ";
$query .= "LEFT JOIN `" . $roster->db->table('members') . "` AS members ";
$query .= "ON asmembers.name = members.name ";
$query .= "WHERE members.guild_id = " . $roster->data['guild_id'] . " ";
$query .= "GROUP BY asevent.id ";
$query .= "ORDER BY asevent.eventName";
if ($result = $roster->db->query($query)) {
$ret = array();
if ($roster->db->num_rows($result) > 0) {
$array = $roster->db->fetch_all();
require_once $addon['dir'] . 'inc/assessment.event.class.php';
foreach ($array as $set) {
$event = new AssessmentEvent();
$event->get($set['id']);
$event->getEventListDetails();
$ret[] = $event;
}
$roster->db->free_result($result);
}
return $ret;
} else {
die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
}
}
示例3: generateHsList
/**
* Generate the Honor List
*
* @return string
*/
function generateHsList()
{
global $roster;
//Highest Lifetime Rank
$query = "SELECT `name`, `lifetimeRankName` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `lifetimeHighestRank`DESC, `lifetimeHK` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist1'], 'NAME' => $row['name'], 'COUNT' => $row['lifetimeRankName'] ? $row['lifetimeRankName'] : ' '));
}
//Highest LifeTime HKs
$query = "SELECT `name`, `lifetimeHK` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `lifetimeHK` DESC, `lifetimeHighestRank` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist2'], 'NAME' => $row['name'], 'COUNT' => $row['lifetimeHK']));
}
//Highest honorpoints
$query = "SELECT `name`, `honorpoints` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `honorpoints` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist3'], 'NAME' => $row['name'], 'COUNT' => $row['honorpoints']));
}
//Highest arenapoints
$query = "SELECT `name`, `arenapoints` FROM `" . $roster->db->table('players') . "` WHERE `guild_id` = '" . $roster->data['guild_id'] . "' ORDER BY `arenapoints` DESC LIMIT 0 , 1";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
$row = $roster->db->fetch($result);
if ($row) {
$roster->tpl->assign_block_vars('hslist', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('guild-memberslist-honorlist'), 'VALUE' => $roster->locale->act['hslist4'], 'NAME' => $row['name'], 'COUNT' => $row['arenapoints']));
}
$roster->db->free_result($result);
$roster->tpl->set_handle('hslist', 'hslist.html');
return $roster->tpl->fetch('hslist');
}
示例4: createTables
function createTables()
{
global $wowdb, $roster_conf, $db_prefix;
// Declare tables needed for EventCalendar
$create_events = "CREATE TABLE `" . $db_prefix . "events` (\n\t\t`eventid` int(6) NOT NULL AUTO_INCREMENT,\n\t\t`date` datetime NOT NULL default '0000-00-00 00:00:00',\n\t\t`title` varchar(100) NOT NULL default '',\n\t\t`type` varchar(100) NOT NULL default '',\n\t\t`note` varchar(255) NOT NULL default '',\n\t\t`leader` varchar(100) NOT NULL default '',\t\t\n\t\t`minLevel` int(11) NOT NULL default '0',\n\t\t`maxLevel` int(11) NOT NULL default '0',\n\t\t`maxCount` int(11) NOT NULL default '0',\n\t\tKEY `eventid` (`eventid`)\n\t\t) TYPE=MyISAM;";
$create_eventmembers = "CREATE TABLE `" . $db_prefix . "event_members` (\n\t\t`name` varchar(100) NOT NULL default '',\n\t\t`guild` varchar(255) NOT NULL default '',\n\t\t`class` varchar(100) NOT NULL default '',\n\t\t`level` int(11) NOT NULL default '0',\n\t\tUNIQUE KEY `name` (`name`)\n\t\t) TYPE=MyISAM;";
$create_eventsubscribers = "CREATE TABLE `" . $db_prefix . "event_subscribers` (\n\t\t`eventid` int(11) NOT NULL default '0',\n\t\t`name` varchar(100) NOT NULL default '',\n\t\t`place` varchar(10) NOT NULL default '',\n\t\t`status` varchar(100) NOT NULL default '',\n\t\t`note` varchar(255) NOT NULL default '',\n\t\tKEY `eventid` (`eventid`),\n\t\tKEY `name` (`name`)\n\t\t) TYPE=MyISAM;";
$create_eventlimits = "CREATE TABLE `" . $db_prefix . "event_limits` (\n\t\t`eventid` int(11) NOT NULL default '0',\n\t\t`class` varchar(100) NOT NULL default '',\n\t\t`min` int(11) NOT NULL default '0',\n\t\t`max` int(11) NOT NULL default '0',\n\t\tKEY `eventid` (`eventid`)\n\t\t) TYPE=MyISAM;";
// Create tables declared above
$tables = 0;
if ($wowdb->query($create_events) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $create_events)) {
$tables += 1;
}
if ($wowdb->query($create_eventmembers) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $create_eventmembers)) {
$tables += 1;
}
if ($wowdb->query($create_eventsubscribers) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $create_raidmembers)) {
$tables += 1;
}
if ($wowdb->query($create_eventlimits) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $create_eventlimits)) {
$tables += 1;
}
if ($tables == 4) {
echo border('syellow', 'start');
echo '<table width="300px">';
echo '<tr><td align="center">All tables successfully added</td></tr>';
echo '<tr><td align="center"><a href="addon.php?roster_addon_name=EventCalendar">Finish installation</a></td></tr>';
echo '</table>';
echo border('syellow', 'end');
}
}
示例5: getplugin
/**
* Sets up plugin data for use in the plugin framework
*
* @param string $pluginname | The name of the plugin
* @return array $plugin | The plugin's database record
*
* @global array $plugin_conf | The plugin's config data is added to this global array.
*/
function getplugin($pluginname)
{
global $roster, $accounts;
if (!isset($accounts->plugin_data[$pluginname])) {
roster_die(sprintf($roster->locale->act['plugin_not_installed'], $pluginname), $roster->locale->act['plugin_error']);
}
$plugin = $accounts->plugin_data[$pluginname];
// Get the plugin's location
$plugin['dir'] = $addon['inc_dir'] . DIR_SEP . 'plugin' . DIR_SEP . $plugin['basename'];
// Get the plugin's url
$plugin['url'] = $addon['inc_dir'] . DIR_SEP . 'plugin' . DIR_SEP . $plugin['basename'] . '/';
$plugin['url_full'] = ROSTER_URL . $plugin['url'];
$plugin['url_path'] = ROSTER_PATH . $plugin['url'];
// Get plugin's url to images directory
$plugin['image_url'] = ROSTER_URL . $plugin['url'] . 'images/';
$plugin['image_path'] = ROSTER_PATH . $plugin['url'] . 'images/';
// Get the plugin's css style
$plugin['css_file'] = $plugin['dir'] . 'style.css';
if (file_exists($plugin['css_file'])) {
$plugin['css_url'] = $plugin['url_path'] . 'style.css';
} else {
$plugin['css_url'] = '';
}
// Get the plugin's inc dir
$plugin['inc_dir'] = $plugin['dir'] . 'inc' . DIR_SEP;
// Get the plugin's conf file
$plugin['conf_file'] = $plugin['inc_dir'] . DIR_SEP . 'conf.php';
// Get the plugin's search file
$plugin['search_file'] = $plugin['inc_dir'] . DIR_SEP . 'search.inc.php';
// Get the plugin's locale dir
$plugin['locale_dir'] = $plugin['dir'] . 'locale' . DIR_SEP;
// Get the plugin's admin dir
$plugin['admin_dir'] = $plugin['dir'] . 'admin' . DIR_SEP;
// Get the plugin's trigger file
$plugin['trigger_file'] = $plugin['inc_dir'] . 'update_hook.php';
// Get the plugin's ajax functions file
$plugin['ajax_file'] = $plugin['inc_dir'] . 'ajax.php';
// Get config values for the default profile and insert them into the array
$plugin['config'] = '';
$query = "SELECT `config_name`, `config_value` FROM `" . $roster->db->table('plugin_config', $addon['basename']) . "` WHERE `plugin_id` = '" . $plugin['plugin_id'] . "' ORDER BY `id` ASC;";
$result = $roster->db->query($query);
if (!$result) {
die_quietly($roster->db->error(), $roster->locale->act['plugin_error'], __FILE__, __LINE__, $query);
}
if ($roster->db->num_rows($result) > 0) {
while ($row = $roster->db->fetch($result, SQL_ASSOC)) {
$plugin['config'][$row['config_name']] = $row['config_value'];
}
$roster->db->free_result($result);
}
return $plugin;
}
示例6: guild_post
/**
* Guild_pre trigger, set out guild id here
*
* @param array $guild
* CP.lua guild data
*/
function guild_post($guild)
{
global $roster, $update;
$addon = getaddon('raidbox');
//echo '<pre>';
//print_r($addon);
//echo '</pre>';
//build critera data
$query = "SELECT * FROM `" . $roster->db->table('g_criteria', 'achievements') . "`";
// WHERE `cid` = '15079'";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
$crit = array();
while ($row = $roster->db->fetch($result)) {
$crit[$row['crit_id']] = array('crit_id' => $row['crit_id'], 'crit_date' => $row['crit_date'], 'crit_value' => $row['crit_value']);
}
//build achievement data
$query1 = "SELECT * FROM `" . $roster->db->table('g_achievements', 'achievements') . "`";
// WHERE `cid` = '15079'";
$result1 = $roster->db->query($query1) or die_quietly($roster->db->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
$achi = array();
while ($row = $roster->db->fetch($result1)) {
$achi[$row['achie_id']] = array('achie_id' => $row['achie_id'], 'achie_date' => $row['achie_date']);
}
// this loops each raid
foreach ($this->raids as $raid => $rinfo) {
$overide = false;
if (isset($achi[$rinfo['id']]['achie_date'])) {
$overide = true;
}
$this->messages .= '<br/>' . $rinfo['title'] . '<ul>';
//echo $rinfo['title'].' <img src="'.$roster->config['img_url'].'interface/icons/'.$rinfo['icon'].'"></a><br>';
foreach ($rinfo['criteria'] as $id => $boss) {
if (isset($crit[$boss['id']]['crit_value'])) {
$down = $crit[$boss['id']]['crit_value'];
} else {
$down = '0';
}
if ($overide or $down >= 1) {
$down = 1;
}
//echo $boss['description'] . ' x' . $down . '<br>';
$this->messages .= '<li>' . $boss['description'] . ' - ' . $down . '</li>';
$querystr = "UPDATE `" . $roster->db->table('addon_config') . "` SET `config_value` = '" . $down . "' WHERE `config_name` = '" . $raid . '_boss_' . ($id + 1) . "'";
//$this->messages .= $querystr.'<br>';
$result = $roster->db->query($querystr);
}
$this->messages .= '</ul>';
}
return true;
}
示例7: _dbWrite
/**
* dbFunction Insert or Update
*
* @param string $string
* @return string date
*/
function _dbWrite()
{
global $roster, $addon;
$query = $this->_buildWriteQuery();
$ret;
if (!$roster->db->query($query)) {
die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
} else {
if ($this->idNeeded && $this->id == 0) {
$query = "SELECT LAST_INSERT_ID();";
if ($roster->db->query($query)) {
$this->id = $roster->db->query_first($query);
} else {
die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
}
}
}
}
示例8: glyphlookup
function glyphlookup($locales)
{
global $roster;
$query = "SELECT DISTINCT `recipe_name`, `reagents`, `recipe_type`, `recipe_tooltip`, `recipe_texture`, `item_color`\n\t\t\tFROM `" . $roster->db->table('recipes') . "` as r, `" . $roster->db->table('members') . "` as m\n\t\t\tWHERE (`skill_name` = '" . $roster->locale->act['sill'] . "')\n\t\t\tand `m`.`guild_id` = '" . $roster->data['guild_id'] . "'\n\t\t\tand `m`.`member_id` = `r`.`member_id`";
for ($i = 1; $i < count($locales); $i++) {
if ($locales[$i] != '') {
$query .= " OR (`skill_name` = '" . $roster->locale->act['sill'] . "') ";
}
}
$query .= "ORDER BY recipe_type, `reagents`,`recipe_name` ";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
$count = 0;
$temp = array();
while ($row = $roster->db->fetch($result)) {
$temp[$count] = $row;
$count++;
}
return $temp;
}
示例9: gemlookup
function gemlookup($locales, $color)
{
global $roster;
$query = "SELECT DISTINCT `recipe_name`, `reagents`, `recipe_type`, `recipe_tooltip`, `recipe_texture`, `item_color`\n\t\t\tFROM `" . $roster->db->table('recipes') . "`\n\t\t\tWHERE (`recipe_type` = '" . $roster->locale->act['GemType'][$color] . "'\n\t\t\tAND `skill_name` = '" . $roster->locale->act['sill'] . "') ";
for ($i = 1; $i < count($locales); $i++) {
if ($locales[$i] != '') {
$query .= " OR (`recipe_type` = '" . $roster->locale->act['GemType'][$color] . "'\n\t\t\tAND `skill_name` = '" . $roster->locale->act['sill'] . "') ";
}
}
$query .= "ORDER BY `reagents`,`recipe_name` ";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
$count = 0;
$temp = array();
while ($row = $roster->db->fetch($result)) {
$temp[$count] = $row;
$count++;
}
return $temp;
}
示例10: set_tpl
function set_tpl($data)
{
global $roster;
// Create a character based icon
if ($data['raceEn'] == '' || $data['sexid'] == '') {
$data['char_icon'] = 'unknown';
} else {
$data['char_icon'] = strtolower($data['raceEn']) . '-' . ($data['sexid'] == '0' ? 'male' : 'female');
}
/**
* Assigning everything this file may need to the template
* The only tpl vars not here are ones that need to be generated in their respective methods
*/
$query = 'SELECT guild.* ' . "FROM `" . $roster->db->table('guild') . "` guild " . "WHERE `guild_id` = '" . $roster->data['guild_id'] . "';";
$result = $roster->db->query($query);
if (!$result) {
die_quietly($roster->db->error(), 'Database Error', __FILE__ . '<br />Function: ' . __FUNCTION__, __LINE__, $query);
}
$rdata = $roster->db->fetch($result);
$roster->tpl->assign_vars(array('CHAR_ICON' => $data['char_icon'], 'NAME' => $data['name'], 'SERVER' => $data['server'], 'ID' => $data['member_id'], 'LOCALE' => $data['clientLocale'], 'LEVEL' => $data['level'], 'RACE' => $data['race'], 'CLASS' => $data['class'], 'GUILD_TITLE' => $data['guild_title'], 'GUILD_NAME' => $data['guild_name'], 'FACTION_EN' => strtolower($rdata['factionEn']), 'FACTION' => $rdata['faction']));
}
示例11: selectQuery
function selectQuery($table, $fieldtoget, $field, $current, $urltorun)
{
global $roster;
/**
* table, field, current option if matching to existing data (EG: $row['state'])
* and you want the drop down to be preselected on their current data, the id field from that table (EG: stateid)
*/
$sql = "SELECT {$fieldtoget} FROM {$table} ORDER BY `quest_data`.{$field} ASC;";
// execute SQL query and get result
$sql_result = $roster->db->query($sql) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $sql);
// put data into drop-down list box
while ($row = $roster->db->fetch($sql_result)) {
$id = rawurlencode($row["{$field}"]);
// must leave double quote
$optiontocompare = $row["{$field}"];
// must leave double quote
$optiontodisplay = $row["{$field}"];
// must leave double quote
$roster->tpl->assign_block_vars($field . '_list', array('NAME' => $optiontodisplay, 'VALUE' => makelink("{$urltorun}={$id}", true), 'SELECTED' => stripslashes($current) == $optiontocompare ? true : false));
}
}
示例12: guide_step2
function guide_step2()
{
global $roster;
$roster->tpl->assign_var('S_STEP_2', true);
$name = trim(post_or_db('name'));
$server = trim(post_or_db('server'));
$region = strtoupper(substr(trim(post_or_db('region')), 0, 2));
if (!empty($name) || !empty($server) || !empty($region)) {
$query = "UPDATE `" . $roster->db->table('upload') . "` SET `default` = '0';";
if (!$roster->db->query($query)) {
die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
}
$query = "INSERT INTO `" . $roster->db->table('upload') . "`" . " (`name`,`server`,`region`,`type`,`default`)" . " VALUES ('" . $name . "','" . $server . "','" . $region . "','0','1');";
if (!$roster->db->query($query)) {
die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
}
$roster->tpl->assign_var('MESSAGE', messagebox(sprintf($roster->locale->act['guide_complete'], makelink('rostercp-install'))));
} else {
$roster->tpl->assign_var('MESSAGE', messagebox($roster->locale->act['upload_rules_error'], '', 'sred'));
}
}
示例13: parse_sql
/**
* Parse multi-line SQL statements into a single line
*
* @param string $sql SQL file contents
* @param char $delim End-of-statement SQL delimiter
* @return array
*/
function parse_sql($sql, $delim)
{
if ($sql == '') {
die_quietly('Could not obtain SQL structure/data');
}
$retval = array();
$statements = explode($delim, $sql);
unset($sql);
$linecount = count($statements);
for ($i = 0; $i < $linecount; $i++) {
if ($i != $linecount - 1 || strlen($statements[$i]) > 0) {
$statements[$i] = trim($statements[$i]);
if (strpos($statements[$i], $roster->db->table('menu')) === false && strpos($statements[$i], $roster->db->table('menu_button')) === false) {
$statements[$i] = str_replace("\r\n", '', $statements[$i]) . "\n";
// Remove 2 or more spaces
$statements[$i] = preg_replace('#\\s{2,}#', ' ', $statements[$i]);
$retval[] = trim($statements[$i]);
}
}
}
unset($statements);
return $retval;
}
示例14: insert_stat
function insert_stat($itemrawlist)
{
global $roster_conf, $addon_conf, $wowdb;
foreach ($itemrawlist as $group => $itemraw) {
$item = explode("\n", $itemraw);
foreach ($item as $itemsplit) {
$itemtmp = explode("\t", $itemsplit);
$itemrowid = $itemtmp[0];
$items = explode(" ", $itemtmp[1]);
$itemcount = count($items);
$insertitems = '';
$insertvals = '';
for ($i = 0; $i < $itemcount; $i++) {
$insertitems .= ', `' . strtolower($items[$i + 1]) . '`';
$itemval = $items[$i];
$insertvals .= ", '" . $itemval . "'";
$i++;
}
$insertsql = "INSERT INTO `roster171_dkpitemstats` (`suffix_id`, `text_id`" . $insertitems . ") VALUES ('" . $itemrowid . "', '" . $group . "'" . $insertvals . ")";
$result = $wowdb->query($insertsql) or die_quietly($wowdb->error(), 'roster_dkp', __FILE__, __LINE__, $insertsql);
print $insertsql . "<br>" . $result . "<br><br>";
}
}
}
示例15: getitemcache
function getitemcache($itemid, $itemname, $itemdkpval = '', $itemquality = 0, $itemcolor = 0, $itemtexture = 0, $update_outdated = 0)
{
global $roster_conf, $addon_conf, $wowdb, $wordings;
$updatecache = FALSE;
$insertcache = FALSE;
$date_now = date("Y-m-d H:i");
$udate_now = date("U");
// Test if our itemcache table exists
$query = "SHOW TABLES LIKE '" . ROSTER_ADDON_DKP_WIZARD_CACHE . "'";
$result = $wowdb->query($query) or die_quietly($wowdb->error(), 'dkp_wizard', __FILE__, __LINE__, $query);
if ($row = $wowdb->fetch_assoc($result)) {
$wowdb->free_result($result);
// Get config values and insert them into the array
$query = "SELECT * FROM `" . ROSTER_ADDON_DKP_WIZARD_CACHE . "` WHERE `item_id` = '" . $itemid . "' LIMIT 1";
$result = $wowdb->query($query) or die_quietly($wowdb->error(), 'dkp_wizard', __FILE__, __LINE__, $query);
if ($row = $wowdb->fetch_assoc($result)) {
$cache_item = $row;
$udate_item = strtotime($cache_item['storedate']);
$oldtooltip = $row['item_tooltip'];
if (($udate_now - $udate_item > 604800 || $udate_item > $udate_now) && $update_outdated) {
// The Store Date of the item in the cache is too old (7 days) or in the future!!!
// Lets re-get the details and update the cache
$updatecache = TRUE;
}
if ($cache_item['item_quality'] != $itemquality && $itemquality) {
// The Item Quality does not match with the cache, lets update the cache
$updatecache = TRUE;
}
if ($cache_item['item_color'] != $itemcolor && $itemcolor) {
// The Item Color does not match with the cache, lets update the cache
$updatecache = TRUE;
}
if ($cache_item['item_texture'] != $itemtexture && $itemtexture) {
// The Item Texture does not match with the cache, lets update the cache
$updatecache = TRUE;
}
if (isset($itemdkpval) && $itemdkpval != '' && $cache_item['dkp_value'] != $itemdkpval) {
// The Item Texture does not match with the cache, lets update the cache
$updatecache = TRUE;
}
} else {
// Item does not exist in cache yet, lets flag the item for caching.
$insertcache = TRUE;
}
$wowdb->free_result($result);
if ($updatecache || $insertcache) {
$itemid_split = explode(":", $itemid);
$url = $addon_conf['allakhazam'] . $itemid_split[0] . '&locale=' . $roster_conf['roster_lang'];
print $url . '<br>';
$itemtooltiptmp = rosterdkp_gettooltip($url);
if (is_array($itemtooltiptmp['set'])) {
$itemset['id'] = $itemtooltiptmp['set']['id'];
$itemset['name'] = $itemtooltiptmp['set']['name'];
} else {
$itemset['id'] = 0;
$itemset['name'] = '';
}
$itemtooltiptmp = $itemtooltiptmp['tooltip'];
$item['item_id'] = $itemid;
// Add the ItemStats based on the SuffixID (if there is any)
$tooltipaddon = '';
if ($itemid_split[2] > 0) {
// Get the Statistics for this Suffix
$query = "SELECT * FROM `" . ROSTER_ADDON_DKP_WIZARD_CACHE_STATS . "` WHERE `suffix_id` = '" . $itemid_split[2] . "' LIMIT 1";
$result = $wowdb->query($query) or die_quietly($wowdb->error(), 'roster_dkp', __FILE__, __LINE__, $query);
if ($row = $wowdb->fetch_assoc($result)) {
foreach ($row as $wording => $value) {
if ($value && $wording != 'suffix_id' && $wording != 'text_id') {
if ($wording == 'block' || $wording == 'dodge') {
$tooltipaddon .= "\n +" . $value . '% ' . $wordings[$roster_conf['roster_lang']][$wording];
} elseif ($wording == 'critical_hit') {
$tooltipaddon .= "\n " . $wordings[$roster_conf['roster_lang']][$wording] . ' +' . $value . '%';
} elseif ($wording == 'on_get_hit_shadow_bolt') {
$tooltipaddon .= "\n " . $wordings[$roster_conf['roster_lang']][$wording] . ' (' . $value . ' ' . $wordings[$roster_conf['roster_lang']]['damage'] . ')';
} else {
$tooltipaddon .= "\n +" . $value . ' ' . $wordings[$roster_conf['roster_lang']][$wording];
}
} elseif ($wording == 'text_id') {
$tooltipaddon_desc = $wordings[$roster_conf['roster_lang']]['statlocal'][$row['text_id']];
}
}
}
}
if ($itemtooltiptmp && isset($oldtooltip)) {
$itemtooltiptmp = $oldtooltip;
}
$itemtooltiptmp = explode("\n", $itemtooltiptmp);
if ($tooltipaddon_desc != '') {
$itemtooltiptmp[0] = str_replace("...", $tooltipaddon_desc, $itemtooltiptmp[0]);
}
$tooltip = implode("\n", $itemtooltiptmp) . $tooltipaddon;
$item['item_tooltip'] = $tooltip;
$item['item_tooltip_escape'] = $wowdb->escape($item['item_tooltip']);
if (!$item['item_tooltip'] || eregi("tem not f", $item['item_tooltip'])) {
$item['item_tooltip'] = $itemname . $tooltipaddon;
$item['item_tooltip_escape'] = $wowdb->escape($item['item_tooltip']);
}
if ($itemname && $itemname != '') {
$item['item_name'] = $wowdb->escape($itemname);
} else {
//.........这里部分代码省略.........