本文整理汇总了PHP中template_out函数的典型用法代码示例。如果您正苦于以下问题:PHP template_out函数的具体用法?PHP template_out怎么用?PHP template_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了template_out函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: login_error
function login_error($error_msg)
{
global $tpl;
$modul_name = "acp_login";
$tpl->assign('if_disable_menu', 1);
$tpl->assign('LITO_ERROR_MSG', $error_msg);
$tpl->assign('if_login_error', 1);
template_out('login.html', $modul_name);
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:9,代码来源:login.php
示例2: show_error
function show_error($error_msg, $from_modul, $load_from_lang = 1)
{
global $tpl, $db, $n, $userdata, $lang_suffix;
if ($load_from_lang == 1) {
$lang_file = LITO_LANG_PATH . $from_modul . '/lang_' . $lang_suffix . '.php';
$tpl->config_load($lang_file);
$tpl->assign('LITO_ERROR_MSG', $tpl->get_config_vars($error_msg));
} else {
$tpl->assign('LITO_ERROR_MSG', $error_msg);
}
$tpl->assign('if_login_error', 1);
template_out('error.html', 'core');
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:14,代码来源:functions.php
示例3: template_out
}
if ($action == "main") {
template_out('main.html', $modul_name);
}
if ($action == "listmod") {
$mods_q = $db->query("SELECT `modul_admin_id`, `modul_name`, `modul_description`, `acp_modul`, `perm_lvl` FROM `cc" . $n . "_modul_admin` WHERE `acp_modul` = '1'");
$mods = array();
$i = 0;
while ($mod = $db->fetch_array($mods_q)) {
$mods[$i]['id'] = $mod['modul_admin_id'];
$mods[$i]['name'] = $mod['modul_name'];
$mods[$i]['description'] = $mod['modul_description'];
$mods[$i]['perm'] = $mod['perm_lvl'];
$i++;
}
$tpl->assign('mods', $mods);
template_out('listmod.html', $modul_name);
}
if ($action == "listgroup") {
$groups_q = $db->query("SELECT `id`, `name`, `perm_lvl` FROM `cc" . $n . "_user_groups`");
$groups = array();
$i = 0;
while ($group = $db->fetch_array($groups_q)) {
$groups[$i]['id'] = $group['id'];
$groups[$i]['name'] = $group['name'];
$groups[$i]['perm'] = $group['perm_lvl'];
$i++;
}
$tpl->assign('groups', $groups);
template_out('listgroup.html', $modul_name);
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:perm.php
示例4: header
exit;
}
$_GET['id'] = $_GET['id'] * 1;
$db->query("UPDATE `cc" . $n . "_users` SET `design_id` = '" . $_GET['id'] . "' WHERE `userid` = '" . $_SESSION['userid'] . "'");
header("Location:" . LITO_ROOT_PATH_URL);
}
if ($action == "main") {
$themes_q = $db->query("SELECT `design_id`, `design_name`, `design_author`, `design_copyright`, `design_author_mail`, `design_author_web`, `design_description`, `aktive`, `alternate_permit` FROM `cc" . $n . "_desigs`");
$themes = array();
$i = 0;
while ($theme = $db->fetch_array($themes_q)) {
$themes[$i]['id'] = $theme['design_id'];
$themes[$i]['name'] = $theme['design_name'];
$themes[$i]['author'] = $theme['design_author'];
$themes[$i]['copy'] = $theme['design_copyright'];
$themes[$i]['mail'] = $theme['design_author_mail'];
if (!preg_match('!^http://!', $theme['design_author_web'])) {
$theme['design_author_web'] = 'http://' . $theme['design_author_web'];
}
$themes[$i]['web'] = $theme['design_author_web'];
$themes[$i]['description'] = $theme['design_description'];
$themes[$i]['aktive'] = $theme['aktive'];
$themes[$i]['alt'] = $theme['alternate_permit'];
$i++;
}
$tpl->assign('themes', $themes);
template_out('main.html', $modul_name);
}
?>
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:29,代码来源:themes.php
示例5: str_replace
$text = str_replace($order, $replace, $text);
$text = nl2br($text);
$sql = "INSERT into cc" . $n . "_news (user_id,heading,date,text) VALUES('{$_SESSION['userid']}','{$heading}','{$date}','" . $text . "')";
$update = $db->query($sql);
}
header("LOCATION: " . LITO_MODUL_PATH_URL . "acp_news/news.php");
exit;
}
if ($action == "edit") {
$news_id = intval($_GET['id']);
$result_news = $db->query("SELECT * FROM cc" . $n . "_news where news_id ='{$news_id}'");
$row = $db->fetch_array($result_news);
$tpl->assign('NEWS_OVER', $row['heading']);
$tpl->assign('ACTION_SAVE', 'update&id=' . $news_id);
$tpl->assign('NEWS_TEXT_LANG', $row['text']);
template_out('news_new.html', $modul_name);
}
if ($action == "update") {
$news_id = intval($_GET['id']);
if (empty($_POST['new_news']) || empty($_POST['new_news'])) {
error_msg($l_emptyfield_error);
} else {
$text = mysql_real_escape_string(trim($_POST['new_news']));
$heading = mysql_real_escape_string(trim($_POST['heading']));
if ($heading == "") {
$heading = "no input";
}
$date = date("d.m.Y, H:i");
$sql = "update cc" . $n . "_news set user_id='{$_SESSION['userid']}' ,heading= '{$heading}' ,date='{$date}',text='" . nl2br($text) . "' where news_id ='{$news_id}'";
$update = $db->query($sql);
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:news.php
示例6: Copyright
Litotex Browsergame - Engine
http://www.Litotex.de
http://www.freebg.de
Copyright (c) 2008 FreeBG Team
************************************************************
Hinweis:
Diese Software ist urheberrechtlich gesch�tzt.
F�r jegliche Fehler oder Sch�den, die durch diese Software
auftreten k�nnten, �bernimmt der Autor keine Haftung.
Alle Copyright - Hinweise innerhalb dieser Datei
d�rfen WEDER entfernt, NOCH ver�ndert werden.
************************************************************
Released under the GNU General Public License
************************************************************
*/
$modul_name = "index";
require "./../../includes/global.php";
if (is_modul_name_aktive($modul_name) == 0) {
show_error('MODUL_LOAD_ERROR', 'core');
exit;
}
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
} else {
$action = "main";
}
if ($action == "main") {
$tpl->assign('if_disable_menu', 1);
template_out('index.html', $modul_name);
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:index.php
示例7: template_out
$tpl->assign('ras', $ras);
$tpl->assign('load_name', $load_name);
$tpl->assign('load_ress_1', $load_ress_1);
$tpl->assign('load_ress_2', $load_ress_2);
$tpl->assign('load_ress_3', $load_ress_3);
$tpl->assign('load_ress_4', $load_ress_4);
$tpl->assign('buildtime', $load_buildtime);
$tpl->assign('load_points', $load_points);
$tpl->assign('load_required', $load_required);
$tpl->assign('load_b_pic', $load_b_pic);
$tpl->assign('description', $description);
$tpl->assign('make_aktion', $make_aktion);
$tpl->assign('error_buildings', $error_buildings);
$tpl->assign('build_option', $build_option);
$tpl->assign('positions', $positions);
template_out('edit_explore.html', $modul_name);
exit;
}
if ($action == "update") {
$name = trim($_POST['explorename']);
$explorepic = trim($_POST['buildpic']);
$gold = intval($_POST['kost1']);
$stone = intval($_POST['kost2']);
$oil = intval($_POST['kost3']);
$exp = intval($_POST['kost4']);
$race = intval($_POST['rasse']);
$buildtime = intval($_POST['buildtime']);
$points = intval($_POST['points']);
$required = intval($_POST['required']);
$explore_id = intval($_GET['id']);
$b_option = trim($_POST['build_option']);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:edit_explore.php
示例8: make_timebanner
}
$endtime = $row['endtime'] - ($requesttime - $time_for_one);
$backurl = "build_units.php";
$time_one = make_timebanner($starttime, $endtime, $y, $backurl);
} else {
$time_one = $buildunits10;
}
$message = "<br><a href=\"{$cancelURL}\">{$buildunits11}</a>";
$new_found_inhalt_loop = array($z, $name, $numOfMans, $time_one, $time_ready, $message);
array_push($new_found_loop, $new_found_inhalt_loop);
}
}
if ($z != 0) {
$tpl->assign('loop', $new_found_loop);
}
template_out('build_units.html', $modul_name);
exit;
}
if ($action == "create") {
$num = intval($_POST['num']);
$soid = intval($_GET['soid']);
if ($num == 0 || $soid == 0 || $num < 0) {
show_error('BUILD_UNITS_14', $modul_name);
exit;
}
$result = $db->query("SELECT * FROM cc" . $n . "_soldiers WHERE sid='{$soid}'");
$row = $db->fetch_array($result);
$row['res1'] = $row['res1'] * $num;
$row['res2'] = $row['res2'] * $num;
$row['res3'] = $row['res3'] * $num;
$row['res4'] = $row['res4'] * $num;
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:build_units.php
示例9: template_out
$tpl->assign('load_ress_2', $load_ress_2);
$tpl->assign('load_ress_3', $load_ress_3);
$tpl->assign('load_ress_4', $load_ress_4);
$tpl->assign('load_size', $load_size);
$tpl->assign('load_points', $load_points);
$tpl->assign('load_buildtime', $load_buildtime);
$tpl->assign('load_ap', $load_ap);
$tpl->assign('load_vp', $load_vp);
$tpl->assign('load_req_level', $load_req_level);
$tpl->assign('load_b_pic', $load_b_pic);
$tpl->assign('description', $description);
$tpl->assign('make_aktion', $make_aktion);
$tpl->assign('required', $required);
$tpl->assign('error_buildings', $error_buildings);
$tpl->assign('positions', $positions);
template_out('edit_units.html', $modul_name);
exit;
}
if ($action == "update") {
$name = trim($_POST['buildingname']);
$rasse = intval($_POST['rasse']);
$gold = intval($_POST['kost1']);
$stone = intval($_POST['kost2']);
$oil = intval($_POST['kost3']);
$exp = intval($_POST['kost4']);
//$bauzeit=intval($_POST['bauzeit']);
$reisezeit = intval($_POST['traveltime']);
$einmheiten_id = intval($_GET['id']);
$ap = intval($_POST['value_ap']);
$vp = intval($_POST['value_vp']);
$point = intval($_POST['points']);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:edit_units.php
示例10: Copyright
************************************************************
Litotex Browsergame - Engine
http://www.Litotex.de
http://www.freebg.de
Copyright (c) 2008 FreeBG Team
************************************************************
Hinweis:
Diese Software ist urheberrechtlich gesch�tzt.
F�r jegliche Fehler oder Sch�den, die durch diese Software
auftreten k�nnten, �bernimmt der Autor keine Haftung.
Alle Copyright - Hinweise innerhalb dieser Datei
d�rfen WEDER entfernt, NOCH ver�ndert werden.
************************************************************
Released under the GNU General Public License
************************************************************
*/
$modul_name = "screenshot";
require "./../../includes/global.php";
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
} else {
$action = "main";
}
if (is_modul_name_aktive($modul_name) == 0) {
show_error('MODUL_LOAD_ERROR', 'core');
exit;
}
if ($action == "main") {
template_out('screenshot.html', $modul_name);
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:screenshot.php
示例11: make_timebanner
$cancelURL = "exploring.php?eid={$userdata['eid']}&action=del";
$message = make_timebanner($userdata['startexploretime'], $userdata['endexploretime'], $row_explores['eid'], "") . "<br><a href=\"{$cancelURL}\">" . $exploreabort . "</a>";
} else {
$es_wird_gebaut = 1;
$message = 'Es wird bereits geforscht! ';
}
} else {
$message = "<a href=\"exploring.php?action=explore&eid={$row_explores['eid']}\">{$explore}</a>";
}
$image = "\"" . $row_explores['explorePic'] . "\"";
$new_found_inhalt = array($image, $row_explores['name'], $size, $row_explores['description'], $anzeige_res1, $anzeige_res2, $anzeige_res3, $anzeige_res4, $buildtime, $message);
array_push($new_found, $new_found_inhalt);
}
}
$tpl->assign('daten', $new_found);
template_out('exploring.html', $modul_name);
exit;
}
if ($action == "explore") {
$eid = intval($_GET['eid']);
if (!$eid) {
show_error('EXPLORING_ERROR_1', $modul_name);
exit;
}
$result = $db->query("SELECT * FROM cc" . $n . "_explore WHERE eid='{$eid}'");
$row = $db->fetch_array($result);
if ($row['required'] > $userdata['build_explore']) {
show_error('EXPLORING_ERROR_2', $modul_name);
exit;
}
$res1 = $row['res1'] * ($userdata[$row['tabless']] + 1);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:exploring.php
示例12: get_name_from_explore
$inhalt[$i]['req1'] = get_name_from_explore($req1, $race_id) . " ( " . $req_lv . ")";
$inhalt[$i]['req2'] = $userdata[$req1];
$i++;
}
} else {
if ($techtree_type == "2") {
/* Build the Tabless Names */
$Tabless = array();
$i = 0;
$result = $db->query("SELECT * FROM `cc" . $n . "_explore` WHERE race= '" . $race_id . "'");
while ($row = $db->fetch_array($result)) {
$single = $row['tabless'];
$name = $row['name'];
$image = $row['explorePic'];
$req = $row['required'];
$req_lv = $userdata[$single];
$b_name = get_buildings_name('build_explore', $userdata['race']);
$inhalt[$i]['name'] = $name . " (" . $userdata[$single] . ")";
$inhalt[$i]['image'] = $image;
$inhalt[$i]['req1'] = $b_name . " " . $req;
$inhalt[$i]['req2'] = $userdata['build_explore'];
$inhalt[$i]['description'] = $row['description'];
$i++;
}
}
}
}
$tpl->assign('daten', $inhalt);
template_out('techtree.html', $modul_name);
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:techtree.php
示例13: while
$angreifer_name = $row_angreifer['username'];
$count++;
$battle_def[$battle_def_count]['angreifer_name'] = $angreifer_name;
$battle_def[$battle_def_count]['angreifer_land'] = $angreifer_land;
$battle_def[$battle_def_count]['group_name'] = $group_name;
$battle_def[$battle_def_count]['request_counter'] = $request_counter;
$battle_def[$battle_def_count]['request_battle_counter'] = $request_battle_counter;
$battle_def_count++;
}
$tpl->assign('daten_battle_def', $battle_def);
$result = $db->query("SELECT * FROM cc" . $n . "_groups WHERE islandid = '{$userdata['activeid']}' AND group_status = 0");
while ($row = $db->fetch_array($result)) {
$groups .= "<option value=\"" . $row['groupid'] . "\">" . $row['name'] . "</option>";
}
$tpl->assign('groups', $groups);
template_out('battle.html', $modul_name);
exit;
}
if ($action == "send") {
$endx = intval($_POST['endx']);
$endy = intval($_POST['endy']);
$groupid = intval($_POST['groupid']);
if (!$endx || $endx < 0 || !$endy || $endy < 0) {
show_error('LM_system_e', $modul_name);
exit;
}
$result = $db->query("SELECT * FROM cc" . $n . "_countries WHERE x='{$endx}' AND y='{$endy}'");
$row = $db->fetch_array($result);
$target_user_id = $row['userid'];
$result2 = $db->query("SELECT * FROM cc" . $n . "_users WHERE userid='" . $row['userid'] . "'");
$row2 = $db->fetch_array($result2);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:battle.php
示例14: trim
}
$result = $db->query("SELECT * FROM cc" . $n . "_allianz WHERE aid='{$id}'");
$row = $db->fetch_array($result);
$banner = trim($row['imageurl']);
if ($banner == "") {
$banner = LITO_IMG_PATH_URL . $modul_name . "/no_ali_banner.png";
}
$description = bb2html($row['text_long']);
$ibit = "";
$result = $db->query("SELECT userid,username,is_ali_admin,status FROM cc" . $n . "_users WHERE allianzid='{$id}' ORDER BY is_ali_admin DESC");
while ($i = $db->fetch_array($result)) {
$ibit .= generate_messagelink_smal($i[username]) . " " . generate_userlink($i[userid], $i[username]);
if ($i['is_ali_admin'] == 1) {
$ibit .= " (Leiter)";
}
$ibit .= " {$img}<br>";
}
$is_in_ali = 0;
if (intval($userdata['allianzid']) > 0) {
$is_in_ali = 1;
}
$tpl->assign('is_in_ali', $is_in_ali);
$tpl->assign('banner', $banner);
$tpl->assign('name', $row['name']);
$tpl->assign('text', $row['text']);
$tpl->assign('points', intval($row['points']));
$tpl->assign('ibit', $ibit);
$tpl->assign('description', $description);
$tpl->assign('ali_id', $row['aid']);
template_out('alliance.html', $modul_name);
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:alliance.php
示例15: strftime
}
$alli = $row['allianzid'];
$chpt = $row['points'] - $row['lastpoints'];
$lastlog = strftime("%d.%m. %H:%M", $row['lastlogin']);
if ($row['allianzid'] == 0) {
$allianzname = "";
} else {
$allianzname = allianz($row['allianzid']);
}
$userpic = "";
if ($row['userpic'] == "") {
$userpic = LITO_IMG_PATH_URL . "members/no_user_pic.jpg";
} else {
$userpic = $row['userpic'];
}
$daten[$i]['profile_link'] = generate_userlink($row['userid'], $row['username']);
$daten[$i]['name'] = $username;
$daten[$i]['u_points'] = $userpoints;
$daten[$i]['image'] = $userpic;
$daten[$i]['u_online'] = $online;
$daten[$i]['lastlogin'] = $lastlog;
$daten[$i]['alianz'] = $allianzname;
$daten[$i]['message'] = generate_messagelink_smal($username);
$i++;
}
if ($i > 0) {
$tpl->assign('daten', $daten);
}
template_out('search.html', $modul_name);
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:search.php
示例16: header
Alle Copyright - Hinweise innerhalb dieser Datei
dürfen WEDER entfernt, NOCH verändert werden.
************************************************************
Released under the GNU General Public License
************************************************************
*/
@session_start();
require $_SESSION['litotex_start_acp'] . 'acp/includes/global.php';
if (!isset($_SESSION['userid'])) {
header("LOCATION: " . $_SESSION['litotex_start_url'] . 'acp/index.php');
exit;
}
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
} else {
$action = "main";
}
$modul_name = "acp_sample";
if ($action == "main") {
$sql = "SELECT * from cc" . $n . "_users";
$result_users = $db->query($sql);
while ($row_g = $db->fetch_array($result_users)) {
$daten[] = $row_g;
}
$tpl->assign('daten', $daten);
$tpl->assign('test1', "http://www.blabla.de");
$test = "www";
template_out('sample.html', $modul_name);
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:30,代码来源:sample.php
示例17: make_ingamemail
if ($die != 1) {
$db->query("UPDATE cc" . $n . "_countries SET sol_kolo=sol_kolo+'1' WHERE islandid='{$userdata['islandid']}'");
} else {
$add_mes = $newland13;
}
make_ingamemail(0, $userdata['userid'], $newland14, $newland15);
}
$db->query("DELETE FROM cc" . $n . "_new_land WHERE koloid='{$row['koloid']}'");
header("LOCATION: new_land.php");
}
$new_found_inhalt = array($sol_name, $row['x'], $row['y'], $timebanner);
array_push($new_found, $new_found_inhalt);
}
$tpl->assign('daten', $new_found);
$tpl->assign('daten2', $new_found_2);
template_out('new_land.html', $modul_name);
exit;
}
if ($action == "send") {
$do = $_POST['send'];
if ($userdata['sol_kolo'] == 0) {
show_error('NEW_LAND_ERROR_1', $modul_name);
exit;
}
if ($do == "send") {
$x = intval($_POST['x']);
$result = $db->query("Select max(x) as max_x from cc" . $n . "_crand");
$row = $db->fetch_array($result);
if ($x < 0 || !isset($x) || $x > $row['max_x']) {
show_error('NEW_LAND_ERROR_2', $modul_name);
exit;
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:new_land.php
示例18: ks_battle
//.........这里部分代码省略.........
$einheiten_anzahl = $kampfscript->verteidiger[$name]["unit_count"];
$einheiten_new_count = $kampfscript->verteidiger[$name]["new_units_count"];
$einheiten_name = get_soldiers_name($einheiten_name, $vert_race);
$einheit_vert .= $einheiten_name . "<br>";
$einheit_vert_count .= intval($einheiten_anzahl) . "<br>";
$einheiten_vert_ap += $kampfscript->verteidiger[$name]["ap_single"] * $einheiten_anzahl;
$einheiten_vert_vp += $kampfscript->verteidiger[$name]["vp_single"] * $einheiten_anzahl;
if ($fromadmin == 0) {
$db->query("update cc" . $n . "_countries set " . $einheiten_name_org . " ='" . $einheiten_new_count . "' where islandid='" . $land_id . "'");
$db->query("update cc" . $n . "_countries set " . $einheiten_name_org . " ='0' where islandid='" . $land_id . "' and " . $einheiten_name_org . " <'0'");
}
}
}
$dauer_berechnung = sprintf("%.05f", ntime($stime, mtime()));
$last_msg = "Es wurden " . intval($all_einheiten) . " Einheiten in " . $dauer_berechnung . " Sekunden berechnet.";
unset($kampfscript);
$date = date("d.m.Y H:i:s", time());
$last_archive_id = 0;
$result = $db->query("SELECT archive_id FROM cc" . $n . "_battle_archiv order by archive_id DESC limit 1");
$row = $db->fetch_array($result);
$last_archive_id = $row['archive_id'];
$kr_number = $last_archive_id + 1;
$random = password(5);
$random1 = time();
$battle_url = "battle_id_" . $random . "_" . $random1 . ".html";
$db->query("INSERT INTO cc" . $n . "_battle_archiv(ang_username,ang_land,vert_username,vert_land,battle_time,battle_url) VALUES ('{$angreifer_name}','{$angreifer_land}','{$verteidiger_name}','{$verteidiger_land}','" . time() . "','{$battle_url}')");
$message_topic = "Kampfreport vom : " . date("d.m.Y H:i:s", time());
$tpl->assign('date', $date);
$tpl->assign('angreifer_name', $angreifer_name);
$tpl->assign('angreifer_land', $angreifer_land);
$tpl->assign('verteidiger_name', $verteidiger_name);
$tpl->assign('verteidiger_land', $verteidiger_land);
$tpl->assign('einheit_ang', $einheit_ang);
$tpl->assign('einheit_ang_count', $einheit_ang_count);
$tpl->assign('einheit_vert', $einheit_vert);
$tpl->assign('einheit_vert_count', $einheit_vert_count);
$tpl->assign('all_einheiten_angr_count', $all_einheiten_angr_count);
$tpl->assign('einheiten_ang_ap', $einheiten_ang_ap);
$tpl->assign('all_einheiten_vert_count', $all_einheiten_vert_count);
$tpl->assign('einheiten_vert_ap', $einheiten_vert_ap);
$tpl->assign('einheiten_ang_vp', $einheiten_ang_vp);
$tpl->assign('einheiten_vert_vp', $einheiten_vert_vp);
$tpl->assign('verlust_angreifer', $verlust_angreifer);
$tpl->assign('verlust_verteidiger', $verlust_verteidiger);
$tpl->assign('last_msg', $last_msg);
$tpl->assign('kr_number', $kr_number);
$k_report = $tpl->fetch(LITO_THEMES_PATH . 'battle/battle_ks_web.html');
$Datei = LITO_ROOT_PATH . "battle_kr/{$battle_url}";
$Datei_url = LITO_ROOT_PATH_URL . "battle_kr/{$battle_url}";
$message_text = "Du wurdest angegriffen.<br>Den Kampfreport findest du hier:<br> [url=" . $Datei_url . "]Kampfreport Nr.:" . $kr_number . "[/url]";
if ($fromadmin == 0) {
make_ingamemail(0, $angreifer_user_id, $message_topic, $message_text);
make_ingamemail(0, $verteidiger_user_id, $message_topic, $message_text);
}
$erstellen = fopen($Datei, "w");
fwrite($erstellen, $k_report);
fclose($erstellen);
if ($all_einheiten_vert_count <= 0) {
$max_steal = intval($op_res_steal);
if ($max_steal > 0) {
resreload($land_id);
$result = $db->query("SELECT res1,res2,res3,res4,islandid FROM cc" . $n . "_countries WHERE islandid='" . $land_id . "'");
$row = $db->fetch_array($result);
$land_res1 = $row['res1'];
$land_res2 = $row['res2'];
$land_res3 = $row['res3'];
$land_res4 = $row['res4'];
$per_res1 = round($land_res1 * ($max_steal / 100), 0);
$per_res2 = round($land_res2 * ($max_steal / 100), 0);
$per_res3 = round($land_res3 * ($max_steal / 100), 0);
$per_res4 = round($land_res4 * ($max_steal / 100), 0);
if ($per_res1 < 0) {
$per_res1 = 0;
}
if ($per_res2 < 0) {
$per_res2 = 0;
}
if ($per_res3 < 0) {
$per_res3 = 0;
}
if ($per_res4 < 0) {
$per_res4 = 0;
}
$result = $db->query("update cc" . $n . "_countries set res1=res1-'" . $per_res1 . "',res2=res2-'" . $per_res2 . "',res3=res3-'" . $per_res3 . "',res4=res4-'" . $per_res4 . "' WHERE islandid='" . $land_id . "'");
$result = $db->query("update cc" . $n . "_groups set res1=res1+'" . $per_res1 . "',res2=res2+'" . $per_res2 . "',res3=res3+'" . $per_res3 . "',res4=res4+'" . $per_res4 . "' WHERE groupid='" . $group_id . "'");
}
// group back
$result = $db->query("SELECT * FROM cc" . $n . "_groups WHERE islandid = '{$userdata['activeid']}' AND groupid = {$group_id}");
$row = $db->fetch_array($result);
$old_traveltime = get_duration_time($userdata['x'], $userdata['y'], $row['endx'], $row['endy'], $row['speed']);
$requesttime = $row['traveltime'] - time();
if ($requesttime < 0) {
$requesttime = 0;
}
$back_traveltime = $old_traveltime - $requesttime;
$starttime = time();
$db->query("UPDATE cc" . $n . "_groups SET group_status = 2, starttime={$starttime},traveltime = {$back_traveltime}, endx = {$userdata['x']}, endy = {$userdata['y']} WHERE groupid='{$group_id}'");
}
template_out('battle_ks.html', $modul_name);
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:101,代码来源:battle_ks.php
示例19: md5
$x_pos = $land['x'];
$y_pos = $land['y'];
$md5_pw = md5($password);
trace_msg("User {$username} registriert ", 1);
$db->query("INSERT INTO cc" . $n . "_users (username,email,password,register_date) VALUES ('{$username}','{$email}','{$md5_pw}','" . time() . "')");
$userid_r = $db->insert_id();
$db->query("INSERT INTO cc" . $n . "_countries (res1,res2,res3,res4,userid,lastressources,picid,x,y,size) VALUES ('{$op_reg_res1}','{$op_reg_res2}','{$op_reg_res3}','{$op_reg_res4}','{$userid_r}','" . time() . "','1','{$x_pos}','{$y_pos}','" . rand($op_min_c_size, $op_max_c_size) . "')");
$islandid_r = $db->insert_id();
$db->query("UPDATE cc" . $n . "_crand SET used='1' WHERE x='" . $x_pos . "' AND y='" . $y_pos . "'");
$db->query("UPDATE cc" . $n . "_users SET activeid='{$islandid_r}' WHERE userid='{$userid_r}'");
send_register_mail($email, "mail_register.html", $modul_name, $username, $password, $x_pos, $y_pos);
show_error("REGISTER_SUBMIT_OK", $modul_name);
exit;
}
if ($action == "forgott") {
template_out('register_forgott.html', $modul_name);
exit;
}
if ($action == "submit_forgott") {
$username = c_trim(strtolower($_POST['username']));
$email = c_trim(strtolower($_POST['email']));
if ($username == "") {
show_error("REGISTER_ERROR_2", $modul_name);
exit;
}
if (!preg_match("/^[0-9a-z_-]{3,15}\$/i", $username)) {
show_error("REGISTER_ERROR_4", $modul_name);
exit;
}
if ($email == "") {
show_error("REGISTER_ERROR_2", $modul_name);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:register.php
示例20: while
//start
$nn = 0;
$result = $db->query("SELECT * FROM cc" . $n . "_allianz ORDER BY points DESC LIMIT {$start},30");
while ($row = $db->fetch_array($result)) {
$alli = $row['aid'];
if ($row['text']) {
$infotext = substr($row['text'], 0, 30);
if (strlen($row['text']) > 30) {
$infotext .= "...";
}
} else {
$infotext = $ln_rankings_no_allianz_infos;
}
$i++;
$nn++;
$inhalt[$nn]['ali_name'] = generate_allilink($alli);
$inhalt[$nn]['ali_test'] = $infotext;
$inhalt[$nn]['points'] = $row['points'];
$inhalt[$nn]['platz'] = $i;
$ali_flag = get_allianz_flag($row['aid']);
$inhalt[$nn]['ali_flag'] = $ali_flag;
$inhalt[$nn]['ali_anz'] = $row['members'];
}
for ($i = 0; $i < $maxpage + 1; $i++) {
$pagesbit .= "<option value=\"{$i}\">" . ($i + 1) . "</option>";
}
$tpl->assign('page', $pagesbit);
$tpl->assign('daten', $inhalt);
template_out('ranking_ali.html', $modul_name);
exit;
}
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:ranking.php
注:本文中的template_out函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论