Joomla

Pagination in Your Joomla Component

While I was working today to fix how to sort the pagination in my Joomla component, I found this way of pagination to work for me. Hope this will help you too   First of all I edited my Model which interacts with database. I made a function to display some content from the database which is as follows

LOCATION /com_findengg/models/findengg.php

 function displayDeadRegions()
/* THIS CODE IS TO BE MODIFIED AS PER YOUR MODEL. THE ONLY THING I CHANGED IN MY MODEL IS I ADDED $mainframe variable $limit  $limitstart and modified the query */

{
   global $mainframe;
   $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); 
   $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); 
   $db =& JFactory::getDBO();
   $query = 'SELECT * FROM `jos_findmyengineer_dead` ORDER BY `jos_findmyengineer_dead`.`date_logged` DESC ';
   $db->setQuery( $query, $limitstart, $limit );
   if( !$db->query() ) 
      { $errorMessage = $this->getDBO()->getErrorMsg();
        JError::raiseError( 500, 'Error in GETTING List of Dead RegionS: ' . $errorMessage ); 
      } 
   $dead_regions = $db->loadObjectList(); // Return the list of product types return $dead_regions; }///end of function dead regions  

In the same model I made another function to get the page parameters

LOCATION /com_findengg/models/findengg.php


  function getPageNavParameters($tablename) {
    global $mainframe;
    $db =& JFactory::getDBO(); 
    $table = $db->nameQuote( $tablename ); 
    $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); 
    $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); 
    $query = "SELECT COUNT(*) FROM " . $table; 
    $db->setQuery( $query ); 
    $total = $db->loadResult();
    jimport('joomla.html.pagination');
    $pageNav = new JPagination( $total, $limitstart, $limit ); 
    return $pageNav; 
    }//end of function getPageNavParameters 

Now I edited the view.html.php file. The place where I was making call to my layout, I called this function as follows

LOCATION /com_findengg/views/findengg/view.html.php

 
          $layout = JRequest::getVar( 'layout', 'default' ); 
          $this->setLayout($layout); 
          switch ($layout) { 
            case deadregions:{ 
                              $dead_regions=$model->displayDeadRegions();
                              $this->assignRef( 'dead_regions', $dead_regions);
                              $db_table_name='jos_findmyengineer_dead'; 
                              $pageNav=$model->getPageNavParameters($db_table_name);
                              $this->assignRef( 'pagination', $pageNav); 
                              break; } 
            default:{ 
                            } 
       } parent::display( );
    }
 } 

Finally in my template layout file in folder tmpl I added this code in the table

LOCATION /com_findengg/views/tmpl/deadregions.php

 	
	 echo pagination->getListFooter(); 

Joomla FTP setup in ubuntu server

Hi all

I have been struggling so long to configure my FTP layer for joomla but could not find any satisfactory answer…………Then i came up with the following idea to get rid of all the errors and make the webpage secure too

Follow the following steps
1. chmod 777 /location_of_your_joomla_folder/
chmod 777 /var/www/joomla15/
2. install the joomla and check the owner of the configuration.php
3. chown -R www-data /var/www/joomla15
4. The site is now in production stage ………..Once the site is completely created , change back the permission to the original user.

Strict standards : Non-static methods called statically Joomla Installation General problem

I have been using using joomla 1.5.7 on xampp 1.7.3a for my website

I have been struggling hard to remove the following errors comming to my webpage after installing Joomla.

Strict Standards: Non-static method JLoader::import() should not be called statically in /opt/lampp/htdocs/joomla/libraries/joomla/import.php on line 29

Strict Standards: Non-static method JLoader::register() should not be called statically in /opt/lampp/htdocs/joomla/libraries/loader.php on line 71

Strict Standards: Non-static method JLoader::import() should not be called statically in /opt/lampp/htdocs/joomla/libraries/joomla/import.php on line 32

Strict Standards: Non-static method JLoader::register() should not be called statically in /opt/lampp/htdocs/joomla/libraries/loader.php on line 71

Strict Standards: Non-static method JLoader::load() should not be called statically in /opt/lampp/htdocs/joomla/libraries/loader.php on line 161

Strict Standards: Non-static method JLoader::register() should not be called statically in /opt/lampp/htdocs/joomla/libraries/loader.php on line 138

Strict Standards: Non-static method JRequest::clean() should not be called statically in /opt/lampp/htdocs/joomla/libraries/joomla/import.php on line 33

The only way I was able to repair it was by changing the following value in configuration.php file which is present in Joomla home folder. Sometimes we also manually upload this file to joomla home folder.

  • EARLIER VALUE :  var $error_reporting = ‘-1’;
  • CHANGED VALUE:  var $error_reporting = ‘6135’;

It worked fine for me.