Archive

Posts Tagged ‘WordPress’

Preparing for the Jump to WordPress 3 Multisite for OEIT

August 16th, 2010 by Brandon Muramatsu No comments

This post details some of the things I’ve learned while examining how to run WordPress 3 multisite (Network) for OEIT.

Peter and I decided not to migrate the individual sites now, pending a further investigation of how to handle the hostnames and Shibboleth integration.

Read more…


Categories: Professional Tags: , , ,

Running WordPress and Drupal side-by-side

August 16th, 2010 by Brandon Muramatsu No comments

I’ve had a case where I need to run WordPress and Drupal side-by-side.

My preferred method is to run WordPress in a sub-directory of the Drupal installation.

So the server’s document root is set to: /var/www/html/oeit/. The Drupal instance is in: /var/www/html/oeit/drupal/. And the WordPress install is in /var/www/html/oeit/haiti-oer-symposium/.

Aside: We already have a rewrite rule in place because our Drupal installation was coded to require the subdirectory <server document root>/drupal. Yes, that’s not ideal. But the rewrite rule has been a heck of a lot easier than going through and changing the custom theme and testing it out. I’m not a Drupal developer, nor do I see a particular need to become one right now.

With the rewrite rule, I needed to be able to let the WordPress rewrite rules take precedence in the /var/www/html/oeit/haiti-oer-symposium/ directory. That actually gives part of a clue as to how the problem is solved.

I originally looked for stuff like “integrate wordpress and drupal” or “run wordpress in subdirectory of drupal”. Ultimately I ran across the suggestion to have Apache ignore anything going to the haiti-oer-symposium sub-directory.

I added the following code to our .htaccess file:

RewriteCond %{REQUEST_URI} !^/haiti-oer-symposium/

Here’s an explanation from rick_deckard about how this is doing it’s thing…

RewriteCond %{REQUEST_URI} !^blog

In that case it says
If the request URI does NOT (!) BEGIN (^) with “blog” and the requested URI does not map to a file or directory, then rewrite to invoke drupal.

Put another way
If the request URI is for my blog or a file or a directory, serve that straight up, without handing me off to drupal. So in the case of your blog, it passes you through to WP

[And this proved to be key...]

As for the leading slash – run the HTTP Live Headers plugin in Firefox to see what the server thinks your actual REQUEST_URI is (or use phpinfo() on your /blog directory). In my case at least, it does not want the leading slash.

[Our server did require the leading and trailing slashes.]

Source: rick_deckard

So, is it better to know what you’re doing, or just get lucky with copy and paste?


Categories: Professional Tags: , , , ,

Creative Commons Configurator Plug-in

April 27th, 2010 by Brandon Muramatsu No comments

From a post on Alan Levin’s blog, I found out about the Creative Commons Configurator Plug-in.

So I added it to all of the sites I’m maintaining (though you’ll only see it on the single post page, in each page’s <head>, and in the RSS feeds).

License Sample
Source: Brandon

License Sample

For Tom: This is the css I’m using with the iNove Theme. I enable all of the options from the plugins configuration page, but I chose to not display the CC logo in the license block on each post (it’s in the page footer in any event). Also, you can change which of the CC logos the plugin uses–but you have to edit the php file directly–0=no logo (which you can set via the configuration screen), 1=31 pixel high logo, 2=15 pixel high logo. If I were to use a logo, I’m more partial to the 15 pixel high logo for this application.

.cc-block {
  width: 95%;
   font-size:10px;
   text-align: center;
   line-height:110%;
   padding:4px;
   border: 1px solid #cccccc;
   color: #aaaaaa;
   background-color: #ffffff;
}

iPhone Theme for WordPress

April 20th, 2010 by Brandon Muramatsu No comments

While surfing on my iPhone, I ran across a site using the WPtouch theme by the folks over at BraveNewCode. I thought it was cool enough to upload to my personal website and the two project sites I’m maintaining.

Here’s a screenshot of what my site looks like using the theme. (Unless you have an iPhone to access it yourself via the iPhone’s web browser.)

Brandon's Website on the iPhone
Source: Brandon

Brandon's Website on the iPhone


(…waits for Tom to copy this too…)


WordPress Blogs for OEIT

April 12th, 2010 by Brandon Muramatsu No comments

These notes are mostly for me…since I seem to create these blogs often enough I figured I should write up what to do.

Assumptions:

  • MySQL, PHP and Apache Installed and are properly configured.
  • You’re going to install the blog in the document root of the webserver, my examples will assume /home/www/project_name/.
  • That you want the user to access the blog at http://hostname.mit.edu/wordpress/

How to do it…

  1. Create a mysql database using MySQL Administrator or similar tool:
    • Create a database for <sitename_wordpress>
    • Create a user account for <username_wordpress>
    • Give <username_wordpress> privileges for localhost
    • Give <username_wordpress> privileges for % (any host) if you intend to allow the site to be edited remotely (probably not recommended or even necessary)
  2. Install the latest copy of WordPress:

    Navigate to the document root (/home/www/project_name/) and get a copy of the latest WordPress code.

    % wget http://wordpress.org/latest.zip

  3. Extract WordPress

    % unzip wordpress-x.x.x.zip

    which will create a wordpress subdirectory in your document root (/home/www/project_name/wordpress/), and the WordPress site will be visible at http://hostname.mit.edu/wordpress/

    If you want to change the location to http://hostname.mit.edu/, I suggest you do this before you edit the settings file and finish the configuration. Change webserver’s document root to /home/www/project_name/wordpress/ before proceeding. (WordPress includes a way to change the URL at which WordPress resolves, but it has always worked kind of wacky for me.)

  4. Create a Settings file

    Copy the sample settings file

    % cp /home/www/project_name/wordpress/wp-config-sample.php /home/www/project_name/wordpress/wp-config.php

    and edit the file and insert the database name, database username, database password in the appropriate locations.

  5. Finish the WordPress configuration

    Go to http://hostname.mit.edu/wordpress/, if everything’s working properly you should be asked to enter in your Site’s name and an email address for the administrator user. You can also select if you want the site to be searchable by Google and other search engines.

  6. Change the default administrator password.

  7. Create your account (and I suggest giving this account WordPress administrator privileges and using this account to administer the site).

  8. Get some plugins and/or themes.

Here are a sampling of the “standard” plugins I think should be used for OEIT-based WordPress installations.

  • Academic Sandbox, http://www.academicsandbox.com/academic_citations.html

    This WordPress 2.x plugin generates academic citations in five common academic citation formats: AMA, APA, Chicago, Harvard, MLA. You can select which (or all) of these five formats to show, and in the order you choose. Note: This requires some customization to get it working with the Thesis theme.

  • Akismet (comes preinstalled), http://downloads.wordpress.org/plugin/akismet.zip

    Akismet checks your comments against the Akismet web service to see if they look like spam or not and lets you review the spam it catches under your blog’s “Comments” admin screen.

  • Dublin Core plugin for WordPress, http://www.brainonfire.net/resources/files/dublin-core-for-wordpress/

    This plugin implements some Dublin Core metadata elements for WordPress.

  • Google Analytics for WordPress, http://yoast.com/wordpress/google-analytics/

    Optional: Use this if the theme does not include Search Engine Optimization (SEO). This plugin easily adds your Google Analytics tracking code (the new ga.js one!) to all pages within your blog. This plugin adds the possibility to tag and segment all outgoing links, so you can see whether a click came from a comment or an article.

    You’ll need to get a free Google Account to have access to their Analytics service. I usually use a general account for MIT project that I’ve setup, or if I’m building the WordPress site for a client, I’ll create a new username just for the project (this means I create a new GMail acccount, which also allows me to use the Analytics service). The separate accounts are a nice way of separating these projects.

  • Google (XML) Sitemaps Generator for WordPress, http://www.arnebrachhold.de/projects/wordpress-plugins/google-xml-sitemaps-generator/

    This plugin generates a XML-Sitemap compliant sitemap of your WordPress blog. This format is supported by Ask.com, Google, YAHOO and MSN Search.

  • External Links Plugin For WordPress, http://www.semiologic.com/software/external-links/

    The external links plugin for WordPress lets you process outgoing links differently from internal links.

  • Sociable for WordPress, http://blogplay.com/sociable-for-wordpress/

    The Sociable Plugin is something we at BlogPlay.com offer to bloggers. With this easy-to-install plugin, your readers will be able to share your posts with the rest of the world.

  • Template Override, http://wordpress.org/extend/plugins/template-overide/

    Very simple, it lets you add custom css to your template so when you upgrade the template with the wordpress update function your changes are never lost!

  • WordPress.com Stats, http://wordpress.org/extend/plugins/stats/

    Automattic created its own stats system, to focus on just the most popular metrics a blogger wants to track and provide them in a clear and concise interface.

    You’ll need a free WordPress.com account to use their stats package. I usually use a general account for all my MIT projects that I’ve setup, or if I’m building the WordPress site for a client, I’ll create a new username just for the project. The separate accounts are a nice way of separating these projects.

  • WP-reCAPTCHA, http://wordpress.org/extend/plugins/wp-recaptcha/

    reCAPTCHA is an anti-spam method originating from Carnegie Mellon University which uses CAPTCHAs in a genius way. Instead of randomly generating useless characters which users grow tired of continuosly typing in, risking the possibility that spammers will eventually write sophisticated spam bots which use OCR libraries to read the characters, reCAPTCHA uses a different approach.

    You’ll want to get a free reCaptcha account to manage your reCaptcha keys. I usually use a general account for all my MIT projects that I’ve setup, or if I’m building the WordPress site for a client, I’ll create a new username just for the project. The separate accounts are a nice way of separating these projects.

Added June 18, 2010:
Some additional Plugins.

  • Flash Video Player, http://www.mac-dev.net/
    Simplifies the process of adding video to a WordPress blog. Powered by Jeroen Wijering’s FLV Media Player and SWFObject by Geoff Stearns.
  • WPaudio, http://wpaudio.com/
    Play mp3s and podcasts in your posts by converting links and tags into a simple, customizable audio player.
  • WPtouch iPhone Theme, http://bravenewcode.com/products/wptouch
    A plugin which formats your site with a mobile theme for the Apple iPhone / iPod touch, Google Android, Palm Pre and other touch-based smartphones.

Added July 20, 2010:

  • WP-DBmanager, http://wordpress.org/extend/plugins/wp-dbmanager/
    Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up and optimizing of database.
  • WP Post Notifier For All, http://wordpress.org/extend/plugins/wp-post-notifier-for-all/
    Notify all WordPress users (and not only the admin) on post publishing. The notification is sent only one time after the first post publishing(not on every update).

Categories: Professional Tags: , , ,