Pages

Tuesday, July 26, 2011

jCarousel: No width/height set for items

PROBLEM: While loading, jCarousel popup alert with this error message:
"jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."
I would always get this error message every time the front page loads. I have been searching for a solution for many months and have finally found one.

SOLUTION: Not sure if this is really a solution or workaround, but it does the job of stopping the nagging popup box once and for all (while permitting jCarousel functionality).
  1. Open jquery.jcarousel.pack.js in the ../jcarousel/lib/ directory.
  2. Search for the word "alert" and you should find a snippet of code like this:
    Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|
  3. Replace "alert" with "isNan":
    Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|isNan|class|
  4. Refresh the webpage that loads jCarousel and you should no longer get the infinite loop popup error!

Joomla logout Button or Link, Joomla1.6 or Joomla1.7

Joomla 1.5 Logout Link

<a href="index.php?option=com_user&task=logout&return=Lw">Log Out</a>

In Joomla 1.5 make a menu-item type 'url' to 
If you want to create a "log out" button or link for users, here is the easiest way. Create a new menu of “External Link” type. Then, set its access level to "Registered" and give it any name you want like “Logout.” In the “Link” text box type the following “index.php?option=com_user&task=logout&return=Lw”.


Joomla 1.6 or Joomla 1.7 Logout Link

Hello Everyone,
I found a solution, If you want to create a "log out" button in Joomla 1.6 or Joomla 1.7, override the joomla token in get method:

<a href="index.php?option=com_users&task=user.logout&<?php echo JUtility::getToken(); ?>=1&return=<?php echo base64_encode($this->baseurl); ?>">LOGOUT</a>

It's works like a charm.

I hope it's help you. Please comments on it and share it.

Monday, July 25, 2011

Set your Joomla Module in Component in Joomla

<?php
jimport('joomla.application.module.helper');
// this is where you want to load your module position
$modules = JModuleHelper::getModules('MODULE-POSITION');
foreach($modules as $module)
{
        echo JModuleHelper::renderModule($module);
}
?>

You can set joomla modules in your joomla components by setting this code. only you have to put this code in component where you want to saw you Joomla module and only set position in 'MODULE-POSITION'.

Wednesday, July 20, 2011

Insert, Update and Delete Query in Joomla

Now its Insert, Update and Delete Query in Joomla,

For INSERT query in Joomla structure
$db = &JFactory::getDBO();
             $insert_query = "INSERT into #__TABLENAME(feild1,feild2) values('value1','value2') ";
             $db->setQuery( $insert_query );
             $db->query();

For UPDATE query in Joomla structure
             $update_query = "UPDATE #__TABLENAME SET feild1 = 'value1' ";
             $db->setQuery( $update_query );
             $db->query();

For DELETE query in Joomla structure
             $delete_query = "DELETE FROM #__TABLENAME WHERE feild1 = 'value1' ";
             $db->setQuery( $delete_query );
             $db->query();

Thursday, July 14, 2011

SQL Query in Joomla

Hi to everyone,

In Joomla you create sql query easy way. Only you have to get DBO connection to start database connection only one time in a page.

$db = &JFactory::getDBO();
        $query = "select * from #__TABLENAME";
        $db->setQuery($query);
        $rows = $db->loadObjectList();

in which "TABLENAME" is your joomla table name and "#__" is behalf of "jos_". "jos_" is predefined value in every jomla table. $rows is an array in which all records has been fetched from database.