If you'd like to let visitors select their language on your site, do the following in your index.php file



$lang_request = JRequest::getWord('lang');
$lang_choice = implode("-", str_split($lang_request, 2));
$currentSession = JFactory::getSession();

if(!empty($lang_choice))
{
$currentSession->set("langChoice",$lang_choice);
$lang =& JFactory::getLanguage();
$lang->setLanguage( $lang_choice );
$lang->load();
}
elseif($currentSession->getState())
{
$lang =& JFactory::getLanguage();
$lang->setLanguage( $currentSession->get("langChoice") );
$lang->load();
}



when user clicks on a link have your url like the following:
http://www.yoursite.com/?lang=de-DE or /?lang=en-GB

the lang would be stored in session so you don't need to worry about it anymore.

To display SQL of Zend_Db_Select object, try this


$query = $this->select()
->where("permitted = 'Y'")
->order("id DESC")
->limit($count);

echo $query->__toString();


that will do it.

If you like to add 'Select Category' option to the option list you got from DB.



$db =& JFactory::getDBO();
$query = "SELECT id as value,name as text FROM categories WHERE parent_id > 0 ORDER BY name";
$db->setQuery($query);
$categories = $db->loadAssocList();
$begin_categories = array(array("value"=>0,"text"=>"Select Category"));
$categories = array_merge($begin_categories,$categories);
$lists['categories'] = JHTML::_('select.genericlist', $categories, 'categories', 'class="inputbox" size="1"', 'value', 'text', null);



I am not sure any better way to do with Joomla classes.

How to add jQuery to Joomla ?

The Joomla 1.5 is coming with Mootools therefore you might experience some conflict with jQuery now.
Just follow the way below to avoid any conflicts. Add the following lines to your view.html.php.



$document = &JFactory::getDocument();
$document->addScript( 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' );
$document->addCustomTag( '' );



The above code fragment would solve your problem.

How to add Javascript or css to your Joomla template?

Just do the following to get it working. Add the following lines to your view.html.php.



$document = &JFactory::getDocument();
$this->document->addStyleSheet('your path/style.css');
$this->document->addScript( 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' );


That would solve your problem.



Some Links (off programming)