Tuesday, November 12, 2013

How to get user data in joomla root page [SOLVE]

How to get user data in joomla root page  external
 
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', $_SERVER[ 'DOCUMENT_ROOT' ] );
... then you need to include three files, like:
require_once( JPATH_BASE . DS . 'includes' . DS . 'defines.php' );
require_once( JPATH_BASE . DS . 'includes' . DS . 'framework.php' );
require_once( JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php' );
$mainframe =& JFactory::getApplication('site');
EDIT.. ... or you can include only two files like:
require_once( JPATH_BASE . 'libraries' . DS . 'import.php' ); // framework
require_once( JPATH_BASE . 'configuration.php' ); // config file
... and finally use joomla class, like:
$db = JFactory::getDBO();

how to remove mootools jquery in joomla home page ?

please go through below. copy and paste the above joomlaheader tag.

<?php
if ($menu->getActive() == $menu->getDefault()) {
         $headData = $doc->getHeadData();
         $scripts = $headData['scripts'];
   

         //remove your script, i.e. mootools

         unset($scripts['/canvasink/media/system/js/mootools-more.js']);
         unset($scripts['/canvasink/media/system/js/mootools-core.js']);
         $headData['scripts'] = $scripts;
         $doc->setHeadData($headData);
}
         ?>