Jump to content



- - - - -

Adding A Twitter Feeds Widget to your SSL site.


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1   wildvettes

wildvettes
  • Members
  • 81 posts

Posted 05 April 2011 - 04:21 PM

I have spent about 3 hours+ trying to figure out how to get this widget to work on my SSL site. Twitter has been working on a solution forever so I wouldn't hold your breath on them fixing it any time soon.

The alternative is to exclude the widget from your secure pages. Ok, I can live with that.

The problem I was having was I am using the "Generic Box" addon to incorporate a facebook and twitter feed on my site and the exclude was not working within the confines of the "Generic Box" Text field. I am guessing because it is an actual PHP command. My next step was to try and replicate the box in my right column going outside the "Generic Box" and this is how I did it.

Got to : catalog/includes/template_bottom.php

Find:

<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">
  <?php echo $oscTemplate->getBlocks('boxes_column_right'); ?>
</div>

Change to:
<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">
  <?php echo $oscTemplate->getBlocks('boxes_column_right'); ?>
<?php
if( $_SERVER['HTTPS'] != "on" )
{
?>
<div class="ui-widget-content contentContainer">
*******Insert Your XYZ Widget Here*******
</div>
<?php
}
?>
</div>

So Mine looked like this...
<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">
  <?php echo $oscTemplate->getBlocks('boxes_column_right'); ?>

  <?php
if( $_SERVER['HTTPS'] != "on" )
{
?>
<div class="ui-widget-content contentContainer">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'Corvette',
  interval: 6000,
  title: 'Corvette Tweets',
  subject: '',
  width: 'auto',
  height: 300,
  theme: {
	shell: {
	  background: '#535454',
	  color: '#ffffff',
	},
	tweets: {
	  background: '#050505',
	  color: '#f2eff2',
	  links: '#1985b5'
	}
  },
  features: {
	scrollbar: true,
	loop: true,
	live: true,
	hashtags: true,
	timestamp: true,
	avatars: true,
	toptweets: true,
	behavior: 'default'
  }
}).render().start();
</script>
</div>
<?php
}
?>

  </div>

<?php
  }
?>


You can see it in action at www.wildvettes.com

Look at the home page, then click on my account and watch the widget vanish and give you a safe page encryption message. Hopefully this helps someone else out until Twitter makes the thing secure.

Edited by Jan Zonjee, 05 August 2011 - 05:46 AM.


#2   wildvettes

wildvettes
  • Members
  • 81 posts

Posted 05 April 2011 - 04:42 PM

>_<

Sorry for anyone that pasted that code up there...the contentContainer div is one of my own

you'll want infoBoxContainer, so it would look like:

<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">
  <?php echo $oscTemplate->getBlocks('boxes_column_right'); ?>
<?php
if( $_SERVER['HTTPS'] != "on" )
{
?>
<div class="ui-widget-content infoBoxContainer">
*******Insert Your XYZ Widget Here*******
</div>
<?php
}
?>
</div

Edited by wildvettes, 05 April 2011 - 04:43 PM.


#3   laxbeach

laxbeach
  • Members
  • 1 posts

Posted 05 August 2011 - 03:25 AM

Thank you so much. This worked like a charm on our site.

@laxbeach

Edited by Jan Zonjee, 05 August 2011 - 05:46 AM.


#4   germ

germ
  • Members
  • 13,921 posts

Posted 05 August 2011 - 11:03 AM

The change won't work on every server.

Once you have SSL working correctly if you use:

  if ( $request_type == 'NONSSL' )
Instead of:

  if ( $_SERVER['HTTPS'] != "on" ) 
You shouldn't have any problems.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#5   dreammachine

dreammachine
  • Members
  • 7 posts

Posted 19 January 2012 - 07:59 AM

Hi, good thing to add this cool widget, but does anybody know how to add this code inside Box content left our right when using release Merchant v2.2

thanks in advanced for reply, would be graet to inbedding this on our site to.

#6   usernamenone

usernamenone
  • Members
  • 2,175 posts

Posted 30 January 2012 - 03:51 AM

why in ssl on My Account does the link go here?

http://developers.facebook.com/docs/plugins/