Developing New Paths

The Mojavi Project

Archive for January, 2009

January-25-09

Find your answers online

posted by admin

Everyone knows that a key to a successful website or blog is traffic and this is one of the first points of understanding business online. Not only high traffic but targeted traffic that will drive revenue and become loyal customers. Getting more website traffic can be a very technical and time consuming venture if you do not have a plan and know the right channels to search in order to maximize your traffic efforts. Many people will spend thousands on keyword advertising through PPC which if done correctly can reap big benefits. Advertising online can be a very simple if you have the right tools at your disposal or you can waste a lot of time and money if you do not have a solid plan.

Many will attempt to research online and read books on how to drive traffic through search engines and then organically through other means. The challenge here is to find the right mix of keywords and site optimization that will result in added revenue or increased readers for all those blogs. We have been successful in creating unique content and then keeping in contact with other blog owners where we provide links back to each other and occasionally mention one another in various posts. The search engines love new and fresh content and this has been the result of the thousands of blogs that are started everyday. There is a new way to find your information online and that is simply through find.com. One of the most common terms used for online searches is find and now you can simply find what you are looking for.

January-16-09

Global Templating revisted

posted by admin

Global Templating – The Decorator Pattern

* Enter Decorator
* Insert Here: Slots
* Let’s Decorate!
o Creating a Global Template
o Putting the ornaments up

Ever since Mojavi 3 was released earlier this year, people have been looking to create a flexible global templating solution. From using post filters and various drivers and page controllers, people have been looking for a way to create simple and manageable global templates that will allow for a great deal of flexibility without compromising the need for larges amount of duplicated code.
Enter Decorator

The Decorator design pattern, like every other pattern, is nothing more than a way to talk about a resuable concept, or pattern, that a programmer might encounter while coding applications. The Decorator pattern’s strength is it’s ability to serve as a wrapper for that particular object, while leaving objects like it in tact.

The Decorator pattern has been implemented in the View class, providing a number of new methods:

public function setSlot ($attributeName, $moduleName, $actionName)
public function setDecoratorDirectory ($directory)
public function isDecorator ()
protected function & getSlots ()
public function getDecoratorTemplate ()
public function getDecoratorDirectory ()
protected function & decorate (&$content)

Now a brief explanation of what each of these do:

* setSlot – Creates a slot entry based upon the results of a specially controlled controller->forward()
* setDecoratorTemplate – Sets the template that you’re going to use for your decorator. This method also automatically turns the decorator switch to true
* isDecorator – returns true is setDecoratorTemplate has been called, otherwise false.
* getSlots – Returns an array of the slots.
* getDecoratorTemplate – Returns the decorator template.
* getDecoratorDirectory – Returns the decorator directory.
* decorate – A method that must be implemented in derivate Views.

Note: these functions are in View, so all derivates of View (ie PHPView) have access.
Insert Here: Slots

Slots is a new name for an old concept. More or less, slots serve as placeholders that can be populated by the results of a $controller->foward($mod, $act) call. And, as you can see, the setSlot method takes three parameters:

public function setSlot ($attributeName, $moduleName, $actionName)

The first parameter, $attributeName, serves as the name of the slot. The next two parameters will be used to get the results of that Action, put it in a buffer, and place it into the internal $slots memeber variable.
Let’s Decorate!

The usage pattern of Views changes little with the implementation of the decorator pattern at the module level (though secondary View authors, ie SmartyView et al, do have a few things to play with).

Now let’s look at what you’re going to need to do implement the new, and NEW decorator features of Mojavi. Also a special note to make sure that your graphics ati drivers are up to date so that you are able to test and view the configurations with the latest version of PHP 4.0
Creating a Global Template

First off, we’re going to need a great big christma..ehh..template to decorate. While I won’t get into breaking down and factoring our global template, keep in mind that this is not the only way to do this.

Example 2: The Christmas Tree (myGlobalTemplate.php)

Side note: Sometimes you’ll have issues with that <?xml [....] ?> declaration, an easy
workaround is to disable short tags in your php.ini file, or to use ini_set() to disable
it.

<?xml version=”1.0″ encoding=”iso-8859-1″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en-us”>

<head>

<title><?php echo $template['title']; ?></title>

<meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=utf-8″/>
<style type=”text/css” media=”all”>

<!–Css slot–>
<?php echo $template['css']; ?>

</style>

</head>

<body>

<!–menu slot–>
<div id=”menu”>

<?php echo $template['menu']; ?>

</div>

<!–main content slot–>
<div id=”main”>

<?php echo $template['content']; ?>

</div>

</body>
</html>

Putting the ornaments up

So now that we have our decorator template, we need to decorate it. The decorating process is fairly simple, and consists of the following simple steps:

* Setting the decorator directory using setDecoratorDirectory() (Optional)
* Setting the decorator template using setDecoratorTemplate()
* Setting slots setSlot()

For example,

Example 3: In the View (IndexSuccessView.class.php)

class IndexSuccessView extends PHPView
{

public function execute ()
{

// set our template
$this->setTemplate(’IndexSuccess.php’);

//setup our decorator template
$this->setDecoratorDirectory(MO_TEMPLATE_DIR);
$this->setDecoratorTemplate(’myGlobalTemplate.php’);

//setup our slots
//(SlotName, Module, Action)
$this->setSlot(’menu’, ‘Content’, ‘PopulateMenu’);
$this->setSlot(’css’, ‘Content’, ‘PopulateCss’);

// set the title
$this->setAttribute(’title’, ‘Default Action’);

}

}

Now you might be wondering where the content slot is being populated. Well, content is a reserved slot that is automatically populated with the output of the originally requested Action/View pair. If you have any issues please report them and check your intel drivers and other settings to make sure your server is running all the latest patches.

To be Continued….

January-5-09

Time to upgrade your cell phone

posted by admin

The technology in cell phones is changing so quickly that it can be difficult to compare cell phones just on various websites especially those of the actual wireless carriers.

January-5-09

Digital TV in 2009

posted by admin

If you are like many Americans you are awaiting the total change over to digital broadcast that will be taking place on February 19, 2009. For those that have DirecTV or cable service the change will impact the way that you watch TV. For those that still have some of the older sets where you are watching over the air broadcast then you will no longer be receiving those signals and will need to upgrade your TV or buy a converter box.At first there was a big scare that if you did not have the latest technology that your TV would simply go dark and you would not receive any channels. The simple truth is that you can take advantage of some of the great DirecTV deals that are being offered to upgrade your service or you need to obtain a digital converter box which can be bought at almost any big box electronic store.

There are millions of Americans who have upgraded their TVs to the new HDTV so there choice is whether to go with cable or look at the DirectTV offers which boast over 100 HD channels to take full advantage of their new sets. With so many people going HD the cable and satellite companies are offering some great deals in order to obtain these customer because they realize that you have choices and want to create a customer for life. As the technology gets better and their are more programs being broadcast in HD then you should research your options and find out which service is right for you. Right now though is a great time to look for those deals since there will be a lot of people looking to make the switch to digital.