Posts made in August, 2009

Combustion Logo Concept

Combustion Logo Concept

Got bored and thought it would be cool to create an inspirational brand-name design for my Combustion project.

read more

Combustion – A CodeIgniter CMS

Reading around the www for any existing medium-scale CodeIgniter based CMS and I came across one.

It was by Elliot Haughin and the topic was found here on his public blog. I was impressed by his willingness to get something out there for us avid CodeIgniter developers to use!

He called his project CodeIgnition at launch, and eventually became Blaze. However it seems he has taken it down. It started as a simple proof-of-concept project and by the first release candidate/beta, he stated on his blog it wasn’t exactly the way he felt it should be. Also CodeIgniter will most likely be bringing out a new version post-launch of EE 2.0 .

Well, I’ve decided to take the inspiration he had seem to have at the beginning of the project and create my own version of a CodeIgniter CMS dubbed “Combustion”.

It will be designed with the ideal in mind that fellow developers will use it for commissions, therefore easily change out the copyright tags to read the designer of the site. I won’t require anyone to keep my name or site on the visible copyright, just in the source. Something I’ve been looking for, for quite some time now is an easily implemented CMS that does the basics and can be expanded by a series of self-writ modules (or from a library of modules/controllers/libs from CI Wiki, lol).

I’ll keep everyone in the loop who is interested.

If anyone out there wants to start a collaborative project on this, get in contact with me! I’ll even take a back seat position if a project is already started.

read more

Language Class – Database

Well, the other day I was looking around in CodeIgniter’s User Guide, and noticed it utilized a simple dynamic language class.

Well, as great as that is… not everyone on the sites I’m using CodeIgniter on is a developer, or even has any knowledge/access to change these files.

So I go to thinking… and eureka! Make it so that if the file_system can’t find the text called, than look in a database table.


Step 1: Create the Table


We’re going to have to create a table in order for the language to be thrown on to.

-- ----------------------------
-- Table structure for language
-- ----------------------------
CREATE TABLE `language`
(
 `id` INT(10) NOT NULL auto_increment,
 `key` VARCHAR(255) collate utf8_unicode_ci NOT NULL,
 `language` VARCHAR(255) collate utf8_unicode_ci NOT NULL DEFAULT 'english',
 `set` VARCHAR(255) collate utf8_unicode_ci DEFAULT NULL,
 `text` longtext collate utf8_unicode_ci,
 PRIMARY KEY (`id`)
)
ENGINE = MyISAM AUTO_INCREMENT = 1 DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci CHECKSUM = 1

Feel free to tweak this how you see fit… though keep in mind you will have to change the object or array calls in the class to reflect it.

Now download and install this file into your ../application/libraries/ directory, and make sure that the MY_ on both the file name and the class is what your …/application/config/config.php :: subclass_prefix is set to. (MY_ is default)

Class MY_Language extends CI_Language {
	var $language	= array();
	var $is_loaded	= array();
	var $idiom;
	var $set;
	var $line;
	var $CI;
	function __construct()
	{
		parent::CI_Language();
	}
	/**
	 * Load a language file
	 *
	 * @access	public
	 * @param	mixed	the name of the language file to be loaded. Can be an array
	 * @param	string	the language (english, etc.)
	 * @return	mixed
	 */
	function load($langfile = '', $idiom = '', $return = FALSE)
	{
		// Calling early before CI reformats them
		$this->set = $langfile;
		$this->idiom = $idiom;
		$langfile = str_replace(EXT, '', str_replace('_lang.', '', $langfile)).'_lang'.EXT;
		if (in_array($langfile, $this->is_loaded, TRUE))
		{
			return;
		}
		if ($idiom == '')
		{
			$CI =& get_instance();
			$deft_lang = $CI->config->item('language');
			$idiom = ($deft_lang == '') ? 'english' : $deft_lang;
			$this->idiom = $idiom;
		}
		// Determine where the language file is and load it
		if (file_exists(APPPATH.'language/'.$idiom.'/'.$langfile))
		{
			include(APPPATH.'language/'.$idiom.'/'.$langfile);
		}
		else
		{
			if (file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile))
			{
				include(BASEPATH.'language/'.$idiom.'/'.$langfile);
			}
			else
			{
				$database_lang =  $this->_get_from_db();
				if ( ! empty( $database_lang ) )
				{
					$lang = $database_lang;
				}else{
					show_error('Unable to load the requested language file: language/'.$langfile);
				}
			}
		}
		if ( ! isset($lang))
		{
			log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile);
			return;
		}
		if ($return == TRUE)
		{
			return $lang;
		}
		$this->is_loaded[] = $langfile;
		$this->language = array_merge($this->language, $lang);
		unset($lang);
		log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile);
		return TRUE;
	}
	/**
	 * Load a language from database
	 *
	 * @access	private
	 * @return	array
	 */
	private function _get_from_db()
	{
        $CI =& get_instance();
		$CI->db->select   ('*');
		$CI->db->from	 ('language');
		$CI->db->where	('language', $this->idiom);
		$CI->db->where	('set', $this->set);
		$query = $CI->db->get()->result();
		foreach ( $query as $row )
		{
			$return[$row->key] = $row->text;
		}
		unset($CI, $query);
		return $return;
	}
}
read more

Titan Network Project(s)

Well… I’ve been part of a really cool community called the Titan Network since October of 2008. It’s a webring of great sites and services for the City Of Heroes players.

I was brought in to help SuckerPunch/Dan Cunha make his original script known as “SuckerPunch’s Online Planner” even better than it was before by bringing in a series of useful calculations that would normally only be found in an application.

Well… a few months pass and Titan founders Sean, Terry and Dan all go into “semi-retirement” and leave the network to TonyV, the founder of ParagonWiki.com, and myself.


Now, I don’t pretend to be the originator of these sites, but I am responsible for a lot that goes on these sites. We also have a few of extremely knowledgable developers to backing us up. SaintNicster (Nick Fajardo) and Fleeting Whisper (Brain Shields) I could name of the top of my head… but there are more and there will be more and it’s just an awesome group of people.

With that said, let’s get to the point I’m posting this.

Current Titan Projects:

  • PvPEC (Titan Events)
    • Changing the name from the PvPEC to Titan Events, because I plan on making it to support more than just the PvP aspect of the game
    • It will be a script the utilizes the characters listed in City Info Tracker and allow users to start events, T/S Forces, tournaments, etc…
    • And very to user calender script to export into what ever application or device they wish to use this information in
    • Possibly a module on Glycerine to let people know that there is an event they’re signed up to about to start(?)
  • TNA Revamp
    • Well, my first script on Titan was the TNA “Titan Network Administrator” which was literally me just attempting my first stab at using and utilizing the CodeIgniter Framework, so it didn’t work as well as I (and everyone else) had hoped.
    • This new version features an array of ajax scripts and much friendlier navigation and UI for the moderators and admins to administer different aspects of the network.
  • Flagship Revamp
    • The main site (http://cohtitan.com) has been in dire need for an upgrade for awhile… although the basic look and feel are relatively the same… there was a complete overhaul made to the code behind it.
    • Includes full PayPal Donation support and keeps track of every penny donated by each invisual user to see within their own account settings
    • Will include a full-blown FAQ and Tutorial module for users still wildered on how to use our sites and service
  • COHFaces
    • My least favorite site on the Network, but the most traffic and used site… lol
    • It’s code is pretty solid, however it needs an overhaul as it is coded on what seems like a php4 mindset.
      • Needs __construct() functions instead of calling the function by the class name
      • Need to change out all $_POST with CodeIgniter XSS checks for ajax calls
      • Condense ajax controllers into one master controller with multiple functions.
      • Update the authentication class to create a faces session (currently creating cit session… don’t ask, lol)
      • Migrate authentication class to database session as cookies haveĀ  a limit and we’re getting dangerously close.
  • COH Online Planner
    • Eventually finish Dan’s handy work and get a online version of a comprensible library of builds
    • Somehow link this and Mids’ Hero & Villain Designer (MxD) to talk to each other.
  • MxD
    • Address my issues with it
    • Update to make fully current with all the right numbers and attributes
    • Address old issues with it
    • Luckily we have Fleeting Whisper who is creating a Cross-Operation System version of the script in Java, which will be nice and eventually force the original source into retirement.

There is more, but it’s smaller stuff and just haven’t gotten around to it is all.

FUN!

read more

Welcome!

Just a bit of a welcome to the new and improved Stei{nerd}.com website.

This is my little stock-pile of helpful code snippets, ideas and other thoughts that I believe should be public knowledge.

read more