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.

 

MetaMod Pro on AdsManager

MetaMod Pro on AdsManager

Hi I have been struggling on this.
What I want to do is to show featured ads on X category (catid=70) ONLY at that X category page.
So I created the AdsManager module for this, ID=167, Enable=No, Menu=None.

Then I created the MetaMod module and paste this code.

if (

$option == 'com_adsmanager'
and JRequest::getVar('page') == 'show_category'
and JRequest::getVar('catid') == '70'
and $Itemid == NULL
and JRequest::getVar('expand') == '0'
and JRequest::getVar('order') == '0'
and JRequest::getVar('text_search') == ''
) return 167;

But the problem is that the module is showing on all pages, not only pages '70'. Not sure what I did wrong. Pls helps.

Thanks.

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

Re: MetaMod Pro on AdsManager

Hi never mind, I figured out the problem. I put the module id in "id include" field.

Another question.

Below is only for catid = 70. How do I write for range of catid, for example start from catid 70 to catid 90.

and JRequest::getVar('catid') == '70'. Thank you.

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

Re: MetaMod Pro on AdsManager

Hi aimamu0322,

It's great to see this being used for AdsManager. Thanks for sharing this code.

To search for a range of catids, try it this way:

$catid = JRequest::getVar('catid');
if (
  $option == 'com_adsmanager'
  and JRequest::getVar('page') == 'show_category'
  and $catid >= '70'
  and $catid <= '90'
  and $Itemid == NULL
  and JRequest::getVar('expand') == '0'
  and JRequest::getVar('order') == '0'
  and JRequest::getVar('text_search') == ''
) return 167;

Cheers,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: MetaMod Pro on AdsManager

Hi Stephen, thanks a lot. Work great !!

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

Re: MetaMod Pro on AdsManager

Hi Stephen, needs another helps.

I want to put module XX in all pages, except when user write the ads. How can I do this ?
This is the page code when user write an ads.

$option == 'com_adsmanager'
and JRequest::getVar('page') == 'write_ad'
and JRequest::getVar('catid') == '10'
and $Itemid == NULL

Thanks.

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

Re: MetaMod Pro on AdsManager

if ( ! ( $option == 'com_adsmanager' and JRequest::getVar('page') == 'write_ad' ) ) return XX;


The "!" means "not", and means that we negate the stuff that comes after it. So we're looking for the situation where it's NOT "com_adsmanager and write_ad".

Cheers,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10091
Newest User:
lamanaudio
Members Online:
3
Guests Online:
182


Forum Legend:

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