Code Igniter PHP Framework

October 25, 07 by kenrich

Code Igniter PHP FrameworkAfter reading some discussion on the PHP mailing list, I noticed a lot of people were recommending the Code Igniter framework. So I decided to do myself a favor and go check it out. Code Igniter is a very lightweight PHP framework for building web applications.

So far, I’ve just been reading the documentation to get a feel for how it works. It has some nice URL rewriting features to help your site rate well in the search engines. It also uses a lot of object-oriented methodologies to manage code modules. I really like the fact that it comes with a lot of helper classes to do common things like build HTML code. This was one thing I had built into my own framework.

It uses a helper class to access the database as well. I’m not sure if this is beneficial or not because there appears to be some limitations in how you can use it.

Some people think that PHP is not ready for the enterprise because it lacks the backing of a major corporation and doesn’t have the support that some of the big players have. I have been developing for over 3 years now and I can tell you that’s just not the case.
If you are just starting out in PHP, I think the Code Igniter framework like this is just the ticket to get you started creating powerful web applications. Of course, a knowledge of MySQL database would definitely be a major plus.

San Diego Fire Storm 2007

October 23, 07 by kenrich

As you probably know, yesterday was one of the worst days for the San Diego firestorm. Our area was evacuated in the afternoon as a precaution. The fire has burned more than 130,000 acres and more than 1000 homes have burned down in the San Diego area alone. Our house was not affected since we were lucky and not in the path of danger.

My parents who live in Poway were nearly hit by the Witch fire which went through Poway. The firefighters did an excellent job of controlling the fire (as much they could due to the Santa Ana conditions we have here.) I’m looking forward to all of the fires being out soon. I hope this is the last of the big fires. Like most of the other areas of the country, San Diego has been experiencing a drought. We sure could use some rain in this area.

I’m looking forward to things getting back to normal. I should be going back to work tomorrow (barring any drastic change in the fire.) I need to catch up on a few projects that I left unfinished.

Welcome to Our New Blog

October 18, 07 by kenrich

Wordpress LogoI decided to move my blog to a new software. I switched from Movable Type to WordPress which seems to be the most popular browser these days. Maybe I’ll get back into writing more articles on the site. Recently, I’ve been pretty busy and just letting the whole blogging thing slide. I don’t have a large readership after all. This re-designed blog also represents a change in hosting to a load-balanced host with an enterprise-quality database back end.

Since I do need to keep on top of things, I really should be familiar with the most popular blogging platform. At least it is the most popular if you are going to host your blog yourself and not pay for a service like bloggger.com. Plus,

Another benefit is that this type of blog (with the theme I have installed) should make the entries much more readable. By that I mean the size of the text and the whitespace to format the articles is easier on the eyes. It may be rather boring to look at, but if you are a technical person like myself, you won’t really care too much for the frills and cutting-edge design.

Creating Theme Support for Our CMS

March 04, 07 by kenrich

I am trying to develop a themes module for my new PHP intranet that will allow me to easily install themes. I plan to create an update site which holds all of the available themes. Each theme will be identified by an XML descriptor file which contains all of the properties for the theme. On the update site, a service will scan all of the folders on the site and parse all of the XML descriptor files. The theme information will then be collected and summarized then stored in a global themes file. This way, when someone does an update, they can just retrieve one file from the update server to build a list of available themes to download.

I’m thinking of having two different types of themes. One set of themes will be for the public site while the other will be strictly for the control panel. Users are free to mix and match themes so that the theme for the public site doesn’t need to match the one used on the control panel. Although they share a lot of the same components, it’s better to keep them separate so there is no confusion over what elements are specific to the public and which elements are specific to the control panel (and which elements are shared by both.)

Another feature I would like to have is the ability to customize a theme. So if a user doesn’t like one particular aspect of the theme, they can use a web-based theme editor to tweak the parts that they wish to improve. This should provide maximum flexibility when working with themes. I’m really hoping to get the theme support done quickly so I can open up the demo site to everyone.

Configuration Settings on a CMS

March 01, 07 by kenrich

I’m in the process of developing the next generation Orvado Intranet application. Technically, it’s a which will be used to build and manage very dynamic websites. I have designed a database for universal configuration settings which can be used across all modules but now I need to determine how the settings will be accessed.

In the past I’ve used a system where the settings would be accessible from each page of the control panel. This makes the settings easily accessible and relevant to the current section you are in. The only problem with this setup is that you don’t see all of the configuration settings in one place.

We could put all of the settings for each module in one common area. However, this would require that users navigate away from the section they are currently in to make changes. Then, once their changes are complete, they would have to navigate back to the section they came from. Not the ideal situation.

Another issue I’d like to address is having global settings for the entire site. These are settings that are not specific to on specific module or feature on the site. Usually, I’d put these settings on the home page of the control panel or in a special Configuration area of the site.

I think I’ll put the settings in both areas. Make all of the configuration settings accessible from a centralized location and also make module-specific settings appear in their related sections. This should provide the best of both worlds and (hopefully) won’t be too confusing for the operators.

Tragic Errors by President Bush in Iraq

January 12, 07 by kenrich

As Iraq is quickly sliding deeper and deeper into chaos, President Bush has made no substantial effort to listen to his military advisers, congress or the American people. Iraq has already shown a reluctance to fulfill its obligations in policing itself. It barely polices its capitol city, Baghdad, much less the entire country. It’s as if Iraq is milking the United States for everything its got, much like the terrorists are trying to bring our great country to economic ruin. It’s the same tactic the Taliban used in Afghanistan against the Soviet Union. As the war nears the 4 year mark it is time to reflect and take stock of the situation. Over 3000 U.S. soldiers killed, plus many more wounded. More than 25,000 innocent Iraqi civilians killed. The escalation of troops proposed by President Bush has already been tried twice before. It’s a flawed policy that is doomed to fail. The Bush Administration needs to heed the recommendations of the Iraq Study Group and begin the real task of healing Iraq. His misguided notion of bringing democracy and freedom to the Middle East are largely meaningless in the Arab world. You might as well ask them to change their religion.

I’ve submitted my opinion to my local newspaper. It is imperative that the American people take action. Please take the time to convey your opinion to your local media, your local congressmen and all of your friends and family. I don’t want to see my children grow up in world bogged down in World War III. Our country has long been a moral standard for the rest of the world to follow. Thanks to our current administration, it has become the laughing stock of the entire world.

Nintendo Wii and PS3 Bundles Suck Eggs

December 19, 06 by kenrich

I’ve been following the craziness surrounding the sales of the two new video game consoles (the and the .) I know have other made this same comment but I want to stress how unfair the situation has become. I had been considering buying a console, but now I think I’ll wait another year.

Long gone are the days when you could pick up a console for $125 bucks and get a free game bundled. Actually, this is not entirely true because the Wii does come for $250 and it includes a bundled game. The one difference being that they bumped up the price to pay for the game instead of just selling it for $200. In light of the shortages, I guess this is a good business decision.

I’m sick of all of these Customer’s Choice or Gamer’s Choice bundles that everyone seems to be offering. The only way to get a console is to shell out $800 for a Wii or $1100 for a PS3. I doubt that either of these would be chosen by the average customer or a gamer. It is just another way greedy corporations are trying to take advantage of the consumer. If you really want a game system for the holidays, why not buy yourself a Nintendo DS or a playstation 2 to hold yourself over until supplies are plentiful and these ridiculous bundles are shunned into non-existance.

I’ve become so frustrated with the situation, I’ve decided to wait another 6 months. By then, at least we’ll know which system is really going to dominate the marketplace. By then we should see a major price drop in current generation systems (especially true for the XBox 360). Also, it will benefit the consumer greatly to know which system is going to serve their customers better and provide the most compelling features. So far, the odds look to be in favor of the Nintendo Wii (very few hardware issues and the most bang for the dollar).

American Values are Under Attack

November 06, 06 by kenrich

The mid-term are just one more day away. I want to encourage everyone to get out and vote. It is your civic duty and responsibility. We as a country can not progress unless we participate in our democracy and make positive changes in our federal government.

I personally feel we are getting bogged down in a . This is much less a war than an occupation. The enemy only exists because of our occupation. If we didn’t maintain a presence in Iraq, then there wouldn’t be any “war” to speak of. It’s time to get the train back on track and make positive strides in Iraq.

George Bush’s idea of taking the war to the enemy is a false one. This war was fabricated and manufactured by the Republican administration. It was started to help out the people who helped get Bush into power. The first goal was to ensure a stable supply of oil to the oil industries in the United States. An added benefit was the defense and civil engineering contracts which were doled out to Bush’s friends.

Lastly, I think this war was designed to distract from major changes the Bush administration has made to income taxes, health care (medicare) and social security, student loans and immigration. By sowing fear into the hearts of our citizens, Bush has attempted to energize this country into shifting more power to the executive and shift fortunes from the middle class to the super rich (ie: large corporations and big government).

Remember what this administration has done for you. Remember Hurricane Katrina. Remember the inadequate armor and supplies for our troops. Remember privatizing social security. Remember Osama Bin Laden (oh yeah, we didn’t forget about him). Remember Abu Gharaib. Remember Harriet Miers (supreme court nominee). Remember Scott Abramhoff, Robert Frist, Bob Ney, Donald Rumsfeld, Dick (shooting accident) Cheney, Karl Rove and Scott Foley. Remember all of the concessions Republicans have made in the Congress and Senate (there have been NONE). Remember how they manipulated the elections by phone jamming schemes, disenfranchising African-American voters and Katherine Harris forcing a recount in Florida.

Lastly, remember the paltry $500 tax relieve Bush gave us and remember the tax windfall that billionaire CEOs (all Republicans received). Wages have remained flat while inflation has increased our cost-of-living. The national surplus has been turned into a massive national deficit has exploded and is now at 8.6 trillion dollars. Let me write this out to make this clear: $8,604,232,678,606. With the current population of the United States at 300 million, this means that each citizens share of this debt (which will have to be paid back) is a staggering $28,665!

If you disagree with what I’ve said then be all means get out and vote. Even if you agree with what I’ve said, it’s imperative that you get out and vote. In the past two major elections, people have voted for moral values and family security. Sadly, the way the vote turned has been detrimental to both of these essential values. Now is the time for you to correct our country and live up to the ideals of our founding fathers. Protect our constitution and restore dignity to American values.

Firefox 2.0 – The Best Browser Around

October 27, 06 by kenrich

The other day, I just installed Firefox 2.0 to try it out on my machine. I am pretty impressed with the new browser although it isn’t a while lot different from the previous version. I had a problem with installing it the first time because when I tried to close my old Firefox, it appeared to close but it was actually still running when I installed. This caused all sorts of problems with the install such as missing images on the setup dialog and having all of my bookmarks disappear.

So I did the smart thing and uninstalled the application and then re-installed. This fixed all of the problems I was experiencing. I was disappointed that my favorite theme (Qute 3.1) was not supported in the new browser, however, I am able to enjoy the new default theme which matches the new Windows Vista interface quite nicely. My bookmark synchronizer also hasn’t been ported to the new browser. These issues are to be expected since the browser was only just released a couple of days ago.

I would definitely recommend doing some user tweaks to the browser after you first get it installed. I found some good tweaks from the developer site dzone.com. They include disabling the browser pre-fetch which attempts to pre-load pages that are linked to the page you are viewing. You can also tweak the amount of memory that Firefox uses and the behavior of the tab close buttons (which are changed in 2.0).

One of my favorite tweaks is the built-in spell checker which will check any typing you do in web forms. All text fields are checked in real time as you type. If you mis-spell a word, the word will be underlined in red. By right-clicking on the word, you can pick a suggested corrected spelling or you can add the word to the dictionary if you know it’s correct and shouldn’t be flagged as mis-spelled.

I recommend that you give this excellent program a try. Internet Explorer is introducing IE 7 which contains a lot of similar features. The benefits of Firefox is that it is more secure (since hackers don’t target it as much as IE). It has an excellent skinable architecture with it’s themes support and the add-ons and extensions allow you to customize it to do whatever you like. I rate this software 5 out of 5 stars.

Comparing ASP to PHP Includes

September 10, 06 by kenrich

When comparing PHP scripts to Active Server Pages, there is a huge difference between the way you use include files. When using ASP, you either have to use Server-Side Includes or the Server.Execute statement to include one script inside another. In PHP, you have a lot more options. You can use “include”, “require” or “require_once” to include a file.

One of the shortcomings of Server-Sidie includes is that you cannot include a file more than once. This causes problems when you want to do a conditional include. In most cases, you will only need to include a filie once. One case where you might want to include a file twice is an admin login check. With such a script, you would check to see if the user is logged in and if not, you would display the login form. Because you want to include a header and footer in the login include and also include the header and footer on any admin page that includes the login check, you will need to include the header and footer twice.

If you declare any variables, constants, classes or functions in the header or footer, you won’t be allowed to include the file more than once. This would give you a “variable already declared” error. Even if the code is contained in a conditiona “if-then” statement, the parser will still process all of the code statements and recognize the duplicate variable declaration. You could used the Server.Execute statement but when you do this, the file is not truly included within the context of the current script. Instead, the script is executed standalone, and the output from that script is inserted into the current script.

PHP eliminates a lot of these problems by providing truly conditional includes. When you put an include statement within an “If then” statement, the code will not be processed until the script is evaluated and the condition is met. This eliminates the problem with redeclaring variabels inside header and footer. Additionally, PHP provides a new statement called “require_once”. This statement ensures that an include statement is only included once. Only when the require_once statement is first encountered, does each unique include file get included.