Subscribe

Or get daily updates via email:

Latest Twitter Update

@ThatLeeGuy Yep, we're on it. Thanks. 12 hours ago

Search

My Other Work Online

Learn How to Build a Website with ExpressionEngine

Recent Writing/Links

Older & Archived

Podcast Free America

EE Insider

January 05, 2009

This morning I launched EE Insider, a website created to share news and tutorials on developing websites with ExpressionEngine.

EE Insider logo

If you’ve been following along for the last 6 months, you know I’m also the creator of the popular EE Screencasts, a series of video tutorials that build a website from beginning to end with ExpressionEngine. So, I see EE Insider as a natural next step in my part of building a mature community where people can access quality information about ExpressionEngine.

This first edition of the site consists of three main areas: Blog entries keeping track of EE news and releases, ExpressionEngine How-to articles that will help you become an EE ninja and ExpressionEngine Video Tutorials (free ones and paid videos via PragProg) that will show you different techniques for building websites with EE.

Additionally, the EE Help Chat now makes it home at EE Insider.

And now for some credits: Obviously, the site was built in ExpressionEngine, but there were some key people that helped me. Thanks go to Greg Storey for the core design and help the entire way, Luke Dorny for his invaluable feedback and keen eye for usability, Jim Renaud, Brian Warren and Jeremy Floyd for their feedback and suggestions. An extra special Thank You goes to Mike Clark for all of his ideas (like the domain name) and help over the last 6 months.

Perfume

December 19, 2008

Venetian

Hallway in the Venetian Hotel, Las Vegas.

  • Photography, and the Tolerance for Courageous Sucking - Is it just me or has Merlin’s writing become more interesting and insightful over the last month? I link to this article, sure, but go back and read the last three or four. Totally worth the time it takes. Also, watch all of the George Carlin videos he talks about. Free, on YouTube. And then come back and tell me how much they rock. (-)
  • Is Vinyl the new CD? - I used to actively collect it but haven’t in more than 5 years. Probably should break out those original Rolling Stones West German pressings I have.  (-)
  • $10 Posters - My Associate Cornelius cuts the prices on their excellent concert posters. (-)
  • 25% Off the EE Screencasts - PragProg is having a one-day “Black Friday” sale. 25% off pretty much everything in the store (books, screencasts, PDFs). Great way to stock up on goodies for the holidays. Did I mention the EE Screencast series is part of this? Save more than $15 when you buy the entire series. (-)
  • It’s not the reader’s job to unsubscribe from an old feed and subscribe to a new one. Last time I checked a 301 Redirect took 3 seconds to implement. Making it hard for your readers to get your content is dumb, dumb, dumb. (-)
  • Dear IE6 - Fun Twitter app that lets you bid (or wish) farewell to IE 6. (Technical note: built on CodeIgniter). (-)
  • Frenzic for iPhone - I’ve been beta testing this app and it is awesome. Great way to keep your brain active during intermittent downtime. (-)

Case Study: Social Networking with ExpressionEngine, Part 2

November 21, 2008

In this part of the short series of articles on my experience building social networking tools for ExpressionEngine, I will be focusing on the “Friending” functionality built for the Clinician1 website (see previous article on the Networks module for more information).

Along with the ability for users to join networks, the client also required that users are able to connect individually as “colleagues.” This is, as you probably know, basic functionality for any social networking website. We’re not breaking new ground here...except that this type of functionality isn’t built-in to ExpressionEngine.

Well, that isn’t entirely true. There is something in ExpressionEngine called Buddy List (it is mentioned once in the documentation) and is available to users on the default EE My Account template. It’s located under Private Messages and allows you to add other members to a Buddy List.

EE My Account Buddy List

I could have re-used some of that functionality, but, honestly, it was a lot easier to just build the module from scratch. If I used the Buddy List, I still needed to abstract that out to the front-end templates and add some necessary features (every friend request requires approval, as one example). So, my decision was to not use the Buddy List feature and instead create the Friends module.

Friend module listing in EE control panel

The Friends module has one database table, exp_friends, which stores all of the relationships and a status for each relationship (If a user “friends” someone, that relationship isn’t automatically reciprocated. The receiving user has to approve that person as a friend for it be added) and a timestamp should we ever need it in the future.

The EE code for the module is very similar to that of the Network module. To show a list of the currently logged-in user’s friends, their avatars and a button to remove them as friends :

{exp:friends:show}
 {avatar_image}
 {name}
 {remove}
{/exp:friends:show}

This code produces something like this on the Clinician1 website (screenshot from static templates, so as to not reveal actual user information):

screenshot of friends listing

A nice overview of the user’s friends with name and avatar and an action button in case you’d like to drop them.

All Clinician1 members can access the profiles of other members and from there add them as friends. For this I created a simple profile tag that outputs a button to add the friend. The code looks like this:

{exp:friends:profile}
 {add_friend}
{/exp:friends:profile}

In a member profile this code produces the “Add as Colleague” button in the screenshot below. I also used it in member search results, so users could easily add a friend right from the search results.

member profile screenshot

Earlier I mentioned that every time someone adds a friend it generates a friend request that sends an email to the person being “friended.” All users have the ability to approve friend requests and we do that using the following code:

{exp:friends:requests}
 {name}
 {avatar_image}
 {approve}
{/exp:friends:requests}

The display is very similar the screenshot of the friend listing but instead of an “Remove” button there is an “Approve” button.

For the Friends module I didn’t build a control panel interface to manage relationships because it was something that was needed for this project and I’m not sure the practicality of managing those types of relationships from an administrative perspective.

Combined with the Network module I wrote about in Part 1, Clinician1 has a nice set of simple social networking tools that allow members to connect and find others with similar interests.

Case Study: Social Networking with ExpressionEngine, Part 1

November 13, 2008

Last week Greg posted to the Airbag blog detailing some recent projects that were hatched by Team Airbag. I thought I would point out (again, as Greg did mention this in the comments of his write-up) that three of those projects were developed on ExpressionEngine. However, I’d like to talk about just one of them right now: Clinician1.

Clinician 1 Logo in Header of Website

Clinician1 came to Airbag with the task of building a community website for Physician Assistants. A large part of the site is based around content from members of the community, comments on that content and responses to polls.

ExpressionEngine is a great tool to manage content, allow commenting on content and dozens of other ways of interacting with the content (ratings, saving or favoriting, tagging) using third party add-ons. But the client also wanted some more traditional social networking features: groups and friends. Every user had to have the ability to join a topical group and add other users as friends (in the case of Clinician1, they were called “colleagues").

I pondered all of the ways I could implement this by cobbling together existing ExpressionEngine functionality and ultimately decided it would be easier to write both of the social networking tools from scratch, as custom modules. It was time consuming but proved easier in the long run because I have exact control over how these features act. Another benefit of going custom is that I maintain the ability to add new features to the modules and refine existing ones, based on client needs. This wouldn’t have been the case if I hacked together existing add-ons.

I created two modules: a Networks module and a Friends module. These modules are not available for download (but maybe one day), but I do want to walk through a few examples of how they are used in the templates. This part of the series we will talk about the Networks module.

Let’s start with some EE code, shall we?

{exp:networks:show type="all"}
Network name: {name}
Network Description: {description}
{join}
{/exp:networks:show}

This is the basic networks tag pair that lists out all of the networks in the system. It displays the name, the description and then a button to join the network. The tag pair accepts the “type” parameter, which can have the value of “all” or “user.” If you give it the “user” value, the module will only return networks of which the currently logged-in user is a member.

Joining a group or network

For a list of groups or networks that the user is already a member of, we use the “user” parameter and a single variable to create a button to leave the group.

{exp:networks:show type="user"}
Network name: {name}
{leave}
{/exp:networks:show}

Leaving a group or network

There’s also the option of adding the count of network members using the {count} variable inside of the networks:show tag pair, as well as creating a permalink ({permalink}) to view the network detail page.

I also created the functionality to display a list of all members from a certain group:

{exp:networks:member_list network="1"}
{ screen_name }
{/exp:networks:member_list}

as well as a way for users to create their own groups (and automatically join the new group they just created). Group creation in Clinician1 is currently restricted to the control panel and admin users, but the functionality was built to allow anyone to create a new group.

In the ExpressionEngine control panel, the networks are accessible, allowing the administrator to create new networks, edit existing networks (just the name and description) and delete networks.

Administering Networks from the Control Panel

Finally, I also added simple search functionality, so the users could search for groups to join. This isn’t part of the initial Clinician1 website, but the ability is there should it ever be needed.

This brief look at the Networks module ends Part 1 of this case study on social networking with ExpressionEngine. Next up is the Friends module, which allows users to create one-on-one connections with other members of the community. 

Automate OmniFocus Tasks from Basecamp To-Dos

November 10, 2008

I’m sure that I am one of many people who rely on both OmniFocus and Basecamp in their day-to-day work and task management. One of the things missing for me was a fairly automated way of getting To-dos out of Basecamp and into OmniFocus as tasks.

There is a built-in way to funnel emails from Apple Mail to OmniFocus as tasks, but the script sets the email subject as the task name. Unfortunately, Basecamp uses a generic subject line ([ABC Project] To-do item assigned to you) and therefore the task name that is created in OmniFocus is useless. I created this AppleScript so that we could get new tasks with proper names based on to-dos in Basecamp.

Getting the Script

Screen grab of script code

It’s as easy as downloading the file BasecampTodosToOmniFocus.zip, unzipping it and placing it in your user’s scripts directory (~/Library/Scripts).

Setting up the Mail Rule

Now we need to create the rule in Apple Mail so it filters email messages based on the subject line and then processes matches using the AppleScript we just downloaded.

Go to Preferences in Mail and choose Rules. Add a new rule called “Send Basecamp To-dos to OmniFocus.”

There is only one condition and it should be if the email subject contains “To-do item assigned to you.” There are two actions that need to be set. The first is “Run AppleScript” and then input the path to the script (mine is ~/Library/Scripts/Mail Scripts/BasecampTodosToOmniFocus) and then set the last action to be “Stop Evaluating Rules.” This lets Mail know that it shouldn’t use any other rules to process matching messages.

Setting up Mail rule for OmniFocus To-dos

Testing, testing 123

The final step is test to make sure the script is working properly. You can do this by creating a to-do in Basecamp and sending the email. However, I don’t believe you’re able to send emails to yourself if you create a to-do and assign it to yourself. So, you may want to ask someone else on your team to create a to-do assigned to you. You can also test by right-clicking on an existing Basecamp to-do message and choosing “Apply Rules.” Whichever method you use, it should result in a new task appearing in your OmniFocus inbox. The task name should be the name of the to-do item.

Sample Item added to OmniFocus inbox

And that’s it! The upside of this method is that it’s simple. The downside is that if someone assigns you a to-do in Basecamp and does not opt to send an email this solution never has a chance to be implemented.

Show and Tell

Want to follow along as I set this script up, step-by-step? Watch the 4m30s long screencast:

screenshot of screencast on installing applescript