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.

 

Best way to check on url

Best way to check on url

Is there an easy way to check if the url contain certain keywords?

hlchia
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Best way to check on url

Yes:

if ($core_genius->check("url contains any of keyword1, keyword2, keyword3")) return XXX;

or to test that it contains ALL of the keywords listed, in any order:

if ($core_genius->check("url contains all of keyword1, keyword2, keyword3")) return XXX;


JomGenius gives you lots of other things that you can easily test for, like referrer etc. See http://www.metamodpro.com/jomgenius/about and http://www.metamodpro.com/jomgenius/parameters for more details.

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

Re: Best way to check on url

Let's say for following url:
http://demo.reviewsforjoomla.com/art-ga … rd-theatre

The following statement will be evaluated as true?
if ($core_genius->check("url contains any of art, redford"))

hlchia
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Best way to check on url

Yes, that's right. In fact it contains both art and redford, so any one of those would be sufficient to be evaluated as true.

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

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5945
Total Posts Today:
1
User Info:
 
Total Users:
5610
Newest User:
idim4
Members Online:
1
Guests Online:
342

Online: 
bseba9l

Forum Legend:

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