Find your next scenic drive!

August 3, 2006

Corrupted Comments Table...

I was recently cleaning up the endless comment spam this blog gets, and at some point while doing this, I noticed that one comment ended up not being deletable. From the bBlog admin interface, it was not evident that there was a problem, and I decided to look at it when I got home. When I got home, I had received a couple more comment spams, but I could not delete these or the previous one from the admin interface, and so I decided to drop to the mysql interface.

The mysql interface seemed fine at first, as it allowed me to select * from bB_comments, however, when I attempted to delete all the items on hold, I noticed something different:

  • mysql> delete from bB_comments where onhold = 1;
  • ERROR 126 (HY000): Incorrect key file for table './bBlog_table/bB_comments.MYI'; try to repair it

Some of my initial search results were non-conclusive as to what the deal was, and so I hoped that by restarting MySQL, that the error would be more evident. MySQL started up fine, but my query results now were different:

  • mysql> delete from bB_comments where onhold = 1;
  • ERROR 145 (HY000): Table './Blog/bB_comments' is marked as crashed and should be repaired

From that error message, I landed on this message that indicated that the repair was as simple as running the REPAIR query, as described here:

  • mysql> REPAIR Table bB_comments;
  • +-------------------------+--------+----------+----------+
  • | Table | Op | Msg_type | Msg_text |
  • +-------------------------+--------+----------+----------+
  • | bBlog_table.bB_comments | repair | status | OK |
  • +-------------------------+--------+----------+----------+

And now I am back in business and able to delete my comment spam. It is unclear what corrupted the table to begin with; I was impatient in deleting the comment spam, but I doubt that is the root cause. If it happens again, I will take a look.

June 7, 2006

Adding the comment URL to bBlog's RSS 2.0 Feeds...

The default bBlog RSS 2.0 feed template does not present the user with a link to the comments page. Although this is easily derived, some RSS readers can do some funky stuff with this information. It turns out that adding this is extremely easy. Simply do the following:

  1. Change the current directory to your bBlog directory
  2. Edit bblog/inc/admin_templates/rss20.html.
  3. Search for the guid tag, and you should see something like:
    • ...
    • <guid isPermaLink="true">{$post.permalink}</guid>
    • <title>{$post.title|htmlspecialchars}</title>
    • <link>{$post.permalink}</link>
    • <comments>{$post.permalink}#comments</comments>
    • {if strlen($post.author.email) > 0}
    • ...
  4. The line in bold above is the one you should add in.
  5. Save, and enjoy!

Or just take a short cut to all this and snag mine. Let me know if there's anything.

October 22, 2005

bBlog nextprev 0.4.2 Released...

The bBlog hide-from-homepage feature is something that I do not personally use, however, I have received a request to support it from Fredrik. As such, I am releasing nextprev 0.4.2 to resolve this issue.

All this version does is add the home variable to the nextprev call, similar to what you are currently doing for the posts.

If there are any other issues, please let me know. Enjoy.

July 26, 2005

bBlog Trackbacks for Moderation...

Unfortunately my site was down for the last couple of months during my move to Seattle, and I was getting used to not having any blog spam. While there are some preventive measures in bBlog for spam, with more coming in the newer releases, one of the parts that I find most annoying is the fact that trackbacks are posted directly on your site, regardless of your setting for posting comments.

Since the comments and trackbacks are stored in the same database, you can easy have trackbacks wait for moderations like other comments by simply adding onhold='1', in your trackback.php file where it generates the query into the SQL database. A snapshot of my 0.7.6 release of this file is https://www.eyt.ca/Software/trackback.php.

When you receive a trackback, you will receive your e-mail as normal, however, your visitors will see that a comment is pending moderation. In order for the trackback to be displayed, you will have to log in to your admin interface and approve the comment under Comments by clicking Approve. Or, Delete :-).

While it precludes the entire concept of trackbacks, this does prevent your visitors (and particularly your search-engine visitors) from seeing links to these sites.

Needless to say, this is not linked into your user interface, and thus if you change your mind, it will require another code change.


October 21, 2004

nextprev for post.html...

On the bBlog forums, someone commented on getting a nextprev-type plugin for the posts.

While perhaps not the most efficient way of doing this, one way to accomplish this is by using the max_pages variable, and adding the following code to your post.html template:

{nextprev num=1 max_pages=1}
{getrecentposts num=1 assign=posts home=true skip=$current_offset}
{if $goprev ne ''}
<a href="{$goprev}" title="Next Post">Next</a>
{if $gonext ne ''}
<a href="{$gonext}" title="Previous Post">Previous</a>