Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Compatibility problem metamod free / smart slider / smart content tab

Compatibility problem metamod free / smart slider / smart content tab

Hi everybody,
I use joomla 2.5.8.
Since one year i use metamod to display banner and menu in fictitious page as the search page (ajax universal search and the login page of community builder).
Since one year i use smart slider a component of the offlajn company to make easy slides and i never had any problems.

One week ago i downloaded the update of smart slider with a new component smart content tab.
After installation i had a big error on our professional online web site.
It s a problem of compatibility between metamod free and smart slider...

I asked Offlajn company but i have not yet answer.

The error message on my web site its about metamod and the helper php 628:
The error message is only display where i using component of Offlajn company.

I mean that if i go on a page where i use metamod and not smart slider, everything is ok. but if i go on a page where i have a smart slider i have error messages:

Notice: Undefined variable: task in /home/...../modules/mod_metamod/helper.php(628) : eval()'d code on line 4

Notice: Undefined variable: task in /home/...../modules/mod_metamod/helper.php(628) : eval()'d code on line 5

Notice: Undefined variable: searchphrase in /home/...../modules/mod_metamod/helper.php(628) : eval()'d code on line 4

Notice: Undefined variable: searchword in /home/......./modules/mod_metamod/helper.php(628) : eval()'d code on line 5

Do someone know if we can do something with this incompatibility ?
If i buy metamod pro do i ll have the same problem ?

Thank you for your help

Sebpl
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Compatibility problem metamod free / smart slider / smart content tab

Hi Sebpl,

sorry about the slow reply - I've been out of town for the last 2 weeks and wasn't able to work on customer issues during that time.

The Notices that you are getting from the MetaMod file are directly related to the PHP code that you are using inside the MetaMod PHP block ("recipe").

I have a feeling that the smart slider module may have something in it which increases the error reporting level, meaning that you can then see the warnings. I am pretty sure that the warnings are being generated ALL the time, but that you are only seeing them when smart slider is active.

I think that in your PHP code you are probably referring to $task, $searchphrase, and $searchword, and expecting these variable to be populated from the URL, automatically. This will not work! (or it can only work if you have a bad server setup that automatically populates these from the URL. This is dangerous!).

What you need to do is to change $task to this:

JRequest::getVar('task')
... and do the same for $searchphrase and $searchword.

Then the errors will disappear, and the PHP code will probably work better!

If in doubt, post your PHP code into the forum here and I'll take a look at it for you.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Compatibility problem metamod free / smart slider / smart content tab

Hi Stephen,

Thank you for your answer>
I had try to work on a way without metamod but i prefer to use metamod smile.
You say that i could fix the problem by changing the php code.

I am not so good with php so i prefer that you confirm the code that i should use.

I use metamod for make appear banner or module or menu in fictitious page like the comprofiler page or search page.

For example:baner
I had created a metamod module with the following php code:
if ( $option =="com_comprofiler" ) return 118;
if ( $task == "registers" ) return 118;
if ( $task == "login" ) return 118;

(118 was of course the id of my banner)

and for baner in the search page:
if ( $option == "com_search" ) return 120;
if ( $itemid == "101") return 120;
if ( $searchphrase == "all" ) return 120;
if ( $searchword == "*" ) return 120;

I have just to change $task to JRequest::getVar('task')
and $searchword to JRequest::getVar('searchword') ?

the code will be the following ?
if ( $option =="com_comprofiler" ) return 118;
if ( JRequest::getVar('task') == "registers" ) return 118;
if ( JRequest::getVar('task') == "login" ) return 118;

Thank you for your help.

Merry Christmas and Happy New Year

Sebpl
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Compatibility problem metamod free / smart slider / smart content tab

Stephen,

I have again one question.
Why i need to assign the module to "all the page" for that it s work on the comprofiller page or search page?
It s not possible to assign to no page and publish it ? it s the purpose of the php code to retourn the baner when the task is on comprofiler ?

Sebpl
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Compatibility problem metamod free / smart slider / smart content tab

Hi Sebpl,

in answer to your previous question: yes, the modified code you wrote at the end was correct.
In fact, here's an even more efficient way to do it:

$task = JRequest::getVar('task');
$searchphrase = JRequest::getVar('searchphrase');
$searchword = JRequest::getVar('searchword');
if ( $option =="com_comprofiler" ) return 118;
if ( $task == "registers" ) return 118;
if ( $task == "login" ) return 118;
if ( $searchphrase == "all" ) return 120;
if ( $searchword == "*" ) return 120;
// etc

In answer to your last post:
1 - the MetaMod needs to be assigned to some or all pages, otherwise the PHP code in the MetaMod will not be run. Often it's best to set it to ALL pages, but there might be some subset of pages on your site where you want it to run, and if so that's good. So if all your comprofiler pages always appear in a certain menu item then by all means, limit the MetaMod to just that menu item. Just be careful that none of the comprofiler pages are ever accessed outside of that menu item (e.g. with a different Itemid) or you will find it won't work.

2 - You can assign the "target" module (the one that you want to control) to any module position (or none), and published or unpublished, it's up to you. MetaMod can auto-publish a module that it includes, depending on the setting of "auto-publish included modules?".

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Compatibility problem metamod free / smart slider / smart content tab

Hi Stephen,

Many thanks for your help smile
I wish you an Happy New Year.

Sebpl
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Compatibility problem metamod free / smart slider / smart content tab

Thanks Seb - and same to you!

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11529
Newest User:
jame380003
Members Online:
1
Guests Online:
151

Online: 
jame380003

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked