Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding A Twitter Feeds Widget to your SSL site.


wildvettes

Recommended Posts

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.

Link to comment
Share on other sites

>_<

 

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

Link to comment
Share on other sites

  • 3 months later...

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 >

Link to comment
Share on other sites

  • 5 months later...

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.

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...