function letzte_nachrichten() { global $prefix, $cookie_id, $cookie_liga, $cookie_username, $live_scoring_min_gespielt; $ausgabe = ''; if (isset($_SESSION['ignoList'])) { $ignoList = unserialize($_SESSION['ignoList']); } else { $ignoList = array(); } if (mt_rand(1, 8) == 5) { $up1 = "UPDATE " . $prefix . "users SET last_chat = " . time() . " WHERE ids = '" . $cookie_id . "'"; mysql_query($up1); } $sql1 = "SELECT " . $prefix . "chatroom.id, " . $prefix . "chatroom.user, " . $prefix . "chatroom.zeit, " . $prefix . "chatroom.nachricht, " . $prefix . "users.username FROM " . $prefix . "chatroom JOIN " . $prefix . "users ON " . $prefix . "chatroom.user = "******"users.ids ORDER BY " . $prefix . "chatroom.id DESC LIMIT 0, 20"; $sql2 = mysql_query($sql1); while ($sql3 = mysql_fetch_assoc($sql2)) { if (in_array($sql3['user'], $ignoList)) { continue; } $ausgabe .= '<p'; if ($sql3['user'] == CONFIG_OFFICIAL_USER or stripos($sql3['nachricht'], $cookie_username) !== FALSE) { $ausgabe .= ' style="background-color:#ddd"'; } $ausgabe .= '>'; $ausgabe .= '<strong><a href="#" onclick="talkTo(\'' . addslashes($sql3['username']) . '\'); return false">' . $sql3['username'] . '</a> (' . date('H:i', $sql3['zeit']) . '):</strong> '; $ausgabe .= autoLink($sql3['nachricht']); $ausgabe .= '</p>'; } echo $ausgabe; }
/** * @dataProvider allDataProvider * * @param Memo $memo */ public function testIndexOnLogined(Memo $memo) { if ($memo->user_id !== static::$all->id_str) { return; } $this->visitWithLogined('/user/memo')->see('作成日時')->see($memo->created_at->format(dateFormat()))->see(autoLink($memo->content))->see('詳しく見る')->see("/memo/show/{$memo->id}")->see('編集')->see("/user/memo/edit/{$memo->id}")->see('削除')->see("/user/memo/delete/{$memo->id}"); }
/** * @dataProvider userDataProvider * * @param string $sn */ public function testUser($sn) { $tmp = $this->memo->where('user_sn', $sn); $memos = $tmp->orderBy('id', 'desc')->paginate(10); $count = $tmp->count(); foreach ($memos as $memo) { $this->visit("/memo/user/{$memo->user_sn}")->see("@{$memo->user_sn}のメモ")->see("https://twitter.com/{$memo->user_sn}")->see($count)->see($memo->created_at->format(dateFormat()))->see($memo->user_sn)->see(autoLink($memo->content))->seeInfo()->assertResponseOk(); if ($count > 10) { $this->see("/memo/user/{$memo->user_sn}"); } } }
/** * Create an email. * @param string $string email * @param string $ref reference to the link */ function mailTo($link, $ref = 'email') { autoLink($link, $ref, 'email'); }
echo _('Angebote auf dem Markt'); ?> </h1> <?php if (isset($_GET['delEntry']) && $cookie_id != CONFIG_DEMO_USER) { $delEntry = mysql_real_escape_string(trim(strip_tags($_GET['delEntry']))); $addSql = " AND user = '******'"; if ($_SESSION['status'] == 'Helfer' or $_SESSION['status'] == 'Admin') { $addSql = ""; } $gb_in1 = "DELETE FROM " . $prefix . "chats_markt WHERE id = " . $delEntry . $addSql; $gb_in2 = mysql_query($gb_in1); } $sql1 = "SELECT a.id, a.user, a.zeit, a.nachricht, b.username FROM " . $prefix . "chats_markt AS a JOIN " . $prefix . "users AS b ON a.user = b.ids ORDER BY a.zeit DESC LIMIT 0, 50"; $sql2 = mysql_query($sql1); while ($sql3 = mysql_fetch_assoc($sql2)) { echo '<p><b>' . displayUsername($sql3['username'], $sql3['user']) . ' schrieb vor ' . time_rel($sql3['zeit']) . ':'; if ($sql3['user'] == $cookie_id or $_SESSION['status'] == 'Helfer' or $_SESSION['status'] == 'Admin') { echo ' <a href="/marktschreier.php?delEntry=' . $sql3['id'] . '">' . _('[Löschen]') . '</a>'; } echo '</b><br />' . autoLink($sql3['nachricht']) . '</p>'; } } else { ?> <p><?php echo _('Du musst angemeldet sein, um diese Seite aufrufen zu können!'); ?> </p> <?php } include 'zz3.php';
} $fromUser = isset($sql3['username']) ? displayUsername($sql3['username'], $sql3['von']) : 'einem gelöschten User'; echo '<h1>' . $sql3['titel'] . '</h1><p><strong>Von ' . $fromUser . ' am '; echo date('d.m.Y', $sql3['zeit']) . ' um ' . date('H:i', $sql3['zeit']) . ' Uhr</strong><br />' . autoLink(hideTeamCode($sql3['inhalt'], $_SESSION['status'])) . '<br />'; // "RE: " EINFUEGEN, WENN NICHT SCHON ANTWORT WAR ANFANG $temp = substr($sql3['titel'], 0, 4); if ($temp != 'RE: ') { $temp = 'RE: ' . $sql3['titel']; } else { $temp = $sql3['titel']; } // "RE: " EINFUEGEN, WENN NICHT SCHON ANTWORT WAR ENDE if ($sql3['von'] != CONFIG_OFFICIAL_USER) { echo '<strong><a href="/post_schreiben.php?id=' . $sql3['von'] . '&betreff=' . urlencode($temp) . '&in_reply_to=' . $sql3['ids'] . '">' . _('Antworten') . '</a> | <a href="/post_schreiben.php?id=' . $sql3['von'] . '">' . _('Neue Nachricht') . '</a></strong>'; } echo '</p>'; if ($sql3['in_reply_to'] != '') { $ur1 = "SELECT inhalt FROM " . $prefix . "pn WHERE ids = '" . mysql_real_escape_string($sql3['in_reply_to']) . "' AND (an = '" . $cookie_id . "' OR von = '" . $cookie_id . "')"; $ur2 = mysql_query($ur1); if (mysql_num_rows($ur2) != 0) { $ur3 = mysql_fetch_assoc($ur2); echo '<h1>' . _('Ursprüngliche Nachricht') . '</h1>'; echo '<p>' . autoLink(hideTeamCode($ur3['inhalt'], $_SESSION['status'])) . '</p>'; } } } ?> <?php include 'zz3.php'; }
<?php function autoLink($string) { $pattern = "/(((http[s]?:\\/\\/)|(ftp[s]?:\\/\\/)|(www\\.))(([a-z][-a-z0-9]+\\.)?[-a-z0-9]+\\.[a-z]+(\\.[a-z]{2,2})?)\\/?[a-z0-9._\\/~#&=;%+?-]+[a-z0-9\\/#=?]{1,1})/is"; $pattern = "/((((http[s]?:\\/\\/)|(ftp[s]?:\\/\\/)|(www\\.))([a-z][-a-z0-9]*\\.)?)[-a-z0-9]+\\.[a-z]+(\\/[a-z0-9._\\/~#&=;%+?-]*)*)/is"; // | https |Subdomain |Domain |Pfad //$pattern = "/(((http[s]?:\/\/)|(ftp[s]?:\/\/)|(www\.))(([a-z][-a-z0-9]+\.)?[-a-z0-9]+\.[a-z]+(\.[a-z]{2,2})?)(\/?[a-z0-9._\/~#&=;%+?-]+[a-z0-9\/#=?]{1,1})*?)/is"; //$pattern = "/(((http[s]?:\/\/)|(www\.))(([a-z][-a-z0-9]+\.)?[a-z][-a-z0-9]+\.[a-z]+(\.[a-z]{2,2})?)\/?[a-z0-9._\/~#&=;%+?-]+[a-z0-9\/#=?]{1,1})/is"; //$pattern = "/(((http[s]?:\/\/)|(ftp[s]?:\/\/)|(www\.))(([a-z][-a-z0-9]+\.)+?([-a-z0-9]+\.)+?[a-z]+(\.[a-z]{2,2})?)\/?[a-z0-9._\/~#&=;%+?-]+[a-z0-9\/#=?]{1,1})/is"; $string = preg_replace($pattern, " <a href='\$1' target='_blank'>\$1</a>", $string); $string = preg_replace("/href='www/", "href='http://www", $string); return $string; } $str = "is 24. Dezember gibt es jeden Tag ein kleines Geschenk, ftps://w.wichtel-werden.de eine http://w.wichtel-werden.de nserem digitalen Adventskalender auf:\n\t<br> http://wichtel-werden.de http://wichtel-werden.de/pfade/unter-ordner/indx.php#anker=22&substring=77~ \n\t<br> http://wichtel-werden.dsdfdfdsfdfe http://wichtel-werden.e/ \n\t<br> http://t.co/ZP4CVW4r"; echo autoLink($str);
while ($sql3 = mysql_fetch_assoc($sql2)) { $user_holen1 = "SELECT username FROM " . $prefix . "users WHERE ids = '" . $sql3['manager'] . "'"; $user_holen2 = mysql_query($user_holen1); if (mysql_num_rows($user_holen2) == 0) { $username_temp = 'Unbekannt'; } else { $user_holen3 = mysql_fetch_assoc($user_holen2); $username_temp = displayUsername($user_holen3['username'], $sql3['manager']); } echo '<p><b>' . $username_temp . ' (' . date('d.m.Y H:i', $sql3['datum']) . ')</b>'; if ($sql3['quote'] != '') { // Zitat enthalten echo '</p><blockquote>' . autoLink(hideTeamCode($sql3['quote'], $_SESSION['status'])) . '</blockquote><p>' . autoLink(hideTeamCode($sql3['inhalt'], $_SESSION['status'])); } else { // kein Zitat enthalten echo '<br />' . autoLink(hideTeamCode($sql3['inhalt'], $_SESSION['status'])); } /*if ($username_temp != 'Unbekannt') { if ($sql3['manager'] == $cookie_id OR $is_moderator == TRUE) { echo '<br /><a href="/forum_eintrag_hinzufuegen.php?id='.$themaID.'&beitrag='.$sql3['id'].'">[Ändern]</a> '; } }*/ /*echo '<a href="/forum_eintrag_hinzufuegen.php?id='.$themaID.'&quote='.$sql3['id']; if ($sql6['sichtbar_fuer'] == 'Helfer') { echo '&postAsTyp=privatePost'; } echo '">[Zitieren]</a>';*/ if ($sql3['quote'] != '') { // Zitat enthalten if ($sql3['manager'] == $cookie_id or $is_moderator == TRUE) { $delQuoteHash = md5('29' . $sql3['id'] . '1992');