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.

 

Publish diffrent mods when httpS:// url

Publish diffrent mods when httpS:// url

I have some mods than does not work correctly with https pages ( because this mods use link on not https pages).
So does anybody know code or variable to use to return diffrent mod id when the url of the current page is http or https one.
Thanks

Edited By: dnomyaj
14-Feb-10 12:40:53

dnomyaj
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Publish diffrent mods when httpS:// url

Hi dnomyaj,

yes, that should be easy to do:

if (@$_SERVER['HTTPS'] == null or @$_SERVER['HTTPS'] == 'off' ) return XXX;
else return YYY;
// replace XXX with the module id of the module to include only when HTTPS is NOT used
// and YYY with the module id to use when HTTPS is used.


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

Re: Publish diffrent mods when httpS:// url

thanks very much for your relply...

During this time i serch ... serch ... and serach again ...
And I find this :
if $_SERVER['SERVER_PORT'] == 80  -> this is http
if $_SERVER['SERVER_PORT'] == 443  -> this is https

but i think your's is better because it is not deepending on apache configuration.

Cheers

dnomyaj
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Publish diffrent mods when httpS:// url

Hi, I think this post may be helpful to me, but I need a bit of assistance.

I want to disable Adsense modules when the URL is using HTTPS because Adsense does not support HTTPS (it displays a message to the user that there is unencrypted information on the page)

I tried using this code but it did not work for me:

if ( $core_genius->check( "issecure" ) == false )
return 80;

I am thinking of using @$_SERVER['HTTPS'] but I don't know the exact code to ONLY display the module if the URL is HTTP, and hide the module if it is HTTPS. Could you be of assistance?

joeymad
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: Publish diffrent mods when httpS:// url

hi,
her is a copy of the code i put in my metamod
i display 3 different mudules inside my metamod
depending on  3 parameters: HTTP, Virtuemart and virtemart cart

you can see it working at http://www.atita38.com/
add to cart an item and choose 'Commander', then you go to https page

/* ---  modules list ---
49 -> En Promotion
75 -> Nouveautés
83 -> GS Flash Vertical  */

/*  $YYN: each lettre is Yes or No for options-> https - virtu - cart*/
$YYN =  ""   ; /* "HTTPS+Virtuemart+PasPayer" ;  */
$YNN = "83,75"  ;  /* "HTTPS+PasVirt+PasPayer" ;  */
$YYY = ""  ; /* "HTTPS+Virtuemart+Payer-? " ;  */
$YNY = ""  ; /* "HTTPS+PasVirt+Payer-?????" ;  */

$NYN = "83,49 , 75 "  ;  /*  "http+Virtuemart+PasPayer" ; */
$NNN = "83,49 , 75 " ;   /*  "http+PasVirt+PasPayer" ; */
$NYY = ""  ;  /*  "http+Virtuemart+Payer-? " ; */
$NNY = "" ;   /*  "http+PasVirt+Payer-?????" ; */


if (@$_SERVER['HTTPS'] == null or @$_SERVER['HTTPS'] == 'off' ){  $httpsY= 0;} else {  $httpsY= 1; }

if ($option == "com_virtuemart") {$virtuY=1;}  else { $virtuY= 0;}
$PayerY = 0 ;     /*if (pagepanier ?? ){ $PayerY = 1;} else { $PayerY = 0;} */

if ( $httpsY== 1 AND $virtuY==1  AND $PayerY == 0) {   return $YYN ;} /*1 cas entree par https ??? */
if ( $httpsY== 1 AND $virtuY==0  AND $PayerY == 0) {  return $YNN ; } /*2 cas tutos en https ??? */
if ( $httpsY== 1 AND $virtuY==1  AND $PayerY == 1) {  return $YYY ; } /*3 cas payer normal */
if ( $httpsY== 1 AND $virtuY==0  AND $PayerY == 1) {   return $YNY ; } /*4 cas impossible  -> pas vitr mais payer ?? */


if ( $httpsY== 0 AND $virtuY==1  AND $PayerY == 0) { return $NYN ; } /*11 cas entree */
if ( $httpsY== 0 AND $virtuY==0  AND $PayerY == 0) { return $NNN ;} /*12 cas tutos */
if ( $httpsY== 0 AND $virtuY==1  AND $PayerY == 1) { return $NYY ; } /*13 cas payer mais pas https??? */
if ( $httpsY== 0 AND $virtuY==0  AND $PayerY == 1) { return $NNY ;} /*14 cas payer mais pas virtuemart et pas https ??? */

dnomyaj
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Publish diffrent mods when httpS:// url

dnomyaj wrote:

if ( $core_genius->check( "issecure" ) == false )
return 80;

That's so close! You're combining the 2 ways to do it. You can either do this:

if ( $core_genius->info( "issecure" ) == false ) return 80;

or this:

if ( $core_genius->check( "issecure = false" ) ) return 80;

I like the rest of your rule smile It's great to see how MetaMod can help place modules according to quite complex criteria!

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

Board Info

Board Stats:
 
Total Topics:
1686
Total Polls:
6
Total Posts:
5933
Total Posts Today:
7
User Info:
 
Total Users:
4432
Newest User:
kinggambling14
Members Online:
0
Guests Online:
119

Online: 
There are no members online

Forum Legend:

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