本文整理汇总了PHP中system::htmlcode方法的典型用法代码示例。如果您正苦于以下问题:PHP system::htmlcode方法的具体用法?PHP system::htmlcode怎么用?PHP system::htmlcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system
的用法示例。
在下文中一共展示了system::htmlcode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
function start()
{
global $config, $SQL, $mysql, $_SYSTEM;
$il = $this->per_page;
$st = $this->per_page * $this->page;
$LIMIT = 'LIMIT ' . $st . ', ' . $il;
$data = array();
$d = $mysql->getRows("SELECT name,displayid,ItemLevel,entry,Flags,RequiredLevel,class,subclass,Quality FROM `item_template` WHERE name LIKE '%?1%'\n\t\t" . ($this->ItemClass != -1 ? 'and class = ' . $this->ItemClass : '') . " " . ($this->ItemSubClass != -1 ? 'and subclass = ' . $this->ItemSubClass : '') . " ORDER BY ItemLevel DESC {$LIMIT}", $this->name, 'world');
$this->count = mysql_result($mysql->query("SELECT count(*) FROM `item_template` WHERE name LIKE '%" . $this->name . "%' " . ($this->ItemClass != -1 ? 'and class = ' . $this->ItemClass : '') . " " . ($this->ItemSubClass != -1 ? 'and subclass = ' . $this->ItemSubClass : ''), 'world'), 0) or $this->count = 0;
if (!$d) {
return;
}
foreach ($d as $dat) {
$ids .= $dat['entry'] . ',';
}
$c = $mysql->getRows("select itemnumber,itemicon,itemhtml from itemicon where itemnumber in (?1-1)", $ids, 'armory');
if ($c) {
foreach ($c as $icon) {
$icons[$icon['itemnumber']] = $icon;
}
}
foreach ($d as $key => $dat) {
$icons[$dat['entry']] = validate_icon($icons[$dat['entry']], $dat['entry']);
$d[$key]['icon'] = $icons[$dat['entry']]['itemicon'];
$d[$key]['tooltip'] = system::htmlcode($icons[$dat['entry']]['itemhtml']);
}
$quest = $mysql->getRows("SELECT `SrcItemId` as id FROM `quest_template` WHERE `SrcItemId` IN (?1-1)", $ids, 'world');
$vendor = $mysql->getRows("SELECT `item` as id FROM `npc_vendor` WHERE `item` IN (?1-1)", $ids, 'world');
$chest = $mysql->getRows("SELECT `gameobject_loot_template`.`item` as id FROM `gameobject_loot_template`,`gameobject_template` WHERE gameobject_template.entry = gameobject_loot_template.entry `item` IN (?1-1)", $ids, 'world');
$drop = $mysql->getRows("SELECT `item` as id FROM `creature_loot_template` WHERE `item` IN (?1-1)", $ids, 'world');
$quest_rew = $mysql->getRows("SELECT RewChoiceItemId1,RewChoiceItemId2,RewChoiceItemId3,RewChoiceItemId4,RewChoiceItemId5,RewChoiceItemId6,\n RewItemId1,RewItemId2,RewItemId3,RewItemId4\n FROM `quest_template` WHERE `RewChoiceItemId1`IN (?1-1) OR `RewChoiceItemId2`IN (?1-1)\n\tOR `RewChoiceItemId3`IN (?1-1) OR `RewChoiceItemId4`IN (?1-1) OR `RewChoiceItemId5`IN (?1-1) OR `RewChoiceItemId6`IN (?1-1)\n\tOR `RewItemId1`IN (?1-1) OR `RewItemId2`IN (?1-1) OR `RewItemId3`IN (?1-1) OR `RewItemId4`IN (?1-1)", $ids, 'world');
foreach ($d as $key => $dat) {
$id = $dat['entry'];
$d[$key]['source'] = '';
if ($quest) {
foreach ($quest as $q) {
if (in_array($id, $q)) {
$d[$key]['source'] .= 'Quest Item, ';
break;
}
}
}
if ($vendor) {
foreach ($vendor as $q) {
if (in_array($id, $q)) {
if ($dat['Flags'] & 32768 == 32768) {
$d[$key]['source'] .= 'PVP Reward, ';
break;
} else {
$d[$key]['source'] .= 'Vendor, ';
break;
}
}
}
}
if ($chest) {
foreach ($chest as $q) {
if (in_array($id, $q)) {
$d[$key]['source'] .= 'Chest Drop, ';
break;
}
}
}
if ($drop) {
foreach ($drop as $q) {
if (in_array($id, $q)) {
$d[$key]['source'] .= 'Drop, ';
break;
}
}
}
if ($quest_rew) {
foreach ($quest_rew as $q) {
if (in_array($id, $q)) {
$d[$key]['source'] .= 'Quest Reward, ';
break;
}
}
}
if (!$d[$key]['source']) {
$d[$key]['source'] = 'Created, ';
}
$d[$key]['source'] = substr($d[$key]['source'], 0, -2);
}
$data = $d;
return $data;
}
示例2: foreach
}
$tp->assign('reward', $rewardTP);
// Disenchant
if ($itemData['DisenchantID']) {
$de = $mysql->getRows("SELECT item_template.name,item_template.entry,item_template.Quality,disenchant_loot_template.item,disenchant_loot_template.ChanceOrQuestChance,disenchant_loot_template.mincountOrRef,disenchant_loot_template.maxcount\n\t FROM `disenchant_loot_template`,`item_template`\n\t WHERE disenchant_loot_template.item = item_template.entry and disenchant_loot_template.entry = ?1 limit 20", $itemData['DisenchantID'], 'world');
if ($de) {
$deTP = '<div class="rel-tab"><p class="rel-de"/><h3>Disenchants into:</h3></div>
<div class="data" style="clear: both;" id="big-results">
<table class="data-table"><thead><tr class="masthead"><td><a class="noLink">Name</a></td><td align="center"><a class="noLink">Drop Chance</a></td><td align="center"><a class="noLink">Count</a></td></tr></thead><tbody>';
foreach ($de as $mob) {
$ids .= $mob['entry'] . ',';
}
$cc = $mysql->getRows("select itemnumber,itemicon,itemhtml from itemicon where itemnumber in (?1-1)", $ids, 'armory');
if ($cc) {
foreach ($cc as $icon) {
$icons[$icon['itemnumber']] = $icon;
}
}
foreach ($de as $mob) {
$icons[$mob['entry']] = validate_icon($icons[$mob['entry']], $mob['entry']);
$deTP .= '<tr><td><strong><a onMouseOver="setTipText(\'' . system::htmlcode($icons[$mob['entry']]['itemhtml']) . '\')" href="item-info.php?i=' . $mob['entry'] . '" class="staticTip rarity' . $mob['Quality'] . '">
<img align="middle" border="0" height="48" alt="" src="images/icon48/' . $icons[$mob['entry']]['itemicon'] . '.png"> ' . $mob['name'] . '</a></strong></td><td class="centeralign">' . round($mob['ChanceOrQuestChance'], 2) . '%</td>
<td>' . ($mob['mincountOrRef'] == $mob['maxcount'] ? $mob['maxcount'] : $mob['mincountOrRef'] . '-' . $mob['maxcount']) . '</td></tr>';
}
$deTP .= '</tbody></table></div>';
}
}
$tp->assign('de', $deTP);
$c->assign('content', $tp->output);
$c->display();
$_SYSTEM->printFooter();
示例3: header
header("content-type: text/xml");
$_FPREFIX = '../';
include '../init.php';
$_SEARCH = new search_item(nameToDB($_GET['name']), (int) $_GET['page']);
if (isset($_GET['ItemClass'])) {
$_SEARCH->ItemClass = (int) $_GET['ItemClass'];
}
if (isset($_GET['ItemSubClass'])) {
$_SEARCH->ItemSubClass = (int) $_GET['ItemSubClass'];
}
$data = $_SEARCH->start();
$oc = count($data) - $_SEARCH->per_page;
echo '<?xml version="1.0" encoding="utf-8"?>
<items>
<overcount>' . $oc . '</overcount>' . "\n";
echo '<count>' . $_SEARCH->count . '</count>' . "\n";
for ($i = 0; $i < count($data) && $i < $_SEARCH->per_page; $i++) {
$temp = $data[$i];
echo '<item>' . "\n";
foreach ($temp as $key => $value) {
if ($value == '') {
$value = ' ';
}
echo '<' . $key . '>' . $value . '</' . $key . '>' . "\n";
}
echo '<category>' . system::htmlcode($ItemClass[$temp['class']]) . '</category>' . "\n";
echo '<subcategory>' . system::htmlcode($ItemSubClass[$temp['class']][$temp['subclass']]) . '</subcategory>' . "\n";
echo '</item>' . "\n";
}
echo '</items>' . "\n";