print "Sendung: " . $titel . "\n";
 //Nummer der Folge
 print "Nummer der Folge: " . $episode . "\n";
 //Thema der Folge
 $el = $html->find("h1.header", 0)->innertext;
 $thema = umlaute(substr($el, 0, strpos($el, "<span")));
 print "Folge: " . $thema . "\n";
 //Datum der Folge
 $datum = trim($html->find("h1.header span", 0)->innertext, "()");
 print "Datum: " . $datum . "\n";
 //Gäste
 print "Gäste:\n";
 $counter = 0;
 $gaeste = array_fill(0, 10, '');
 foreach ($html->find("td.name a") as $el) {
     $gast = umlaute($el->innertext);
     if ($gast != "Anne Will") {
         $gaeste[$counter] = $gast;
         $counter = $counter + 1;
     }
     print $gast . "\n";
 }
 scraperwiki::save_sqlite(array("Nummer der Folge"), array("Sendung" => $titel, "Nummer der Folge" => $episode, "Thema" => $thema, "Datum" => $datum, "Anzahl Gäste" => $counter, "Gast 1" => $gaeste[0], "Gast 2" => $gaeste[1], "Gast 3" => $gaeste[2], "Gast 4" => $gaeste[3], "Gast 5" => $gaeste[4], "Gast 6" => $gaeste[5], "Gast 7" => $gaeste[6], "Gast 8" => $gaeste[7], "Gast 9" => $gaeste[8], "Gast 10" => $gaeste[9]));
 //URL der nächsten Episode scrapen
 $el = $html->find("div.episode-nav", 0);
 foreach ($el->children() as $child) {
     if ($child->innertext == "Next Episode") {
         $url_adresse = $child->href;
     }
 }
 $url_adresse = "http://www.imdb.com" . $url_adresse . "/";
Esempio n. 2
0
				<p>Eine Weitergabe deiner Daten an Dritte erfolgt nicht.</p>
				<b>Auskunftsrecht</b><br>
				<p>Nach dem Bundesdatenschutzgesetz hast Du ein Recht auf unentgeltliche Auskunft über Deine gespeicherten Daten. Außer deiner Emailadresse werden keine weiteren personenbezogenen Daten erhoben. Du kannst jederzeit formlos anfragen, ob wir deine Emailadresse gespeichert haben, indem du uns eine Email an info@antiscrabble.de schickst.</p>
				<h2>sonstiges</h2>
				<p>Wir weisen darauf hin, dass die Datenübertragung im Internet (z.B. bei der Kommunikation per E-Mail) Sicherheitslücken aufweisen kann. Ein lückenloser Schutz der Daten vor dem Zugriff durch Dritte ist nicht möglich.</p>
				<p>Der Nutzung von im Rahmen der Impressumspflicht veröffentlichten Kontaktdaten durch Dritte zur Übersendung von nicht ausdrücklich angeforderter Werbung und Informationsmaterialien wird hiermit ausdrücklich widersprochen. Die Betreiber der Seiten behalten sich ausdrücklich rechtliche Schritte im Falle der unverlangten Zusendung von Werbeinformationen, etwa durch Spam-Mails, vor.</p>';
} elseif (isset($_GET["go"]) and $_GET["go"] == "anleitung") {
    echo 'Hier kommt irgendwann eine Anleitung hin, wenn ich dafür nicht zu faul bin.<br><br>
				Wenn du Freude an Spielen hast, die sprachliches Improvisationsgeschick erfordern, dann solltest du dir außerdem das <a href="http://rhetorisches-quartett.de" target="_blank">Rhetorische Quartett</a> ansehen.';
} elseif (isset($_GET["go"]) and $_GET["go"] == "neu") {
    if (isset($_POST["new"])) {
        $flexion = 0;
        if (isset($_POST['flexion'])) {
            $flexion = 1;
        }
        $query = mysql_query("insert into games (word, status, starter, language, flexion) values ('" . strtolower(umlaute(mysql_real_escape_string($_POST['word']))) . "', 0, '" . mysql_real_escape_string($_SESSION['player']) . "', '" . mysql_real_escape_string($_POST['language']) . "', " . $flexion . ")");
        $id = mysql_insert_id();
        $query = mysql_query("insert into playerstatus (game, player, status) values ({$id}, '" . mysql_real_escape_string($_SESSION['player']) . "', 0)");
        $query = mysql_query("create table game" . $id . " (word varchar(255) CHARACTER SET latin1 COLLATE latin1_german1_ci, player varchar(255) CHARACTER SET latin1 COLLATE latin1_german1_ci, points int(2))") or die("Fehler beim Anlegen der Spieltabelle: " . mysql_error());
        header("Location: http://antiscrabble.de/woerterautomat/?go=game&game=" . $id);
        /* Redirect browser */
        exit;
    } else {
        echo '<form method="post">Gib ein Wort ein, mit dem du ein Spiel starten willst.<br>
					<input type="text" name="word" id="newwordinput"><br>
					Sprache: <select name="language" id="languageinput">
					<option value="de">Deutsch</option>
					<option value="en">Englisch</option>
					</select>
					<span title="gebeugte und abgeleitete Formen von Wörtern wie Mehrzahlen, Deklinationen, Konjugationen, zum Beispiel Häuser, gelaufen, fragte, dessen, mir, Notarin, Fuchses">Flexionsformen</span> erlaubt: <input type="checkbox" name="flexion" value="true" id="flexioncheckbox">
					<input type="submit" name="new" value="Spiel starten" id="newgamesubmit">
Esempio n. 3
0
             }
             $text = umlaute($text);
             $tpl->set_var("ANSWER", $text);
             $tpl->parse("CELL_ANSWER", "cell_answer", true);
             break;
         case QUESTIONARY_INPUT_TENDENCY:
         case QUESTIONARY_INPUT_GRADING:
             foreach ($tdata["bid:questionary:input"][$input_id] as $option) {
                 $text = $option;
                 $tpl->set_var("ANSWER", $text);
                 $tpl->parse("CELL_ANSWER", "cell_answer", true);
             }
             break;
         default:
             $text = $tdata["bid:questionary:input"][$input_id];
             $text = umlaute($text);
             $tpl->set_var("ANSWER", $text);
             $tpl->parse("CELL_ANSWER", "cell_answer", true);
             break;
     }
 }
 //creator
 if ($resultcreator) {
     $tpl->set_var("ANSWER", $tdata["creator"]);
     $tpl->parse("CELL_ANSWER", "cell_answer", true);
 }
 //creation time
 if ($resultcreationtime) {
     $tpl->set_var("ANSWER", " " . date("H:i:s - d.m.Y", $tdata[OBJ_CREATION_TIME]));
     $tpl->parse("CELL_ANSWER", "cell_answer", true);
 }
Esempio n. 4
0
  $keywords[$bild] = preg_replace ("/ [a-zA-ZäöüÄÖÜß]{1,3} /"," ",$keywords[$bild]) ;
  $keywords[$bild] = preg_replace ("/ +/"," ",$keywords[$bild]) ;
  if (strlen($keywords[$bild]) > 12) {$keywords[$bild] = preg_replace ("/ [a-zA-ZäöüÄÖÜß]{1,4} /"," ",$keywords[$bild]) ;$keywords[$bild] = preg_replace ("/ [a-zA-ZäöüÄÖÜß]{1,4} /"," ",$keywords[$bild]) ;}
  if (strlen($keywords[$bild]) > 32) {$keywords[$bild] = preg_replace ("/ [a-zA-ZäöüÄÖÜß]{1,5} /"," ",$keywords[$bild]) ;}
  if (strlen($keywords[$bild]) > 111) {$keywords[$bild] = substr($keywords[$bild],0,100) ; $keywords[$bild] = preg_replace ("/ \w+$/","",$keywords[$bild]) ; }
  $keywords[$bild] = $keywords[$bild] . " " . $kategoriek . " " . $meta_key_words;
  $keywords[$bild] = preg_replace ("/,/"," ",$keywords[$bild]) ;
  $keywords[$bild] = preg_replace ("/ +/"," ",$keywords[$bild]) ;
  $keywords[$bild] = trim($keywords[$bild]) ;
  $dop = explode(" ",$keywords[$bild]) ;
  $dopp = array_unique($dop) ;
  $keywords[$bild] = implode(", ",$dopp) ;
  $keywords[$bild] = preg_replace ("/ +/"," ",$keywords[$bild]) ;
  $keywords[$bild] = preg_replace ("/[, ]{2,}/",", ",$keywords[$bild]) ;
  $keywords[$bild] = umlaute($keywords[$bild]) ;
  $bb[$bild] = umlaute($bb[$bild]);
  $btitle[$bild] = $bb[$bild];
  $btitle[$bild] = preg_replace ("/<.*>/U"," ",$btitle[$bild]) ;
  if (strlen($bb[$bild]) > 200)  {
    $btitle[$bild] = substr($btitle[$bild],0,189) ;
    $btitle[$bild] = preg_replace ("/ \w+$/","",$btitle[$bild]) ;
    $btitle[$bild] = $btitle[$bild] . "... " ; }
  if (strlen($bb[$bild]) < 2)  { $btitle[$bild] =  "(" . $kategoriename . ")"; $metadesc[$bild] = $text_2 . $bn[$bild] . " " . $text_3 . " " . $kategoriename  ;}
  else { $metadesc[$bild] = $bn[$bild] . ": " . $btitle[$bild] ; }

  $btitle[$bild] =  $bn[$bild] . ": \n" . $btitle[$bild] ;
}
echo "<br><table border=1  bgcolor=FFCCFF CELLPADDING=1><TR ALIGN=CENTER VALIGN=MIDDLE><td><b>Picture / Bild</b></td><td><b>Description / Beschreibung</b></td><td><b>Keywords</b></td><td><b>title</b></td></tr>" ;
for($i = 1;$i <= $nr; $i++) {
  $bild = $biname[$i]; 
  echo "<tr VALIGN=TOP><td>Nr. $i: $bild<br>&nbsp;&nbsp; $kb[$bild] kB</td><td>$bb[$bild]&nbsp;</td><td>$keywords[$bild] </td><td>$btitle[$bild]</td></tr>";}
Esempio n. 5
0
function Loteria($CurrentPlanet, $CurrentUser)
{
    global $planetrow, $user, $game_config;
    $loteria_c = doquery("SELECT * FROM {{table}} WHERE config_name = 'configloteria'", 'config', true);
    $loteria_b = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $user['id'] . "' ", 'loteria', true);
    $loteria_s = doquery("SELECT sum(boletos) as boletos_t FROM {{table}} ", 'loteria', true);
    $loteria_d = doquery("SELECT * FROM {{table}} order by nombre_u", 'loteria');
    $Cloteria = explode("|", $loteria_c[1]);
    $metal_c = $Cloteria[0];
    $cristal_c = $Cloteria[1];
    $deute_c = $Cloteria[2];
    $materia_c = $Cloteria[3];
    $metal_p = $Cloteria[4];
    $cristal_p = $Cloteria[5];
    $deute_p = $Cloteria[6];
    $materia_p = $Cloteria[7];
    $boletos_max = $Cloteria[8];
    $boletos_por_u = $Cloteria[9];
    $desactivar = $Cloteria[10];
    $tiempo = $Cloteria[11];
    $parse['metal_c'] = $metal_c;
    $parse['cristal_c'] = $cristal_c;
    $parse['deute_c'] = $deute_c;
    $parse['materia_c'] = $materia_c;
    $parse['metal_p'] = $metal_p;
    $parse['cristal_p'] = $cristal_p;
    $parse['deute_p'] = $deute_p;
    $parse['materia_p'] = $materia_p;
    $parse['boletos_max'] = "<font color=lime>" . $boletos_por_u . "</font>";
    // Total de tickets ##############################################################################
    // En caso de que no hayan comprado tickets se pone el resultado total como 0
    if ($loteria_s['boletos_t'] != 0) {
        $boletos_totales = $loteria_s['boletos_t'];
    } else {
        $boletos_totales = 0;
    }
    if ($loteria_s['boletos_t'] != $boletos_max) {
        $parse['boletos'] = "<font color=lime>" . $boletos_totales . "/" . $boletos_max . "</font>";
    } elseif ($loteria_s['boletos_t'] >= $boletos_max) {
        $parse['boletos'] = "<font color=red>" . $boletos_totales . "/" . $boletos_max . "</font>";
    }
    // Fin total de tickets ##############################################################################
    // Tickets de la persona ##############################################################################
    // En caso de que no haya comprado tickets se pone el resultado total como 0
    if ($loteria_b['boletos'] != 0) {
        $boletos_usuario = $loteria_b['boletos'];
    } else {
        $boletos_usuario = 0;
    }
    if ($loteria_b['boletos'] < $boletos_por_u) {
        $parse['boletos_p_u'] = "<font color=lime>" . $boletos_usuario . "</font>";
    } else {
        $parse['boletos_p_u'] = "<font color=red>" . $boletos_usuario . " (Max.Anzahl)</font>";
    }
    // Fin tickets de la persona ##############################################################################
    // Desactivado de loteria, Prohibida la compra si ya tenes el maximo permitido de boletos p/p, etc #############################
    if ($desactivar != 0) {
        $parse['value'] = "Desactivado";
        $parse['disabled'] = "disabled=\"disabled\"";
        $parse['form'] = "class=\"form\"";
        $parse['color'] = "#FF0000";
        $parse['msj2'] = "Desactivado";
        $parse['blink'] = "blink";
    } else {
        $parse['value'] = "Comprar";
        $parse['color'] = "#00FF00";
        $parse['msj2'] = "AKTIV";
    }
    if ($loteria_b['boletos'] >= $boletos_por_u) {
        $parse['value'] = "Comprar";
        $parse['disabled'] = "disabled=\"disabled\"";
        $parse['form'] = "class=\"form\"";
    }
    // Fin Desactivado de loteria, etc ##############################################################################
    // Lista de usuarios que participan en la loteria y la cantidad de boletos de tal ######################################
    while ($a = mysql_fetch_array($loteria_d)) {
        $parse['participantes'] .= "<tr><th>" . $a['nombre_u'] . " (<font color=lime>" . $a['boletos'] . " boletos</font>)</th></tr>";
    }
    // Fin lista de usuarios ##############################################################################
    // Definimos el Tiempo ##############################################################################
    $Tiempo = time();
    if ($Tiempo < $game_config['Loteria']) {
        $Falta1 = $game_config['Loteria'] - $Tiempo;
        function segundos_tiempo($segundos)
        {
            $minutos = $segundos / 60;
            $horas = floor($minutos / 60);
            $minutos2 = $minutos % 60;
            $segundos_2 = $segundos % 60 % 60 % 60;
            if ($minutos2 < 10) {
                $minutos2 = '0' . $minutos2;
            }
            if ($segundos_2 < 10) {
                $segundos_2 = '0' . $segundos_2;
            }
            if ($segundos < 60) {
                $resultado = 'N&auml;chste Lotterie startet in  ' . round($segundos) . ' Sekunden';
            } elseif ($segundos > 60 && $segundos < 3600) {
                $resultado = 'N&auml;chste Lotterie startet in  ' . $minutos2 . ' Minuten und ' . $segundos_2 . ' Sekunden';
            } else {
                $resultado = 'N&auml;chste Lotterie startet in ' . $horas . ' Stunden, ' . $minutos2 . ' Minuten und ' . $segundos_2 . ' Sekunden';
            }
            return $resultado;
        }
        $segundos = date('h') * 60 * 60 + date('i') * 60 + date('s');
        $parse['loteria_tiempo'] = segundos_tiempo($Falta1);
        $parse['value'] = "En espera...";
        $parse['disabled'] = "disabled=\"disabled\"";
        $parse['form'] = "class=\"form\"";
        // Fin de definir el Tiempo ##############################################################################
    } elseif ($user['loteria_sus'] == 1) {
        $parse['loteria_tiempo'] = "<font color=red>Estas suspendido y no podes participar en esta loteria!</font>";
        $parse['value'] = "Comprar";
        $parse['disabled'] = "disabled=\"disabled\"";
        $parse['form'] = "class=\"form\"";
    } else {
        if ($desactivar != 0) {
            $parse['loteria_tiempo'] = "<font color=#FF8000>Loteria desactivada</font>";
        } else {
            $parse['loteria_tiempo'] = "<font color=lime>Loteria en marcha, compra tus tickets!</font>";
        }
        // Trámite que se ejecuta al comprar boletos ##############################################################################
        $post = $_POST['bole'];
        if ($post == 'si') {
            $ticket = $_POST['tickets'];
            $metal = $ticket * $metal_c;
            $cristal = $ticket * $cristal_c;
            $deute = $ticket * $deute_c;
            $materia = $ticket * $materia_c;
            if ($materia > $user['darkmatter']) {
                $f_materia = $materia - $user['darkmatter'];
                $comun = "<tr><th class=\"error2\">Sie wollten <font color=lime>" . $ticket . "</font> Tickets kaufen:</th></tr>";
                $ff_materia = "<tr><th class=\"error2\">Ihnen fehlen: <font color=lime>" . $f_materia . "</font> Dunkler M&uuml;</th></tr>";
            }
            if ($metal > $planetrow['metal']) {
                $f_metal = $metal - $planetrow['metal'];
                $comun = "<tr><th class=\"error2\">Para comprar <font color=lime>" . $ticket . "</font> boleto/s te falta:</th></tr>";
                $ff_metal = "<tr><th class=\"error2\">Ihnen fehlen: <font color=lime>" . $f_metal . "</font> Metall</th></tr>";
            }
            if ($cristal > $planetrow['crystal']) {
                $f_cristal = $cristal - $planetrow['crystal'];
                $comun = "<tr><th class=\"error2\">Para comprar <font color=lime>" . $ticket . "</font> boleto/s te falta:</th></tr>";
                $ff_cristal = "<tr><th class=\"error2\">Ihnen fehlen: <font color=lime>" . $f_cristal . "</font> Kristall</th></tr>";
            }
            if ($deute > $planetrow['deuterium']) {
                $f_deute = $deute - $planetrow['deuterium'];
                $comun = "<tr><th class=\"error2\">Para comprar <font color=lime>" . $ticket . "</font> boleto/s te falta:</th></tr>";
                $ff_deute = "<tr><th class=\"error2\">Ihnen fehlen: <font color=lime>" . $f_deute . "</font> Deuterium</th></tr>";
            }
            $error_boletos = $ticket + $loteria_b['boletos'];
            $error_boletos2 = $ticket + $loteria_s['boletos_t'];
            if ($error_boletos > $boletos_por_u) {
                $m_b_u = $boletos_por_u - $loteria_b['boletos'];
                $mm_b_m = "<tr><th class=\"error2\">Excedes el maximo de boletos por usuario, podes comprar: <font color=lime>" . $m_b_u . "</font> boletos</th></tr>";
            } elseif ($error_boletos2 > $boletos_max) {
                $m_b_m = $boletos_max - $loteria_s['boletos_t'];
                $mm_b_u = "<tr><th class=\"error2\">Excedes el maximo de boletos disponibles, podes comprar: <font color=lime>" . $m_b_m . "</font> boletos</th></tr>";
            }
            // Planilla de Errores ##############################################################################
            $parse['info'] .= "<br><table width=\"700\" border=\"5\" bordercolor=\"#DF0101\" cellpadding=\"5\" cellspacing=\"10\">";
            $parse['info'] .= $comun;
            $parse['info'] .= $ff_materia;
            $parse['info'] .= $ff_metal;
            $parse['info'] .= $ff_cristal;
            $parse['info'] .= $ff_deute;
            $parse['info'] .= $mm_b_m;
            $parse['info'] .= $mm_b_u;
            $parse['info'] .= "</table>";
            // Fin de la planilla de errores ##############################################################################
            if ($materia <= $user['darkmatter'] && $metal <= $planetrow['metal'] && $cristal <= $planetrow['crystal'] && $deute <= $planetrow['deuterium'] && $error_boletos <= $boletos_por_u && $error_boletos2 <= $boletos_max) {
                doquery("UPDATE {{table}} SET \r\n\t\t\t\t\t`metal` = metal - '" . $metal . "', `crystal` = crystal - '" . $cristal . "', \r\n\t\t\t\t\t`deuterium` = deuterium - '" . $deute . "' WHERE `id` = '" . $planetrow['id'] . "'", "planets");
                doquery("UPDATE {{table}} SET `darkmatter` = darkmatter - '" . $materia . "' WHERE `id` = '" . $user['id'] . "'", "users");
                if ($loteria_b['boletos'] > '0') {
                    doquery("UPDATE {{table}} SET `boletos` = `boletos` + '" . $ticket . "' WHERE `id` = '" . $user['id'] . "'", "loteria");
                } else {
                    doquery("INSERT INTO {{table}} SET `id` = '" . $user['id'] . "', `boletos` = '" . $ticket . "', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t   `nombre_u` = '" . $user['username'] . "', `id_planeta` = '" . $user['id_planet'] . "'", "loteria");
                }
                // Se entrega el premio ##############################################################################
                if ($boletos_max <= $ticket + $loteria_s['boletos_t']) {
                    $query_1 = doquery("SELECT * FROM {{table}} order by rand()", "loteria", true);
                    $query_2 = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $query_1['id'] . "' limit 1", "users", true);
                    $query_3 = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $query_2['id_planet'] . "' limit 1", "planets", true);
                    $materia_pp = $query_2['darkmatter'] + $materia_p;
                    doquery("UPDATE {{table}} SET \r\n\t\t\t\t\t\t\t\t`metal` = metal + '" . $metal_p . "', `crystal` = crystal + '" . $cristal_p . "', \r\n\t\t\t\t\t\t\t\t`deuterium` = deuterium + '" . $deute_p . "' WHERE `id` = '" . $query_3['id'] . "' limit 1", "planets");
                    doquery("UPDATE {{table}} SET `darkmatter` = '" . $materia_pp . "' WHERE `id` = '" . $query_2['id'] . "' limit 1", "users");
                    // Manda mensajes a los participantes ##############################################################################
                    $Time = time();
                    $From = "<font color='#01DF01'>Lotterie</font>";
                    $Subject = "<font color='#01DF01'>Ziehung um " . date("H:i:s", time()) . "</font>";
                    $lote_consulta = doquery("SELECT * FROM {{table}}", "loteria");
                    while ($b = mysql_fetch_array($lote_consulta)) {
                        if ($query_1['id'] == $b['id']) {
                            $Message = "<b>Herzlichen Gl&uuml;ckwunsch<br>Sie hatten das Glückslos. Hier ist ihr Gewinn: ";
                            $Message .= "<br><font color=lime>" . $metal_p . "</font> Metall <br>";
                            $Message .= "<font color=lime>" . $cristal_p . "</font> Kristall <br>";
                            $Message .= "<font color=lime>" . $deute_p . "</font> Deuterium <br>";
                            $Message .= "<font color=lime>" . $materia_p . "</font> Dunkler M&uuml;ll <br><br>";
                            $Message .= "Wir hoffen, sie bald wieder zu beeheren.</b>";
                        } else {
                            $Message = "<b>Du hattest leider nicht das Gewinnerlos. <br>";
                            $Message .= umlaute("Auf jeden Fall wünschen wir Ihnen noch viel Glück und hoffe, Sie wieder hier an der nächsten Teilnahme begrüßen zu dürfen.") . "</b>";
                        }
                        SendSimpleMessage($b['id'], '', $Time, 1, $From, $Subject, $Message);
                    }
                    // Fin de mensajes ##############################################################################
                    doquery("DELETE FROM {{table}} ", 'loteria');
                    $sigueintelore = $tiempo + time();
                    doquery("UPDATE {{table}} SET `config_value`='" . $sigueintelore . "' WHERE `config_name`='Loteria' limit 1", "config");
                }
                // Fin de la entrega ##############################################################################
                message("<font color=lime>" . $ticket . "</font> Tickets gekauft", "game.php?page=loteria", 2);
            }
        }
        // Fin del trámite ##############################################################################
    }
    display(parsetemplate(gettemplate("Loteria.Body"), $parse));
}
Esempio n. 6
0
                $text3 .= Design::erstelleZeileShort(false, $text, 'break');
            }
            if (trim($text2) != '') {
                $text3 .= Design::erstelleZeileShort(false, $text2, 'break');
            }
            $addLink = '';
            if (file_exists($mdFile) || file_exists($mdFileResult)) {
                $addLink = '<br><a style="font-size: 75%" href="' . $data['name'] . '.html' . '">Beschreibung ></a>';
            }
            $body .= Design::erstelleBlock(false, $data['name'] . $addLink, $text3);
            $body .= '</body></html>';
            // speichert die Knotendaten im Verzeichnis des Aufrufs
            file_put_contents(dirname(__FILE__) . '/path/' . $elem . '/' . substr($file, 0, strlen($file) - 5) . '.html', $body);
            if (!file_exists($mdFileResult) && file_exists($mdFile)) {
                $parser = new \Michelf\MarkdownExtra();
                $input = umlaute(file_get_contents($mdFile));
                $my_html = $parser->transform($input);
                file_put_contents($mdFileResult, '<link rel="stylesheet" href="github-markdown.css" type="text/css"><span class="markdown-body">' . $my_html . '</span>');
                //@unlink($mdFile);
            }
            // entferne nun die bearbeitete Datei
            @unlink(dirname(__FILE__) . '/path/' . $elem . '/' . $file);
        }
    }
}
function umlaute($text)
{
    $search = array('ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß');
    $replace = array('&auml;', '&Auml;', '&ouml;', '&Ouml;', '&uuml;', '&Uuml;', '&szlig;');
    return str_replace($search, $replace, $text);
}
Esempio n. 7
0
    }
    $parse['planetes'] .= "<tr><td colspan=\"5\" align=\"center\"><a href=\"news.php?action=create\">News erstellen</a></td></tr>";
    $parse['planetes'] .= "<tr><th class=\"b\" colspan=\"8\">Insgesamt {$i} News vorhanden</th></tr>";
    if ($_GET['action'] == 'edit' && isset($_GET['id'])) {
        $query = doquery("SELECT * FROM {{table}} WHERE id = '" . $_GET['id'] . "';", "news");
        $id = intval($_GET['id']);
        $planet = mysql_fetch_array($query);
        $parse['show_edit_form'] = parsetemplate(gettemplate('adm/news_edit_form'), $planet);
    }
    if ($_GET['action'] == 'create') {
        $parse['show_edit_form'] = parsetemplate(gettemplate('adm/news_create_form'), $planet);
    }
    if ($_GET['action'] == 'delete' && isset($_GET['id'])) {
        doquery("DELETE FROM {{table}} WHERE `id` = '" . $_GET['id'] . "' LIMIT 1;", "news");
    }
    if (isset($_POST['submit'])) {
        $edit_id = intval($_POST['currid']);
        $title = mysql_real_escape_string(addslashes(umlaute($_POST['title'])));
        $text = preg_replace(array('/\\n/', '/\\r/'), array('<br/>', ''), mysql_real_escape_string(addslashes(umlaute($_POST['text']))));
        if (isset($_GET['gone'])) {
            $query = doquery("INSERT INTO {{table}} (`id` ,`user` ,`date` ,`title` ,`text`) VALUES ( NULL , '" . $user['username'] . "', '" . time() . "', '" . $title . "', '" . $text . "');", 'news');
        } else {
            $query = doquery("UPDATE {{table}} SET \r\n\t\t\t\t\t\t\t\t`title` \t\t\t= '" . $title . "',\r\n\t\t\t\t\t\t\t\t`text`\t\t\t\t= '" . $text . "',\r\n\t\t\t\t\t\t\t\t`date`\t\t\t\t= '" . time() . "'\r\n\t\t\t\t\t\t\t\t  WHERE `id` = '" . $edit_id . "' LIMIT 1;", 'news');
        }
        header("location:news.php");
    }
    display(parsetemplate(gettemplate('adm/newslist_body'), $parse), false, '', true, false);
} else {
    message($lang['sys_noalloaw'], $lang['sys_noaccess']);
}
// Created by e-Zobar. All rights reversed (C) XNova Team 2008
Esempio n. 8
0
     // all words and points
     $return["words"] = [];
     $query = mysql_query("select * from game" . mysql_real_escape_string($_GET['game'])) or die('Error: ' . mysql_error());
     while ($result = mysql_fetch_array($query)) {
         $result['player'] = umlaute($result['player']);
         $return["words"][] = $result;
     }
     echo json_encode($return);
     break;
 case "datarequest":
     $query = mysql_query("update playerstatus set activity = CURRENT_TIMESTAMP() where game=" . mysql_real_escape_string($_GET['game']) . " and player='" . mysql_real_escape_string($_GET['player']) . "'");
     $return = [];
     $return["players"] = [];
     $query = mysql_query("select player, status, TIMESTAMPDIFF(MINUTE,activity,CURRENT_TIMESTAMP()) as last_activity from playerstatus where game = " . mysql_real_escape_string($_GET['game']) . " order by last_activity") or die('Error: ' . mysql_error());
     while ($result = mysql_fetch_array($query)) {
         $result['player'] = umlaute($result['player']);
         $return["players"][] = $result;
     }
     $return["words"] = [];
     $query = mysql_query("select word, points from game" . mysql_real_escape_string($_GET['game']) . " where player='" . mysql_real_escape_string($_GET['player']) . "'") or die('Error: ' . mysql_error());
     while ($result = mysql_fetch_array($query)) {
         $return["words"][] = $result;
     }
     $query = mysql_query("select points from playerstatus where game = " . mysql_real_escape_string($_GET['game']) . " and player='" . mysql_real_escape_string($_GET['player']) . "'") or die('Error: ' . mysql_error());
     while ($result = mysql_fetch_array($query)) {
         $return["ownpoints"] = $result;
     }
     echo json_encode($return);
     break;
 case "joingame":
     $new = true;
    //Seite des Landes laden
    $html_land = str_get_html(scraperwiki::scrape($laender[$counter_laender][0]));
    //MdB-Schleife dieses Landes
    foreach ($html_land->find("div.linkIntern a") as $el_MdB) {
        $url_MdB = "http://www.bundestag.de/bundestag/abgeordnete17/" . substr($el_MdB->href, 3);
        list($nachname_MdB, $vorname_MdB, $partei_MdB) = explode(", ", $el_MdB->innertext);
        $nachname_MdB = strtok($nachname_MdB, " ");
        $titel_MdB = "";
        $dot_pos = strrpos($vorname_MdB, ".", -1);
        //Position des Punkts; Suche von hinten, ohne letztes Zeichen
        if ($dot_pos !== false) {
            $titel_MdB = substr($vorname_MdB, 0, $dot_pos + 1);
            $vorname_MdB = substr($vorname_MdB, $dot_pos + 2);
        }
        //Seite dieses einzelnen MdB scrapen
        $html_MdB = str_get_html(scraperwiki::scrape($url_MdB));
        $html_biografie = $html_MdB->find("div.biografie", 0);
        $startzeile = substr($html_biografie, strpos($html_biografie, "Geboren am ") + 11, strpos($html_biografie, ".", strpos($html_biografie, "Geboren am ") + 16) - strpos($html_biografie, "Geboren am ") - 11);
        $satz = explode("; ", $startzeile);
        list($geburtstag_MdB, $geburtsort_MdB) = explode(" in ", $satz[0]);
        $MdB = array($counter_MdB => array("URL" => $url_MdB, "Nachname" => $nachname_MdB, "Vorname" => $vorname_MdB, "Titel" => $titel_MdB, "Geburtstag" => $geburtstag_MdB, "Partei" => $partei_MdB, "Bundesland" => $laender[$counter_laender][1], "Geburtsort" => umlaute($geburtsort_MdB)));
        print "Nr. " . ($counter_MdB + 1) . ": " . $MdB[$counter_MdB]["Vorname"] . " " . $MdB[$counter_MdB]["Nachname"] . " (" . $MdB[$counter_MdB]["Partei"] . ")" . ", " . $MdB[$counter_MdB]["Geburtstag"] . ", " . $MdB[$counter_MdB]["Geburtsort"] . ", " . $MdB[$counter_MdB]["Bundesland"] . "\n";
        $counter_MdB = $counter_MdB + 1;
    }
    $counter_laender = $counter_laender + 1;
}
function umlaute($string)
{
    $upas = array("&#xFC;" => "ü", "&uuml;" => "ü", "&#xE4;" => "ä", "&auml;" => "ä", "&#xF6;" => "ö", "&ouml;" => "ö", "&Auml;" => "Ä", "&Uuml;" => "Ü", "&Ouml;" => "Ö", "&#xDF;" => "ß", "&szlig;" => "ß");
    return strtr($string, $upas);
}