===== ""UserComments"" Action ===== {{lastedit}} >>**See also:** AdminModules >><LoadUser($_GET['user'])): # a valid user is specified as an URL parameter $author = $_GET['user']; break; case (isset($user) && $this->LoadUser($user)): # a valid user parameter is used $author = $user; break; case ($this->GetUser()): $author = $this->GetUserName(); break; } $page = $this->GetPageTag(); if ($author) { $user_comments_count = 0; if ($_GET["alpha"] == 1) { echo $this->Format("== Pages commented by [[".$author."]] == --- --- "); print("This is a list of pages commented by ".$this->Link($author).", along with the time of the comment (Href("", "", "user=".$author."&date=1&action=comments")."\">order by date).

\n"); if ($comments = $this->LoadAll("SELECT id, page_tag, time FROM ".$this->config["table_prefix"]."comments WHERE user = '".mysql_real_escape_string($author)."' ORDER BY page_tag ASC, time DESC")) { foreach ($comments as $comment) { if ($last_tag != $comment["page_tag"]) { $last_tag = $comment["page_tag"]; $firstChar = strtoupper($comment["page_tag"][0]); if (!preg_match("/[A-Z,a-z]/", $firstChar)) { $firstChar = "#"; } if ($firstChar != $curChar) { if ($curChar) print("
\n"); print("$firstChar
\n"); $curChar = $firstChar; } // print entry print("   (".$comment["time"].") href("", $comment["page_tag"], "show_comments=1")."#".$comment["id"]."\">".$comment["page_tag"]."
\n"); $user_comments_count++; } } if ($user_comments_count == 0) { print("User has not commented any pages yet."); } } else { print("No comments found."); } } else { echo $this->Format("== Pages commented by [[".$author."]] == --- --- "); print("This is a list of pages commented by ".$this->Link($author).", ordered by the time of the comment (Href("", "", "user=".$author."&alpha=1&action=comments")."\">order alphabetically).

\n"); if ($comments = $this->LoadAll("SELECT id, page_tag, time FROM ".$this->config["table_prefix"]."comments WHERE user = '".mysql_real_escape_string($author)."' ORDER BY time ASC, page_tag ASC")) { foreach ($comments as $comment) { $commented_pages[$comment["page_tag"]] = $comment["time"]; } $commented_pages = array_reverse($commented_pages); foreach ($commented_pages as $comment["page_tag"] => $comment["time"]) { // day header list($day, $time) = explode(" ", $comment["time"]); if ($day != $curday) { if ($curday) print("
\n"); print("$day:
\n"); $curday = $day; } // print entry print("   (".$time.") href("", $comment["page_tag"], "show_comments=1")."#".$comment["id"]."\">".$comment["page_tag"]."
\n"); $user_comments_count++; } if ($user_comments_count == 0) { print("User has not commented any pages yet."); } } else { print("No comments found."); } } } else { print("No user specified"); } ?> %% ---- CategoryDevelopmentActions CategoryDevelopmentAdmin