Platform developing

So I’ve been working on rewriting my code into almost like a turnkey website sort of thing where i can easily install it on other websites. But I’m not quite sure of the best way to do it. But one thing that’s really made a lot of decisions easier is Smarty. Man I can keep the display component completely separate. Totally awesome. Unfortunately, you can’t define multiple template directories. I was hoping to keep all art gallery stuff in one folder, all profile stuff in another folder, etc. But then again, keeping all the templates in one folder may make sense if you want to make it so the designer can only access the template files.

jQuery has been really helpful as well. It’s been really quick to turn an app into an ajax one. Damnit I love Ajax. And I’ve been playing around with jQuery UI which has some nifty features too. I hope to convert all my ajax stuff from Sarissa to jQuery.

It’s really hard to organize everything though. It may make sense to keep everything related to a component (such as art gallery, photo gallery, web page cms, profile) in its own folder. In that folder would be the php class, php pages, template files, JS, CSS. But it’s hard to do that. Sure you could put all the JS together in one folder, all the PHP in another, etc. But then when you need to install a component in another site you gotta copy paste stuff into like 5 different folders rather than just copying one folder.

Still trying to figure it out. Maybe it shouldn’t be componentized. Maybe everytime I install my software on a site they get all the components. I dunno. I need help with this one.

 

Tried out Smarty Templates

 Just about every PHP programmer has heard of or used Smarty Templates.

I had heard of it a long time ago, but only just recently started using it. For the longest time, I have been using good old phpLib’s Template.inc. It is simple and suits most of my needs. But it’s quite old. I’ve been using it for like 7 years.

A colleague of mine convinced me to try out Smarty. I used it to create a new RSS feature for PaperDemon.com’s blogs (and also added an RSS feed for my blog on BogusRed.net as well, subscribe to me!). I did it using Smarty because it seamed like a good thing to templatize and also because Smarty has a really good caching system. So if people’s RSS readers are constantly pinging the RSS feed pages, the PHP won’t have to pull from the database every time. +1 for performance!

 

Learn the libraries or reinvent the wheel?

For the most part of my time working with PHP, I’ve done things my own way. I don’t use a lot of libraries or read too many articles or books about how to "correctly" develop web applications. I know that most developers stay up to date with the latest libraries that help alot with development. There are also a lot of premade free packages out there that can give you a content management system in minutes such as Word Press. And there are probably a lot of things I’m doing wrong since I’m self taught. Yet I’m still doing my own thing and dread the idea of doing it any other way.

And for a long time I felt like I was an inferior web developer because I wasn’t taking that approach to web development. It’s like I’m reinventing the wheel, the same wheel thousands of other developers have already made.

But an interesting thought occured to me today. With music, I typically don’t like to read sheet music when I play the piano, despite being fairly quick at sight reading. I’d rather figure out the notes myself by ear and then rearrange the music in a different way. And when I do it this way, I understand the music far more than if I had learned it through sheets and it becomes more enjoyable to play.

So maybe that’s my nature; figuring it out for myself. Maybe it’s because I’m a creative person. It seems more fun to me to build an app myself rather than just downloading an existing app and customizing it or plugging in this library with that library.

So here’s to all you reinventers of the wheel out there!


But I make an exception for Javascript. It’s too much of a pain in the ass to write it myself and I’m going to use jQuery to do all the heavy lifting. F*** you, you stupid DOM and your stupid nuance differences in browsers! I HATE writing Javascript!

 

Latest project happenings

So back in November, I mentioned I’d be dedicating myself to Webdev for at least 6 months before returning to my Multimedia projects. Here’s a quick look at the in-progress webdev projects I have completed, have in progress, and future planned projects.

Completed Projects

UTF-8 – I migrated the site to UTF-8 back in late November. This is something that needed to be done since I will be developing more XML based apps.

REDESIGN – I just finished a visual redesign of PaperDemon.com template. It’s not a major overhaul but it does resolve a few issues that I had with the older layout. It’s mainly a change to the header and footer and a few color tweaks.

REFERRALS – Just created a new referral system the other day on PD that allows members to recruite newbies and get free premium accounts. I’ve done this in an effort to increase traffic and activity (and hopefully increase ad revenue).

In Progress Projects

ADVERTISEMENTS – I’m also working on adding more advertisements to PD, particularly adding adult ads in the Red Curtain. My hosting costs far outweight the ad revenue and I’m hoping to change that now that I have a mortgage to pay (just bought a house, whoo!).

AJAX COMMENTS – The commenting system is something I’m working on a major rewrite of. I rewrote it to be more exportable and have made it an XML based output with XSL and AJAX using jquery stuffs. It’s nearly done but I’ve run into a snag with the jquery ajax image uploader. This project started out as a good candidate for experimenting with XML/XSLT based reusable system but ended up being more complex than I thought and is taking forever to finish.

GALLERIES UI – The galleries system for artwork on PD right now has been very confusing for a lot of users. I’m working on a new interface and reorganization of the gallery trees. Not sure when I’ll have this done but I’m hoping to have it done by end of February.

WEB PAGE CMS – I’m in need of a simple yet flexible content management system for web page content for the ShrunkenHeadMan club at SJSU. I’ve started work on this and am about half way through. Content is stored in a database but is served in XML and converted to HTML via XSLT. It allows for multiple layouts and uses YUI Grids for the layouts. It also archives past edits of a page.

SHM REDESIGN – working with the SHM webmaster and have developed a new template for the site. Working on implementing the new template now and should be done within the next couple weeks.

Future Projects

MEMBERS/LOGIN/PROFILE REWRITE – the code for member logins, profiles, etc is my oldest code and is just a huge mess. I can’t easily plug it in to my other projects. I’m rewriting this one and want to make the profile thing xml/xslt based so it can easily be customized for my other sites like PaperDemonMedia, SHM, and a family site that I want to start soon.

PHOTO GALLERY – I’m going to rewrite my simple photo gallery that is used on PD and add a couple features like albums and upload from picasa. Will use this for the family site and for SHM.

FAMILY SITE – once all of my code is rewritten for better reusability and customization, i want to create a new site that uses all my existing software just for my family to post photos and connect with each other. I might integrate it with other apps such as twitter and facebook.

 

As you can see, I have a lot going on. I jump around from project to project. I’m thinking 6 months isn’t enough time. It’s already been more than 2. Well, back to work.