This is machine translation of orginal blog.
« prev next »

Zusätzliche Commenter Profil-Seite zu MovableType

Wenn du den Aufstellungsort überprüfst, der genug vorsichtig ist, siehst du eine kleine Ikone außer dem Namen des commenter. Es ist eben - Commenter Profil verbessert:

screen-comment.png

Die Verbindung auf der Ikone führt dich zur Profilseite des commenter, also verstehst du, welche Anmerkungen he/she vorher bekanntgegeben hat.

Da es auf nur Anzeige Namen basiert, ihn für nicht immer nehmen, vorausgesetzt daß Leute mit dem gleichen Anzeige Namen die gleiche Person sind. Wenn du deinen Namen bist zu allgemein, wählst einen einzigartigeren Namen fandest.

Kodieren?

Unter sind der Code, den ich verwendete. Er ist sehr massy, da ich nicht verbrauchte Zeit, ihn bearbeitbar zu bilden für andere. Er paßte gerade die Notwendigkeiten dieses blog. Ich schrieb ihn, als ob ich eine blog Eintragung writting. Wenn was ich versuche, auszudrücken, durchgeführt wird, wird der Code durchgeführt. So nehmen was auch immer du vom Code nehmen kannst, aber es nicht erwarten, um auf deinem MovableType direkt zu arbeiten. Für die, die nicht Techmaterial mögen, traurig für techie wieder bekanntgeben.

<? php Funktion dirify ($s) {$s = strtolower ($s); ## Kleinschreibung. $s = strip_tags ($s); ## entfernen HTML Umbauten. $s = preg_replace („! u. [^; \ s] +;! “, '', $s); ## entfernen HTML Wesen. $s = preg_replace („! [^ \ W \ s]! “, '', $s); ## entfernen Nichtwort/Raumputzfrauen. $s = preg_replace („! \ s+! “, „_“, $s); ## änderung Raumputzfrauen zu den Unterstreichen. Rückhol$s; } $mt_blog_users = „http://home.wangjianshuo.com/users/“; $mt_blog_archive = „http://home.wangjianshuo.com/archives/“; $file = „<Location von mt-config.cgi file>“; $cfg = Reihe (); wenn ($fp = Akte ($file)) {foreach ($fp als $line) {// Suche durch die Akte wenn (! ereg („^ \ s* \ #“, $line)) {// ignorieren Linien beginnend mit dem Durcheinandersymbol wenn (preg_match („/^ \ s* ([^] +) [] (. *) (\ r|n)? $“, $line, $regs)) {$key = Ordnung ($regs [1]); $value = Ordnung ($regs [2]); $cfg [$key] = $value; }}}} sonst {Würfel („nicht imstande, Konfiguration Akte $file zu öffnen“); } $db = mysql_connect ($cfg [„DBHost“], $cfg [„DBUser“], $cfg [„DBPassword“]) oder Würfel („ich kann nicht an MySQL anschließen. “); mysql_select_db ($cfg [„Datenbank“]); $query = „AUSERWÄHLTES comment_author, gelten (comment_author) als comment_count von der mt_comment GRUPPE DURCH Comment_author ORDER DURCH comment_count“; $result = mysql_query ($query); $comment_author_previous = ""; $comment_author_next = ""; während ($row = mysql_fetch_array ($result)) {wenn ($row [„comment_author“] == $user) {$comment_author_previous = $comment_author_previous_temp; } wenn ($comment_author_previous_temp == $user) {$comment_author_next = $row [„comment_author“]; } $comment_author_previous_temp = $row [„comment_author“]; } Echo „<small><a href='$ mt_blog_users$comment_author_next.htm'> „$comment_author_next</a> |“; Echo“ <a href='http://home.wangjianshuo.com/scripts/mt-user/mt-all-user.php'>Commenters</a> „; Echo „| <a href='$ mt_blog_users$comment_author_previous.htm'>$comment_author_previous“ </a></small> "; $user oder $user = „Jian Shuo Wang“; $query = „AUSERWÄHLTES entry_id, entry_title, comment_id, comment_url, entry_excerpt, comment_text, comment_entry_id, date_format (entry_created_on, „%Y%m%d“) als comment_entry_ymd, date_format (comment_created_on, „%h%i“) als comment_hourmin, comment_created_on vom mt_comment, mt_entry WO comment_entry_id = entry_id UND comment_author = „$user“ AUFTRAG DURCH Comment_id DESC BEGRENZUNG 300“; $comment_url = ""; $comment_count = 0; $html = ""; $result = mysql_query ($query); während ($row = mysql_fetch_array ($result)) {$comment_entry_id = $row [„comment_entry_id“]; $html = $html. „<p>“. (nl2br ($row [„comment_text“])). „<p><small>Posted durch $user an < ein href='http://home.wangjianshuo.com/users/“. $row [„comment_id“]. “ .htm target=_blank> ". $row [„comment_created_on“]. „</a> auf <a target=_blank href=$mt_blog_archive“. $row [„comment_entry_ymd“]. “ _ „. dirify ($row [„entry_title“]). “ .htm# ". $row [„comment_hourmin“]. „>“. $row [„entry_title“]. „</a></small><hr>“; $comment_url oder $comment_url = $row [„comment_url“]; $comment_count = $comment_count + 1; } Echo „<h1>$user</h1><a href='$ comment_url target=_blank>$comment_url</a>“; „informierte <b>$comment_count</b> Anmerkungen“ des Echos; Echo $html; mysql_free_result ($result); mysql_close (); ? >