Parašė LeBro· 2008 Lie. 20 16:07:27
#1
naudoju kalbu keitimo panele. Kodas :
<?php
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
function makeList($dir, $name, $var_lang_name) {
$files = array();
$res = "";
$handle = opendir($dir);
while($file = readdir($handle)) {
if($file != "." && $file != ".." && is_dir($dir."/".$file)) {
$files[] = $file;
}
}
closedir($handle);
natsort($files); // Tri du tableau
$res .= '<select name="'.$name.'" class="textbox"><option value=""></option>';
foreach($files as $v) {
if ($var_lang_name == $v) {
$res .= "<option value='".$v."' selected>".$v."</option>\n";
} else $res .= "<option value='".$v."'>".$v."</option>\n";
}
$res .= '</select>';
return $res;
}
if ($_POST['lang']) {
setcookie("lang",$_POST['lang']);
redirect(FUSION_SELF);
}
openside("Choose language:");
echo "<div align='center'><form method='post' action='".FUSION_SELF."' enctype='multipart/form-data'>";
echo makeList(BASEDIR."locale","lang",$_COOKIE['lang'])." <input type='submit' value='Ok' class='button'/>";
echo "</form></div>";
closeside();
?>
Tai atrodo taip :
taciau toks budas yra nepatogus ir as noreciau, kad pasirinkti galima budu paspaudus ant veliavu ar kokiu kitu paveiksleliu :)
yra zinanciu kaip pakeisti si koda i man reikalinga ?
Redagavo Žmogus· 2008 Lie. 20 20:07:37