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
- » Select modules based on Referer URL...
Select modules based on Referer URL on joomla 1.7
Re: Select modules based on Referer URL on joomla 1.7
That simply means that you did a typo somewhere in the PHP.
Can you paste the exact code you are using in the PHP box into this forum, and I'll check it for you?
It's possible that the original code in that recipe was incorrect... will check that too. Sorry in advance if that was the case!
Cheers,
Stephen
Re: Select modules based on Referer URL on joomla 1.7
Yes, that was an error in the recipe page - sorry!
The correct recipe is this:
if (array_key_exists('DID_GOOGLE_MODULE', $_COOKIE)) return;
if ( $core_genius->check( "referer starts with http://www.google/" )) {
/* if so, set a cookie for 10 years... */
setcookie('DID_GOOGLE_MODULE',1,time() + 10*365*24*60*60,'/');
/* ... and show the module */
return XXX; /* replace XXX with module id to return */
}
Re: Select modules based on Referer URL on joomla 1.7
I think that is the recipe i need but i don't know how can i use it. I want to hide my breadcrumbs module for the shop.product_details if user come from my own page. But if they come from google or another, will see the breadcrumb. Can you help me to do that? Thank you,
Now i have put "only" in my code for hide allways at shop.product_details:
Code:
if ($_GET['page'] != "shop.product_details") {
return 168;
}
Re: Select modules based on Referer URL on joomla 1.7
No, I wouldn't use that. Instead, I think this will work:
$vm = JomGenius("virtuemart");
$on_detailspage = $vm->check("pagetype = shop.product_details");
$from_self = $core_genius->check("referrer startswith http://www.mysite.com/"); // CUSTOMISE SITE NAME!
if (! ($on_detailspage and $from_self)) return 168;
What this does is it gets 2 pieces of information:
1 - whether it's on the details page
2 - whether it's coming from itself (referrer is your own site)
If BOTH of those conditions are true, then it should not show the module. So we negate it (the "!"), so if either of them is not true, then the module will be shown.
Hope that helps,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Select modules based on Referer URL...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7622
- Newest User:
- boestreecare
- Members Online:
- 2
- Guests Online:
- 147
- Online:
- boestreecare, musser4585
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked