# b2 VIEW ALL COMMENTS # by Stevem Source: http://cafelog.com/board/viewtopic.php?t=5893 Updated: 18.11.04, updated version featuring search, step 1 and 4 17.11.04, notes and STEP 3 It is useful to have a list of all the comments on your blog in case there is some old spam to weed out or you want IP addresses to add to the blacklist. The b2allcomments.php will list all the comments (from new to old) and also allow you to quickly delete them. STEP 1 a) If you don't have any comments (fresh install), skip this step. b) Backup your database. You can use b2 Quick Backup available at http://www.sigg3.net/cafelog/files/b2backup.zip STEP 2 Put this into a file called b2allcomments.php: [CODE] Go back !"); if ($search!="") { $query = "DELETE FROM $tablecomments WHERE comment_content NOT LIKE '%%' AND comment_content LIKE '%$search%'"; } else { $query = "DELETE FROM $tablecomments WHERE comment_ID=$comment"; } $result = mysql_query($query) or die("Oops, no comment with this ID. Go back !"); header ("Location: $PHP_SELF"); } ?> Comments

:: return to the blog    :: return to edit

     %' AND comment_content LIKE '%$search%' ORDER BY comment_date DESC"; $resultc = mysql_query($queryc); if ($search!="" && mysql_num_rows($resultc)>0) { ?> " onclick="return confirm('You are about to delete all comments containing \'\'\nCancel to stop, OK to delete')">Delete all comments including ''

comment_ID); $posting = $rowc->comment_post_ID; $commentauthor = $rowc->comment_author; $postdata = get_postdata($posting); ?>

( ) (IP: ) @ Delete Comment ]"; ?>
Comment was made in @

:: return to the blog    :: return to edit
[/CODE] STEP 3 Make a link in b2menutop.txt. It can only be seen by logged-in users at level 8 or above but change that if you wish on line 12. Should look something like this: 8 b2allissues.php All comments STEP 4 Upload it to your blog-directory, '/' not '/b2-include/'. That's it! Source: http://cafelog.com/board/viewtopic.php?t=5893