ARCHIVES

Embed Facebook Fan Page Photo Albums In WordPress

January 8, 2010

It is a great idea to have a Facebook fan page for your company, club or organization.

This is a minor hack of the Fotobook plugin for WordPress by Aaron Harp. Fotobook is originally meant to apply your personal photo albums into WordPress, but we’re going to make one small code tweak to instead pull the albums from the fan page that we administer.

After installing the plugin, go ahead and activate it and grant the permissions to your Facebook account.

Next, visit your Facebook fan page, and click into an album so you’re viewing all photos in one particular album. In the address bar you’ll see a &id=123123123. Copy that ID number.

In the plugin directory open the fotobook.php file and head down to line 243 and look for this code.

$uid = $session['uid'];

Swap that code for this

//$uid = $session['uid'];
$uid = 123123123;

With the 123123123 being the ID code for your fan page.

If you have a custom URL set for your fan page you might notice that the album photos are not showing. To correct that move down around line 809 in fotobook.php and look for:

if(!is_numeric($id)) return false;

And code it out of use by adding // in front so that it now looks like

//if(!is_numeric($id)) return false;

Back in the plugin administration page, go ahead and import your albums. And you should be good to go!

With a thanks to B. Thibault in the forums at the Fotobook Application Page.

Remove and Prevent Revisions in Wordpress

June 17, 2009

I recently noticed that a particular post had built up about 10 or 15 revisions for it. I started thinking that of all the posts I have, there have to be quite a few revisions and therefore are creating a hefty sized table in my database. This was run on my WP 2.8, but should work for 2.6 and up.

Here is a solution to prevent revisions from being created, as well as removing all revisions from your database.

Prevent Revision Creation

Open wp-config.php and add this to the very bottom of the file, before the php closing tag.

define('WP_POST_REVISIONS', false);

This completely turns off any revision creation. If you’d like to restrict revision creation to a set amount per post, you can change ‘false’ for the number of revisions you’d like stored.

Remove All Revisions From Database

Open up your database in phpmyadmin and run this SQL Query.

DELETE FROM wp_posts WHERE post_type = "revision";

And now you’ll have a more tidy database.

Install Wordpress On a Local Server

April 15, 2009

In this tutorial, we’ll go through the process of setting up a server on your local computer. This will allow you to run PHP & MySQL applications, such as Wordpress, directly on your machine.

As I have yet resisted joining the ranks of the Mac cult, we’ll be using PC server software. I am aware of XAMPP, WAMP, and I personally use VertrigoServ for no other reason than it is the only one I’ve tried. (Mac cultists can use MAMP.)

This Tutorial Is Based On VertrigoServ

They say that cleanliness is next to godliness, and in that vein let us install our server in a organized location. On my desktop, I actually use a whole separate hard drive to store my server. If you don’t have the luxury of a dedicated HDD, then your local disk or C:\ will be fine.

01. Installing The Server

Create the following directory: C:\usr\. Then run the server installer, and be sure to install the software in the C:\usr\ location. If you installed the VertrigoServ software, then the “public web” files will be located in C:\usr\www\. So let’s download and install Wordpress inside C:\usr\www\wordpress\ and then be sure to fire the server up after installation.

02. Setup The Database

So we’ll need to have a database created before we can install Wordpress. In your web browser, navigate to http://localhost/phpmyadmin and login. There should be the default user and password if this is your first time. Find it by clicking the VertrigoServ icon in the bottom right tray, and selecting “Help and Readme”. Be sure to change your passwords once you get in. Default login is root/vertrigo.

Now that we’re in PHPmyAdmin, let’s create a database for our local Wordpress install. Type in your desired database name, and hit the “Create” button.

wpdb-create

03. Installing Wordpress

With the database created, we can now input our database details into the wp-config.php file of our WP install.

1
2
3
4
5
6
7
// ** MySQL settings ** //
define('DB_NAME', 'database_name');    // The name of the database from step 2
define('DB_USER', 'root');     // Vertrigo uses root as the default username
define('DB_PASSWORD', 'vertrigo_password'); // the password used to get into your local phpmyadmin
define('DB_HOST', 'localhost');    // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Now we can pull open our browser, and navigate to http://localhost/wordpress and begin the installation of Wordpress.

The http://localhost/ address looks into the \usr\www\ directory. So whatever the name of the directory we installed in, is what we’ll need to punch in after localhost/. For example, if I installed an application in \usr\cms\, I will need to navigate to http://localhost/cms in order to pull up that site.

WordPress Custom Login

June 24, 2008

Just made use of the BM Custom Login plugin. If you’re looking to brand your Wordpress login page, for customers, your company, or for fun, then you’ll want to add this one to your list of default plugins.

And for security reasons, you should also implement the Login Lockdown Plugin.

(flickr)
c.hadcoleman.com custom login

Twitter Plugins for Wordpress

June 18, 2008

As I’ve recently become sucked into the world of Twitter, I’ve found myself searching for the best Twitter plugin for Wordpress. Here is what I’ve found

Twitter Tools

By Alex King – This plugin creates an integration between your WordPress blog and your Twitter account. Pull your tweets into your blog and create new tweets on blog posts and from within WordPress.

  • Advanced options page.
  • Widgetized.
  • Post to twitter directly from your sidebar!
  • Blog entries can become Tweets.
  • Tweets can become blog entries.

Twitter For Wordpress

By Ricardo González – Displays yours latest tweets in your WordPress blog. Much simpler than Twitter Tools.

  • No options page.
  • Widgetized.

Twitter Widget Pro

By Aaron D. Campbell – A widget that properly handles twitter feeds, including @username and link parsing. It supports displaying profiles images, and even lets you control whether to display the time and date of a tweet or how log ago it happened. Requires PHP5.

I decided to go with Twitter Tools as it was the most advanced. I like being able to send out a quick tweet from my sidebar at any moment.