Chris Jean's Blog

Linux, WordPress, programming, anime, and other stuff.
twitter
rss

Archive for WordPress

All the content on my site was gone. When I went to investigate, I found my error log was filled with the following error:

WordPress database error Table ‘./database_name/prefix_posts’ is marked as crashed and should be repaired for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM prefix_posts  WHERE post_type = ‘post’ AND post_status = ‘publish’ GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC  made by require, require_once, include, do_action, call_user_func_array, flexx_after_content, get_sidebar, locate_template, load_template, require_once, dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, WP_Widget_Archives->widget, wp_get_archives

A very scary looking error, but it was easy to fix.

My Preferred Repair Method

[user@server ~/public_html]$ mysql -u user -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1120449
Server version: 5.1.48 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> connect database
Connection id:    1120477
Current database: database

mysql> select * from prefix_posts limit 1;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1120568
Current database: database

ERROR 145 (HY000): Table './database/prefix_posts' is marked as crashed and should be repaired
mysql> repair table prefix_posts;
+-----------------------+--------+----------+----------+
| Table                 | Op     | Msg_type | Msg_text |
+-----------------------+--------+----------+----------+
| database.prefix_posts | repair | status   | OK       |
+-----------------------+--------+----------+----------+
1 row in set (3.56 sec)

mysql> select * from prefix_posts limit 1;
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
| ID | post_author | post_date           | post_date_gmt       | post_content | post_title | post_category | post_excerpt | post_status | comment_status | ping_status | post_password | post_name | to_ping | pinged | post_modified       | post_modified_gmt   | post_content_filtered | post_parent | guid                                                       | menu_order | post_type  | post_mime_type | comment_count |
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
| 12 |           8 | 2008-05-20 10:09:49 | 2008-05-20 15:09:49 |              | 308image1  |             0 |              | inherit     | open           | open        |               | 308image1 |         |        | 2008-05-20 10:09:49 | 2008-05-20 15:09:49 |                       |           0 | http://gaarai.com/wp-content/uploads/2008/05/308image1.gif |          0 | attachment | image/gif      |             0 |
+----+-------------+---------------------+---------------------+--------------+------------+---------------+--------------+-------------+----------------+-------------+---------------+-----------+---------+--------+---------------------+---------------------+-----------------------+-------------+------------------------------------------------------------+------------+------------+----------------+---------------+
1 row in set (0.00 sec)

mysql> exit
Bye
[user@server ~/public_html]$ 

For me, this was the easiest and quickest way to repair the table.

Repairing Tables with phpMyAdmin

For you, you might prefer to use phpMyAdmin. Fortunately, repairing a table with phpMyAdmin is easy.

  1. Log in to your phpMyAdmin or connect to it via your cPanel back-end.
  2. Select the database with the crashed table.
  3. Put a checkmark next to each crashed table.
  4. Select “Repair table” from the “With selected:” drop down at the bottom of the list.
  5. Let phpMyAdmin do its thing.

Hello again my faithful readers. Again, I am terribly sorry for the lack of posts recently. I’ve been extremely busy at work with some huge projects.

I work for iThemes doing back-end development for themes and “special projects”. Previously, I never wanted to talk about it much on my blog because we weren’t GPL, and that can cause a lot of commotion. I don’t have to worry about that anymore. As of today, iThemes is GPL.

This is a very exciting move for us. We’ve talked about it internally for a long time. I’m glad that we’ve finally made the change.

If you’d like to know more about the change, please check out the official announcement.

Now that I know how to do this, it seems so easy and straight-forward. To change the default application files of a specific type are opened with, do the following:

  1. Right-click a file that you wish to change the default application for and select Properties.
  2. Click the “Open With” tab.
  3. Select the desired application’s radio button.
    • Additional applications can be added if the one you want is not listed. Use the Add button to find the desired application.
    • You can also remove applications from the list by highlighting the application and clicking the Remove button.
    • Adding applications to or removing applications from this list changes which applications are available in the “Open With” option when you right-click a file.
  4. Click the Close button.

Again, it seems so easy and straight-forward now. Go figure. :)

I just started using the Press This feature of WordPress, and I quickly ran into a problem. Each time I’d try to use it, I’d get a 404 error page.

I’m not sure exactly what the issue is, but there is an easy fix that you can find here.

Since beginning work on my DNS Yogi site, I’ve had to do numerous regular expressions to matching all sorts of string bits. I quickly ran into problems when I realized that I need to add support for Unicode characters since certain TLD registrars support registrations with non-Latin characters.

The main issue is that there are multiple regular expression engines. PHP uses a flavor of the PCRE (Perl Compatible Regular Expression) engine. Each engine and varient of an engine has a slightly different way of handling regular expression syntax. I needed to find out exactly how the PHP regular expression engine worked, and finding that information was not easy.

Continue reading “PHP Regular Expression Syntax References”

A while back, I posted about how I wanted to find an alternative to DNS Stuff. Since then, I haven’t found much to get excited about. In addition, I continue to get search traffic where people use terms like “free dnsstuff”, “dnsstuff alternative”, or “dnsstuff coupon code”. So, it seems that I’m not the only one that wants a real alternative to DNS Stuff.

Introducing DNS Yogi. My goal is to provide a set of tools that can compete with the quality of DNS Stuff while remaining free. Here is what I plan to launch the site with:

Continue reading “DNS Yogi: A True Alternative to DNSStuff”

WordPress may at its core be a blogging platform. I know that Matt Mullenweg, creator of WordPress, wants to keep all development of WordPress focused on blogging. I also know that WordPress is and will always be primarily used for blogging. However, as I work more an more with WordPress, I’ve come to see WordPress in a different light.

There are those that want to use WordPress as a full web publishing platform and not just a blogging platform. With the right kind of theme and plugins, using WordPress in this way can produce great results. Again, I see WordPress in an even more abstract view than as just a web publishing platform.

How do I see WordPress then? Frankly, I see it as an incredibly-flexible web application framework that can be used to develop seemingly unlimited type of applications.

Continue reading “WordPress as a Web Application Framework”

After working on a new theme off and on for over a month, I’ve finally settled on a look and decided to update the site.

My old theme was a slight modification of the fSpring theme by Fredrik Fahlstad. I still think that it’s a very nice design, but I decided that it was time for a change.

Continue reading “gaarai.com Gets a New Theme”

I’ve been running Woopra stats on this site since August 1, 2008. I got into the beta program really early since I was at WordCamp Dallas, where some of the initial beta codes were given out. I also had the pleasure of meeting John Pozadzides who is the founder of Woopra.

Since I’ve been using Woopra for half a year now, I’d like to give a review of what I like and dislike about it.

About Woopra

For those of you who don’t know anything about Woopra, here’s a bit of info. Woopra is a very new site statistics and visitor analytics tools. It is so new in fact, that it is still very much in beta.

Woopra aims to revolutionize the way we think of stats in relation to our site. Rather than being purely a historical tool, as most of the other stat gathering tools are, Woopra provides the ability to see what is happening on your site in real time. There is a Live tab that will show you visitors that are active on your site, where each visitor is located in the world, how each visitor got to the site, what pages they’ve navigated to, any external links they’ve clicked on, and even gives you the ability to open up a live chat with an individual visitor.

Continue reading “Woopra Review”

Have you ever wanted to turn WordPress into a more powerful, CMS-style platform? The Pods plugin looks to be the first step toward achieving this goal.

In case you haven’t heard about Pods, here is a snippet from Pods’ site:

WordPress evolved.

Create more than just blog posts and pages. Add new content types with only the fields you need. Customize exactly how each content type’s list and detail pages appear. Automatic pagination, filtering, public forms and more are possible with the Pods CMS plugin.

Continue reading “Pods for WordPress – Content Beyond Posts and Pages”