0) { $query = "SELECT count(*) as anzahl FROM $noticetable n, $playertable p WHERE n.player_id=p.id AND "; foreach ($textarray as $word) { $query .= " n.noticetext LIKE '%".mysql_real_escape_string($word)."%' AND "; } $query = substr($query,0,strlen($query)-4); $query .= "ORDER BY n.last_update DESC"; $limit = " LIMIT ".(($page-1)*$entries_per_page).",".$entries_per_page; $res = mysql_query($query) or die(mysql_error()); $line = mysql_fetch_object($res); $anzahl = $line->anzahl; $query = str_replace("count(*) as anzahl"," n.*, p.playername,p.id as player_id, DATE_FORMAT(CONVERT_TZ(last_update, '+00:00', '".$_SESSION['s_timezone_offset']."'), '%H:%i:%s - %d. %m. %Y') as lastupdate ",$query).$limit; $res = mysql_query($query) or die(mysql_error()); $i = 0; $found = false; } else { $anzahl = 0; } ?>
0) { $to = ($page*$entries_per_page < $anzahl) ? $page*$entries_per_page : $anzahl; echo ""; while ($line = mysql_fetch_object($res)) { // display every entry echo ''."\n"; echo ''."\n"; echo ''."\n"; if (++$i < mysql_num_rows($res)) { echo ''."\n"; } } } else { echo ''."\n"; } ?>
".NOTICE_HITS.": ".(($page-1)*$entries_per_page+1)."-".$to." ".NOTICE_OF." $anzahl
"; if ($anzahl > $entries_per_page) { draw_pagenumbers($page,$anzahl,$entries_per_page,$_SERVER['PHP_SELF']."?action=searchres","page"); } echo "
'.NOTICE_DATE.':'.$line->lastupdate.'
'.NOTICE_PLAYERNAME.':'.$line->playername.''; echo '
'.NOTICE_TEXT.':"; echo ''.utf8_decode(nl2br($line->noticetext)).'

'.NOTICE_NOTHING.'
0)) { // Insert data if ($_GET['action'] == "save") { $text = stripslashes(trim($_POST['text'])); $text = str_replace("<","<",$text); $text = str_replace(">",">",$text); $text = utf8_encode($text); } if (!isset($text) || empty($text)) { $query = "DELETE FROM $noticetable WHERE player_id='$player_id'"; $res = mysql_query($query); if (!$res) echo "Fehler: ".mysql_error(); else echo "
".NOTICE_DELETED."
"; } else { $query = "REPLACE INTO $noticetable SET noticetext='".mysql_real_escape_string($text)."', player_id='$player_id', last_update=NOW()"; $res = mysql_query($query); if (!$res) echo "Fehler: ".mysql_error(); else echo "
".NOTICE_SAVED."
"; } $_GET['action'] = "edit"; } if ($_GET['action'] == "edit" && $player_id > 0) { // edit/create data // retrieve old notice $text = ""; $timevalue = ""; $playername = ""; $query = "SELECT n.*, p.playername, CONVERT_TZ(n.last_update, '+00:00', '".$_SESSION['s_timezone_offset']."') FROM $noticetable n LEFT JOIN $playertable p ON (n.player_id = p.id) WHERE n.player_id='$player_id' LIMIT 1"; $res = mysql_query($query) or die(mysql_error()); while ($line = mysql_fetch_object($res)) { $text = utf8_decode($line->noticetext); $timevalue = $line->last_update; $playername = $line->playername; } if (empty($playername)) { // determine playername if no notice exists yet $query = "SELECT playername FROM $playertable WHERE id='$player_id'"; $res = mysql_query($query) or die(mysql_error()); $line = mysql_fetch_object($res); $playername = $line->playername; } ?>

(0 / 65000 )
'."\n"; echo ''."\n"; echo ''."\n"; echo ''; ?>
playername)"; ?>
'.NOTICE_DATE.':'.$line->lastupdate.'
'.NOTICE_PLAYERNAME.':'.$line->playername; echo '
'.NOTICE_TEXT.':'.utf8_decode(nl2br($line->noticetext)).'
('.NOTICE_EDIT.' / '.NOTICE_DELETE.')
Keine Aktion festgelegt! / No Action given!!"; } makefooter(); ?>