Changeset 887
- Timestamp:
- 02/17/2004 08:35:04 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r869 r887 1 1 <?php 2 3 function url_shorten ($url) { 4 $short_url = str_replace('http://', '', stripslashes($url)); 5 $short_url = str_replace('www.', '', $short_url); 6 if ('/' == substr($short_url, -1)) 7 $short_url = substr($short_url, 0, -1); 8 if (strlen($short_url) > 35) 9 $short_url = substr($short_url, 0, 32).'...'; 10 return $short_url; 11 } 2 12 3 13 function selected($selected, $current) { -
trunk/wp-admin/edit-comments.php
r872 r887 3 3 $parent_file = 'edit.php'; 4 4 require_once('admin-header.php'); 5 if (empty($_GET['mode'])) $mode = 'view'; 6 else $mode = $_GET['mode']; 5 7 ?> 6 8 <ul id="adminmenu2"> … … 9 11 <li class="last"><a href="moderation.php">Awaiting Moderation</a></li> 10 12 </ul> 11 13 <script type="text/javascript"> 14 <!-- 15 function checkAll(form) 16 { 17 for (i = 0, n = form.elements.length; i < n; i++) { 18 if(form.elements[i].type == "checkbox") { 19 if(form.elements[i].checked == true) 20 form.elements[i].checked = false; 21 else 22 form.elements[i].checked = true; 23 } 24 } 25 } 26 //--> 27 </script> 12 28 <div class="wrap"> 13 29 <form name="searchform" action="" method="get"> … … 15 31 <legend>Show Comments That Contain...</legend> 16 32 <input type="text" name="s" value="<?php echo $s; ?>" size="17" /> 17 <input type="submit" name="submit" value="Search" /> 33 <input type="submit" name="submit" value="Search" /> 34 <input type="hidden" name="mode" value="<?php echo $mode; ?>" /> 35 (Searches within comment text, email, URI, and IP address.) 18 36 </fieldset> 19 37 </form> … … 28 46 comment_author_IP LIKE ('%$s%') OR 29 47 comment_content LIKE ('%$s%') 30 ORDER BY comment_date ");48 ORDER BY comment_date DESC"); 31 49 } else { 32 $comments = $wpdb->get_results("SELECT * FROM $tablecomments ORDER BY comment_date $commentorderLIMIT 20");50 $comments = $wpdb->get_results("SELECT * FROM $tablecomments ORDER BY comment_date DESC LIMIT 20"); 33 51 } 52 if ('view' == $mode) { 34 53 if ($comments) { 35 54 echo '<ol>'; … … 63 82 ?> 64 83 <p> 84 <strong>No results found.</strong></p> 85 86 <?php 87 } // end if ($comments) 88 } elseif ('edit' == $mode) { 89 if ($comments) { 90 echo '<form name="deletecomments" id="deletecomments" action="" method="post"> 91 <table width="100%" cellpadding="3" cellspacing="3"> 92 <tr> 93 <th scope="col">*</th> 94 <th scope="col">Name</th> 95 <th scope="col">Email</th> 96 <th scope="col">IP</th> 97 <th scope="col">Comment Excerpt</th> 98 <th scope="col">Edit</th> 99 <th scope="col">Delete</th> 100 </tr>'; 101 foreach ($comments as $comment) { 102 $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee'; 103 ?> 104 <tr style='background-color: <?php echo $bgcolor; ?>'> 105 <td><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /></td> 106 <th scope="row"><?php comment_author_link() ?></th> 107 <td><?php comment_author_email_link() ?></td> 108 <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td> 109 <td><?php comment_excerpt(); ?></td> 110 <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { 111 echo "<a href='post.php?action=editcomment&comment=$comment->comment_ID' class='edit'>Edit</a>"; } ?></td> 112 <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { 113 echo "<a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('You are about to delete this comment by \'".$comment->comment_author."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\" class='delete'>Delete</a>"; } ?></td> 114 </tr> 115 <?php 116 } // end foreach 117 ?></table> 118 <p><a href="javascript:;" onclick="checkAll(document.getElementById('deletecomments')); return false; ">Invert Checkbox Selection</a></p> 119 <p style="text-align: right;"><input type="submit" name="Submit" value="Delete Checked Comments" onclick="return confirm('You are about to delete these comments permanently \n \'Cancel\' to stop, \'OK\' to delete.')" /> </p> 120 </form> 121 <?php 122 } else { 123 124 ?> 125 <p> 65 126 <strong>No results found.</strong> 66 127 </p> … … 68 129 <?php 69 130 } // end if ($comments) 70 131 } 71 132 ?> 72 133 -
trunk/wp-admin/moderation.php
r682 r887 97 97 ?> 98 98 <ul id="adminmenu2"> 99 <li><a href="edit.php"> LatestPosts</a></li>100 <li><a href="edit-comments.php"> LatestComments</a></li>101 <li class="last"><a href="moderation.php" class="current"> CommentsAwaiting Moderation</a></li>99 <li><a href="edit.php"> Posts</a></li> 100 <li><a href="edit-comments.php"> Comments</a></li> 101 <li class="last"><a href="moderation.php" class="current">Awaiting Moderation</a></li> 102 102 </ul> 103 103 <?php … … 167 167 ?> 168 168 </ol> 169 <input type="submit" name="submit" value="Moderate Comments" class="search"/>169 <input type="submit" name="submit" value="Moderate Comments" /> 170 170 </form> 171 171 <?php -
trunk/wp-includes/template-functions-comment.php
r885 r887 7 7 8 8 add_filter('comment_email', 'remove_slashes', 5); 9 add_filter('comment_email', 'antispambot' , 5);9 add_filter('comment_email', 'antispambot'); 10 10 11 11 add_filter('comment_url', 'clean_url'); 12 12 13 add_filter('comment_text', 'remove_slashes', 5); 13 14 add_filter('comment_text', 'convert_chars'); 14 15 add_filter('comment_text', 'make_clickable'); 15 add_filter('comment_text', 'wpautop' );16 add_filter('comment_text', 'wpautop', 30); 16 17 add_filter('comment_text', 'balanceTags'); 17 18 add_filter('comment_text', 'convert_smilies', 20); 18 19 20 add_filter('comment_excerpt', 'remove_slashes', 5); 21 add_filter('comment_excerpt', 'convert_chars'); 22 19 23 function clean_url($url) { 20 24 $url = str_replace('http://url', '', $url); … … 130 134 echo $url; 131 135 } else { 132 echo 'mailto:'.antispambot($email);136 echo "mailto:$email"; 133 137 } 134 138 echo '" rel="external">' . $author . '</a>'; … … 154 158 $email = apply_filters('comment_email', $comment->comment_author_email); 155 159 if ((!empty($email)) && ($email != '@')) { 156 $display = ($linktext != '') ? $linktext : antispambot(stripslashes($email));160 $display = ($linktext != '') ? $linktext : stripslashes($email); 157 161 echo $before; 158 162 echo "<a href='mailto:$email'>$display</a>"; … … 183 187 $comment_text = str_replace('<pingback />', '', $comment_text); 184 188 echo apply_filters('comment_text', $comment_text); 189 } 190 191 function comment_excerpt() { 192 global $comment; 193 $comment_text = str_replace('<trackback />', '', $comment->comment_content); 194 $comment_text = str_replace('<pingback />', '', $comment_text); 195 $comment_text = strip_tags($comment_text); 196 $blah = explode(' ', $comment_text); 197 if (count($blah) > 20) { 198 $k = 20; 199 $use_dotdotdot = 1; 200 } else { 201 $k = count($blah); 202 $use_dotdotdot = 0; 203 } 204 $excerpt = ''; 205 for ($i=0; $i<$k; $i++) { 206 $excerpt .= $blah[$i] . ' '; 207 } 208 $excerpt .= ($use_dotdotdot) ? '...' : ''; 209 echo apply_filters('comment_excerpt', $excerpt); 185 210 } 186 211
Note: See TracChangeset
for help on using the changeset viewer.