Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY000]: General error: 145 Table './skippy_skippy/h_sessions' is marked as crashed and should be repaired in system/classes/databaseconnection.php line 269
As part of the Weblog Tools Collection Plugin Contest, I created a plugin that binds a virtual host to a single WordPress category.
The vhost plugin binds a WordPress category to a virtual host on your webserver, either a sub-domain or a seperate fully-qualified domain. You can have as many such bindings as you have vhosts: just make a new category for each one. Each vhost+category pair can use its own template.
You can see this in action at tangential.info, which is the main blog. The demo has been taken offline.
Additionally, blog administrators can edit a registered user's profile, and set the URL in that user's profile to the fully-qualified domain name of a valid vhost. That user may then login to http://vhost/wp-admin/ and post only in that vhost's category. If that user attempts to access the /wp-admin/ directory on the main blog, they will be redirected to their vhost.
NOTICE: This is a beta release. This plugin has not yet received extensive testing. Only download this plugin if you're willing to accept that it may break your blog. It is released with no guarantee of usability, and I will not accept any responsibility if it does bad things. I will accept bug reports and patches.
ALSO: This plugin will not work well with a default WordPress 1.5 installation. In order for post navigation to work well, you'll want to edit get_previous_post() and get_next_post() so that you can use the "in_same_category" flag. Then edit your template(s) to use previous_post_link() and next_post_link(), instead of previous_post() and next_post().
See bug 1252 and changeset 2542 for additional information.
Download vhost 1.3 now!
Mad props to Owen for his limit categories plugin, which provided an excellent foundation for me!
About | Policies | skippy.net
Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY000]: General error: 145 Table './skippy_skippy/h_sessions' is marked as crashed and should be repaired in system/classes/databaseconnection.php line 269
Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY000]: General error: 145 Table './skippy_skippy/h_sessions' is marked as crashed and should be repaired in system/classes/databaseconnection.php line 269
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE 1=1 AND post_date_gmt Server Info: PHP: 4.3.11 ; MySQL: 4.0.22 The server info where Vhost runs fine is : PHP: 4.3.10; MySQL: 4.0.23$site = parse_url(strtolower($user_url));, which check's the user's URL as defined in their profile. From the error message you supplied, it looks like the user's URL is not a fully-qualified domain name. Can you double check that please?wp-content/themes/tekstack.remidian.comdirectory -- just copy the default theme into there, to make sure that it works.function vhost_join($join = '') { global $wpdb, $vhost_cat; if (false === stristr($join, " INNER JOIN $wpdb->post2cat ON ")) { //$join .= " INNER JOIN $wpdb->post2cat ON $wpdb->posts.ID=$wpdb->post2cat.post_id AND category_id=$vhost_cat "; /* REVHACK, 12/20/2005 8:40PMm (support child categories */ $_children = ltrim( get_category_children($vhost_cat,','), ','); if ( $_children == ''){ $join .= " INNER JOIN $wpdb->post2cat ON $wpdb->posts.ID=$wpdb->post2cat.post_id AND category_id=$vhost_cat "; }else{ $join .= " INNER JOIN $wpdb->post2cat ON $wpdb->posts.ID=$wpdb->post2cat.post_id AND (category_id=$vhost_cat OR category_id in ($_children))"; } } return $join; } // vhost_joinI'm not really into wordpress and it might be a very dirty solution, but it looks like it works... remi@