Menu Content

Shopping Cart

cart
Your Cart is currently empty.

Currencies Accepted


Newsletter

Subscribe to our newsletter


Name:

Email:

Like it? Share it!

Find Us Elsewhere



Follow us on Twitter

Home Articles

Articles
Browser Detection in Joomla PDF Print E-mail
Articles - Articles
Written by Spiral Scripts   
Monday, 08 March 2010 11:19

It is often the case that as web developers we need to add some extra coding that will deal with the quirks of particular web browsers . Using Joomla we can take advantage of Joomla's built in browser detection.

Browser detection is handled through the JBrowser class. The is located in Joomla's class library, in the environment subpackage. In order to use it you will first need to import it:-

jimport('joomla.environment.browser');

Then you need to get an instance of the browser object

$browser = &JBrowser::getInstance();

You can then find information about the web browser being used through examing the properties of this object, which are accessed through the appropriate 'get' method. The methods include:-

  1. getPlatform: returns the browser platform ('win','mac' or 'unix');
  2. getBrowser: returns the browser type ('opera','palm','msie', 'amaya', 'fresco', 'avantgo', 'konqueror', 'mozilla', 'lynx', 'links', 'hotjava', 'up','xiino', 'palmscape', 'nokia', 'ericsson', 'wap', 'imode', 'blackberry', 'motorola', 'mml');
  3. getMajor: returns the major version number;
  4. getMinor: returns the minor version number.

To give an example, a very common application is that you wish to load a separate stylesheet for users of Internet Explorer 6, to deal with its annoying quirks.

Example

        jimport('joomla.environment.browser');
$doc =& JFactory::getDocument();
$browser = &JBrowser::getInstance();
$browserType = $browser->getBrowser();
$browserVersion = $browser->getMajor();
if(($browserType == 'msie') && ($browserVersion < 7))
{
$doc->addStyleSheet( 'css/ie6.css' );

}

If there is a particular quirk that you wish to deal with, such as lack of support for alpha transparency in png images (a common complaint with IE6), you can use the getQuirks() method:-

   If($browser->getQuirks('png_transparency'))
   {
        $doc->addScript( 'js/pngfix.js' );
   }

Other useful methods are:-

  1. isRobot(): returns true if the user agent is in fact a robot;
  2. isSSLConnection(): returns true if the connection is SSL.
  3. hasFeature('feature'): returns true if the browser supports the feature 'feature', which can include among others ('iframes', 'frames', 'javascript','java', 'images', 'dom, 'svg'')

Limitations

The browser object uses the reported user agent to detect this information, this information is under the control of the client so there is no guarantee that it is true. In particular you need to be careful using the hasFeature() method. For example the reported value for hasFeature('javascript') does not take account of the fact that users can choose to disable scripting on a browser that will support javascript.

Add a comment
 
Understanding CSS Selectors When Editing Joomla Templates PDF Print E-mail
Articles - Articles
Written by Spiral Scripts   
Monday, 18 January 2010 18:06

When editing a Joomla! template one of the biggest challenges can be finding the css style rules that apply to a particular element. It really helps if you understand the basics of css selectors, and how they are applied to css style rules.

Add a comment
Read more... [Understanding CSS Selectors When Editing Joomla Templates]
 
Displaying artist and track title in the mp3 player PDF Print E-mail
Articles - Articles
Written by Spiral Scripts   
Saturday, 16 January 2010 11:34

Our Random MP3 player can display artist and song information about the mp3 file that it is playing. It does this by reading the ID3 tags from the file. ID3 tags are data fields that are added to an MP3 file. ID3 tags contain information about the file, such as the name of a song, album, and artist.

Sometimes there are difficulties with this, usually due to the fact that there are a variety of formats for these tags. The player supports version 1.0, 1.1, 2.3, and 2.4 tags; version 2.2 tags are not supported.

If your player is having problems displaying the information then it may be because the ID3 tags for your mp3s are the wrong version for it. It is in fact quite easy to change the version if you have iTunes. To convert the tags, first open iTunes, then find the mp3 track file. Right-click on the track, and select 'Convert ID3 tags', you will then be prompted to select the tag version.

Add a comment
 
Social Networking Extensions for Joomla PDF Print E-mail
Articles - Articles
Written by Spiral Scripts   
Friday, 08 January 2010 17:01

A system of user profiles that allows for the display of user information, activities and interaction is a common requirement for many websites and there is a variety of software available, of varying quality. The purpose of this article is to provide a guide to some of the options available.

The main contenders are Community Builder, JomSocial, and Mighty Extensions Touch.

Add a comment
Read more... [Social Networking Extensions for Joomla]
 
Joomla Password Security PDF Print E-mail
Articles - Articles
Written by Spiral Scripts   
Monday, 21 December 2009 12:17

Recent discussions in the Joomla! security forum have made it clear that a particular weak point of the Joomla security system is the front-end password reset function. If your site includes any extension that is vulnerable to a relatively common security problem - sql injection - then an attacker can potentially abuse the password reset function to change your administrator password. They can do this even if you do not display the login module in your front-end.

Add a comment
Read more... [Joomla Password Security]
 
<< Start < Prev 1 2 Next > End >>

Page 1 of 2
 
 

VirtueMart Featured Products Grid

Switch View

A module extension for the the Joomla 1.5 CMS. It plays a random list of mp3s using the Flash media player.

£12.00


A module extension for the the Joomla 1.5 CMS. It displays a short excerpt from articles in a selected category or section, or from a specified list of articles, with link and optional thumbnail image.

£12.00


A featured items module that shows selected entries from the SOBI2 business index.

£12.00


A Flash puzzle game for the Joomla! content management system. This would be suitable for a site aimed at children.

£10.00



 
 

fitness