Foodizu.com - new website, powered by facebook connect

 

foodizucom-powered-by-facebook-connect.txt

I recently started work on a new website called foodizu.com, this site was built mostly as an experiment in using Facebook Connect to power a website. In this case, this website was a site where you could add recipes, comment on recipes and bookmark recipes that others have added. I decided to make use of a couple different pieces of available technologies:

  1. Facebook Connect for user logins

  2. *Disqus.com *for comments (which also accepts Facebook Connect)

  3. *AddThis.com *for bookmarking off the home page

  4. ShareThis for bookmarking recipes. My reason for doing this was mostly to see how it all handled together. I’m generally the bootstrap type guy, who builds everything from scratch. But for the purpose of this project, I decided to just go with the existing services.

Setting up facebook connect was pretty straight forward. You can build the site itself pretty quickly and they have lots of tips for handling user connections. I also included the ability for people to sign up who didn’t want to use Facebook. One advantage to using facebook, is that you can have facebook notify your friends that you’ve just added a new recipe on the website, by posting it on your newsfeed. This is optional, and entirely up to the user.

In displaying the recipes, I decided to use disqus.com to handle comments, as I could also have that site use facebook connect. I also placed ShareThis on that page to take care of people wanting to bookmark certain recipes.

I probably put in about 20 hours development time on the site. Between the disqus setup, testing the connections to facebook. Configuring user feeds, handling how recipes were posted and displayed, setting up RSS feeds, setting up Pings to feedburner (google now) to update the RSS feeds. So what’s next? Well, I haven’t decided yet, but it should be interesting.

Ok,  as an update, setting disqus to use facebook connect on a site powered by facebook connect just doesn’t work. The two sites actually cancel each other out, so that logging into one, makes the other instead of connect think you are logged into that one, and yet, you are not which means you get issues. End result, is that if you use facebook connect, it’s better to stick to your own comments system. Lesson learned on that one.

 
 

Quick Function: Small Tip When Importing Non-WordPress Powered Sites into WordPress.

 

Recently,  some clients of mine decided to move a site that was fairly established on it’s own platform to wordpress.

So I was faced with importing all the old articles into wordpress.

For the import, I decided to set up an RSS feed that contained the content, and so I imported all articles to the new system. But then, we found a problem. The old site, used article.php?id=ARTICLEID, whereas the new site used /article-name so if you went to an article from the old site, you got a 404 error. This caused a problem when the site sent out thousands of emails a day, and was used as a central area of conversation for it’s industry.

We were faced with setting up 301 redirects for over 2000 articles, or finding another solution.

After some research and testing, I noticed that wordpress stores the original article’s address as the new article’s permalink during the import. So we wrote a quick little function that could check for old article references.

function redirect_fix() {
    global $wpdb;
    if ( isset($_GET['id']) || $_SERVER['QUERY_STRING'] != "" || substr($_SERVER['REQUEST_URI'],-1) == "?") {
        $likestr = "?id=".$_GET['id'];
        $likestra = explode("#",$likestr);
        $likestr = $likestra[0];
        $querystr = "SELECT wposts.* FROM $wpdb->posts AS wposts WHERE wposts.guid LIKE '%".$likestr."'";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        foreach ($pageposts as $post){
            $url = get_permalink($post->ID);
            if( count($likestra) > 0) $url .= "#".$likestra[1];
            wp_redirect($url,301);
            exit;
        }
    }
}
add_action('plugins_loaded','redirect_fix',0);

I placed this in the functions.php file of our theme, and set it to work. Now, whenever someone goes to the site using an old URL, they are given a 301 redirect to the new URL. Since we put this fix live over a month ago, we have had no problems with the site.

This tip is just something to show you an idea for handling importing an old established site into wordpress and how to address some of the issues that can come up. This method has worked well for me on the site I used it with, and may help you out later too.

To change it for your needs, change the reference to id to whatever field your site used to use. so that if you used to have a site that called article as the id tag, then you would replace references to “id” with “article”, as shown below:

function redirect_fix() {
    global $wpdb;
    if ( isset($_GET['article']) || $_SERVER['QUERY_STRING'] != "" || substr($_SERVER['REQUEST_URI'],-1) == "?") {
        $likestr = "?article=".$_GET['article'];
        $likestra = explode("#",$likestr);
        $likestr = $likestra[0];
        $querystr = "SELECT wposts.* FROM $wpdb->posts AS wposts WHERE wposts.guid LIKE '%".$likestr."'";
        $pageposts = $wpdb->get_results($querystr, OBJECT);
        foreach ($pageposts as $post){
            $url = get_permalink($post->ID);
            if( count($likestra) > 0) $url .= "#".$likestra[1];
            wp_redirect($url,301);
            exit;
        }
    }
}
add_action('plugins_loaded','redirect_fix',0);

It’s that simple to address, and has worked well. Since then I’ve used this trick on my own blog when I merged 360affiliate.com with this blog.

 
 

Server move

 

Ok, so if you’re seeing this, then the site is now live on it’s new server. I made up my mind recently to move more of my sites onto my mediatemple account, since I want to keep my sites grouped together, blogs on one server, other sites on another server, etc. It was a bit of a rocky start as mediatemple had some issues at the same time, but it seems to be fine now. Will give it a couple days before I start to move the others over.

 
 

So far…

 

Well, so far I have moved a few more sites onto mediatemple and no problems yet so i’ll start the rest of the move shortly. In moving quickpipe, I also decided to start a on new look for the site, it’s not finished yet, but it’s coming along pretty good. Once the new template is done, I have a couple new features planned for the site which will be showing up pretty quickly. Otherwise, that’s about it.

 
 

New WordPress plugin: newsPage

 

newspage.txt

This past week, I redid the design for QuickPipe.com, and one of the things I wanted to add was an Industry News section. I thought about just making a page that was part of the template, but then I decided that I wanted to control the RSS feeds from the backend, so that began my work on this new plugin. newsPage is an RSS feed aggregator much like PopUrls or AllTop, two pretty popular web sites. This topic has been looked at before by lots of websites and it wasn’t something I was trying to repeat. What I was trying to repeat, was the idea of being able to give people a way to quickly turn sections of their blogs into news aggregation pages. You could easily use this plugin to make a website similiar to PopUrls, or you could use it to make a page that has all your industry news. There’s some more functionality I’ll be adding later, but this is the initial beta release, and it’s one I’m pleased with so far.

View demo download files