Перейти к содержимому


Фотография
- - - - -

com


Лучший Ответ Kess , 09 February 2014 - 22:27

Hello,

 

Sorry for a delayed answer. There is one solution that you can try.

 

First, remove those hidden fields from the search module template. Also, look what is the id of your application and of the menu item which is defined in the search module settings (as I can see, for your main search modules it's 1 and 138 accordingly, the filter on the frontpage is different). Then edit the main index.php of your website by adding the following in it:

if (isset($_REQUEST['Itemid']) && $_REQUEST['Itemid'] == <INSERT_MENU_ID>) {
    $_POST['option'] = $_GET['option'] = $_REQUEST['option'] = 'com_zoo';
    $_POST['app_id'] = $_GET['app_id'] = $_REQUEST['app_id'] = <INSERT_APP_ID>;
}

So in your case it can be

if (isset($_REQUEST['Itemid']) && $_REQUEST['Itemid'] == 138) {
    $_POST['option'] = $_GET['option'] = $_REQUEST['option'] = 'com_zoo';
    $_POST['app_id'] = $_GET['app_id'] = $_REQUEST['app_id'] = 1;
}
Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 4

#1 P.K

P.K

Отправлено 07 February 2014 - 15:43

Hi

I see that the for each search hidden fields are sent using get method. This generates an url which is highly nonsef.

I want to remove the option=com_zoo and app_id for security reasons.   

I know that it is no possible as it is get method but i thought a solution. I use search only for zoo so in the helper file i could make it default so i won't have to send this value.(PS i can do this because i dont use any search except zoo)

 

Can you suggest?


  • 0

#2 Kess

Kess

Отправлено 09 February 2014 - 22:27   Лучший Ответ

Hello,

 

Sorry for a delayed answer. There is one solution that you can try.

 

First, remove those hidden fields from the search module template. Also, look what is the id of your application and of the menu item which is defined in the search module settings (as I can see, for your main search modules it's 1 and 138 accordingly, the filter on the frontpage is different). Then edit the main index.php of your website by adding the following in it:

if (isset($_REQUEST['Itemid']) && $_REQUEST['Itemid'] == <INSERT_MENU_ID>) {
    $_POST['option'] = $_GET['option'] = $_REQUEST['option'] = 'com_zoo';
    $_POST['app_id'] = $_GET['app_id'] = $_REQUEST['app_id'] = <INSERT_APP_ID>;
}

So in your case it can be

if (isset($_REQUEST['Itemid']) && $_REQUEST['Itemid'] == 138) {
    $_POST['option'] = $_GET['option'] = $_REQUEST['option'] = 'com_zoo';
    $_POST['app_id'] = $_GET['app_id'] = $_REQUEST['app_id'] = 1;
}

  • 0

#3 P.K

P.K

Отправлено 10 February 2014 - 14:48

Hi

I tried and got 

Fatal error: Call to a member function getResource() on a non-object in /home/sitename/public_html/administrator/components/com_zoo/classes/type.php on line 278

 

What could be the issue? Also can itemid also be removed


  • 0

#4 Kess

Kess

Отправлено 10 February 2014 - 21:44

I think you made something wrong. You should have edited modules/mod_jbzoo_search/tmpl/default.php (or it's joomla template override) by removing following lines from there:

<input type="hidden" name="option" value="com_zoo"/>
<input type="hidden" name="app_id" value="<?php echo $application->id; ?>" class="jsApplicationId"/>

and then adding

if (isset($_REQUEST['Itemid']) && $_REQUEST['Itemid'] == 138) {
    $_POST['option'] = $_GET['option'] = $_REQUEST['option'] = 'com_zoo';
    $_POST['app_id'] = $_GET['app_id'] = $_REQUEST['app_id'] = 1;
}

to the index.php from your root folder before the

$app->execute();

line. That's the code for your main search modules.

 

Please, check if that's what you have done.


  • 0

#5 P.K

P.K

Отправлено 11 February 2014 - 05:58

Hi

My mistake. Was doing in the template's index.php. Now it works. Can we extend this solution for itemid= in the url?

 

An issue is that for main search auto-complete is not working :(

thanks


Сообщение отредактировал P.K: 11 February 2014 - 06:02

  • 0




Click to return to top of page in style!