Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Error 501 : Method not implemented
Error 501 : Method not implemented
Error 501 : Method not implemented
Hello,
i have installed Metamod pro, when i try the code number 1,
Code:
if (
$option == 'com_virtuemart'
and JRequest::getVar('page') == 'shop.cart'
and $Itemid == '2'
and JRequest::getVar('zone_qty') == '1' /*!*/
) return right_META; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
so to show module at a certain position, everything works.
With the code number 2,
Code:
if ( ! (
$option == 'com_virtuemart'
and JRequest::getVar('page') == 'shop.cart'
and $Itemid == '2'
and JRequest::getVar('zone_qty') == '1' /*!*/
) ) return right_META; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
does not work, it should allow me to hide a standard module with Metamod. The problem is that when I validate the configuration of the module with the code number 2, I have the following error 501:
Method Not Implemented
POST to /administrator/index.php not supported.
Is there an error in the code number 2 when i add the
Code:
! (
at start and
the
Code:
)
at end ?
Thanks for help, regards,
Frédéric
Re: Error 501 : Method not implemented
Hi Frédéric,
that's very strange indeed - there's nothing wrong with the particular syntax you have used, as it's valid PHP and is supposed to work! I tested it on my test server and it didn't cause an error there.
One thing that you should do, however, is surround the right_META with quotes like this:
return "right_META";
Something that I have seen happen sometimes is that hidden characters can creep in when you are copying and pasting. You could try typing out the whole thing again instead of copying and pasting (lucky it's short).
If you can confirm that the error you reported ONLY occurs when you add the (! ) syntax, then I will be very confused! Please let me know...
Cheers,
Stephen
Re: Error 501 : Method not implemented
I am *very* puzzled as to why this is happening for you. I have never seen an error like it. There's obviously something strange going on in your setup.
Perhaps you can avoid that syntax by changing the rule to the following:
Code:
if (
$option != 'com_virtuemart'
or JRequest::getVar('page') != 'shop.cart'
or $Itemid != '2'
or JRequest::getVar('zone_qty') != '1'
) return "right_META"; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
Does this give you the same error?
Cheers,
Stephen
Re: Error 501 : Method not implemented
I havent the error, but the module dont show on other pages, i try this code on an other site :
if (
$option != 'com_quickform'
and $view != 'quickmain'
and $Itemid != '29'
and JRequest::getVar('lang') != 'fr'
and JRequest::getVar('forms') != '1'
and JRequest::getVar('/quickmain/1_html') != '' /*!*/
) return left_FRED;
Is it correct ? the module have to show on all pages but not on the quickform page no ?
Re: Error 501 : Method not implemented
Hi thefbi,
the opposite of (x AND y AND z) is (!x OR !y OR !z).
So if you want to reverse the rule that you get from Advanced Debug mode, you have to change all the "==" to "!=" (as you have done), and change all the "and" to "or".
Therefore, I think this is what you want:
if (
$option != 'com_quickform'
or $view != 'quickmain'
or $Itemid != '29'
or JRequest::getVar('lang') != 'fr'
or JRequest::getVar('forms') != '1'
or JRequest::getVar('/quickmain/1_html') != ''
) return "left_FRED";
However, sometimes the Advanced Debug mode doesn't help you when you are trying to identify ONLY the front page of a component.
That's because often the inner pages of a component contain extra URL parameters, that the front page of the component does not have.
e.g. the front page of the component might be:
index.php?option=com_mycomponent&Itemid=100
and the inner pages might be:
index.php?option=com_mycomponent&Itemid=100&view=foobar&id=22
Therefore you can't uniquely identify the front page by looking for $option == com_mycomponent and $Itemid == 100, because that would select the inner page as well. The front page would have to be identified by having $option and $Itemid, but NOT having $view or $id.
I hope that might help to explain the situation... it might be easier if you can provide some more full URLs for some different pages in your component (or Advanced Debug output), or a link to your site if it's public.
Hope that helps,
Stephen
Re: Error 501 : Method not implemented
Hello,
sorry for the late response, but many job.
Now it work with the != and the or, so it is ok. But not with the ( ! (.
I have another question, my code is :
Code:
if (
$option != 'com_virtuemart'
or JRequest::getVar('page') != 'checkout.index'
or $Itemid != '73'
or JRequest::getVar('/Voir-le-contenu-de-votre-panier_html') != '' /*!*/
) return 50; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
So the in the page checkout.index, my module dont show. But if i want to hide it too another page, how do i
put the code, because i have try to put at following like this :
Code:
if (
$option != 'com_virtuemart'
or JRequest::getVar('page') != 'checkout.index'
or $Itemid != '73'
or JRequest::getVar('/Voir-le-contenu-de-votre-panier_html') != '' /*!*/
) return 50; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
if (
$option != 'com_virtuemart'
or JRequest::getVar('page') != 'shop.cart'
or $Itemid != '73'
or JRequest::getVar('/Voir-le-contenu-de-votre-panier_html') != '' /*!*/
) return 50; /* remplacer XXX par l'ID du module ou par sa position pour le faire apparaître */
But it dosent work.
Thank you, regards.
Re: Error 501 : Method not implemented
To combine those 2 rules, you can do it this way:
if (
$option != 'com_virtuemart'
or ( JRequest::getVar('page') != 'checkout.index' and JRequest::getVar('page') != 'shop.cart' )
or $Itemid != '73'
or JRequest::getVar('/Voir-le-contenu-de-votre-panier_html') != '' /*!*/
) return 50;
In fact, I am pretty sure that you don't need the "Voir-le-contenu-de-votre-panier_html" line, so you should be able to use:
if (
$option != 'com_virtuemart'
or ( JRequest::getVar('page') != 'checkout.index' and JRequest::getVar('page') != 'shop.cart' )
or $Itemid != '73'
) return 50;
Cheers,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Error 501 : Method not implemented
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7645
- Newest User:
- foocd90
- Members Online:
- 2
- Guests Online:
- 165
- Online:
- melton7386, foocd90
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked