Fix for PI frontend category/section select from url

From forum here:
http://www.pages-and-items.com/index.php?option=com_kunena&Itemid=29&func=view&id=2136&catid=8#2136


url format:
[code]index.php?option=com_pi_pages_and_items&task=item&sub_task=new&pageId=888&item_type=custom_3&Itemid=63&section=1&category=40&hide_select=1[/code]


version 1.4.6
file:
administrator/components/com_pi_pages_and_items/admin/item.php
line: 55
[code]//check section access. don't check if from frontend, sections and category select will be filtered out
    if(!$class_pi->check_section_access_by_pageid($page_id) && !$frontend){
      
   [/code]

change to
[code]    //check section access. don't check if from frontend, sections and category select will be filtered out
    if(!$frontend){
        if(!$class_pi->check_section_access_by_pageid($page_id)){
          
   [/code]

and add a } to close the extra if().

 
line 67 (or 80 after you did the above ;-)#
[code]//get the section which the category belongs to    
        $class_pi->db->setQuery("SELECT id, section, name FROM #__categories WHERE id='$cat_id'");//name?
        $rows = $class_pi->db->loadObjectList();
        $row = $rows[0];
        $section_id = $row->section;
    }[/code]
change to
[code]
        //get the section which the category belongs to    
        $class_pi->db->setQuery("SELECT id, section, name FROM #__categories WHERE id='$cat_id'");//name?
        $rows = $class_pi->db->loadObjectList();
        $row = $rows[0];
        $section_id = $row->section;
    }
    
    //get category and section id from url
    if($frontend){
        $section_id = intval($class_pi->get_var('section', '' ));    
        $cat_id = intval($class_pi->get_var('category', '' ));
        $hide_page_select = $class_pi->get_var('hide_select', '' );
    }[/code]

line: 930
[code]if($frontend){
                            $pi_sections_array = $class_pi->get_sections();[/code]
change to
[code]if($frontend && !$hide_page_select){
                            $pi_sections_array = $class_pi->get_sections();[/code]

   

SEO by AceSEF