Jump to content



Latest News: (loading..)

- - - - -

Advice on were to put code needed please.


  • Please log in to reply
5 replies to this topic

#1   CrazyCarzCustoms

CrazyCarzCustoms
  • Members
  • 151 posts
  • Real Name:Rob
  • Gender:Male
  • Location:Oliveira do Hospital - Portugal

Posted 22 August 2012 - 10:19 AM

Hi all,

I have a Skype box on my website , it is in the footer.
But the buttons from Skype are  non-ssl and therefor will trigger problems when i install the ssl part of the site , so i need to turn Skype off on ssl pages.

I found the following code in an other Skype contribution.

My question is , would this code be ok and where is the best place to put it.
I also use the Header-Footer-Contents contri and therefor i have also a sub-footer and a sub-header.

/* code to disable Skype on SSL pages */
if ($request_type != 'SSL') {
				// Skype Contact box only visible when on non-secured pages
				include(DIR_WS_BOXES .'skype_contact.php');
		}

Many thanks in advance,

Rob

#2   MrPhil

MrPhil
  • Members
  • 4,139 posts
  • Real Name:Phil
  • Gender:Male

Posted 22 August 2012 - 02:52 PM

I don't understand what you mean by asking "where should I put this?". You go and find wherever Skype code is embedded in osC pages, and wrap
/* code to disable Skype on SSL pages */
  if ($request_type != 'SSL') {
							// Skype Contact box only visible when on non-secured pages 
and
  }
around it to prevent it from being invoked on an SSL-secured page. I'm assuming that the skype_contact.php file includes all the links, etc., and there isn't a separate function call to make elsewhere on the page.

Note that if this is within a function definition, you will need to add
global $request_type;
after the function line and before the above code, to make the variable $request_type available to the code. It's possible, but not likely, that it's already in the code, so check to prevent a duplicate "global".

#3   CrazyCarzCustoms

CrazyCarzCustoms
  • Members
  • 151 posts
  • Real Name:Rob
  • Gender:Male
  • Location:Oliveira do Hospital - Portugal

Posted 23 August 2012 - 09:02 AM

Hi Phil,

Thanks for the response.
Actualy the Skype box has just 2 files , one in the includes/languages folder and one in the include/modules/header-footer-contents folder wich puts it in the footer.
So , if not prevented , i think it will display on every page.

Sorry , i am a noob and i do not understand what you mean with " wherever Skype code is embedded in osC pages" could you please explain a bit more?

Thanks in advance,

Rob

#4   Praful Kamble

Praful Kamble
  • Members
  • 264 posts
  • Real Name:Praful
  • Gender:Male
  • Location:Pune, India

Posted 23 August 2012 - 12:39 PM

Hello CrazyCarzCustoms,

You have added Skype box in footer. ( included contribution file in footer file ). just check in catalog/includes/footer.php file skype box code( may be you will get included skype_me.php ) add condition  there.
if ($request_type != 'SSL') {
}


Thanks
Praful
Like post..hit LIKE button.

osCommerce | Joomla | WordPress | Magento | SEO | CakePHP | CI

Guaranteed Website Speed Optimization!!

#5   CrazyCarzCustoms

CrazyCarzCustoms
  • Members
  • 151 posts
  • Real Name:Rob
  • Gender:Male
  • Location:Oliveira do Hospital - Portugal

Posted 23 August 2012 - 02:00 PM

Hi Praful

Thanks for your answer.
The actual Skype file is not in the footer but gets send there by the Header-footer-contents module , it´s a modular system.


I will put your code into the footer and sub-footer file because that is were the Skype file is send to.

Thanks very much,

Rob

#6   CrazyCarzCustoms

CrazyCarzCustoms
  • Members
  • 151 posts
  • Real Name:Rob
  • Gender:Male
  • Location:Oliveira do Hospital - Portugal

Posted 23 August 2012 - 02:03 PM

ps , sorry for asking this here , should have done that in the contribution topic :-(

Gr,

Rob