0) $max_page++; // max. Anzahl von Seiten
$prepages = $startpage-1;
if ($prepages > 5) $prepages = 5;
$followpages = 10-1-$prepages;
if ($followpages > 9) $followpages = 9;
if (($followpages + $startpage) > $max_page) $followpages = $max_page - $startpage;
if (($prepages + $followpages + 1) < $max_page) $prepages = 10 - $followpages - 1;
if ($prepages >= $startpage) $prepages = $startpage - 1; // neu
$endpage = $startpage+$followpages;
$urlbind = strpos($page_uri,"?"); // Schauen ob schon Variablen angeh�ngt sind
if ($urlbind === FALSE) {
$urlbind = "?";
} else {
$urlbind = "&";
}
// pagelink generieren
$page_uri = str_replace($urlbind.$varname."=".$startpage,"",$page_uri);
// < und << davorsetzen
if ((($startpage - 10) <= 0) && ($startpage > 2)) {
echo "<< ";
} elseif ((($startpage - 10) > 0)) {
echo "<< ";
}
if ($startpage > 1) {
echo "< ";
}
// Seitennummern inkl. pagelink ausgeben
$pagenumber = $startpage - $prepages;
while ($pagenumber <= $endpage) {
if ($pagenumber != $startpage) {
echo "$pagenumber ";
} else {
echo "".$pagenumber." ";
}
$pagenumber++;
}
// > und >> dahintersetzen
if ($startpage < $max_page) {
echo "> ";
}
if ((($startpage + 10) >= $max_page) && ($startpage+1 < $max_page)) {
echo ">> ";
} elseif ((($startpage + 10) < $max_page)) {
echo ">> ";
}
}
function makeheader($title) {
global $global_universe, $allyhistory, $playerhistory;
@include "../languages/korean_workaround.inc.php";
@include "../languages/taiwan_workaround.inc.php";
@include "../languages/japan_workaround.inc.php";
@include "../languages/chinese_workaround.inc.php";
// styles path holen
if (isset($_SESSION['s_stylepath'])) $stylepath = $_SESSION['s_stylepath'];
if (trim($stylepath) == "") $stylepath = "styles.css";
$tmp = strrpos($stylepath,"/");
$modname = "EpicBlue";
if ($tmp !== false) {
$tmp = substr($stylepath,0,$tmp);
$pos = strrpos($tmp,"/");
if ($pos !== false) $modname = substr($tmp,$pos+1,strlen($tmp)-$pos);
}
echo '
'.$title.'
';
if ($title == VIEW_TITLE) {
echo '';
} elseif (isset($_GET['action']) && $_GET['action'] == "searchres" && isset($_POST[urlencode(REPORTS_SEARCH_EXTENDED)])) {
echo "";
} else {
echo '';
}
// for timeout issues
echo '';
echo '
'.SHORTNAME.'
'.VERSION.' ';
// --------------------------------- BEGIN OF INFORMATION BLOCK ---------------------------------------------
if (!empty($global_universe) && is_numeric($global_universe)) echo '
'.UNIVERSE.' '.$global_universe.' ';
echo '
'.$modname.'-Mod
";
// --------------------------------- END OF INFORMATION BLOCK ---------------------------------------------
// --------------------------------- BEGIN OF OPTION BLOCK ---------------------------------------------
echo '
';
@include "../hosting/left_menu.php";
echo '
';
@include "../hosting/mainframe_top.php";
// --------------------------------- END OF STUFF BLOCK ---------------------------------------------
}
function makefooter() {
@include "../hosting/mainframe_bottom.php";
echo '
';
}
/**
* This function will check every status and print the letters given as parameters instead. This makes
* sure that every language will get it's corresponding letter for the status.
*
* @param boolean $statusstring Angabe ob es als BB Code ausgegeben werden soll, oder nicht
* @param string $statusstring
* @param char(1) $printbanned the letter which shall be shown for banned players
* @param char(1) $printvaction the letter which shall be shown for players at vacation mode
* @param char(1) $printnoob the letter which shall be shown for noob players
* @param char(1) $printinactive the letter which shall be shown for inactive players
* @param char(1) $printlonginactive the letter which shall be shown for long inactive players
*/
function print_status($show_as_bb_code, $statusstring, $printbanned="g", $printvaction="u", $printnoob="n", $printinactive="i", $printlonginactive="I") {
if ($show_as_bb_code) {
if (strpos($statusstring,"g") !== false) {
echo "[COLOR=".$_SESSION['s_bb_banned']."]".$printbanned."[/COLOR]";
}
if (strpos($statusstring,"u") !== false) {
echo "[COLOR=".$_SESSION['s_bb_vacation']."]".$printvaction."[/COLOR]";
}
if (strpos($statusstring,"n") !== false) {
echo "[COLOR=".$_SESSION['s_bb_noob']."]".$printnoob."[/COLOR]";
}
if (strpos($statusstring,"i") !== false) {
echo "[COLOR=".$_SESSION['s_bb_inactive']."]".$printinactive."[/COLOR]";
}
if (strpos($statusstring,"I") !== false) {
echo "[COLOR=".$_SESSION['s_bb_longinactive']."]".$printlonginactive."[/COLOR]";
}
} else {
if (strpos($statusstring,"g") !== false) {
echo "$printbanned ";
}
if (strpos($statusstring,"u") !== false) {
echo "$printvaction ";
}
if (strpos($statusstring,"n") !== false) {
echo "$printnoob ";
}
if (strpos($statusstring,"i") !== false) {
echo "$printinactive ";
}
if (strpos($statusstring,"I") !== false) {
echo "$printlonginactive ";
}
}
}
function update_speedsim_link($link,$key,$value) {
if (empty($link)) $link = "http://websim.speedsim.net/?";
//?ship_d0_3_b=4&tech_a0_0=10&tech_d0_1=12&engine_0=10&ship_d0_18_b=1&engine0_0=10&enemy_metal=10.000
if ($value > 0 || $key == "coordinates" || $key == "enemy_name") {
switch ($key) {
case "coordinates": $link .= "enemy_pos=$value&"; break;
case "enemy_name": $link .= "enemy_name=$value&"; break;
case "metal": $link .= "enemy_metal=$value&"; break;
case "crystal": $link .= "enemy_crystal=$value&"; break;
case "deuterium": $link .= "enemy_deut=$value&"; break;
case "kt": $link .= "ship_d0_0_b=$value&"; break;
case "gt": $link .= "ship_d0_1_b=$value&"; break;
case "lj": $link .= "ship_d0_2_b=$value&"; break;
case "sj": $link .= "ship_d0_3_b=$value&"; break;
case "krz": $link .= "ship_d0_4_b=$value&"; break;
case "ss": $link .= "ship_d0_5_b=$value&"; break;
case "kolo": $link .= "ship_d0_6_b=$value&"; break;
case "rec": $link .= "ship_d0_7_b=$value&"; break;
case "spio": $link .= "ship_d0_8_b=$value&"; break;
case "bomb": $link .= "ship_d0_9_b=$value&"; break;
case "sat": $link .= "ship_d0_10_b=$value&"; break;
case "zerri": $link .= "ship_d0_11_b=$value&"; break;
case "ds": $link .= "ship_d0_12_b=$value&"; break;
case "skrz": $link .= "ship_d0_13_b=$value&"; break;
case "rak": $link .= "ship_d0_14_b=$value&"; break;
case "ll": $link .= "ship_d0_15_b=$value&"; break;
case "sl": $link .= "ship_d0_16_b=$value&"; break;
case "gauss": $link .= "ship_d0_17_b=$value&"; break;
case "ion": $link .= "ship_d0_18_b=$value&"; break;
case "plasma": $link .= "ship_d0_19_b=$value&"; break;
case "ksk": $link .= "ship_d0_20_b=$value&"; break;
case "gsk": $link .= "ship_d0_21_b=$value&"; break;
case "waffentech": $link .= "tech_d0_0=$value&"; break;
case "schildtech": $link .= "tech_d0_1=$value&"; break;
case "rpz": $link .= "tech_d0_2=$value&"; break;
case "arak": $link .= "abm_b=$value&"; break;
}
if ($_SESSION['s_vbt'] > 0 && !strpos($link,"engine0_0=")) {
$link .= "engine0_0=".$_SESSION['s_vbt']."&";
}
if ($_SESSION['s_impulse'] > 0 && !strpos($link,"engine0_1=")) {
$link .= "engine0_1=".$_SESSION['s_impulse']."&";
}
if ($_SESSION['s_hra'] > 0 && !strpos($link,"engine0_2=")) {
$link .= "engine0_2=".$_SESSION['s_hra']."&";
}
if ($_SESSION['s_waffentech'] > 0 && !strpos($link,"tech_a0_0=")) {
$link .= "tech_a0_0=".$_SESSION['s_waffentech']."&";
}
if ($_SESSION['s_schildtech'] > 0 && !strpos($link,"tech_a0_1=")) {
$link .= "tech_a0_1=".$_SESSION['s_schildtech']."&";
}
if ($_SESSION['s_rpz'] > 0 && !strpos($link,"tech_a0_2=")) {
$link .= "tech_a0_2=".$_SESSION['s_rpz']."&";
}
if (!strpos($link,"lang=")) {
switch ($_SESSION['lang']) {
case "german" :
$link .= "lang=de&";
break;
case "polish" :
$link .= "lang=pl&";
break;
case "english" :
$link .= "lang=en&";
break;
case "spanish" :
$link .= "lang=sp&";
break;
case "dutch" :
$link .= "lang=nl&";
break;
case "balkan" :
$link .= "lang=ba&";
break;
case "french" :
$link .= "lang=fr&";
break;
case "portugues" :
$link .= "lang=pt&";
break;
case "italian" :
$link .= "lang=it&";
break;
case "turkish" :
// nothing yet
break;
case "danish" :
$link .= "lang=dk&";
break;
case "brazilian" :
$link .= "lang=pt&"; // no brazil yet, but pt is better than german
break;
case "russian" :
$link .= "lang=ru&";
break;
case "swedish" :
$link .= "lang=sv&";
break;
case "greek" :
$link .= "lang=gr&";
break;
case "romanian" :
$link .= "lang=ro&";
break;
case "hungarian" :
// nothing available yet
break;
case "czech" :
$link .= "lang=cz&";
break;
case "korean" :
$link .= "lang=kr&";
break;
case "norwegian" :
$link .= "lang=no&";
break;
case "taiwan" :
$link .= "lang=tw&";
break;
case "japan" :
$link .= "lang=ja&";
break;
case "chinese" :
$link .= "lang=cn&";
break;
case "bulgarian" :
$link .= "lang=bg&";
break;
case "lithuanian" :
$link .= "lang=lt&";
break;
case "latvian" :
// not available yet
break;
case "finnish" :
// not available yet
break;
default: break;
}
}
}
return $link;
}
function get_phalanx_range($moon_array) {
ksort($moon_array); // sort array by galaxy key
$range_array = array();
foreach ($moon_array as $galaxy => $values) {
usort($values,"compare_moon_array");
$phalanx_string[$galaxy] = "";
$biggest_max_system = 0;
for ($i=0;$i