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

PHP tmpl_open函数代码示例

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

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



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

示例1: 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


示例2: 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


示例3: 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


示例4: 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


示例5: 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


示例6: 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


示例7: 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


示例8: _show

 function _show()
 {
     global $db_login, $db_game, $params, $cfg;
     $login = array();
     $game = array();
     $tvars = array();
     $template = tmpl_open("modules/Module_Statistics/templates/statistics.ihtml");
     // UNIQUE LOGINS THIS MONTH
     $query = "SELECT COUNT( DISTINCT (\n         user\n       ) ) AS playersPerMonth\n       FROM LoginLog\n       WHERE success =1\n       AND MONTH( stamp ) = MONTH( CURDATE( ) ) \n       AND YEAR( stamp ) = YEAR( CURDATE( ) )";
     $result = $db_login->query($query);
     if ($result && !$result->isEmpty() && ($row = $result->nextRow())) {
         $playersPerMonth = $row['playersPerMonth'];
     }
     // UNIQUE LOGINS PER DAYS OF THIS MONTH
     $query = "SELECT DATE( stamp ) AS date , COUNT( DISTINCT ( \n        user \n       ) ) AS playersPerDay\n       FROM LoginLog \n       WHERE success =1 \n       AND MONTH (stamp) = MONTH( CURDATE() )\n       AND YEAR (stamp) = YEAR(CURDATE())\n       GROUP BY DATE( stamp ) \n       ORDER BY DATE( stamp ) DESC";
     $result = $db_login->query($query);
     $dayInfo = array();
     if ($result && !$result->isEmpty()) {
         while ($row = $result->nextRow()) {
             $dayInfo[] = array('date' => $row['date'], 'playersPerDay' => $row['playersPerDay'], 'quotient' => $row['playersPerDay'] / $playersPerMonth);
         }
     }
     // UNIQUE LOGINS LAST HOUR
     $query = "SELECT COUNT( DISTINCT (\n         user\n       ) ) AS playersLastHour,\n       COUNT( loginLogID ) AS loginsLastHour\n       FROM LoginLog\n       WHERE success =1\n       AND TIME_TO_SEC( TIMEDIFF(NOW(), stamp )) < 3600";
     $result = $db_login->query($query);
     if ($result && !$result->isEmpty() && ($row = $result->nextRow())) {
         $tvars['playersLastHour'] = $row['playersLastHour'];
         $tvars['lpuLastHour'] = $row['loginsLastHour'] / $row['playersLastHour'];
     }
     // UNIQUE LOGINS LAST DAY
     $query = "SELECT COUNT( DISTINCT (\n         user\n       ) ) AS playersLastDay,\n       COUNT( loginLogID ) AS loginsLastDay\n       FROM LoginLog\n       WHERE success =1\n       AND TIME_TO_SEC( TIMEDIFF(NOW(), stamp )) < 3600 * 24";
     $result = $db_login->query($query);
     if ($result && !$result->isEmpty() && ($row = $result->nextRow())) {
         $tvars['playersLastDay'] = $row['playersLastDay'];
         $tvars['lpuLastDay'] = $row['loginsLastDay'] / $row['playersLastDay'];
     }
     // UNIQUE LOGINS LAST WEEK
     $query = "SELECT COUNT( DISTINCT (\n         user\n       ) ) AS playersLastWeek,\n       COUNT( loginLogID ) AS loginsLastWeek\n       FROM LoginLog\n       WHERE success =1\n       AND TIME_TO_SEC( TIMEDIFF(NOW(), stamp )) < 3600 * 24 * 7";
     $result = $db_login->query($query);
     if ($result && !$result->isEmpty() && ($row = $result->nextRow())) {
         $tvars['playersLastWeek'] = $row['playersLastWeek'];
         $tvars['lpuLastWeek'] = $row['loginsLastWeek'] / $row['playersLastWeek'];
     }
     // UNIQUE LOGINS LAST MONTH
     $query = "SELECT COUNT( DISTINCT (\n         user\n       ) ) AS playersLastMonth,\n       COUNT( loginLogID ) AS loginsLastMonth\n       FROM LoginLog\n       WHERE success =1\n       AND TIME_TO_SEC( TIMEDIFF(NOW(), stamp )) < 3600 * 24 * 30";
     $result = $db_login->query($query);
     if ($result && !$result->isEmpty() && ($row = $result->nextRow())) {
         $tvars['playersLastMonth'] = $row['playersLastMonth'];
         $tvars['lpuLastMonth'] = $row['loginsLastMonth'] / $row['playersLastMonth'];
     }
     $tvars['dailyLogins'] = $dayInfo;
     tmpl_set($template, $tvars);
     return tmpl_parse($template);
 }
开发者ID:microlefes,项目名称:Game,代码行数:54,代码来源:Module_Statistics.php


示例9: 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


示例10: 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


示例11: 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


示例12: 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


示例13: profile_show

function profile_show($db_login, $feedback = NULL)
{
    global $params;
    // get login data
    $playerData = profile_getPlayerData($db_login);
    if (!$playerData) {
        page_dberror();
    }
    // open template
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'profile.ihtml');
    // show message
    if ($feedback) {
        tmpl_set($template, '/MESSAGE/message', $feedback);
    }
    // show the profile's data
    profile_fillUserData($template, $playerData);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:18,代码来源:profile.html.php


示例14: 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


示例15: 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


示例16: _show

 function _show()
 {
     global $db_game, $params;
     $this->_getDetails();
     if (empty($this->Cave)) {
         return $this->_search('Could not find cave');
     }
     $template = tmpl_open("modules/Module_Cave/templates/show.ihtml");
     tmpl_set($template, array('CaveID' => $this->Cave['caveID'], 'name' => $this->Cave['name'], 'xCoord' => $this->Cave['xCoord'], 'yCoord' => $this->Cave['yCoord'], 'PlayerName' => !empty($this->Cave['PlayerName']) ? $this->Cave['PlayerName'] : 'Dies ist eine freie Höhle', 'PlayerID' => !empty($this->Cave['playerID']) ? $this->Cave['playerID'] : -1, 'SECURECAVE' => $this->Cave['secureCave'] == TRUE ? array('iterate' => '') : NULL, 'secureCaveValue' => !empty($this->Cave['secureCave']) ? 1 : 0, 'TAKEOVERABLE' => $this->Cave['takeoverable'] ? array('iterate' => '') : NULL, 'takeoverableValue' => !empty($this->Cave['takeoverable']) ? 1 : 0, 'STARTINGPOSITION' => $this->Cave['starting_position'] ? array('iterate' => '') : NULL, 'startingpositionValue' => !empty($this->Cave['starting_position']) ? 1 : 0, 'NOSTATISTIC' => $this->Cave['noStatistic'] ? array('iterate' => '') : NULL, 'noStatisticValue' => !empty($this->Cave['noStatistic']) ? 1 : 0));
     // init game rules
     $this->_get_game_rules();
     // parse all...
     $this->_print('resource', 'resourceID', '/RESOURCE', $template);
     $this->_print('building', 'buildingID', '/BUILDING', $template);
     $this->_print('unit', 'unitID', '/UNIT', $template);
     $this->_print('defense', 'defenseSystemID', '/DEFENSE', $template);
     $this->_print('science', 'scienceID', '/SCIENCE', $template);
     // parse resource boni and factor
     foreach ($this->resource as $value) {
         $BoniName = $value->dbFieldName . '_bonus';
         if (isset($this->Cave[$BoniName])) {
             $other_ary[] = array('id' => $BoniName, 'lang' => !empty($value->name) ? 'Boni ' . $value->name : $BoniName, 'value' => $this->Cave[$BoniName]);
         }
         $FactorName = $value->dbFieldName . '_factor';
         if (isset($this->Cave[$FactorName])) {
             $other_ary[] = array('id' => $FactorName, 'lang' => !empty($value->name) ? 'Faktor ' . $value->name : $FactorName, 'value' => $this->Cave[$FactorName]);
         }
     }
     $other_values = $this->_get_other_values();
     foreach ($other_values as $value) {
         if (isset($this->Cave[$value['name']])) {
             $other_ary[] = array('id' => $value['name'], 'lang' => $value['lang'], 'value' => $this->Cave[$value['name']]);
         }
     }
     if (!empty($other_ary)) {
         tmpl_iterate($template, '/OTHER');
         tmpl_set($template, '/OTHER', $other_ary);
     }
     if ($this->error) {
         return $this->_search('Achtung!!! Datenbank oder Game Regel Fehler!!!');
     }
     return tmpl_parse($template);
 }
开发者ID:microlefes,项目名称:Game,代码行数:43,代码来源:Module_Cave.php


示例17: 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


示例18: _show

 function _show()
 {
     global $db_login, $db_game, $params, $cfg;
     $login = array();
     $game = array();
     if (!$this->_getDetails($params->player, $login, $game)) {
         return $this->_search('Could not find player "' . $params->player . '"');
     }
     $template = tmpl_open("modules/Module_Player/templates/show.ihtml");
     $query = "SELECT * FROM Block ORDER BY blockid ASC";
     $result = $db_login->query($query);
     $blocks = array();
     if ($result && !$result->isEmpty()) {
         while ($row = $result->nextRow()) {
             $blocks[] = array('text' => $row['reasonShort'], 'value' => $row['blockid'], 'SELECTED' => $login['multi'] == $row['blockid'] ? array('iterate' => '') : NULL);
         }
     }
     tmpl_set($template, array('name' => $game['name'], 'tribe' => $game['tribe'], 'playerID' => $game['playerID'], 'DELETED' => $login['deleted'] ? array('iterate' => '') : NULL, 'MULTI' => $blocks, 'ban' => $login['ban'], 'comment' => $login['comment']));
     return tmpl_parse($template);
 }
开发者ID:agatho,项目名称:uaenhanced,代码行数:20,代码来源:Module_Player.php


示例19: quest_getQuestDetails

function quest_getQuestDetails($questID, $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']] . '/quest_details.ihtml');
    $data = array();
    // checking if the given quest is really known to the given player
    if (!questKnownByPlayer($questID, $playerID, $db)) {
        $data['QUESTNOTKNOWN'] = array('dummy' => "");
        tmpl_set($template, "/", $data);
        return tmpl_parse($template);
    }
    $data['QUESTKNOWN'] = array("title" => getQuestTitle($questID, $db), "description" => getQuestDescription($questID, $db), "todo" => getQuestToDo($questID, $db));
    // checking if the given quest is aborted to the given player
    if (questAbortedToPlayer($questID, $playerID, $db)) {
        $data['QUESTABORTED'] = array('message' => getQuestAbortMsg($questID, $db));
    }
    tmpl_set($template, "/", $data);
    return tmpl_parse($template);
}
开发者ID:agatho,项目名称:uaenhanced,代码行数:21,代码来源:quest_details.html.php


示例20: doYouKnow_getContent

function doYouKnow_getContent()
{
    global $config;
    global $params;
    global $db;
    $template = tmpl_open($params->SESSION->player->getTemplatePath() . 'doYouKnow.ihtml');
    if ($params->POST->show == "all") {
        $query = "SELECT * FROM `doYouKnow`";
    } else {
        $query = "SELECT * FROM `doYouKnow` ORDER BY RAND( ) LIMIT 0 , 1";
    }
    $ 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP tmpl_parse函数代码示例发布时间:2022-05-23
下一篇:
PHP tmpl_iterate函数代码示例发布时间: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