Jak na svůj web dostanu diakritiku? *

Místo pro dotazy a rady ohledně programovacích jazyků (C++, C#, PHP, ASP, Javascript, VBS..) a tvorby webových stránek

Moderátor: Mods_senior

Grow
Level 2.5
Level 2.5
Příspěvky: 254
Registrován: 31 bře 2011 19:41

Re: Jak na svůj web dostanu diakritiku? *

Příspěvek od Grow »

Ano, hotový script. Sám script v php neudělám.. Zkusil sem to takhle
home.php

Kód: Vybrat vše

<!DOCTYPE....>

<html>

<head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>

<?php
// translator ready
// addnews ready
// mail ready

if (isset($_POST['template'])){
	$skin = $_POST['template'];
	if ($skin > "") {
		setcookie("template",$skin ,strtotime("+45 days"));
		$_COOKIE['template']=$skin;
	}
}

define("ALLOW_ANONYMOUS",true);
require_once("common.php");
require_once("lib/http.php");


if (!isset($session['loggedin'])) $session['loggedin']=false;
if ($session['loggedin']){
	redirect("badnav.php");
}

tlschema("home");

$op = httpget('op');

page_header();
output("`cVítejte ve browserové hře Big Fighter.`n");

if (getsetting("homecurtime", 1)) {
	output("`@Ve městě %s je `%%s`@.`0`n", getsetting("villagename", LOCATION_FIELDS), getgametime());
}

if (getsetting("homenewdaytime", 1)) {
	$secstonewday = secondstonextgameday();
	output("`@Další den je za: `\$%s (real time)`0`n`n",
			date("G\\".translate_inline("h","datetime").", i\\".translate_inline("m","datetime").", s\\".translate_inline("s","datetime"),
				$secstonewday));
}

if (getsetting("homenewestplayer", 1)) {
	$name = "";
	$newplayer = getsetting("newestplayer", "");
	if ($newplayer != 0) {
		$sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='$newplayer'";
		$result = db_query_cached($sql, "newest");
		$row = db_fetch_assoc($result);
		$name = $row['name'];
	} else {
		$name = $newplayer;
	}
	if ($name != "") {
		output("`QNejnovější hráč je: `&%s`0`n`n", $name);
	}
}

clearnav();
addnav("Nový ve hře?");
addnav("Vytvořit postavu","create.php");
addnav("MoĹľnostĂ­ hry");
addnav("Zapomenuté heslo","create.php?op=forgot");
addnav("Highscore","list.php");
addnav("Novinky dne", "news.php");
addnav("Další info");
addnav("O hře","about.php");
addnav("NastavenĂ­ hry", "about.php?op=setup");

modulehook("index", array());

if (abs(getsetting("OnlineCountLast",0) - strtotime("now")) > 60){
	$sql="SELECT count(acctid) as onlinecount FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."'";
	$result = db_query($sql);
	$onlinecount = db_fetch_assoc($result);
	$onlinecount = $onlinecount ['onlinecount'];
	savesetting("OnlineCount",$onlinecount);
	savesetting("OnlineCountLast",strtotime("now"));
}else{
	$onlinecount = getsetting("OnlineCount",0);
}
if ($onlinecount<getsetting("maxonline",0) || getsetting("maxonline",0)==0){
	output("Vlož své jméno a heslo pro vstup do hry.`n");
	if ($op=="timeout"){
		$session['message'].= translate_inline(" Nepodařilo se připojit do hry. Prosím opakujte akci.`n");
	}
	if (!isset($_COOKIE['lgi'])){
		$session['message'].=translate_inline("Máte zakázané cookies na této stránce.`n");
	}
	if (isset($session['message']) && $session['message']>"")
		output_notl("`b`\$%s`b`n", $session['message'],true);
	rawoutput("<script language='JavaScript' src='lib/md5.js'></script>");
	rawoutput("<script language='JavaScript'>
	<!--
	function md5pass(){
		//encode passwords before submission to protect them even from network sniffing attacks.
		var passbox = document.getElementById('password');
		if (passbox.value.substring(0, 5) != '!md5!') {
			passbox.value = '!md5!' + hex_md5(passbox.value);
		}
	}
	//-->
	</script>");
	$uname = translate_inline("<u>J</u>méno");
	$pass = translate_inline("<u>H</u>eslo");
	$butt = translate_inline("Přihlásit");
	rawoutput("<form action='login.php' method='POST' onSubmit=\"md5pass();\">".templatereplace("login",array("username"=>$uname,"password"=>$pass,"button"=>$butt))."</form>");
	output_notl("`c");
	addnav("","login.php");
} else {
	output("`\$`bServer full!`b`n`^Prosím počkejte než se někdo neodhlásí.`n`n`0");
	if ($op=="timeout"){
		$session['message'].= translate_inline(" Sezení uplynulo, prosím přihlašte se znovu.`n");
	}
	if (!isset($_COOKIE['lgi'])){
		$session['message'].=translate_inline("It appears that you may be blocking cookies from this site. At least session cookies must be enabled in order to use this site.`n");
	}
	if ($session['message']>"") output("`b`\$%s`b`n", $session['message'],true);
	rawoutput(templatereplace("loginfull",array()));
	output_notl("`c");
}

$msg = getsetting("loginbanner","*BETA* This is a BETA of this website, things are likely to change now and again, as it is under active development *BETA*");
output_notl("`n`c`b`&%s`0`b`c`n", $msg);
$session['message']="";
output("`c`2Herní server běžící verze: `@%s`0`c", $logd_version);

if (getsetting("homeskinselect", 1)) {
	rawoutput("<form action='home.php' method='POST'>");
	rawoutput("<table align='center'><tr><td>");
	$form = array("template"=>"Vyberte si skin hry:,theme");
	$prefs['template'] = $_COOKIE['template'];
	if ($prefs['template'] == "")
		$prefs['template'] = getsetting("defaultskin", "ailean.htm");
	require_once("lib/showform.php");
	showform($form, $prefs, true);
	$submit = translate_inline("Vybrat");
	rawoutput("</td><td><br>&nbsp;<input type='submit' class='button' value='$submit'></td>");
	rawoutput("</tr></table></form>");
}

page_footer();
?>
</body>
</html>
ale pořád to nejde

--- Doplnění předchozího příspěvku (15 Lis 2011 17:46) ---

Prosím jak to udělat?

--- Doplnění předchozího příspěvku (15 Lis 2011 19:13) ---

To mám jako uložit jako html soubor?
Odpovědět

Zpět na „Programování a tvorba webu“