当前位置: 首页>>代码示例>>PHP>>正文


PHP item::type方法代码示例

本文整理汇总了PHP中item::type方法的典型用法代码示例。如果您正苦于以下问题:PHP item::type方法的具体用法?PHP item::type怎么用?PHP item::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在item的用法示例。


在下文中一共展示了item::type方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: msg

     break;
 case 'delete':
     $itemid or msg('请选择信息');
     isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
     dmsg('删除成功', $forward);
     break;
 case 'level':
     $itemid or msg('请选择信息');
     $level = intval($level);
     $do->level($itemid, $level);
     dmsg('级别设置成功', $forward);
     break;
 case 'type':
     $itemid or msg('请选择信息');
     $typeid = intval($typeid);
     $do->type($itemid, $typeid);
     dmsg('分类设置成功', $forward);
     break;
 default:
     $sfields = array('标题', '简介', '会员名');
     $dfields = array('title', 'introduce', 'username');
     isset($fields) && isset($dfields[$fields]) or $fields = 0;
     $level = isset($level) ? intval($level) : 0;
     $typeid = isset($typeid) ? intval($typeid) : 0;
     $thumb = isset($thumb) ? intval($thumb) : 0;
     $itemid or $itemid = '';
     $fields_select = dselect($sfields, 'fields', '', $fields);
     $level_select = level_select('level', '级别', $level);
     $type_select = type_select($tid, 0, 'typeid', '默认', $typeid);
     $condition = "specialid={$specialid}";
     if ($keyword) {
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:item.inc.php

示例2: item

while ($row = mysql_fetch_array($results)) {
    $tempitem = new item($row);
    for ($i = 1; $i <= 5; $i++) {
        if ($row["augslot" . $i]) {
            $query = "SELECT * from items where id = " . $row["augslot" . $i] . " LIMIT 1";
            if (defined('DB_PERFORMANCE')) {
                dbp_query_stat('query', $query);
            }
            //added 9/28/2014
            $augresults = mysql_query($query);
            $augrow = mysql_fetch_array($augresults);
            $tempitem->addaug($augrow);
            $itemstats->additem($augrow);
        }
    }
    if ($tempitem->type() == EQUIPMENT) {
        $itemstats->additem($row);
    }
    if ($tempitem->type() == EQUIPMENT || $tempitem->type() == INVENTORY) {
        $itemstats->addWT($row['weight']);
    }
    $allitems[$tempitem->slot()] = $tempitem;
}
//drop page
$d_title = " - " . $name . $language['PAGE_TITLES_CHARACTER'];
include "include/header.php";
//build body template
$template->set_filenames(array('character' => 'character_body.tpl'));
$template->assign_vars(array('HIGHLIGHT_GM' => $highlightgm && $gm ? "GM" : "", 'REGEN' => $itemstats->regen(), 'FT' => $itemstats->FT(), 'DS' => $itemstats->DS(), 'HASTE' => $itemstats->haste(), 'FIRST_NAME' => $name, 'LAST_NAME' => $last_name, 'TITLE' => $title, 'GUILD_NAME' => $guild_name, 'LEVEL' => $level, 'CLASS' => $dbclassnames[$class], 'RACE' => $dbracenames[$race], 'CLASS_NUM' => $class, 'DEITY' => $dbdeities[$deity], 'HP' => GetMaxHP($level, $class, $baseSTA + $itemstats->STA(), $itemstats->hp()), 'MANA' => GetMaxMana($level, $class, $baseINT + $itemstats->INT(), $baseWIS + $itemstats->WIS(), +$itemstats->mana()), 'ENDR' => GetMaxEndurance($baseSTR + $itemstats->STR(), $baseSTA + $itemstats->STA(), $baseDEX + $itemstats->DEX(), $baseAGI + $itemstats->AGI(), $level, $itemstats->endurance()), 'AC' => GetMaxAC($baseAGI + $itemstats->AGI(), $level, $defense, $class, $itemstats->AC(), $race), 'ATK' => GetMaxAtk($itemstats->attack(), $baseSTR + $itemstats->STR(), $offense), 'STR' => $baseSTR + $itemstats->STR(), 'STA' => $baseSTA + $itemstats->STA(), 'DEX' => $baseDEX + $itemstats->DEX(), 'AGI' => $baseAGI + $itemstats->AGI(), 'INT' => $baseINT + $itemstats->INT(), 'WIS' => $baseWIS + $itemstats->WIS(), 'CHA' => $baseCHA + $itemstats->CHA(), 'HSTR' => $itemstats->HSTR(), 'HSTA' => $itemstats->HSTA(), 'HDEX' => $itemstats->HDEX(), 'HAGI' => $itemstats->HAGI(), 'HINT' => $itemstats->HINT(), 'HWIS' => $itemstats->HWIS(), 'HCHA' => $itemstats->HCHA(), 'POISON' => PRbyRace($race) + $PRbyClass[$class] + $itemstats->PR(), 'FIRE' => FRbyRace($race) + $FRbyClass[$class] + $itemstats->FR(), 'MAGIC' => MRbyRace($race) + $MRbyClass[$class] + $itemstats->MR(), 'DISEASE' => DRbyRace($race) + $DRbyClass[$class] + $itemstats->DR(), 'COLD' => CRbyRace($race) + $CRbyClass[$class] + $itemstats->CR(), 'HPOISON' => $itemstats->HPR(), 'HFIRE' => $itemstats->HFR(), 'HMAGIC' => $itemstats->HMR(), 'HDISEASE' => $itemstats->HDR(), 'HCOLD' => $itemstats->HCR(), 'WEIGHT' => round($itemstats->WT() / 10), 'PP' => $mypermission['coininventory'] ? $language['MESSAGE_DISABLED'] : $pp, 'GP' => $mypermission['coininventory'] ? $language['MESSAGE_DISABLED'] : $gp, 'SP' => $mypermission['coininventory'] ? $language['MESSAGE_DISABLED'] : $sp, 'CP' => $mypermission['coininventory'] ? $language['MESSAGE_DISABLED'] : $cp, 'BPP' => $mypermission['coinbank'] ? $language['MESSAGE_DISABLED'] : $bpp, 'BGP' => $mypermission['coinbank'] ? $language['MESSAGE_DISABLED'] : $bgp, 'BSP' => $mypermission['coinbank'] ? $language['MESSAGE_DISABLED'] : $bsp, 'BCP' => $mypermission['coinbank'] ? $language['MESSAGE_DISABLED'] : $bcp, 'L_HEADER_INVENTORY' => $language['CHAR_INVENTORY'], 'L_HEADER_BANK' => $language['CHAR_BANK'], 'L_REGEN' => $language['CHAR_REGEN'], 'L_FT' => $language['CHAR_FT'], 'L_DS' => $language['CHAR_DS'], 'L_HASTE' => $language['CHAR_HASTE'], 'L_HP' => $language['CHAR_HP'], 'L_MANA' => $language['CHAR_MANA'], 'L_ENDR' => $language['CHAR_ENDR'], 'L_AC' => $language['CHAR_AC'], 'L_ATK' => $language['CHAR_ATK'], 'L_STR' => $language['CHAR_STR'], 'L_STA' => $language['CHAR_STA'], 'L_DEX' => $language['CHAR_DEX'], 'L_AGI' => $language['CHAR_AGI'], 'L_INT' => $language['CHAR_INT'], 'L_WIS' => $language['CHAR_WIS'], 'L_CHA' => $language['CHAR_CHA'], 'L_HSTR' => $language['CHAR_HSTR'], 'L_HSTA' => $language['CHAR_HSTA'], 'L_HDEX' => $language['CHAR_HDEX'], 'L_HAGI' => $language['CHAR_HAGI'], 'L_HINT' => $language['CHAR_HINT'], 'L_HWIS' => $language['CHAR_HWIS'], 'L_HCHA' => $language['CHAR_HCHA'], 'L_POISON' => $language['CHAR_POISON'], 'L_MAGIC' => $language['CHAR_MAGIC'], 'L_DISEASE' => $language['CHAR_DISEASE'], 'L_FIRE' => $language['CHAR_FIRE'], 'L_COLD' => $language['CHAR_COLD'], 'L_HPOISON' => $language['CHAR_HPOISON'], 'L_HMAGIC' => $language['CHAR_HMAGIC'], 'L_HDISEASE' => $language['CHAR_HDISEASE'], 'L_HFIRE' => $language['CHAR_HFIRE'], 'L_HCOLD' => $language['CHAR_HCOLD'], 'L_WEIGHT' => $language['CHAR_WEIGHT'], 'L_AAS' => $language['BUTTON_AAS'], 'L_KEYS' => $language['BUTTON_KEYS'], 'L_FLAGS' => $language['BUTTON_FLAGS'], 'L_SKILLS' => $language['BUTTON_SKILLS'], 'L_CORPSE' => $language['BUTTON_CORPSE'], 'L_INVENTORY' => $language['BUTTON_INVENTORY'], 'L_FACTION' => $language['BUTTON_FACTION'], 'L_BOOKMARK' => $language['BUTTON_BOOKMARK'], 'L_CHARMOVE' => $language['BUTTON_CHARMOVE'], 'L_CONTAINER' => $language['CHAR_CONTAINER'], 'L_DONE' => $language['BUTTON_DONE']));
//dump inventory items ICONS
foreach ($allitems as $value) {
开发者ID:EQMacEmu,项目名称:magelo,代码行数:31,代码来源:character.php

示例3: item

$results = mysql_query($query);
while ($row = mysql_fetch_array($results)) {
    $tempitem = new item($row);
    for ($i = 1; $i <= 5; $i++) {
        if ($row["augslot" . $i]) {
            $query = "SELECT * from items where id = " . $row["augslot" . $i] . " LIMIT 1";
            if (defined('DB_PERFORMANCE')) {
                dbp_query_stat('query', $query);
            }
            //added 9/28/2014
            $augresults = mysql_query($query);
            $augrow = mysql_fetch_array($augresults);
            $itemstats->additem($augrow);
        }
    }
    if ($tempitem->type() == EQUIPMENT) {
        $itemstats->additem($row);
    }
}
if ($epicbg) {
    $query = "SELECT items.icon, items.id FROM items \r\n             JOIN titles ON items.id = titles.item_id\r\n             JOIN character_inventory ON items.id = character_inventory.itemid\r\n             WHERE character_inventory.id = {$charID}\r\n               AND titles.class = {$class}\r\n             ORDER BY items.id DESC\r\n             LIMIT 0, 1;";
    if (defined('DB_PERFORMANCE')) {
        dbp_query_stat('query', $query);
    }
    //added 9/28/2014
    $results = mysql_query($query);
    if ($row = mysql_fetch_array($results)) {
        $epicicon = sprintf($path['EPIC'], $row['icon']);
    }
}
$chardata = array('FIRST_NAME' => $name, 'LAST_NAME' => $last_name, 'TITLE' => $title, 'GUILD_NAME' => $guild_name, 'GUILD_RANK' => $guild_rank, 'LEVEL' => $level, 'CLASS' => $dbclassnames[$class], 'RACE' => $dbracenames[$race], 'DEITY' => $dbdeities[$deity]);
开发者ID:EQMacEmu,项目名称:magelo,代码行数:31,代码来源:sig.php

示例4: get_results

 public function get_results()
 {
     global $DB;
     $results = array();
     if (is_null($this->params['search'])) {
         return $this->results = $results;
     }
     $fullname = $DB->sql_fullname('u.firstname', 'u.lastname');
     $search = array();
     $searchsql = "";
     if ($this->params['search']) {
         $search = array($DB->sql_like('i.caption', '?', false, false), $DB->sql_like($fullname, '?', false, false), $DB->sql_like('u.username', '?', false, false), $DB->sql_like('f.filename', '?', false, false));
         $searchsql = 'AND (' . implode(' OR ', $search) . ')';
     }
     $params = array($this->params['context']->id, $this->params['collection']->id);
     $groupswhere = '';
     if ($this->params['group']) {
         $groupswhere = "AND i.userid IN (\n                SELECT DISTINCT gm.userid\n                FROM {groups_members} gm\n                JOIN {groups} g ON g.id = gm.groupid\n                WHERE g.id = ?\n            )";
         $params[] = $this->params['group'];
     }
     $roleswhere = '';
     if ($this->params['role']) {
         $roleswhere = " AND i.userid IN (\n                SELECT ra.userid\n                FROM {role_assignments} ra\n                WHERE ra.contextid = ? AND ra.roleid = ?\n            )";
         $params[] = $this->params['context']->get_course_context()->id;
         $params[] = $this->params['role'];
     }
     if (count($search) > 0) {
         $params += array_fill(count($params), count($search), '%' . $this->params['search'] . '%');
     }
     $select = "i.*, i.id AS itemid, i.caption AS itemcaption, g.id AS galleryid, g.name AS galleryname,\n                    {$fullname} as creator, i.userid";
     $sql = "SELECT g.*\n                FROM {mediagallery_item} i\n                JOIN {mediagallery_gallery} g ON i.galleryid = g.id\n                JOIN {mediagallery} m ON g.instanceid = m.id\n                JOIN {user} u ON i.userid = u.id\n                LEFT JOIN {files} f ON f.itemid = i.id AND f.contextid = ? AND f.component = 'mod_mediagallery'\n                    AND f.filearea = 'item' AND f.filename != '.'\n                WHERE m.id = ? {$groupswhere} {$roleswhere} {$searchsql}";
     $grs = $DB->get_recordset_sql($sql, $params);
     $gallerys = array();
     foreach ($grs as $galleryrecord) {
         $gallerys[$galleryrecord->id] = new gallery($galleryrecord, array('collection' => $this->params['collection']));
     }
     $sql = str_replace('g.*', $select, $sql);
     $rs = $DB->get_recordset_sql($sql, $params);
     $userids = array();
     foreach ($rs as $record) {
         $item = new item($record, array('nogallery' => true));
         if ($this->params['type'] != base::TYPE_ALL && $item->type() != $this->params['type']) {
             continue;
         }
         if (!$gallerys[$record->galleryid]->user_can_view()) {
             continue;
         }
         $userids[$record->userid] = true;
         $results[$record->id] = $record;
     }
     $userids = array_keys($userids);
     $groups = $this->get_groups_for_users($userids);
     $roles = $this->get_roles_for_users($userids);
     // Now with the list of userids, lookup the groups and roles for display.
     foreach ($results as $record) {
         if (isset($groups[$record->userid])) {
             asort($groups[$record->userid]);
         }
         if (isset($roles[$record->userid])) {
             asort($roles[$record->userid]);
         }
         $record->groups = isset($groups[$record->userid]) ? $groups[$record->userid] : array();
         $record->roles = isset($roles[$record->userid]) ? $roles[$record->userid] : array();
     }
     return $this->results = $results;
 }
开发者ID:eSrem,项目名称:moodle-mod_mediagallery,代码行数:66,代码来源:search.php


注:本文中的item::type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。