Changeset 4700
- Timestamp:
- 01/17/06 16:40:54 (2 years ago)
- Files:
-
- wp-stats/trunk/readme.txt (modified) (1 diff)
- wp-stats/trunk/wp-stats.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wp-stats/trunk/readme.txt
r4573 r4700 14 14 - FIXED: Page Permalink Issues 15 15 - FIXED: Error If User Has Not Posted Comment 16 - FIXED: Page Navigation if There Are 0 or 1 Page. 17 - FIXED: Exploit $comment_author 16 18 17 19 // Version 2.00 (01-01-2006) wp-stats/trunk/wp-stats.php
r4573 r4700 268 268 // Comment Author Link 269 269 $comment_author_link = urlencode($comment_author); 270 // Comment Author SQL 271 $comment_author_sql = $wpdb->escape($comment_author); 270 272 // Total Comments Posted By User 271 $totalcomments = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_author='$comment_author '");273 $totalcomments = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_author='$comment_author_sql'"); 272 274 // Checking $page and $offset 273 275 if (empty($page) || $page == 0) { $page = 1; } … … 281 283 $totalpages = ceil($totalcomments/$perpage); 282 284 // Getting The Comments 283 $gmz_comments = $wpdb->get_results("SELECT $wpdb->posts.ID, comment_author, comment_date, comment_content, ID, comment_ID, post_date, post_title, post_name FROM $wpdb->comments INNER JOIN $wpdb->posts ON $wpdb->comments.comment_post_ID = $wpdb->posts.ID WHERE comment_author = '$comment_author ' AND comment_approved = '1' AND post_date < '".current_time('mysql')."' AND (post_status = 'publish' OR post_status = 'static') ORDER BY comment_post_ID DESC, comment_date DESC LIMIT $offset, $perpage");285 $gmz_comments = $wpdb->get_results("SELECT $wpdb->posts.ID, comment_author, comment_date, comment_content, ID, comment_ID, post_date, post_title, post_name FROM $wpdb->comments INNER JOIN $wpdb->posts ON $wpdb->comments.comment_post_ID = $wpdb->posts.ID WHERE comment_author = '$comment_author_sql' AND comment_approved = '1' AND post_date < '".current_time('mysql')."' AND (post_status = 'publish' OR post_status = 'static') ORDER BY comment_post_ID DESC, comment_date DESC LIMIT $offset, $perpage"); 284 286 ?> 285 287 <h2 class="pagetitle">Comments Posted By <?php echo $comment_author; ?></h2> 286 288 <p>Displaying <b><?php echo $displayonpage; ?></b> To <b><?php echo $maxonpage; ?></b> Of <b><?php echo $totalcomments; ?></b> Comments</p> 287 289 <?php 290 // Get Comments 288 291 if($gmz_comments) { 289 292 foreach($gmz_comments as $post) { … … 306 309 echo "<p>$comment_author has not made any comments yet.</p>"; 307 310 } 311 312 // If Total Pages Is More Than 1, Display Page Navigation 313 if($totalpages > 1) { 308 314 ?> 309 315 <table width="100%" cellspacing="0" cellpadding="0" border="0"> … … 344 350 if ($i >= 1 && $i <= $totalpages) { 345 351 if($i == $page) { 346 echo " [$i]";352 echo " [$i] "; 347 353 } else { 348 354 echo "<a href=\"wp-stats.php?author=$comment_author_link&page=$i\">$i</a> "; … … 360 366 </td> 361 367 </tr> 362 </table> 368 </table> 369 <?php 370 } 371 ?> 363 372 <p><b>««</b> <a href="<?php get_settings('home'); ?>wp-stats.php">Back To Stats Page</a></p> 364 373 <?php
