本文整理汇总了PHP中tmpl_open函数的典型用法代码示例。如果您正苦于以下问题:PHP tmpl_open函数的具体用法?PHP tmpl_open怎么用?PHP tmpl_open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tmpl_open函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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önnt Ihr nur eine Quest " . " bekommen, wenn Ihr eine Questsiedlung besucht. Um eine Quest zu erhalten reicht es, mittels "Rohstoffe bringen" " . " dort eine Einheit vorbeizuschicken. Sie muß allerdings nicht zwingend eine Resource mitnehmen.<br><br>" . " Questsiedlungen sind nicht gekennzeichnet und viele sind auch überhaupt nicht als bewohnte Siedlungen zu erkennen. " . " Bei bestimmten Aufträgen können Siedlungen sichtbar werden, wo vorher Einöden waren. In der Regel sind diese " . " dann nur für diejenigen sichtbar, die auch einen Auftrag fü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ür reicht irgendeine Bewegung aus. Entdeckte Questsiedlungen bleiben dann sichtbar.<br><br>" . " Es hängen normalerweise mehrere Quests zusammen, d.h. nach einer abgeschlossenen Quest bekommt man oft eine nächste. " . " Questverläfe sind selten gradlinig, viele sind abhängig von anderen Quests. Und ob andere Spieler diese gelöst haben " . " oder nicht, kann Deine Quests beeinflussen.<br><br>" . " Den Beginn eines Questweges kann grundsätzlich jeder Spieler bekommen, der eine Questsiedlung besuchen kann. Dafür ist " . " allerdings je nach Entfernung mehr oder wengier Nahrung nötig. Das ist beabsichtigt, da so mehrere Spieler gezwungen sind, " . " zusammenzuarbeiten. Auch kö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ünf Zustände haben:<br>" . " <b>Aktiv:</b> Diese Quest(s) sind für Dich noch offen, das heißt, weder Du noch jemand anders (bei einer QUest, die nur von " . " einem gelöst werden kann) hat sie bisher abgeschlossen.<br>" . " <b>Erfolgreich abgeschlossen:</b> Du hast die Quest gelöst.<br>" . " <b>Verloren:</b> Du hast diese Quest nicht lösen können. Mögliche Gründe können sein, jemand anders ist dir " . " zuvorgekommen, du oder jemand anders hat etwas getan, wodurch diese Quest unlö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önnen unter Umständen wieder aufgenommen werden (wenn jemand dir ein Quest Artefakt geklaut hat, du " . " es aber zurück erobern konntest o.ä.).<br>" . " <b>Nicht mehr durchführbar:</b> Die Quests hier können nicht mehr gelö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ört.<br>" . " Möglicherweise erscheinen hier für neue Spieler auch Quests, die andere Spieler schon gelöst haben.");
tmpl_set($template, "/", $data);
return tmpl_parse($template);
}
示例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);
}
示例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ö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 . "&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);
}
示例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);
}
示例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;
}
示例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 >= " . 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;
}
示例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);
}
示例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);
}
示例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);
}