Garden Preview XV: Modules

Views are used to define the main content of a page (ie. a list of discussions, a user profile, etc), but what about all of the other supplementary elements on a page? How does Garden handle adding buttons, menus, and all of the sundry elements that make any page complete? Modules.

Modules are extremely simple classes that have one purpose: return a string. That string can really be anything you want, but typically it will be a string of xhtml that is to be added to any of the asset containers defined in the master view.

Garden comes with a number of predefined modules, such as:

HeadModule: Allows the addition of tags to the head of the document, like link (css) tags, script tags, meta tags, etc.
MenuModule: Used to build a hierarchical menu that can then be manipulated to do a number of different tasks. For example, it is used for the main menu of Garden that includes hover-driven dropdown items, and it also is used for the main settings page as a sidebar menu.
EditInPlaceModule: Can be added to any page in the sidebars, header, or footer and allows administrators to put anything they want into that page by editing the content block in-place.

Commitment

A few months ago I posted about how I went down to Boulder, Colorado to attend open source discussion forum software for a Day. Mark O’Sullivan online is a mentorship-driven seed-stage investment fund. In human terms, it means that they invest a small amount of money in your business and provide mentorship to help you get off the ground in exchange for a small stake in the company.

I stumbled upon TechStars when I decided that it was time to take Vanilla to the next level. Garden and Vanilla 2 were nearing completion, and I realized that without some kind of small investment, I was going to fall back into the pattern of trying to support my open-source efforts by doing side-projects. And inevitably those side-projects become my main project, and Vanilla becomes the side-project in turn. I started emailing and calling everyone I knew asking if they had any ideas for how I might make a real business out of Vanilla. One of my good friends referred me to Jeffrey Kalmikoff at Threadless, and Jeffrey referred me to David Cohen from TechStars.

I honestly didn’t think TechStars was a viable option for me. In my mind I just needed some money so I could continue to develop and pay my monthly bills.

Garden Preview Part VIII: Plugins

Before best open source forum began development on Garden, we spent a lot of time thinking about how to improve upon the plugin architecture adopted for Vanilla 1, and then I spent even more time doing test after test after test to see what really worked. In the end I realized that there can easily be more than one way to accomplish the task, so I’ve adopted a few standards, and I’ve left the code open to new methods of plugging in that some of you may decide to pursue. For now, I’ll talk about four different ways of plugging in.

1. Custom Events

Events are essentially what I mis-named as “delegation” in Vanilla 1. Any class that extends the class “Pluggable” has the ability to call $this->FireEvent('EventName'), and then plugins can attach to that event to perform some kind of operation. There should be no surprises here. There is a PluginManager class that picks up any defined plugins in the bootstrapper file (the file that includes core classes, defines constants, defines configuration settings, etc), and when the FireEvent method is called, it references the PluginManager class to see if there are any plugins that want to attach to the event name being fired.

Garden Preview Part X: User Registration

Depending on the type of website you are building, your user registration needs could vary greatly. You might have a private, friends-only Vanilla installation. You might have a corporate, local-network installation that requires a no-frills setup. You might be a very public site where you need a bot-checker or even human-checking of applicants. Garden covers all of these methods and more. There are five methods for registration that are included in Garden out of the box.

Closed

Simply put, registration is closed. Going to Garden’s registration screen tells you just that. Administrators can then add users manually (and send out welcome emails as they are created) using the user administration screens.

Basic Registration

No frills user registration. Users are prompted to enter their username, email, password, and are granted access immediately after submitting the form.

 

Captcha

Using the free recaptcha.net service, this option allows you to add a captcha anti-bot tool to prove that the person applying is, in fact, a person. Assuming that the user sufficiently proves this, they will be granted access immediately after submitting the form.

 

Approval

Administrative approval is my personally preferred method for granting users access to your site. With this method, after registration, users are added to an “Applicants” list that administrators can then review and choose to approve or deny access.

Magic

I believe there are just a handful of moments in one’s life where you feel the beauty of what it is to be alive.

Even more precious than those are the rare instances where you can share that experience with those you truly love.

Happy Thursday

“Why doesn’t Mark O’Sullivan online blog work anymore” you ask?

It’s not because I have nothing to say. To the contrary, I have plenty of things going on, and many many thoughts keeping me up pontificating at night. No, it’s because of something my father told me many years ago, “Say anything you want, but never put it in writing.”

Of course, my father was referring to things like angry exchanges with an employer. But through my work with Vanilla, I became afraid of over-promising and under-delivering. I decided to not write about anything we were doing until it was done. This practice led into my personal life as well. And before I knew it, I didn’t want to put anything on my blog because the thought that someone might want to debate a point with me made me feel nothing but exhaustion. I figured that if I don’t care to hear another’s opinion, what right did I have to share mine?

Well, as things go, I’m in yet another “transition period” in my life. We all go through them. We cut ourselves a nice groove and ride it for any number of years, and then eventually we begin to vibrate at another level and we decide to either accept our circumstances as they are, or take the responsibility for changing them.

Funny Games

Being in the Halloween spirit, I recently decided to sit down and watch a “scary movie”. I’m not a big fan of scary movies, so this is a rarity for me – and I’ve been waiting for the right time to watch Funny Games – a U.S. remake of the original French Version which I had read a lot about in recent months.

For those of you who haven’t seen it, please stop reading (SPOILER ALERT).

This movie was really not what I was expecting in the least, and I can’t stop thinking about it. My wife sat, terrified, through out the entire movie; while I sat watching it in contemplation – feeling the strange sensation that I’d somehow been through these motions before. Who were these “sociopaths”, and why did they seem to care so little about the lives of those they are hurting? Why don’t they ever sleep? How can one be eating while another shoots a child in the head?

It wasn’t until the scene where the woman gets a hold of the gun and kills one of the two sociopaths that it all came together for me. Shortly after she shoots him, the other sociopath digs around for a remote control and, upon finding it, rewinds the movie back to before she reached for the gun.