Joomla Hosting BLOG

Blog about Joomla, Technologies and Hosting Service

Joomla 1.6 Hosting - ASPHostPortal :: How to Convert a Joomla! 1.5 template to 1.6 – the XML file

clock June 30, 2011 05:59 by author Jervis

Now that the dust has settled from the recent launch of Joomla! 1.6 and developers are releasing new 1.6 compatible components daily, you may be getting anxious to move your site from 1.5 to 1.6.

You might be asking yourself (or others), “Am I able to use my existing 1.5 template for my new 1.6 site?“  The answer is, in short, no.

Ok – while that’s not entirely true, there are a lot of changes that you’re going to have to make before even attempting to install your 1.5 template on Joomla! 1.6.  Although there are lots of changes that may be required, depending upon your template, we’re going to review 3 of the most common changes: the XML file, the index.php file, and your template overrides.

Changes with the XML file (templateDetails.xml)

As the old saying goes, “The one thing that’s constant is change.” Well this is true for the Joomla! XML file as well.  The XML file is essentially the database of information about an extension (yes, templates are extensions). When it comes to Joomla templates, the XML file must be named templateDetails.xml.


Let’s take a look at the differences in a Joomla 1.5 templateDetails.xml file and a Joomla 1.6 templateDetails.xml file:

Joomla 1.5 Template XML Introduction


<?xml version="1.0" encoding="iso-8859-1"?>
<install version="1.5" type="template">
<name>Your Template Name</name>
<version>1.0</version>
<creationDate>04/01/2011</creationDate>
<author>JoomDaddy</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.joomdaddy.com</authorUrl>
<copyright>(c) 2011 JoomDaddy.com</copyright>
<license>GNU GPL</license>
<description>This is my template description.</description>


This example contains detailed information about the template – the version of Joomla! for which it’s developed, the author, author contact info, and the license information. Now let’s look at the same section of a Joomla! 1.6 template XML file.

Joomla 1.6 Template XML Introduction

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd">
<extension version="1.6" type="template" client="site">
<name>Your Template Name</name>
<creationDate>04/01/2011</creationDate>
<author>JoomDaddy</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.joomdaddy.com</authorUrl>
<copyright>(c) 2011 JoomDaddy.com</copyright>
<license>GNU General GPL</license>
<version>1.0</version>
<description>This is my template description.</description>

So far, the only major differences in this file are the use of a DocTypeDefinition (DTD) and the use of <extension> instead of <install>. The DTD is used to check the XML file’s content to make sure that it matches the structure needed by the application. Prior to 1.6, Joomla has not used DTDs in the XML file. The other difference is the extension element and version parameter – which must be set to 1.6 instead of 1.5. This let’s the system know that you’re installing a template developed for 1.6, instead of a 1.5 or 1.0 template.


The next section of the XML file is the used to index the files and folder.  This section has gone unchanged:

<files>
<folder>css</folder>
<folder>images</folder>
<folder>html</folder>
<filename>index.php</filename>
<filename>index.html</filename>
<filename>favicon.ico</filename>
<filename>templateDetails.xml</filename>
<filename>template_thumbnail.png</filename>
</files>

This list needs to be accurate or you’ll receive an error during installation. Note, however, that files and folders found within the folders of the <folders> element do not need to be listed separately. This feature saves developers a lot of time when creating XML files!

The next part of the XML file is defining your module positions. You can add as many as you need.  The position names cannot have spaces, but other than that can be named anything you want:

<positions>
<position>left</position>
<position>right</position>
<position>top</position>
</positions>

At the end of your XML file, you’ll need to include the </extension> tag to let the system know it has reached the end of the file.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla 1.6 Hosting - ASPHostPortal :: Logging in the Joomla 1.6 admin area

clock June 27, 2011 07:28 by author Jervis

First, in order to build your web site you will have to log into the administrator area. This can be achieved by opening the corresponding URL in your web browser:

http://yourdomainname.com/administrator

Replace yourdomainname.com with your actual Joomla URL.

Next, you have to enter the admin login details which have been set during the installation:

After entering the Joomla administrator area, you can check the featured articles (the ones that are included in the sample data or created by you) published on the front page through Content->Featured Articles.



You can edit them, create new ones, remove existing from the front page, delete, publish and unpublish articles.

If you have installed the Sample Data, before adding new articles you can delete the sample ones. Select them and click on the Trash button. Then remove the menu links to the sample articles from
Menus->Main Menu.

After this you can add a new category from Content->Category Manager->Add New Category.




For example, you can put “Test” as the new category Title. The other options can be left blank or you can set their values as per your personal preferences. Click on the Save button to add your new category.

Next, navigate to Content->Article Manager->Add New Article.



Only the Title field is mandatory. Enter the article title. You can also select your category from the corresponding drop-down menu. Change the article State to Published. If you want to show it on the front page, set the Featured value to Yes.

Once you are ready with the settings you can proceed with the actual article content. Use the included text editor to type the article text, to include images or to directly edit the HTML code.



Under the text editor area you can set the permissions for the different user groups regarding your article.

You can also adjust the settings in the Publishing Options, Article Options, Metadata Options menus.



You can hover your mouse pointer over the options’ labels and get a brief description of each one of them.

Once you are ready, Save the article and check it on the front end. You can always edit the existing articles from the Joomla admin area->Content->Article Manager.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.


You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla 1.6 Hosting - ASPHostPortal :: Upgrade Joomla 1.5 to Joomla 1.6 Template

clock February 9, 2011 06:09 by author Jervis

Upgrade Joomla 1.5 to Joomla 1.6 Template : Joomla 1.6 is really phenomenal as  joomla 1.5 , means it inherits all the basics of joomla 1.5 and added the advance functionality .Joomla 1,6 open’s new door to developers to create extension’s and template which are compatible for joomla1.6 .We’ll describe how to convert Joomla1.5 template to Joomla1.6

In both Joomla! 1.5 and 1.6 template parameters are defined in templateDetails.xml.

Whereas in 1.5 parameters are defined as part of the
<params> section, and each parameter is defined as a <param>, in 1.6 template parameters are contained in the <config> section and treated as a <field>nested within the <fieldset> and <fields> tags, as illustrated below.

<fieldset>
<option value="1">On</option>
<option value="0">Off</option>
</fieldset>

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla 1.5 Hosting - ASPHostPortal :: How to Add New Module Positions in Joomla 1.5 Template

clock January 24, 2011 08:58 by author Jervis

If you are developing a new joomla 1.5 template or are editing any pre existing one, and need to add a new custom module position of your choice some where in the template index.php, here it is how to do it (you will be able to select this new module position from the Joomla! 1.5 admin backend for modules to be published at this new position):

1. Goto <joomla root>/templates/<template name>/ folder

2. Open the file index.php in that folder in your favourite editor

3. Add this code in the relative position in html of the template index.php to add the new custom module position in your Joomla 1.5 template

<?php if ($this->countModules('custom')) : ?>
<div>
<jdoc:include type="modules" name="custom" style="xhtml" />
</div>
<?php endif; ?>


4. Rename the word custom coming twice in the above code with any name that you want to give to that new module position.

5. Open templateDetails.xml in the same folder and find the part of code where it says <position>

6. After the already existing positions, simply add the new position that you just created in the above step in your Joomla! 1.5 index.php in the same format as the already existing ones.

7. Replace the word custom with the name of the position that you defined in step 4 above while adding the new module position code for Joomla! 1.5 in template index.php file.

This will add a new custom module position in your Joomla! 1.5 template which you can use to publish modules at this new position. You can repeat the same procedure for more custom module positions for Joomla! 1.5 template.

Reasons why you must trust ASPHostPortal.com


Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla 1.6 Hosting - ASPHostPortal :: Creating Custom Parameters in Joomla 1.6

clock January 10, 2011 08:06 by author Jervis

In the course of updating our extensions to Joomla 1.6 we have managed to figure out some useful information about the differences between Joomla 1.5 and 1.6. There have been some big changes in the format of the installation package, which this article explores.

Format of the Installation Manifest

There have been some changes to the format of the installation manifest xml file. The root <install> tag has been replaced with an <extension> tag, while the <params> and <param> tags have been replaced with the <fields> and <field> tag respectively. The <fields> tags are now placed in a <config> tag container. The rest of the layout remains much the same. So a typical layout for a module in Joomla 1.6 would be:

<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="1.6.0" method="upgrade" client="site">
<name>My Module</name>
<author>Jo Bloggs</author>
<creationDate>July 2010</creationDate>
<copyright>Inspiration Web Design</copyright>
<license>GPL</license>
<authorEmail>

[email protected]This e-mail address is being protected from spambots. You need JavaScript enabled to view it

</authorEmail>
<authorUrl>www.mysite.com</authorUrl>
<version>1.0.0</version>
<description>Mails a link to the current page</description>
<files>
  <filename module="my_module">my_module.php</filename>
  <filename>helper.php</filename>
  <filename>index.html</filename>
  <filename>tmpl/default.php</filename>
  <filename>tmpl/index.html</filename>
  <folder>assets</folder>
</files>
<config>
  <fields name="params">
    <fieldset name="basic" label="Module Parameters" description="Configure Module">
    <field name="fromEmail" type="text" default="" label="from email address"  />
    <field name="bcc" type="text" default="" label="bcc" description="DESCBCC" />
    <field name="filterEmails" type="textarea" cols="20" rows="3" label="invalid emails"  />
    <field name="moduleclass_sfx" type="text" default="" label="Module Class Suffix"  />
    <field name="use_slider" type="list" default="0" label="Use mootools slider" >
      <option value="1">Yes</option>
      <option value="0">No</option>
    </field>
    <field name="use_cookie" type="list" default="1" label="Remember slide state" >
      <option value="1">Yes</option>
      <option value="0">No</option>
    </field>
    <field name="use_detection" type="list" default="0" label="Use Extended URL detection">
      <option value="1">Yes</option>
      <option value="0">No</option>
    </field>
    </fieldset>
  </fields>
</config>
<languages>
  <language tag="en-GB">en-GB.my_module.ini</language>
  <language tag="en-US">en-US.my_module.ini</language>
</languages>
</extension>


Adding Custom Parameters

So how do you go about adding custom parameters? If you are familiar with doing this with Joomla 1.5 you will remember that this involved extending the JElement Class, and overriding the fetchElement() method. This method was used to generate the html for the required field.

In Joomla 1.6 the process is quite similar, in this case we need to extend the JFormField Class. This Joomla class includes a getInput() method, which we can override to generate the html for the form field. The main difference from Joomla 1.5 is in how we access the name, value and other attributes of the form field. In Joomla 1.5 these were passed as parameters to the fetchElement() method. In Joomla 1.6 these are pre-populated as properties of the JFormField object that we are working with. So, for example to access the name of the form field we simply refer to it by $this->name. The class include a variable $type which must be set to the name of the field type.

In case this is not all crystal clear, the best way to illustrate this is with a example. The example below generates a list of currently published Joomla articles arranged by category.

<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );


jimport('joomla.html.html');
jimport('joomla.form.formfield');//import the necessary class definition for formfield


/**
 * Supports an HTML select list of articles
 * @since  1.6
 */
class JFormFieldArticles extends JformField

{
      /**
  * The form field type.
  *
  * @var  string
  * @since  1.6
  */
      protected $type = 'Articles'; //the form field type

      /**
  * Method to get content articles
  *
  * @return array The field option objects.
  * @since  1.6
  */
      protected function getInput()
      {
  // Initialize variables.
  $session = JFactory::getSession();
  $options = array();
 
  $attr = '';

  // Initialize some field attributes.
  $attr .= $this->element['class'] ? ' class="'.(string) $this->element['class'].'"' : '';

  // To avoid user's confusion, readonly="true" should imply disabled="true".
  if ( (string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true') {
   $attr .= ' disabled="disabled"';
  }

  $attr .= $this->element['size'] ? ' size="'.(int) $this->element['size'].'"' : '';
  $attr .= $this->multiple ? ' multiple="multiple"' : '';

  // Initialize JavaScript field attributes.
  $attr .= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';


    //now get to the business of finding the articles
     

  $db = &JFactory::getDBO();
  $query = 'SELECT * FROM #__categories WHERE published=1 ORDER BY parent_id';
  $db->setQuery( $query );
  $categories = $db->loadObjectList();
 
  $articles=array();
 

  // set up first element of the array as all articles
  $articles[0]->id = '';
  $articles[0]->title = JText::_("ALLARTICLES");
 

    //loop through categories
    foreach ($categories as $category) {
     $optgroup = JHTML::_('select.optgroup',$category->title,'id','title');
     $query = 'SELECT id,title FROM #__content WHERE catid='.$category->id;
     $db->setQuery( $query );
     $results = $db->loadObjectList();
     if(count($results)>0)
     {
    array_push($articles,$optgroup);
    foreach ($results as $result) {
     array_push($articles,$result);
    }
     }
    }  
  
  // Output
 
  return JHTML::_('select.genericlist',  $articles, $this->name, trim($attr), 'id', 'title', $this->value );
 
      }
}


Simples!

Note that there are other ways of tackling this. Among the predefined field types that Joomla 1.6 supplies is the 'list' type, which defines the JFormFieldList class, which in turn is an extension of JFormField. We could have chosen to extend The JFormFieldList instead. This class returns a generic select list field. It includes a method, getOptions(), which returns the options available. We could have chosen to over-ride this method to return the articles as a list of options.

Adding the Custom Form Field to The Installation Package


The custom form field is added to your installation package using an addfieldpath attribute added to the < fields> tag. In the example below we assume that the articles field definition is placed in a file called articles.php which is placed in a folder /modules/mod_mymodule/fields (note that this is relative to the root folder of your site).

<fields name="params" addfieldpath="/modules/mod_mymodule/fields">

Backwards Compatibility With Joomla 1.5

In fact we have found that the Joomla 1.6 installer will understand the old <install> tag, so it is possible to create an installation package that will install in Joomla 1.6 and Joomla 1.6. To do this, use the <install> tag:-

<install type="module" version="1.5.0" method="upgrade" client="site">

The parameters for Joomla 1.6 can be added in a <config> tag, while the old <params> tag can be used for the Joomla 1.5 parameters. The installers will simply ignore the tags that they do not use.

If you want to add custom parameters for versions 1.5 and 1.6 we have found that the easiest way to do this is to have separate folders for the separate definitions of the custom fields, for example called 'elements' and 'fields' respectively.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla 1.5 Hosting - ASPHostPortal :: How To Structure Content In Joomla 1.5

clock December 24, 2010 05:48 by author Jervis

Here are the steps:

1.
First we want to create a Section since they are at the top of the tree. You can access the “Section Manager” either by clicking the “Section Manager” Icon on the Admin Home Page (This is the page you see when you first login). Or you can select “Content” from the top horizontal menu and click on “Section Manager”.



2. You will now see a list of Sections, if you installed the sample data when you installed Joomla there will be a small list already here. For now we just want to create a new Section, so click the “New” Icon from the top right.



3. Now you will need to enter the “Title” for the new section and an “Alias”. The Alias is the text that will be used in the URL, no spaces allowed and if left blank it will simply use the Tile and replace spaces with hyphens. You want to set Published to yes and for now it is best to leave the Access Level set to Public.



4. For the Description just enter a basic description about this Section for now, it can be changed later if you decide you need it.

5. Click “Save” from the top right.



Add however many sections you want/need, you can always edit/add/delete these later.

6. Now we want to create some categories for those sections. From the top horizontal menu select “Content” and then click “Category Manager”.



7. We want to make a new Category so click the “New” icon from the top right.



8. This is basically Step 4 and 5 again, so repeat those steps here. No point in me saying the exact same steps again.

9. When done click “Save”



Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla 1.5 Hosting - ASPHostPortal :: Different layout for every page in Joomla 1.5.x

clock December 15, 2010 06:07 by author Jervis

The good thing is control layout of pages by administrator panel.
The solution is create different templates. But keeping the same things like header, footer and menu in every template is bad and if we are going to change something in future (who knows?) it will be a big problem.

So we need to have one main template with basic layout and another (inherited) templates with layout for each page.

Solution


First of all we need to create main template which will be wrapper for all the next templates.


Creating global template, named it “_global”. Files that we need:

- /templates/_global/index.php
- /templates/_global/layout.php
- /templates/_global/templateDetails.xml
- /templates/_global/helper.php


1. Index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>">
  <head>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/framework/stylesheets/application.css" type="text/css" charset="utf-8">
  </head>
<body>
  <div class="header">
    Header of page
  </div>
  <div class="layout">
    <jdoc:file name="layout.php" />
  </div>
  <div class="footer">
    &copy; Egor Hmelyoff
  </div>
</body>
</html>

Here we’ve written the new construction <jdoc:file name=”layout.php” />. Which means that you include layout.php from the current template. After that, we will create this file in each new template and insert there our layout.

2. layout.php (for _global template):

<div class="content">basic layout</div>

Here we can write whatever we need.

3. templateDetails.xml


<?xml version="1.0" encoding="utf-8"?> 
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN" 
 "http://dev.joomla.org/xml/1.5/template-install.dtd"> 
<install version="1.5.9" type="template"> 
  <name>_global template</name> 
  <creationDate>23 April 2009</creationDate> 
  <author>hmelyoff</author> 
  <authorEmail>[email protected]</authorEmail> 
  <authorUrl>http://blog.evershow.me</authorUrl> 
  <copyright>Life Fm, 2009</copyright> 
  <license>GNU/GPL</license> 
  <version>1.5.0</version> 
  <description>Global template with basic html layout</description> 
  <files> 
    <filename>index.php</filename>
    <filename>templateDetails.xml</filename> 
    <filename>helper.php</filename>
    <filename>layout.php</filename> 
  </files>          

  <positions>
  </positions>   

</install>

4. helper.php: (updated)

<?php
  defined('_JEXEC') or die('Restricted access'); 

  function global_render($_params = null)
  {
    global $mainframe; 

    // Base instances
    $document =& JFactory::getDocument();
    $user     =& JFactory::getUser(); 

    // Define global template
    $_template    = "_global";
    $_template_dir      = JPATH_THEMES.DS.$_template; 

    // Define _global params
    if (is_readable( $_template_dir.DS.'params.ini' ))
    {
      $_content = file_get_contents($_template_dir.DS.'params.ini');
      $_global_params = new JParameter($_content);
    } 

    // Define empty params if not exist
    if(!$_params){
      $_params = new JParameter('');
    } 

    // example includes/application.php "render" function
    $file   = JRequest::getCmd( 'tmpl', 'index' );
    if ( JSite::getCfg('offline') && $user->get('gid') < '23' ) {
      $file = 'offline';
    }
    if ( !is_dir( $_template_dir ) && !JSite::getCfg( 'offline' ) ) {
      $file = 'component';
    } 

    $params = array(
      'template' => $_template,
      'file'            => $file.'.php',
      'directory' => JPATH_THEMES
    ); 

    // Catch current template
    $template = $mainframe->getTemplate();
    $template_dir = JPATH_THEMES.DS.$template; 

    // Set global template as current and render document
    $mainframe->setTemplate( $_template );
    $data = $document->render( JSite::getCfg('caching'), $params ); 

    // Set back current template
    $mainframe->setTemplate( $template ); 

    $replace = array();
    $matches = array(); 

    // Catch own construction for include files
    // (example /libraties/joomla/document/html/html.php "_parseTemplate" function)
    if( preg_match_all( '#<jdoc:file\ name="([^"]+)".*\/>#iU', $data, $matches ) ){
      $matches[0] = array_reverse( $matches[0] );
      $matches[1] = array_reverse( $matches[1] ); 

      $count = count( $matches[1] ); 

      for( $i = 0; $i < $count; $i++ ){
        $inc = $matches[1][$i];
        $tpl_dir = $template_dir; 

        // if file does not exist in current template,
        // looking for it in "_global" teamplate dir
        if( !file_exists( $template_dir.DS.$inc ) ){
          $tpl_dir = $_template_dir;
        } 

        $document->params = $_params;
        $document->global_params = $_global_params; 

        $tpl = $document->_loadTemplate( $tpl_dir, $inc );
        $tpl = $document->_parseTemplate( $tpl ); 

        $replace[$i] = $tpl; 

      } 

      $data = str_replace( $matches[0], $replace, $data ); 

    } 

    return $data;

  } 

?>

This is the main function to render new inherited templates.
So, we’ve created “_global” template, but remeber: this template not for assign it.


Inherited templates

Next step: we will create new inherited template for home page (for example).


Files that we need:

- /templates/home/index.php
- /templates/home/layout.php
- /templates/home/templateDetails.php


home” here for example, we can give any name to inherited templates.

1. Index.php: (updated)

<?php
  defined('_JEXEC') or die('Restricted access');
  include JPATH_THEMES.DS.'_global/helper.php';
  echo global_render($this->params);
?>

2. layout.php:

<div class="content">

  <div class="left">new left column in home template</div>
  <div class="center">content part</div>
</div>

3. templateDetails.php:

That’s all. Now we can assign this template by Joomla administrator panel.
Also, in inherited template we have access to params of _global template by $this->global_params->get(…)


Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla Hosting - ASPHostPortal :: Fix 755 permission issues with running PHP as FastCGI

clock December 12, 2010 05:14 by author Jervis

I know there is a lot of talk about security involving any CMS these days. Especially between Joomla, Drupal and Wordpress. Everyone keeps saying 777 is bad, you should never use it because it is a security risk and your site will get hacked. Well that may be true, but most of these people never provide a solution. All they say is your directories should be 755. On many php installs this means only apache can wright to these folders. So if you try to upload a theme, component, module or plugin from your CMS it will fail. That is why so many people have to set directories to 777 in order for things to work properly. Before doing any of the below create a backup first!

If you are using Plesk there is an easy but not well documented solution. Apache suEXEC must be installed for this to work properly, but if you are using plesk it most likely is already running. http://httpd.apache.org/docs/1.3/suexec.html
Go to Domains > yourdomain.com > Web Hosting Settings. Scroll down to PHP support. Make sure ‘safe_mode’ is unchecked then select FastCGI application. This FastCGI is much different and faster than CGI. Also this should be much quicker than using suPHP which would be the other option to fixing permissions issues.




You may have to restart Apache before everything works correctly. After turning this on my site had errors and would not run. Turns out I had some ownership issues. I ran a chown from the command line which returned ownership to the ftp user. Everything worked great after this. You can now change your 777 directories to 755.

If you have SSH shell access the following commands can be run from the command line to reset all files and directories back to the server defaults of 755 and 644. Change directories to the top directory (" / ") of your Joomla! installation, then run:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

For more infomation on Joomla and permissions: http://docs.joomla.org/How_do_UNIX_file_permissions_work%3F

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla Hosting - ASPHostPortal :: Add New Module Position to Joomla 1.5 Template

clock November 24, 2010 17:00 by author Jervis

Here are the steps:

1. open the index.php with the HTML editor and go to the line where you want to add the new module
2. insert the following code: <?php if ($this->countModules('newmodule)) : ?><div id="newmodule" ><jdoc:include type="modules" name="newmodule" style="xhtml" /></div><?php endif; ?>
3. save the file, go to the module manager and place the module on the "newmodule" position.
4. this new position will not be available in the position selector, but you just need to type in and save the module

Style the new module with CSS (style="xhtml")

1. #newmodule .moduletable {}
2. #newmodule .moduletable h3 {}
3. #newmodule .moduletable_menu {}

Add these codes to the template css file, and customize them as you want.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Joomla Hosting - ASPHostPortal :: Creating a Hello World Module for Joomla 1.5

clock November 24, 2010 16:54 by author Jervis

A module is a lightweight and flexible extension that is used for page rendering. They are used for small bits of the page that are generally less complex and are able to be seen across different components.

You can see many examples of modules in the standard Joomla! install: - menus - Latest News - Login form - and many more.

This tutorial will explain how to go about creating a simple Hello World module. Through this tutorial you will learn the basic file structure of a module. This basic structure can then be expanded to produce more elaborate modules.

File Structure

There are four basic files that are used in the standard pattern of module development:
-
mod_helloworld.php
- This file is the main entry point for the module. It will perform any necessary initialization routines, call helper routines to collect any necessary data, and include the template which will display the module output.
-
mod_helloworld.xml
- This file contains information about the module. It defines the files that need to be installed by the Joomla! installer and specifies configuration parameters for the module.
-
helper.php
- This file contains the helper class which is used to do the actual work in retrieving the information to be displayed in the module (usually from the database or some other source).
-
tmpl/default.php - This is the module template. This file will take the data collected by mod_helloworld.php and generate the HTML to be displayed on the page.

Creating mod_helloworld.php

The mod_helloworld.php file will perform three tasks:
- include the helper.php file which contains the class to be used to collect the necessary data
- invoke the appropriate helper class method to retrieve the data
- include the template to display the output.

The helper class is defined in our helper.php file. This file is included with a require_once statement:

require_once( dirname(__FILE__).DS.'helper.php' );

require_once is used because our helper functions are defined within a class, and we only want the class defined once.

Our helper class has not been defined yet, but when it is, it will contain one method: getHello(). For our basic example, it is not really necessary to do this - the “Hello, World” message that this method returns could simply be included in the template. We use a helper class here to demonstrate this basic technique.

Our module currently does not use any parameters, but we will pass them to the helper method anyway so that it can be used later if we decide to expand the functionality of our module.

The helper class method is invoked in the following way:

$hello = modHelloWorldHelper::getHello( $params );

Completed mod_helloworld.php file

The complete mod_helloworld.php file is as follows:

<?php
/**
 * Hello World! Module Entry Point
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tutorials:modules/
 * @license        GNU/GPL, see LICENSE.php
 * mod_helloworld is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Include the syndicate functions only once
require_once( dirname(__FILE__).DS.'helper.php' );

$hello = modHelloWorldHelper::getHello( $params );
require( JModuleHelper::getLayoutPath( 'mod_helloworld' ) );
?>

The one line that we haven’t explained so far is the first line. This line checks to make sure that this file is being included from the Joomla! application. This is necessary to prevent variable injection and other potential security concerns.

Creating helper.php

The helper.php file contains that helper class that is used to retrieve the data to be displayed in the module output. As stated earlier, our helper class will have one method: getHello(). This method will return the ‘Hello, World’ message.

Here is the code for the helper.php file:
<?php

/**
 * Helper class for Hello World! Module
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link http://dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tutorials:modules/
 * @license        GNU/GPL, see LICENSE.php
 * mod_helloworld is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
class modHelloWorldHelper
{
    /**
     * Retrieves the hello message
     *
     * @param array $params An object containing the module parameters
     * @access public
     */   
    function getHello( $params )
    {
        return 'Hello, World!';
    }
}
?>

There is no rule stating that we must name our helper class as we have, but it is helpful to do this so that it is easily identifiable and locateable.

More advanced modules might include database requests or other functionality in the helper class method.

Creating tmpl/default.php

The default.php file is the template which displays the module output.

The code for the default.php file is as follows:

<?php // no direct access
defined( '_JEXEC' ) or die( 'Restricted access' ); ?>
<?php echo $hello; ?>

An important point to note is that the template file has the same scope as the mod_helloworld.php file. What this means is that the variable $hello can be defined in the mod_helloworld.php file and then used in the $hello file without any extra declarations or function calls.

Creating mod_helloworld.xml

The mod_helloworld.xml is used to specify which files the installer needs to copy and is used by the Module Manager to determine which parameters are used to configure the module. Other information about the module is also specified in this file.

The code for mod_helloworld.xml is as follows:

<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0">
    <name>Hello, World!</name>
    <author>Jervis</author>
    <version>1.5.0</version>
    <description>A simple Hello, World! module.</description>
    <files>
        <filename>mod_helloworld.xml</filename>
        <filename module="mod_helloworld">mod_helloworld.php</filename>
        <filename>index.html</filename>
        <filename>helper.php</filename>
        <filename>tmpl/default.php</filename>
        <filename>tmpl/index.html</filename>
    </files>
    <params>
    </params>
</install>

You will notice that there are two additional files that we have not yet mentioned: index.html and tmpl/index.html. These files are included so that these directories cannot be browsed. If a user attempts to point their browser to these folders, the index.html file will be displayed. These files can be left empty or can contain the simple line:

<html><body bgcolor="#FFFFFF"></body></html>

which will display an empty page.

Since our module does not use any parameters, this section is empty.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added- benefits you can find when hosting with us:

- DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Sign in