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


PHP template::add方法代码示例

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


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

示例1: template

<?php

$tp = new template();
$tp->add('guilds_table');
$_LANGUAGE->translate($tp);
$tp->display();
开发者ID:demonreborn,项目名称:miniarmory,代码行数:6,代码来源:guilds.php

示例2: makeMenu

 function makeMenu()
 {
     global $config, $ItemClass, $ItemSubClass;
     $menu = new template();
     $menu->add('menu');
     $menu->assign('DKLock', $config['mangos_version'] ? '' : 'display:none');
     $menu->assign('slink', $config['server_link']);
     $menu->assign('sname', $config['server_name']);
     $item_menu = '<li><a href="search.php?searchType=items">Items</a><ul>';
     foreach ($ItemClass as $cl => $name) {
         $item_menu .= '<li ' . (count($ItemSubClass[$cl]) > 1 ? 'class="fly"' : '') . '><a href="search.php?searchType=items&ItemClass=' . $cl . '">' . $name . '</a>';
         if (count($ItemSubClass[$cl]) > 1) {
             $item_menu .= '<ul>';
             foreach ($ItemSubClass[$cl] as $scl => $sname) {
                 $item_menu .= '<li><a href="search.php?searchType=items&ItemClass=' . $cl . '&ItemSubClass=' . $scl . '">' . $sname . '</a></li>';
             }
             $item_menu .= '</ul>';
         }
         $item_menu .= '</li>';
     }
     $menu->assign('items', $item_menu . '</ul></li>');
     return $menu;
 }
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:23,代码来源:class.system.php

示例3: template

<?php

require_once 'init.php';
$c = new template();
$c->add('headers');
$c->assign('title', 'The Armory - ' . $title);
$_LANGUAGE->translateJS($c);
$c->add('menu');
$lang_box = $config['language_change'] ? '<div class="langs">
	<a href="' . $_DOMAIN . '?set_lang=en"><img src="' . $_DOMAIN . 'css/images/en_lang.jpg" width="30" height="20" alt=""></a>
	<a href="' . $_DOMAIN . '?set_lang=pl"><img src="' . $_DOMAIN . 'css/images/pl_lang.jpg" width="30" height="20" alt=""></a>
    </div>' : '';
$c->assign('langs_box', $lang_box);
$c->assign('page_name', '<img src="' . $_DOMAIN . 'css/shadowText.php?text=Armory - ' . $title . '" alt="Armory - ' . $title . '">');
$c->assign('menu' . $_PAGE, 'menu_selected');
$_LANGUAGE->translate($c);
$c->display();
include 'sections/' . $inc . '.php';
//die("sdf".$mysql->QueryCount);
$_SYSTEM->printFooter();
开发者ID:demonreborn,项目名称:miniarmory,代码行数:20,代码来源:index.php

示例4: template

<?php

$tp2 = new template();
$tp2->add('talents/' . $character->classToString($character->class) . '_' . ($config['mangos_version'] == 0 ? 'old' : 'new'));
for ($i = 0; $i < 3; $i++) {
    $tp2->assign('tl' . $i, $character->talentCount[$i]);
}
$script = '<script type="text/javascript">talentConf = "' . $character->talentLink . '";';
foreach ($character->talentInfo as $key => $value) {
    $script .= "talentName[" . $value['id'] . "] = '" . $_SYSTEM->htmlcode($value['name']) . "';";
    $script .= "talentDescription[" . $value['id'] . "] = '" . $_SYSTEM->htmlcode($value['description']) . "';";
    $script .= "talentID[" . $key . "] = '" . $value['id'] . "';";
    if ($value['sBase']) {
        $script .= "talentHID[" . $value['sBase'] . "] = '" . $value['id'] . "';";
    }
}
$script .= 'talentLoad();</script>';
$tp->assign('talent_tree', $tp2->output . $script);
开发者ID:demonreborn,项目名称:miniarmory,代码行数:18,代码来源:char-talents.php

示例5: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('character-empty');
$tabs = new template();
$tabs->add('character-global-tabs');
$tp->assign('tabs', '<script type="text/javascript">characterTab = \'character\';characterSubTab=\'talents\';</script>' . $tabs->output);
include 'sections/character.php';
$tp2 = new template();
//$tp2->add('talents/'.str_replace(' ','',strtolower($character->classToString($character->class))).'_'.($config['mangos_version']==0?'old':'new'));
$tp2->add('talent-calc-global');
$tp2->assign('classId', $character->guid);
$tp2->assign('TBCLower', $config['mangos_version'] ? '0' : '10');
$tp2->assign('treeStr', talent::makeAllTrees($character->class));
$tp2->assign('talstr', $character->talentLink[$character->activeSpec]);
$script = '<script type="text/javascript">lockTalents();
var talentStr_0 = "' . $character->talentLink[0] . '";
var talentStr_1 = "' . $character->talentLink[1] . '";
</script>';
// Glyphs
for ($spcN = 0; $spcN < 2 && $config['mangos_version'] !== 0; $spcN++) {
    $ct = $ct2 = 3;
    $gp1[$spcN] = $gp2[$spcN] = '';
    foreach ($character->Glyphs[$spcN] as $glyph) {
        if ($glyph['type'] == 0) {
            $ct--;
            $gp1[$spcN] .= '<div class="glyph major staticTip" onmouseover="makeGlyphTooltip(&quot;' . $glyph['name'] . '&quot;,&quot;Major Glyph&quot;,&quot;' . $glyph['desc'] . '&quot;)">
	<span><img class="majorGlyphIcon" src="images/talents/glyph-major-1.gif">' . $glyph['name'] . '<div class="glyphTypeText">Major Glyph</div></span></div>';
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:31,代码来源:character-talents.php

示例6: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('character-empty');
$tabs = new template();
$tabs->add('character-global-tabs');
$tp->assign('tabs', '<script type="text/javascript">characterTab = \'character\';characterSubTab=\'statistics\';</script>' . $tabs->output);
include 'sections/character.php';
$a .= '<table cellspacing="0" cellpadding="0" class="achievement"><tbody>
<tr><td id="a_category" class="a_cat"><div class="a_topcat"></div>';
$bcat = $mysql->getRows("SELECT * FROM `achievement_category` WHERE `parent` = '1' ORDER BY `sortOrder`", 'armory');
foreach ($bcat as $cat) {
    $a .= '<div class=a_bodycat>' . '<a id="ach_' . $cat['id'] . '" href="javascript:void(0)" onclick="selectCat(' . $cat['id'] . ',true);">' . $cat['name'] . '</a>';
    $scat = $mysql->getRows("SELECT * FROM `achievement_category` WHERE `parent` = ?1 ORDER BY `sortOrder`", $cat['id'], 'armory');
    if ($scat) {
        foreach ($scat as $sub) {
            $a .= '<a id="ach_' . $sub['id'] . '" class=sub href="javascript:void(0)" onclick="selectCat(' . $sub['id'] . ',true);">' . $sub['name'] . '</a>';
        }
    }
    $a .= '</div>';
}
$a .= '</div><div class=a_bottomcat></div></td>
<td class="a_data"><div class="a_topdata"></div><div id="a_data" class="a_bdydata"></div><div class="a_btmdata"></div></td></tr></tbody></table>
<script type="text/javascript">selectCat(130,true);</script>';
$tp->assign('achievements', $a);
$tp->assign('rep', $a);
$c->assign('content', $tp->output);
$c->display();
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:31,代码来源:character-statistics.php

示例7: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('calc-tabs');
$tp->add('arena-calc');
$tp->assign('talentdisplay', 'style="display:none;"');
$c->assign('content', $tp->output . '<script type="text/javascript">document.getElementById("arenatab").className="selected-tab";</script>');
$c->display();
$_SYSTEM->printFooter();
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:12,代码来源:arena-calc.php

示例8: unset

    } else {
        if ($_GET['searchType'] == 'arenateams') {
            $count[1] = $count[0] = $count[3] = 0;
        } else {
            if ($_GET['searchType'] == 'items') {
                $count[1] = $count[0] = $count[2] = 0;
            }
        }
    }
}
$selected = 'selected-';
foreach ($sections as $key => $sec) {
    if (!$count[$key]) {
        continue;
    }
    if (isset($selected)) {
        $d = $key;
    }
    $tabs .= '<script type="text/javascript">ItemClass=' . $search->ItemClass . ';ItemSubClass=' . $search->ItemSubClass . ';</script><div class="' . $selected . 'tab" id="' . $key . '"><a href="javascript:selectSearchTab(' . $key . ')">' . $sec . '<span class="tab-count" style="display: inline;">(' . $count[$key] . ')</span></a></div>';
    unset($selected);
}
if ($tabs) {
    $tp->add('search');
    $tp->assign('tabs', $tabs);
    $tp->assign('selected', $d);
} else {
    $tp->add('noresults');
}
$c->assign('content', $tp->output);
$c->display();
$_SYSTEM->printFooter();
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:31,代码来源:search.php

示例9: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('guild-info');
$tabs = new template();
$tabs->add('guild-global-tabs');
if ($_GET['characterName']) {
    $tabs->assign('name', $_GET['characterName']);
    $tabs->assign('mode', '&characterName=' . $_GET['characterName']);
} else {
    $tabs->assign('charactertabdisplay', ' style="display:none;"');
    $tabs->assign('mode', '');
}
$tp->assign('tabs', '<script type="text/javascript">characterTab = \'guild\';characterSubTab=\'roster\';</script>' . $tabs->output);
include 'sections/guild.php';
$c->assign('content', $tp->output);
$c->assign('rep', '');
$c->display();
$_SYSTEM->printFooter();
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:22,代码来源:guild-info.php

示例10: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('arena-ladder');
$_GET['type'] = (int) $_GET['type'];
if (!in_array($_GET['type'], array(2, 3, 5))) {
    $_SYSTEM->error("Invalid team type.");
}
$r = $mysql->getRows("select arena_team.*,arena_team_stats.*,characters.race from arena_team,arena_team_stats,characters where arena_team.arenateamid = arena_team_stats.arenateamid and characters.guid = arena_team.captainguid and arena_team.type = ?1 order by rating desc limit ?2", $_GET['type'], $config['ladder_rows_limit'], 'char');
if ($r) {
    $i = 1;
    foreach ($r as $row) {
        $row['faction'] = character::getAlliance($row['race']);
        $table .= '<tr onMouseOver="zoomInArenaIcon(this)" onMouseOut="zoomOutArenaIcon(this)"><td class="rightNum" style="font-weight: bold;">' . $i++ . '</td><td>
		<div style="float:left;"><img border="0" src="' . getSmallArenaIcon($row) . '" width="20" height="20" alt="" style=" position: absolute;left:0px;top:4px;z-index:1;"> <a href="team-info.php?Realm={$realm}&name=' . $row['name'] . '&type=' . $row['type'] . '" style="margin-left:25px;margin-top:5px;position:absolute;">' . $row['name'] . '</a></div></td><td style="white-space: nowrap">{$realm}</td><td class="centNum"><img class="" src="images/icons/faction/icon-' . $row['faction'] . '.gif" ></td><td class="rightNum" style="font-weight: bold; color: #678705;">' . $row['wins2'] . '</td><td class="rightNum" style="font-weight: bold; color: #9A1401;">' . ($row['played'] - $row['wins2']) . '</td><td class="rightNum" style="font-weight: bold;">' . $row['rating'] . '</td>
</tr>';
    }
} else {
    $table = '<tr><td colspan="7">No results</td></tr>';
}
$tp->assign('table', $table);
$tp->assign('realm', $_SYSTEM->Realms[$_SYSTEM->Realm]);
if (count($_SYSTEM->Realms) > 1) {
    foreach ($_SYSTEM->Realms as $r) {
        $realmlist .= '<a href="arena-ladder.php?Realm=' . $r . '&type=' . $_GET['type'] . '">' . $r . '</a>, ';
    }
}
$tp->assign('realmlist', $realmlist ? '(Realms: ' . substr($realmlist, 0, -2) . ')' : '');
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:31,代码来源:arena-ladder.php

示例11: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('honor-ranking');
if (!in_array($_GET['type'], array('hk', 'honor'))) {
    $_SYSTEM->error("Invalid ranking type.");
}
$r = $mysql->getRows("select characters.name,characters.race,characters.class,?2 as gender,?1 as hh,guild.name as gname,?4 as level from characters left join guild on guild.guildid = ?3 where ?1 < 2000000000 order by ?1 desc limit ?5", $_GET['type'] == 'hk' ? SQL_template(CHAR_HK_OFFSET) : SQL_template(CHAR_HONOR_OFFSET), CHAR_GENDER_OFFSET, SQL_template(CHAR_GUILD_OFFSET), SQL_template(CHAR_LEVEL_OFFSET), $config['ladder_rows_limit'], 'char');
if ($r) {
    $i = 1;
    foreach ($r as $row) {
        $row['faction'] = character::getAlliance($row['race']);
        $table .= '<tr onMouseOver="zoomInArenaIcon(this)" onMouseOut="zoomOutArenaIcon(this)"><td class="rightNum" style="font-weight: bold;">' . $i++ . '</td><td>
		<a href="character-sheet.php?Realm={$realm}&name=' . $row['name'] . '">' . $row['name'] . '</a></td><td style="white-space: nowrap">' . $row['level'] . '</td><td class="centNum"><img src="images/icons/race/' . $row['race'] . '-' . $row['gender'] . '.gif" > <img src="images/icons/class/' . $row['class'] . '.gif" ></td><td class="centNum"><img class="" src="images/icons/faction/icon-' . $row['faction'] . '.gif" ></td><td style="font-weight: bold; color: #678705;">' . ($row['gname'] ? '<a href="guild-info.php?Realm={$realm}&name=' . $row['gname'] . '">' . $row['gname'] . '</a>' : 'None') . '</td><td class="rightNum" style="font-weight: bold;">' . $row['hh'] . '</td>
</tr>';
    }
} else {
    $table = '<tr><td colspan="7">No results</td></tr>';
}
$tp->assign('table', $table);
$tp->assign('realm', $_SYSTEM->Realms[$_SYSTEM->Realm]);
if (count($_SYSTEM->Realms) > 1) {
    foreach ($_SYSTEM->Realms as $r) {
        $realmlist .= '<a href="honor-ranking.php?Realm=' . $r . '&type=' . $_GET['type'] . '">' . $r . '</a>, ';
    }
}
$tp->assign('realmlist', $realmlist ? '(Realms: ' . substr($realmlist, 0, -2) . ')' : '');
$tp->assign('type', $_GET['type'] == 'hk' ? 'HK' : 'Honor');
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:31,代码来源:honor-ranking.php

示例12: template

<?php

//$c->add('table');
$tp = new template();
$tp->add('arenateams');
switch ($_GET['ArenaType']) {
    case '2v2':
        $type = '2 vs. 2';
        $sqlType = 2;
        $_GET['ArenaType'] = '2v2';
        break;
    case '3v3':
        $type = '3 vs. 3';
        $sqlType = 3;
        $_GET['ArenaType'] = '3v3';
        break;
    case '5v5':
        $type = '5 vs. 5';
        $sqlType = 5;
        $_GET['ArenaType'] = '5v5';
        break;
    default:
        $type = '2 vs. 2';
        $sqlType = 2;
        $_GET['ArenaType'] = '2v2';
}
$tp->assign('type', $type);
$data = pvpladder();
$data->ArenaType = $sqlType;
$realms = '<br>
<span class="page-subheader">(Realms: ';
开发者ID:demonreborn,项目名称:miniarmory,代码行数:31,代码来源:arenateams.php

示例13: template

<?php

$tp = new template();
$tp->add('guild');
$guild = guild($_GET['guild']);
if ($guild->id == -1) {
    $_SYSTEM->error('Guild not found!');
}
$tp->assign('name', $guild->name);
$tp->assign('gm_id', $guild->leader_id);
$tp->assign('gm', $guild->leader);
$tp->assign('faction', $guild->faction ? $_LANGUAGE->text['horde'] : $_LANGUAGE->text['alliance']);
$tp->assign('alliance', $guild->faction);
$tp->assign('gender_nr', $guild->leader_gender);
$tp->assign('members', $guild->members);
$tp->assign('race_nr', $guild->leader_race);
$tp->assign('class_nr', $guild->leader_class);
$tp->assign('realm', $guild->realm);
$tp->assign('realmid', $guild->realmID);
$tp->assign('race', $_LANGUAGE->text[character::raceToString($guild->leader_race)]);
$tp->assign('class', $_LANGUAGE->text[character::classToString($guild->leader_class)]);
$_LANGUAGE->translate($tp);
$tp->display();
开发者ID:demonreborn,项目名称:miniarmory,代码行数:23,代码来源:guild.php

示例14: template

<?php

$tp = new template();
$tp->add('character');
$character = character($_GET['character']);
$tp->assign('category', $_GET['category']);
$tp->assign('lastupdate', date("H:i d-m-Y", $character->lastupdate));
if ($character->guid == -1) {
    $_SYSTEM->error('Character not found!');
}
// Ustawianie reputacji
include 'sections/char-reputation.php';
// teraz skili
include 'sections/char-skills.php';
// Talenty
include 'sections/char-talents.php';
// Achievements :)
include 'sections/char-achievements.php';
// Ustawianie itemkow
for ($i = 0; $i < 19; $i++) {
    $todo = '<div class="item-bg" onMouseOut="tooltip_hide();" onMouseOver="tooltip(\'' . $_SYSTEM->htmlcode($character->item_tooltips[$i]) . '\');">';
    if ($character->get_item_icon($i) !== false) {
        $todo .= '<img src="' . $character->get_item_icon($i) . '" alt="">';
    }
    $todo .= '</div>';
    $tp->assign('ITEM_SLOT_' . $i, $todo);
}
// Podstawowe informacje
$tp->assign('guid', $character->guid);
$tp->assign('name', $character->name);
$tp->assign('guid', $character->guid);
开发者ID:demonreborn,项目名称:miniarmory,代码行数:31,代码来源:character.php

示例15: template

<?php

require 'init.php';
$c->add('main');
$c->assign('menu', $menu->output);
$tp = new template();
$tp->add('team-info');
$r = $mysql->getRow("select arena_team.*,arena_team_stats.* from arena_team,arena_team_stats where arena_team_stats.arenateamid = arena_team.arenateamid and name = '?1' and type = ?2", $_GET['name'], (int) $_GET['type'], 'char');
if (!$r) {
    $_SYSTEM->error("Arena Team not found.");
}
$tp->assign('name', $r['name']);
$tp->assign('type', $r['type']);
$rank = getArenaRank($r['arenateamid']);
$place = getPlace($rank[1]);
$tp->assign('rank', $rank[0]);
$tp->assign('place', $place);
$tp->assign('rank_border', $rank[2]);
$tp->assign('wg', $r['games']);
$tp->assign('ww', $r['wins']);
$tp->assign('wl', $r['games'] - $r['wins']);
$tp->assign('wp', $r['games'] ? round($r['wins'] / $r['games'] * 100) : 0);
$tp->assign('wr', $r['rating']);
$tp->assign('sg', $r['played']);
$tp->assign('sw', $r['wins2']);
$tp->assign('sl', $r['played'] - $r['wins2']);
$tp->assign('sp', $r['played'] ? round($r['wins2'] / $r['played'] * 100) : 0);
$icon = getSmallArenaIcon($r);
$tp->assign('icon', $icon);
$m = $mysql->getRows("select arena_team_member.*,characters.name,characters.race,characters.class,?3 as level,?4 as gender,guild.name as gname from arena_team_member inner join characters on arena_team_member.guid= characters.guid left join guild on guild.guildid = ?2 where arena_team_member.arenateamid = ?1", $r['arenateamid'], SQL_template(CHAR_GUILD_OFFSET), SQL_template(CHAR_LEVEL_OFFSET), CHAR_GENDER_OFFSET, 'char');
if ($m) {
开发者ID:BetaScripts,项目名称:armory4trinity,代码行数:31,代码来源:team-info.php


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