Best practices for running Wordpress on the same domain as Rails app
What's the best way to run Wordpress on the same domain as a Rails application? I've got a standard Rails app with Nginx and Mongrel running at http _ mydomain. I need to run a Wordpress blog at http _ mydomain _ com _ blog. My preference would be to host the blog in Apache running on either the same server or a separate box but I don't want the user to see a different server in the URL. Is that possible and if not, what would you recommend to accomplish the goal? 5 Answers Actually, since you're using Nginx, you're already in great shape and don't need Apache. You can run PHP through fastcgi (there are examples of how to do this in the Nginx wiki), and use a URL-matching pattern in your Nginx configuration to direct some URLs to Rails and others to PHP. Here's an example Nginx configuration for running a WordPress blog through PHP fastcgi (note I've also put in the Nginx equivalent of the WordPress .htaccess, so you will also have fancy URLs alre...
Read more…
Running a scheduled task in a Wordpress plug-in
Running a scheduled task in a Wordpress plug-in I'm trying to write a Wordpress plug-in that automatically posts a blog post at a certain time of day. For example, read a bunch of RSS feeds and post a daily digest of all new entries. There are plug-ins that do something similar to what I want, but many of them rely on a cron job for the automated scheduling. I'll do that if I have to, but I was hoping there was a better way. Getting a typical Wordpress user to add a cron job isn't exactly friendly. Is there a good way to schedule a task that runs from a Wordpress plug-in? It doesn't have to run at exactly the right time. 4 Answers codex wordpress: Function_Reference -> wp_schedule_event pseudo-cron is good but the two issues it has is It requires someone to "hit" the blog to execute. Low volume sites will potentially have wide ranging execution times so don't be two specific about the time. The processing happens before the page loads. So ...
Read more…
Wordpress MediaWiki Cookie Integration
Wordpress MediaWiki Cookie Integration I have my Wordpress install and MediaWiki sharing the same login information. Unfortunately, users need to log into both separately, but at least they use the same credentials. What I would like to do is cause a successful login on the Wordpress blog to also cause a login for MediaWiki (ideally both directions). There are two ways this could happen: Logging in causes a login on the other application (writes the cookie and creates the session in the DB) Accessing an application checks for the cookie of the other and then automatically logs in. Since the usernames are shared it seems like the latter should be pretty easy to do. Any tips would be great. 4 Answers The primary problem you are going to run into is that you'll have two login forms, and two logout methods. What you need to do is pick one of the login forms as the default, and redirect the other one over to it. I've been able to successfully integrate bbPress + MediaWik...
Read more…
Seeking code highlighter recommendation for WordPress
Seeking code highlighter recommendation for WordPress Can anybody recommend a reliable and decently documented code highlighter for WordPress 2.6.1? I have tried Code Snippet by Roman Roan and Developer Formatter by Gilberto Saraiva. But they don't seem to work as described in the documentation and are mangling the code snippets instead of prettifying them. Re-opened...OP is asking about a 'code highlighter' widget...something programmers use on their blogs...seems programming related to me. 5 Answers I use WP-Syntax and it's worked very well for me. It's supported every language I've thrown at it so far, and the colors can be customized for a particular theme (though the defaults look just fine too) Initially, I also used this plugin. Its simplicity and the fact that it is based on a well-established library (GeSHi) are the main arguments. I noticed, however, that it does not make best use of WordPress and GeSHi, and that it was not actively developed an...
Read more…
WordPress MediaWiki integration
WordPress MediaWiki integration On the other end of the spectrum, I would be happy if I could install a wiki and share the login credentials between WordPress and the wiki. I hacked MediaWiki a while ago to share logins with another site (in ASP Classic) via session cookies, and it was a pain to do and even worse to maintain. Ideally, I would like to find a plug-in or someone who knows a more elegant solution. 6 Answers The tutorial WordPress, bbPress & MediaWiki should get you on the right track to integrating MediaWiki into your WordPress install. It's certainly going to be a lot easier than hacking WordPress to have wiki features, especially with the sort of granular permissions you're describing. The link in this answer is broken. After a bit of googling I'm pretty sure that this is the page that the link was supposed to point Updated link Both MediaWiki and Wordpress support OpenID Though, I think for automatic logins (after you log in to one, you automa...
Read more…
How to select posts with specific tags, categories in WordPress | SQL
How to select posts with specific tags/categories in WordPress This is a very specific question regarding MySQL as implemented in WordPress . I'm trying to develop a plugin that will show (select) posts that have specific 'tags' and belong to specific 'categories' (both multiple) I was told it's impossible because of the way categories and tags are stored: wp_posts contains a list of posts, each post have an "ID" wp_terms contains a list of terms (both categories and tags). Each term has a TERM_ID wp_term_taxonomy has a list of terms with their TERM_IDs and has a Taxonomy definition for each one of those (either a Category or a Tag) wp_term_relationships has associations between terms and posts How can I join the tables to get all posts with tags "Nuclear" and "Deals" that also belong to the category "Category1"? 6 Answers I misunderstood you. I thought you wanted Nuclear or Deals. The below should giv...
Read more…