echo "<p><font color='red'>Sie befinden sich bereits auf diesem Feld.</font></p>"; } else { $timestring = implode("#", $timearray); $posstring = implode("#", $posarray); $sqlab = "INSERT INTO `schiffs_auftraege` ( `id` , `schiffsid` , `pos_array` , `time_array` ) VALUES ("; $sqlab .= "NULL , '" . $_SESSION["ship"] . "', '" . $posstring . "', '" . $timestring . "')"; mysql_query($sqlab); echo "<p><font color='green'>Sie sind erfolgreich losgeflogen.</font></p>"; } } } $fp = fopen("../daten/galaxy/" . $pos[2] . ".txt", "r"); for ($i = 0; $i < $pos[0]; $i++) { $line = trim(fgets($fp, 2000)); } $splitfilds = get_mark($line, "[*]"); $fieldida = explode(",", $splitfilds[$pos[1] - 1]); echo "<b>" . $fieldtyp[$fieldida[1]][0] . " (" . $tmpPos . ")<b><br><br>"; echo "<table border='0' width='90%'>"; echo "<tr><td width='50%'>"; if ($_SESSION["gmod"] == "1") { echo "<img src='../daten/galaxy/graphics/" . $fieldida[0] . ".png' border='0' alt='" . $fieldtyp[$fieldida[1]][2] . "'>"; } else { echo $fieldtyp[$fieldida[1]][2]; } echo "</td><td width='15%'> </td><td>"; $sqlab = "select * from schiffs_auftraege where schiffsid='" . $_SESSION["ship"] . "'"; $res = mysql_query($sqlab); if (mysql_num_rows($res) > 0) { echo "<p>Sie Fliegen gerade.</p>"; } else {
function bbcode($str) { #bb-code testen if (!bbcodetest($str)) { return "<p>BB-Code falsch dieser eintrag kann nicht angezeigt werden.</p>"; } #[b] [i] [u] $bbreplace = array('[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]'); $bbreplacements = array('<b>', '</b>', '<i>', '</i>', '<u>', '</u>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[left][right][center] $bbreplace = array('[left]', '[/left]', '[right]', '[/right]', '[center]', '[/center]'); $bbreplacements = array('<div align="left">', '</div>', '<div align="right">', '</div>', '<div align="center">', '</div>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[indent] $bbreplace = array('[indent]', '[/indent]'); $bbreplacements = array('<blockquote>', '</blockquote>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[list] $bbreplace = array('[list]', '[/list]', '[*]'); $bbreplacements = array('<ul>', '</ul>', '<li>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[img] $bbreplace = array('[img]', '[/img]'); $bbreplacements = array('<img border="0" alt="picture" src="', '">'); $str = str_replace($bbreplace, $bbreplacements, $str); #[quote] $zitat = '<div style="margin:20px; margin-top:5px; "><div style="margin-bottom:2px"><font size="-1">Zitat:</font></div><table cellpadding="6" cellspacing="0" border="0" width="100%"><tr><td class="alt2" style="border:1px inset"><div style="font-style:italic">'; $zitat2 = '</div></td></tr></table></div>'; $bbreplace = array('[quote]', '[/quote]'); $bbreplacements = array($zitat . "<div>", $zitat2); $str = str_replace($bbreplace, $bbreplacements, $str); #[quote=Option] $zitat = '<div style="margin:20px; margin-top:5px; "><div style="margin-bottom:2px"><font size="-1">Zitat:</font></div><table cellpadding="6" cellspacing="0" border="0" width="100%"><tr><td class="alt2" style="border:1px inset">'; $substr = get_mark($str, "[quote=*]"); for ($i = 0; $i < count($substr); $i++) { $bbreplace = '[quote=' . $substr[$i] . ']'; $bbreplacements = $zitat . "Zitat von <strong>" . $substr[$i] . '</strong><div style="font-style:italic">'; $str = str_replace($bbreplace, $bbreplacements, $str); } #[color=Option] $bbreplace = array('[color=', '[/color]'); $bbreplacements = array('<font color="', '</font>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[size=Option] klappt noch nicht $bbreplace = array('[size=', '[/size]'); $bbreplacements = array('<font size="', '</font>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[font=Option] $bbreplace = array('[font=', '[/font]'); $bbreplacements = array('<font face="', '</font>'); $str = str_replace($bbreplace, $bbreplacements, $str); #[email] $substr = get_mark($str, "[email]*[/email]"); for ($i = 0; $i < count($substr); $i++) { $bbreplace = '[email]' . $substr[$i]; $bbreplacements = '<a href="mailto:' . $substr[$i] . '">' . $substr[$i]; $str = str_replace($bbreplace, $bbreplacements, $str); } $bbreplace = '[/email]'; $bbreplacements = '</a>'; $str = str_replace($bbreplace, $bbreplacements, $str); #[email=Option] $substr = get_mark($str, "[email=*]"); for ($i = 0; $i < count($substr); $i++) { $bbreplace = '[email=' . $substr[$i] . ']'; $bbreplacements = '<a href="mailto:' . $substr[$i] . '">'; $str = str_replace($bbreplace, $bbreplacements, $str); } #[url] $substr = get_mark($str, "[url]*[/url]"); for ($i = 0; $i < count($substr); $i++) { $bbreplace = '[url]' . $substr[$i]; $bbreplacements = '<a target="_blank" href="' . $substr[$i] . '">' . $substr[$i]; $str = str_replace($bbreplace, $bbreplacements, $str); } $bbreplace = '[/url]'; $bbreplacements = '</a>'; $str = str_replace($bbreplace, $bbreplacements, $str); #[url=Option] $bbreplace = '[url='; $bbreplacements = '<a target="_blank" href="'; $str = str_replace($bbreplace, $bbreplacements, $str); #klammern schliesen $bbreplace = array(']'); $bbreplacements = array('">'); $str = str_replace($bbreplace, $bbreplacements, $str); return str_replace("\n", "<br>", Sonderzeichen($str)); }
$line = fgets($fp, 2000); } $positiona = get_mark(trim($line), "[*]"); $position = explode(",", $positiona[$x - 1]); echo "<br>"; echo "<img src='../daten/galaxy/graphics/" . $position[0] . ".png' alt='SternFeld'>"; fclose($fp); } else { $sqlab = "select * from schiffe where id='" . $_SESSION["ship"] . "'"; $res = mysql_query($sqlab); $dsatz = mysql_fetch_assoc($res); $fp = fopen("../daten/galaxy/" . $dsatz["sector"] . ".txt", "r"); for ($i = 0; $i < $dsatz["y"]; $i++) { $line = fgets($fp, 2000); } $positiona = get_mark(trim($line), "[*]"); $position = explode(",", $positiona[$dsatz["x"] - 1]); echo "<br>"; echo "<img src='../daten/galaxy/graphics/" . $position[0] . ".png' alt='SternFeld'>"; fclose($fp); $sector = $dsatz["sector"]; $x = $dsatz["x"]; $y = $dsatz["y"]; } echo "</div>"; echo "<br>"; include "../daten/galaxy/typs.inc.php"; $typ = $fieldtyp[$position[1]][0]; //if($fieldtyp[$position[1]][1]) { #daten aus db holen echo "sector: {$sector} x: {$x} y: {$y}";
function mpdf_buildmenu($content) { $tmpBlock = get_mark($content, '<!--pagetitle:*-->'); for ($i = 0; $i < count($tmpBlock); $i++) { $content = str_replace('<!--pagetitle:' . $tmpBlock[$i] . '-->', '<h1>' . $tmpBlock[$i] . '</h1><bookmark content="' . htmlspecialchars($tmpBlock[$i], ENT_QUOTES) . '" level="2" /><tocentry content="' . htmlspecialchars($tmpBlock[$i], ENT_QUOTES) . '" level="2" />', $content); } //den More filter $tmpFields = explode('<!--more-->', $content); $tmpContent = $tmpFields[0]; if (count($tmpFields) > 1) { $tmpContent = $tmpFields[1]; } $nextLevel = 2; if (count($tmpBlock) > 0) { $nextLevel = 3; } $tmpBlock = get_mark($tmpContent, '<strong>*</strong><br />'); for ($i = 0; $i < count($tmpBlock); $i++) { $content = str_replace('<strong>' . $tmpBlock[$i] . '</strong><br />', '<strong>' . $tmpBlock[$i] . '</strong><bookmark content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="' . $nextLevel . '" /><tocentry content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="' . $nextLevel . '" /><br />', $content); } $tmpBlock = get_mark($tmpContent, '<strong>*</strong>' . "\n"); for ($i = 0; $i < count($tmpBlock); $i++) { $content = str_replace('<strong>' . $tmpBlock[$i] . '</strong>', '<strong>' . $tmpBlock[$i] . '</strong><bookmark content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="' . $nextLevel . '" /><tocentry content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="' . $nextLevel . '" />', $content); } if (count($tmpFields) > 1) { $tmpBlock = get_mark($tmpFields[0], '<strong>*</strong><br />'); for ($i = 0; $i < count($tmpBlock); $i++) { $content = str_replace('<strong>' . $tmpBlock[$i] . '</strong><br />', '<strong>' . $tmpBlock[$i] . '</strong><bookmark content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="2" /><tocentry content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="2" /><br />', $content); } $tmpBlock = get_mark($tmpFields[0], '<strong>*</strong>' . "\n"); for ($i = 0; $i < count($tmpBlock); $i++) { $content = str_replace('<strong>' . $tmpBlock[$i] . '</strong>', '<strong>' . $tmpBlock[$i] . '</strong><bookmark content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="2" /><tocentry content="' . htmlspecialchars(str_replace(array('<br />', ':'), '', $tmpBlock[$i]), ENT_QUOTES) . '" level="2" />', $content); } } $content = str_replace('<p><!--more--></p>', '', $content); return $content; }
while ($datei = readdir($liste)) { if ($datei != "." && $datei != "..") { $data = explode(".", $datei); if ($data[1] == "txt") { $galaxy++; } } } closedir($liste); $galaxy = rand(1, $galaxy); $x = 0; $y = 0; $fp = fopen("../daten/galaxy/" . $galaxy . ".txt", "r"); while ($line = fgets($fp, 2000)) { $line = trim($line); $res = get_mark($line, "[*]"); $x = count($res); $y++; } fclose($fp); $x = rand(1, $x); $y = rand(1, $y); $mod = mysql_real_escape_string($_POST["beruf"]) - 1; $date = date("d.m.Y"); include "../daten/ships/ships.php"; $sqlab = "select * from schiffe where userid='" . $_SESSION["usern"] . "'"; $res = mysql_query($sqlab) or die(mysql_error()); if (mysql_num_rows($res) > 0) { echo "Reload Sperre bitte laden sie diese Seite nicht neu.<br>"; } else { $sqlab = "INSERT INTO `schiffe` ( `id` , `schiffsid` , `userid` , `schifstypid` , `schild` , `huelle` , `waffen` , `ausruestung` , `lager` , `x` , `y` , `sector` ) VALUES (";