• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tmpl_set函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tmpl_set函数的典型用法代码示例。如果您正苦于以下问题:PHP tmpl_set函数的具体用法?PHP tmpl_set怎么用?PHP tmpl_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: improvement_deleteConfirm

function improvement_deleteConfirm($caveID, $buildingID)
{
    global $config, $db, $no_resource_flag, $buildingTypeList, $params;
    $no_resource_flag = 1;
    // Show confirmation request
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'dialog.ihtml');
    tmpl_set($template, 'message', sprintf(_('Möchten Sie 1 %s abreissen?'), $buildingTypeList[$buildingID]->name));
    tmpl_set($template, 'BUTTON/formname', 'confirm');
    tmpl_set($template, 'BUTTON/text', _('Abreißen'));
    tmpl_set($template, 'BUTTON/modus_name', 'modus');
    tmpl_set($template, 'BUTTON/modus_value', IMPROVEMENT_DETAIL);
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_name', 'breakDownConfirm');
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_value', 1);
    tmpl_iterate($template, 'BUTTON/ARGUMENT');
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_name', 'buildingID');
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_value', $buildingID);
    tmpl_iterate($template, 'BUTTON/ARGUMENT');
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_name', 'caveID');
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_value', $caveID);
    tmpl_iterate($template, 'BUTTON');
    tmpl_set($template, 'BUTTON/formname', 'cancel');
    tmpl_set($template, 'BUTTON/text', _('Abbrechen'));
    tmpl_set($template, 'BUTTON/modus_name', 'modus');
    tmpl_set($template, 'BUTTON/modus_value', IMPROVEMENT_DETAIL);
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_name', 'caveID');
    tmpl_set($template, 'BUTTON/ARGUMENT/arg_value', $caveID);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:28,代码来源:improvementDeleteConfirm.html.php


示例2: award_getAwardDetail

/** This function returns basic award details
 *
 *  @param tag       the current award's tag
 */
function award_getAwardDetail($tag)
{
    // get configuration settings
    global $config;
    // get parameters from the page request
    global $params;
    // get db link
    global $db;
    $msgs = array();
    $sql = "SELECT * FROM Awards WHERE tag = '{$tag}'";
    $result = $db->query($sql);
    if (!$result || $result->isEmpty()) {
        $msgs[] = sprintf(_('Dieser Orden existiert nicht: "%s".'), $tag);
        $row = array();
    } else {
        $row = $result->nextRow(MYSQL_ASSOC);
    }
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'award_detail.ihtml');
    if (sizeof($msgs)) {
        foreach ($msgs as $msg) {
            tmpl_iterate($template, "MESSAGE");
            tmpl_set($template, "MESSAGE/message", $msg);
        }
    }
    if (sizeof($row)) {
        tmpl_set($template, 'AWARD', $row);
    }
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:33,代码来源:award.html.php


示例3: getContent

 function getContent()
 {
     if (sizeof($this->cavebookmarks)) {
         tmpl_set($this->template, '/CONTENT/CAVEBOOKMARKS/CAVEBOOKMARK', $this->cavebookmarks);
     } else {
         tmpl_set($this->template, '/CONTENT/NOCAVEBOOKMARKS/iterate', '');
     }
     switch ($this->error) {
         case CAVEBOOKMARKS_ERROR_NOSUCHCAVE:
             tmpl_set($this->template, '/CONTENT/ERROR_NOSUCHCAVE/iterate', '');
             break;
         case CAVEBOOKMARKS_ERROR_MAXREACHED:
             tmpl_set($this->template, '/CONTENT/ERROR_MAXREACHED/entries', CAVESBOOKMARKS_MAX);
             break;
         case CAVEBOOKMARKS_ERROR_INSERTFAILED:
             tmpl_set($this->template, '/CONTENT/ERROR_INSERTFAILED/iterate', '');
             break;
         case CAVEBOOKMARKS_ERROR_DELETEFAILED:
             tmpl_set($this->template, '/CONTENT/ERROR_DELETEFAILED/iterate', '');
             break;
         default:
         case CAVEBOOKMARKS_NOERROR:
             break;
     }
     // return parsed template
     return tmpl_parse($this->template, '/CONTENT');
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:27,代码来源:Show.php


示例4: tribe_getContent

function tribe_getContent($caveID, $tag)
{
    global $db, $no_resource_flag, $config, $params;
    $no_resource_flag = 1;
    if (!($r = $db->query("SELECT t.*, p.playerID, p.name AS leaderName " . "FROM Tribe t " . "LEFT JOIN Player p " . "ON p.playerID = t.leaderID " . "WHERE t.tag LIKE '{$tag}'"))) {
        page_dberror();
    }
    if (!($row = $r->nextRow(MYSQL_ASSOC))) {
        page_dberror();
    }
    $JuniorAdmin = $targetPlayer = new Player(getPlayerByID($row['juniorLeaderID']));
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'tribeDetail.ihtml');
    $row["urltag"] = urlencode(unhtmlentities($tag));
    $row["playerList_modus"] = TRIBE_PLAYER_LIST;
    $row["playerDetail_modus"] = PLAYER_DETAIL;
    $row["tribeHistory_modus"] = TRIBE_HISTORY;
    $row["tribeRelationList_modus"] = TRIBE_RELATION_LIST;
    if (!empty($row['awards'])) {
        $tmp = explode('|', $row['awards']);
        $awards = array();
        foreach ($tmp as $tag) {
            $awards[] = array('tag' => $tag, 'award_modus' => AWARD_DETAIL);
        }
        $row['award'] = $awards;
    }
    foreach ($row as $k => $v) {
        if (!$v) {
            $row[$k] = "k.A.";
        }
    }
    $row['juniorLeaderName'] = $JuniorAdmin->name;
    $row['juniorLeaderID'] = $JuniorAdmin->playerID;
    tmpl_set($template, 'DETAILS', $row);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:35,代码来源:tribeDetail.html.php


示例5: tribePlayerList_getContent

function tribePlayerList_getContent($caveID, $tribe)
{
    global $db, $no_resource_flag, $config, $params;
    $no_resource_flag = 1;
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'tribePlayerList.ihtml');
    tmpl_set($template, 'tribe', $tribe);
    $query = 'SELECT r.rank, r.playerID AS link, r.name, r.average AS points, r.caves, r.religion, r.fame, p.awards ' . ' FROM Ranking r' . ' LEFT JOIN Player p' . ' ON p.playerID = r.playerID' . ' WHERE p.tribe LIKE "' . $tribe . '"' . ' ORDER BY r.rank ASC';
    if (!($dbresult = $db->query($query))) {
        page_dberror();
    }
    while ($row = $dbresult->nextRow(MYSQL_ASSOC)) {
        $i++;
        tmpl_iterate($template, 'ROWS');
        $row['link'] = "main.php?modus=" . PLAYER_DETAIL . "&detailID=" . $row['link'] . "&caveID=" . $caveID;
        if (!empty($row['awards'])) {
            $tmp = explode('|', $row['awards']);
            $awards = array();
            foreach ($tmp as $tag) {
                $awards[] = array('tag' => $tag, 'award_modus' => AWARD_DETAIL);
            }
            $row['award'] = $awards;
        }
        if ($i % 2) {
            tmpl_set($template, 'ROWS/ROW_ALTERNATE', $row);
        } else {
            tmpl_set($template, 'ROWS/ROW', $row);
        }
    }
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:30,代码来源:tribePlayerList.html.php


示例6: getContent

 function getContent()
 {
     if (sizeof($this->contacts)) {
         tmpl_set($this->template, '/CONTENT/CONTACTS/CONTACT', $this->contacts);
     } else {
         tmpl_set($this->template, '/CONTENT/NOCONTACTS/iterate', '');
     }
     switch ($this->error) {
         case CONTACTS_ERROR_NOSUCHPLAYER:
             tmpl_set($this->template, '/CONTENT/ERROR_NOSUCHPLAYER/iterate', '');
             break;
         case CONTACTS_ERROR_MAXREACHED:
             tmpl_set($this->template, '/CONTENT/ERROR_MAXREACHED/entries', CONTACTS_MAX);
             break;
         case CONTACTS_ERROR_INSERTFAILED:
             tmpl_set($this->template, '/CONTENT/ERROR_INSERTFAILED/iterate', '');
             break;
         case CONTACTS_ERROR_DELETEFAILED:
             tmpl_set($this->template, '/CONTENT/ERROR_DELETEFAILED/iterate', '');
             break;
         default:
         case CONTACTS_NOERROR:
             break;
     }
     // return parsed template
     return tmpl_parse($this->template, '/CONTENT');
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:27,代码来源:Show.php


示例7: player_getContent

function player_getContent($caveID, $playerID)
{
    global $db, $no_resource_flag, $config, $params;
    $no_resource_flag = 1;
    if (!($r = $db->query("SELECT * FROM Player WHERE playerID = '{$playerID}'"))) {
        page_dberror();
    }
    if (!($row = $r->nextRow(MYSQL_ASSOC))) {
        page_dberror();
    }
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'playerDetail.ihtml');
    if ($row['avatar']) {
        // FIXME: should be configurable
        tmpl_set($template, 'DETAILS/AVATAR_IMG/avatar', $row['avatar']);
        tmpl_set($template, 'DETAILS/AVATAR_IMG/width', 120);
        tmpl_set($template, 'DETAILS/AVATAR_IMG/height', 120);
    }
    if (!empty($row['awards'])) {
        $tmp = explode('|', $row['awards']);
        $awards = array();
        foreach ($tmp as $tag) {
            $awards[] = array('tag' => $tag, 'award_modus' => AWARD_DETAIL);
        }
        $row['award'] = $awards;
    }
    unset($row['awards']);
    foreach ($row as $k => $v) {
        if (!$v) {
            $row[$k] = _('k.A.');
        }
    }
    $row['mail_modus'] = NEW_MESSAGE;
    $row['mail_receiver'] = urlencode($row['name']);
    $row['caveID'] = $caveID;
    $timediff = getUgaAggaTimeDiff(time_fromDatetime($row['created']), time());
    $row['age'] = 18 + $timediff['year'];
    tmpl_set($template, 'DETAILS', $row);
    // ADDED by chris--- for rank_history
    $row['playerID'] = $playerID;
    // show player's caves
    $caves = getCaves($playerID);
    if ($caves) {
        tmpl_set($template, '/DETAILS/CAVES', $caves);
    }
    //show bodycount
    // Keinen Bodycount fuers erste.... Nebrot
    //$body_count = $row['body_count'];
    //tmpl_set($template, '/DETAILS/BODYCOUNT/body_count', $body_count);
    // show player's history
    $history = Player::getHistory($db, $playerID);
    if (sizeof($history)) {
        tmpl_set($template, '/DETAILS/HISTORY/ENTRY', $history);
    } else {
        tmpl_set($template, '/DETAILS/HISTORY/NOENTRIES/iterate', '');
    }
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:57,代码来源:playerDetail.html.php


示例8: stats_stats

function stats_stats($playerID)
{
    global $params, $config, $no_resource_flag;
    $no_resource_flag = 1;
    $stats = stats_getStats();
    $template = @tmpl_open('./templates/' . $config->template_paths[$params->SESSION->user['template']] . '/stats.ihtml');
    tmpl_set($template, array('runden_start' => $stats['runden_start'], 'uga_time' => $stats['uga_time'], 'kampfberichte' => $stats['kampfberichte'], 'kbs_durchschnitt' => round($stats['kampfberichte'] / $stats['spieler'], 2), 'spioberichte' => $stats['spioberichte'], 'spio_durchschnitt' => round($stats['spioberichte'] / $stats['spieler'], 2), 'takeover' => $stats['takeover'], 'spieler' => $stats['spieler'], 'clans' => $stats['clans'], 'player_clans' => $stats['player_clans'], 'player_noclan' => $stats['player_noclan'], 'player_noreligion' => $stats['player_noreligion'], 'units' => $stats['units'], 'units_durchschnitt' => round($stats['units'] / $stats['spieler'], 2), 'units_moving' => $stats['units_moving'], 'units_move_durchschnitt' => round($stats['units_moving'] / $stats['spieler'], 2), 'messages' => $stats['messages'], 'messages_durchschnitt' => round($stats['messages'] / $stats['spieler'], 2), 'ticker_status' => $stats['ticker_status'], 'caves' => $stats['caves'], 'caves_durchschnitt' => round($stats['caves'] / $stats['spieler'], 2), 'caves_free' => $stats['caves_free'], 'caves_all' => $stats['caves_all'], 'caves_prozent' => round($stats['caves'] / $stats['caves_all'] * 100, 2), 'caves_free_prozent' => round($stats['caves_free'] / $stats['caves_all'] * 100, 2), 'player_religion_agga' => $stats['player_religion_agga'], 'player_religion_uga' => $stats['player_religion_uga'], 'agga_prozent' => round($stats['player_religion_agga'] / $stats['spieler'] * 100, 2), 'uga_prozent' => round($stats['player_religion_uga'] / $stats['spieler'] * 100, 2), 'noreligion_prozent' => round($stats['player_noreligion'] / $stats['spieler'] * 100, 2), 'player_clans_prozent' => round($stats['player_clans'] / $stats['spieler'] * 100, 2), 'player_noclan_prozent' => round($stats['player_noclan'] / $stats['spieler'] * 100, 2), 'questions' => $stats['questions'], 'user_active' => $stats['user_active'], 'user_active_prozent' => round($stats['user_active'] / $stats['spieler'] * 100, 2), 'one_cave' => $stats['one_cave'], 'one_cave_prozent' => round($stats['one_cave'] / $stats['spieler'] * 100, 2), '4_cave' => $stats['4_cave'], '4_cave_prozent' => round($stats['4_cave'] / $stats['spieler'] * 100, 2), 'artefact' => $stats['artefact'], 'artefact_durchschnitt' => round($stats['artefact'] / $stats['spieler'], 2), 'max_active' => $stats['max_active'], 'max_date' => $stats['max_date'], 'player_religion_hex' => $stats['player_religion_hex'], 'hex_prozent' => round($stats['player_religion_hex'] / $stats['spieler'] * 100, 2), 'wunder' => $stats['wunder'], 'wunder_durchschnitt' => round($stats['wunder'] / $stats['spieler'], 2), 'urlauber' => $stats['urlauber'], 'urlauber_prozent' => round($stats['urlauber'] / $stats['spieler'] * 100, 2)));
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:9,代码来源:stats.html.php


示例9: getContent

 function getContent()
 {
     global $params;
     // set count
     if ($this->count != 0) {
         tmpl_set($this->template, '/CONTENT/YOUVEGOTMAIL/count', $this->count);
     }
     // return parsed template
     return tmpl_parse($this->template, '/CONTENT');
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:10,代码来源:New.php


示例10: getContent

 function getContent()
 {
     // set categories
     if ($this->categories) {
         tmpl_set($this->template, '/CONTENT/CATEGORY', $this->categories);
     } else {
         tmpl_set($this->template, '/CONTENT/NOMOVEMENTS/iterate', '');
     }
     // return parsed template
     return tmpl_parse($this->template, '/CONTENT');
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:11,代码来源:Movements.php


示例11: quest_getQuestHelp

function quest_getQuestHelp($playerID)
{
    // hm need to check this
    global $config, $params, $db;
    // open the template
    $template = @tmpl_open('./templates/' . $config->template_paths[$params->SESSION->user['template']] . '/quest_help.ihtml');
    $data = array();
    $data['QUESTHELP'] = array('description' => "Quests werden immer mit einer Bewegung begonnen und mit einer Bewegung abgeschlossen. " . " So k&ouml;nnt Ihr nur eine Quest " . " bekommen, wenn Ihr eine Questsiedlung besucht. Um eine Quest zu erhalten reicht es, mittels &quot;Rohstoffe bringen&quot; " . " dort eine Einheit vorbeizuschicken. Sie muß allerdings nicht zwingend eine Resource mitnehmen.<br><br>" . " Questsiedlungen sind  nicht gekennzeichnet und viele sind auch &uuml;berhaupt nicht als bewohnte Siedlungen zu erkennen. " . " Bei bestimmten Auftr&auml;gen k&ouml;nnen Siedlungen sichtbar werden, wo vorher Ein&ouml;den waren. In der Regel sind diese " . " dann nur f&uuml;r diejenigen sichtbar, die auch einen Auftrag f&uuml;r diese Siedlung bekommen haben.<br><br>" . " Manche Questsiedlungen sind ganz und gar unsichtbar und man kann sie nur durch Zufall entdecken, in dem man die Einöden absucht. " . " Auch hierf&uuml;r reicht irgendeine Bewegung aus. Entdeckte Questsiedlungen bleiben dann sichtbar.<br><br>" . " Es h&auml;ngen normalerweise mehrere Quests zusammen, d.h. nach einer abgeschlossenen Quest bekommt man oft eine n&auml;chste. " . " Questverl&auml;fe sind selten gradlinig, viele sind abh&auml;ngig von anderen Quests. Und ob andere Spieler diese gel&ouml;st haben " . " oder nicht, kann Deine Quests beeinflussen.<br><br>" . " Den Beginn eines Questweges kann grunds&auml;tzlich jeder Spieler bekommen, der eine Questsiedlung besuchen kann. Daf&uuml;r ist " . " allerdings je nach Entfernung mehr oder wengier Nahrung n&ouml;tig. Das ist beabsichtigt, da so mehrere Spieler gezwungen sind, " . " zusammenzuarbeiten. Auch k&ouml;nnen einige Quests von vielen Spieler erfolgreich abgeschlossen werden, andere, wie z.B. ein " . " bestimmtes Artefakt zu stehlen, kann nur einer gewinnen.<br><br>" . " Eine Quest kann f&uuml;nf Zust&auml;nde haben:<br>" . " <b>Aktiv:</b> Diese Quest(s) sind f&uuml;r Dich noch offen, das hei&szlig;t, weder Du noch jemand anders (bei einer QUest, die nur von " . " einem gel&ouml;st werden kann) hat sie bisher abgeschlossen.<br>" . " <b>Erfolgreich abgeschlossen:</b> Du hast die Quest gel&ouml;st.<br>" . " <b>Verloren:</b> Du hast diese Quest nicht l&ouml;sen k&ouml;nnen. M&ouml;gliche Gr&uuml;nde k&ouml;nnen sein, jemand anders ist dir " . " zuvorgekommen, du oder jemand anders hat etwas getan, wodurch diese Quest unl&ouml;sbar wurde (wie z.B. jemand hat dir ein " . " Quest-Artefakt geklaut, Du hast ein Quest-Artefakt eingweiht, was verboten war etc).<br>" . " Verlorene Quests k&ouml;nnen unter Umst&auml;nden wieder aufgenommen werden (wenn jemand dir ein Quest Artefakt geklaut hat, du " . " es aber zur&uuml;ck erobern konntest o.&auml;.).<br>" . " <b>Nicht mehr durchf&uuml;hrbar:</b> Die Quests hier k&ouml;nnen nicht mehr gel&ouml;st werden, da ein questrelevanter " . " Gegenstand verloren ist. Beispiel: Du hattest den Auftrag, eine Questeinheit in eine Siedlung zu bringen, aber durch einen Angriff " . " auf deine Siedlung, in der die EInheit stationiert war, wurde diese Einheit zerst&ouml;rt.<br>" . " Möglicherweise erscheinen hier f&uuml;r neue Spieler auch Quests, die andere Spieler schon gel&ouml;st haben.");
    tmpl_set($template, "/", $data);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:11,代码来源:quest_help.html.php


示例12: show_adressbook

function show_adressbook($playerID, $deleteID)
{
    global $buildingTypeList, $defenseSystemTypeList, $resourceTypeList, $unitTypeList, $config, $params, $db;
    // messages
    $messageText = array(0 => "Spieler wurde eingetragen.", 1 => "Es gibt keinen Spieler mit diesem Namen.", 2 => "Dieser Spieler ist schon in der Liste.", 3 => "Spieler aus der Liste gel&ouml;scht.", 4 => "Spieler konnte nicht aus der Liste entfernt werden.", 5 => "Verarsch mich nicht!", 6 => "Datenbank Fehler.");
    // enter something new
    if (isset($params->POST->empfaenger)) {
        $messageID = book_newEntry($playerID, $params->POST->empfaenger);
    }
    if (isset($params->POST->newEntryName)) {
        $messageID = book_newEntry($playerID, $params->POST->newEntryName);
    } else {
        if ($deleteID > 0) {
            $messageID = book_deleteEntry($playerID, $deleteID);
        }
    }
    $template = @tmpl_open("./templates/" . $config->template_paths[$params->SESSION->user['template']] . "/message_book.ihtml");
    // Show a special message
    if (isset($messageID)) {
        tmpl_set($template, '/MESSAGE/message', $messageText[$messageID]);
    }
    // Getting entries
    // call our function
    $playerlist = book_getEntries($playerID);
    // Show the player table
    for ($i = 0; $i < sizeof($playerlist[id]); $i++) {
        $playername = $playerlist[name][$i];
        // the current playername
        $tribe = $playerlist[tribe][$i];
        // the current tribe
        $tribelink = "<a href=\"main.php?modus=" . TRIBE_DETAIL . "&tribe=" . urlencode(unhtmlentities($tribe)) . "\" target=\"_blank\">";
        if ($tribe != "") {
            $tribe = "(" . $tribe . ")";
        }
        $playerID = $playerlist[id][$i];
        $link = "<a href=\"main.php?modus=" . NEW_MESSAGE . "&amp;playerID=" . $playername . "\">";
        tmpl_iterate($template, '/PLAYER');
        tmpl_set($template, "PLAYER/alternate", $count++ % 2 ? "alternate" : "");
        if ($playername != "Spieler nicht auffindbar") {
            tmpl_set($template, "PLAYER/LINK/link", $link);
        }
        tmpl_set($template, 'PLAYER', array('name' => $playername, 'tribe' => $tribe, 'tribelink' => $tribelink, 'playerID' => $playerID, 'modus' => NEW_MESSAGE, 'modus_delete' => MESSAGE_BOOK_DELETE));
    }
    if (sizeof($playerlist) < 1) {
        tmpl_set($template, "NOPLAYER/dummy", "");
    }
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:48,代码来源:message_book.html.php


示例13: tribeHistory_getContent

function tribeHistory_getContent($tag)
{
    global $no_resource_flag, $config, $params, $db;
    $no_resource_flag = 1;
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'tribeHistory.ihtml');
    $history = relation_getTribeHistory($tag, $db);
    foreach ($history as $key => $values) {
        tmpl_iterate($template, 'ROWS');
        if ($i++ % 2) {
            tmpl_set($template, 'ROWS/ROW_ALTERNATE', $values);
        } else {
            tmpl_set($template, 'ROWS/ROW', $values);
        }
    }
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:16,代码来源:tribeHistory.html.php


示例14: getContent

 function getContent()
 {
     global $params;
     switch ($this->error) {
         //      case CONTACTS_ERROR_NOSUCHPLAYER:
         //        tmpl_set($this->template, '/CONTENT/ERROR_NOSUCHPLAYER/iterate', '');
         //        break;
         default:
         case CONTACTS_NOERROR:
             break;
     }
     // set name and id
     tmpl_set($this->template, '/CONTENT', array('name' => urlencode($params->SESSION->player->name), 'id' => $params->SESSION->player->playerID));
     // return parsed template
     return tmpl_parse($this->template, '/CONTENT');
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:16,代码来源:Index.php


示例15: getContent

 function getContent($modus)
 {
     global $db_game, $params;
     $content = "";
     switch ($modus) {
         case 'suggestion_list':
             $template = tmpl_open("modules/Module_Suggestion/templates/list.ihtml");
             $query = "SELECT Suggestions.*, Player.Name " . "FROM Suggestions " . "LEFT JOIN Player " . "ON Suggestions.playerID = Player.playerID";
             $result = $db_game->query($query);
             $tmp = 0;
             while ($row = $result->nextRow(MYSQL_ASSOC)) {
                 $tmp = ($tmp + 1) % 2;
                 $suggestions[] = array('player' => $row['Name'], 'suggestion' => lib_shorten_html(lib_unhtmlentities(stripslashes($row['Suggestion'])), 100), 'suggestion_id' => $row['suggestionID'], 'class' => $tmp ? 'alternate' : '');
             }
             if (sizeof($suggestions)) {
                 tmpl_set($template, '/ROW', $suggestions);
             } else {
                 tmpl_set($template, '/NOENTRIES', array('iterate' => ''));
             }
             $content = tmpl_parse($template);
             break;
         case 'suggestion_view':
             $template = tmpl_open("modules/Module_Suggestion/templates/view.ihtml");
             $query = "SELECT Suggestions.*, Player.Name " . "FROM Suggestions " . "LEFT JOIN Player " . "ON Suggestions.playerID = Player.playerID " . "WHERE Suggestions.suggestionID=" . $params->suggestionID;
             $result = $db_game->query($query);
             $row = $result->nextRow(MYSQL_ASSOC);
             tmpl_set($template, array('player' => $row['Name'], 'suggestion' => nl2br(stripslashes($row['Suggestion'])), 'suggestion_id' => $params->suggestionID));
             $content = tmpl_parse($template);
             break;
         case 'suggestion_delete':
             $template = tmpl_open("modules/Module_Suggestion/templates/view.ihtml");
             $query = "SELECT Suggestions.*, Player.Name " . "FROM Suggestions " . "LEFT JOIN Player " . "ON Suggestions.playerID = Player.playerID " . "WHERE Suggestions.suggestionID=" . $params->suggestionID;
             $result = $db_game->query($query);
             $row = $result->nextRow(MYSQL_ASSOC);
             tmpl_set($template, array('player' => $row['Name'], 'suggestion' => nl2br(stripslashes($row['Suggestion'])), 'suggestion_id' => $params->suggestionID));
             $query = "DELETE FROM Suggestions " . "WHERE Suggestions.suggestionID=" . $params->suggestionID;
             $result = $db_game->query($query);
             if ($result) {
                 tmpl_set($template, '/MESSAGE', array('message' => 'Successfully deleted.'));
             } else {
                 tmpl_set($template, '/MESSAGE', array('message' => 'An error occured while deleting the suggestion below: ' . mysql_error()));
             }
             $content = tmpl_parse($template);
             break;
     }
     return $content;
 }
开发者ID:microlefes,项目名称:Game,代码行数:47,代码来源:Module_Suggestion.php


示例16: getContent

 function getContent($modus)
 {
     global $db_game, $params;
     $content = "";
     switch ($modus) {
         case 'tribe_history':
             $template = tmpl_open("modules/Module_Tribe/templates/history.ihtml");
             // Form Submitted
             if (isset($params->creator)) {
                 $something_wrong = false;
                 //TODO: $tribe has to be checked
                 $tribe = $params->historyTribe;
                 $day = intval($params->historyDay);
                 if ($day < 1 || $day > DAYS_PER_MONTH) {
                     $something_wrong = true;
                     $message = "Wrong day. Must be between 1 and " . DAYS_PER_MONTH . ".";
                 }
                 $year = intval($params->historyYear);
                 if ($year < STARTING_YEAR) {
                     $something_wrong = true;
                     $message = "Wrong year. Must be &gt;= " . STARTING_YEAR . ".";
                 }
                 $month = getMonthName($params->historyMonth);
                 $entry = $params->historyMessage;
                 if ($something_wrong) {
                     tmpl_set($template, "MESSAGE/message", $message);
                 } else {
                     $query = "INSERT INTO `TribeHistory` (`tribe`, `timestamp`, " . "`ingameTime`, `message`) VALUES ('{$tribe}', NULL , " . "'{$day}. {$month}<br>im Jahr {$year}', '{$entry}')";
                     if (!$db_game->query($query)) {
                         die("Error while inserting your entry!");
                     }
                     tmpl_set($template, "MESSAGE/message", "Entry inserted!");
                 }
             }
             // iterate months
             $months = array();
             for ($i = 1; $i <= MONTHS_PER_YEAR; ++$i) {
                 $months[] = array('text' => getMonthName($i), 'value' => $i);
             }
             if (sizeof($months)) {
                 tmpl_set($template, '/MONTH', $months);
             }
             $content = tmpl_parse($template);
             break;
     }
     return $content;
 }
开发者ID:microlefes,项目名称:Game,代码行数:47,代码来源:Module_Tribe.php


示例17: getContent

 function getContent($count)
 {
     global $params;
     switch ($this->error) {
         default:
         case SUGGESTIONS_NOERROR:
             break;
     }
     // insert maximum number of suggestions
     tmpl_set($this->template, '/CONTENT', array('max_count' => SUGGESTIONS_MAX));
     // output suggestion box
     if ($count < SUGGESTIONS_MAX) {
         tmpl_set($this->template, '/CONTENT/SUGGESTIONS/SUGGESTION', array('num' => $count + 1));
     } else {
         tmpl_set($this->template, '/CONTENT/MAX_SUGGESTIONS_REACHED', array('iterate' => ''));
     }
     // return parsed template
     return tmpl_parse($this->template, '/CONTENT');
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:19,代码来源:Index.php


示例18: tribeLeaderDetermination_getContent

function tribeLeaderDetermination_getContent($playerID, $tribe, $data)
{
    global $no_resource_flag, $governmentList, $leaderDeterminationList, $db, $config, $params;
    $no_resource_flag = 1;
    if (!($governmentData = government_getGovernmentForTribe($tribe, $db))) {
        page_dberror();
    }
    $handlers[1] = "leaderDetermination_infoHandler";
    $handlers[2] = "leaderDetermination_electionHandler";
    $templates[1] = "leaderDeterminationInfo.ihtml";
    $templates[2] = "leaderDeterminationElection.ihtml";
    $id = $governmentList[$governmentData['governmentID']]['leaderDeterminationID'];
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . $templates[$id]);
    if (!($templateData = $handlers[$id]($playerID, $tribe, $governmentData, $data))) {
        page_dberror();
    }
    tmpl_set($template, 'LEADERDETERMINATION', $templateData);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:19,代码来源:tribeLeaderDetermination.html.php


示例19: ticker_getMessages

function ticker_getMessages($playerID)
{
    // hm need to check this
    global $buildingTypeList, $defenseSystemTypeList, $resourceTypeList, $scienceTypeList, $unitTypeList, $wonderTypeList, $effectTypeList, $terrainList, $config, $params, $db;
    // open the template
    $template = @tmpl_open('./templates/' . $config->template_paths[$params->SESSION->user['template']] . '/ticker_archive.ihtml');
    // Getting the messages
    $messages = getTickerMessages($db);
    // Templating
    $data = array();
    if (!sizeof($messages)) {
        $data['NOMESSAGES'] = array('dummy' => "");
    } else {
        $data['MESSAGES'] = $messages;
        tmpl_iterate($template, 'MESSAGES');
    }
    tmpl_set($template, "/", $data);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:19,代码来源:ticker_archive.html.php


示例20: doYouKnow_getContent

function doYouKnow_getContent()
{
    global $db, $config;
    $template = tmpl_open($_SESSION['player']->getTemplatePath() . 'doYouKnow.ihtml');
    if (request_var('show', "") == "all") {
        $sql = $db->prepare("SELECT * FROM " . DO_YOU_KNOW_TABLE);
    } else {
        $sql = $db->prepare("SELECT * FROM " . DO_YOU_KNOW_TABLE . " ORDER BY RAND( ) LIMIT 0 , 1");
    }
    $sql->execute();
    while ($row = $sql->fetch(PDO::FETCH_ASSOC)) {
        tmpl_iterate($template, "ELEM");
        tmpl_set($template, array("ELEM/header" => $row['titel'], "ELEM/text" => str_replace("\n", "<br />", $row['content'])));
    }
    if (request_var('show', "") != "all") {
        tmpl_iterate($template, "LINKLIST");
    }
    return tmpl_parse($template);
}
开发者ID:norter,项目名称:Game,代码行数:19,代码来源:doYouKnow.html.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tname函数代码示例发布时间:2022-05-23
下一篇:
PHP tmpl_parse函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap