Revised: Add a Facebook like button to Xsilva Lightspeed Web Store

New and improved way to add a Facebook like button to the product details page template file in your Xsilva Lightspeed Web Store template. How is it new and improved? Because now we can show the product image as well as the description and link when someone likes the item and posts it to their facebook page. Thanks to Patrick from Slick Willy’s of Dunedin for asking me take the time to figure this out. I might not have bothered otherwise!

Please take care when editing your templates and make sure to keep copies of any files you edit so you can replace the edited ones if a problem occurs.

File to be edited: INDEX.TPL.PHP

On line 69 of index.tpl.php you’ll find this:

[php]<?php global $strPageTitle; ?>
<?php if (isset($strPageTitle)): ?>
<title><?= _xls_get_conf(‘STORE_NAME’, _sp(‘Shopping cart’)); ?> : <?php _p($strPageTitle); ?></title>
<?php endif; ?>[/php]

I always revise this block so that the Title of the Page, Product or Whatever comes before the Store Name. This is good for SEO.

SEO Tip: the code below can also be moved to be right underneath the meta tag for the Content-Type which is found on line 35 of index.tpl.php and looks like this: [php]<meta http-equiv="Content-Type" content="text/html; charset=<?= _xls_get_conf(‘ENCODING’ , ‘utf-8’) ?>" />[/php]

So, find the code block on line 69 of index.tpl.php and cut it. Then copy the following and paste it under the meta tag for the Content-Type:

[php]<?php global $strPageTitle; if (isset($strPageTitle)): ?>
<title><?php _p($strPageTitle); ?> | <?= _xls_get_conf(‘STORE_NAME’, _sp(‘Shopping cart’)); ?> </title>
<meta property="og:title" content="<?php _p($strPageTitle); ?> | <?= _xls_get_conf(‘STORE_NAME’, _sp(‘Shopping cart’)); ?> "/>
<?php endif;?>
<meta property="og:site_name" content="Put Your Store Name Here"/>
<?php if( get_class( $this ) == "xlsws_product"):?>
<meta property="og:image" content="/index.php?listingimage=<?php echo ($this->prod->ImageId)?>.jpg" />
<?php endif; ?> [/php]

File to be edited:PRODUCT_DETAIL.TPL.PHP

Find this: [php]<?php $this->lblDescription->Render() ; ?>[/php]

Add this under it:

[php]<div id="fbLike">
<fb:like href="/index.php?product=<?php echo ($this->prod->Code)?>" send="false" layout="button_count" width="450" show_faces="false" font="arial"></fb:like>
</div>[/php]

Button Placement Tip: you can put the Facebook like button somewhere else – it doesn’t have to go under the product description.
CSS Style Tip: wrapping the button in a div gives you more control over padding,margin and etc.

Facebook JavaScript Connection Code
Because we don’t need to connect our like button with the Facebook API site-wide – just on the product details page where the like button is, we can put the JavaScript connection code in the product_details.tpl.php template file at the bottom of the file. Go here for the code.

No Way, there’s a FIX for this?! Windows 7 – Resolution problem with Intel 915 – Apparently yes!

I am by no means a gadget-loving geek or an early adopter (or is is adapter?) of gadgetry. I have a tendency towards reticence when it comes to buying any kind of electronic equipment. And so it seems my eventual purchases have mostly been out of real necessity: do I need a Mac if I am doing Web development: yes. Do I need a PC if I am doing Web development:yes. Do I need a Blu-Ray DVD player so I can watch Netflix on my TV? Not really ( I did buy it for the mans birthday but I seem to be the only one who really uses it).

Anyway, enough with the preamble! I had an old Compaq PC tower(bought by the mans’ brother back in 2005) that used a new Compaq Q1859 monitor for the display (I used to have a NEC monitor then the mans bought me a widescreen HP HDMI widescreen monitor – sweet). On one side of my desk I have the Mac mini and the HP HDMI monitor – on the other side I had the elderly PC with the Q1859. I would develop my Web sites in Firefox, Chrome and Safari (Mac) and then safety-check them for cross browser support in Windows IE 6,7, 8 and other major browsers that Windows can run) on the PC. It was my simple system and it saved me from being one of those designers who never checks their sites in any other browser except the one they use because they don’t have the machine that can run it or can’t be bothered or just doesn’t think it matters – by the way, after loading my own recently re-designed site in IE8 in Windows 7 I’ve just caught some F**k-ups – yikes!

Then after about 2 days of not paying any attention to it, my PC wouldn’t turn on. It had no secondary on/off switch in the back – the power cord wasn’t the issue – an even older PC tower could use it. All of a sudden I was without a sure-fire way to check a site in IE and my client was reporting some rendering issues in IE and was kind of getting impatient … I begged for time and even though I could load the site in Chrome and basically see the same kind of issues as in IE (yet another reason to develop in Chrome, 1st) I needed to replace my PC, case closed. It’s just very distracting to lose half of your development system overnight.

After pricing refurbished Windows 7 laptops on overstock.com and tigerdirect.com and reading laptop reviews on cnet.com – I still really only needed a machine that could run Internet Explorer. I went on Craigslist and arranged to meet the seller of a Dell XPS M140 with Windows 7. I figured that the size of the laptop display didn’t really matter because I had the external Q1859… So I bought the Dell, took it home and plugged in my monitor. I got the VGA: No signal, Going to sleep message. I rebooted: the same message. Oops. Was this really happening? Seemed like I could not use my monitor with this laptop because of the video card driver. There’s a lot of info online about older Intel video drivers and Windows 7 and a bunch of folks unhappy with Intel for dropping them after only 3 years (or so I read on several forums) and if you research this topic you might get as discouraged as I did; it seems that there will never be an upgrade available from Intel. I was just getting used to the Dell’s 14 inch screen when I decided to look around online just one more time.

Before I did this I also ran a Windows Update since the seller had last updated in February. After I did my Devices listed the Compaq monitor, finally. Before it didn’t even recognize it existed.

Wow you are chatty. Is there a fix or not?

Well, I can’t swear it will work for everyone who has an older Intel model but the one I have is from 2006 and it worked for me.

I found this forum: Windows 7 – Resolution problem with Intel 915. I read the reassuring words of satanicdude and used TekBoi’s download link and followed InstallWizard. There was 1 minor hiccup just like I was warned about. But the driver installed the second time much like the way satanicdude said it would. I restarted Windows and saw the Windows start up screen on my Compaq Q1859. Additionally my laptop display automatically reset to 1280 x 800. Before it was stuck on a maximum resolution of 1024 x 768.

Still, everything is not perfect. My Compaq Q1859 auto detects the factory setting of a resolution of 1366 x 768 & from the Dell’s 1280 x 800 display it looks a little stretched out (but it did on my old PC) but it also doesn’t fill the monitor screen. Although at least now the Action Center no longer reports any issues with the Video Card!

Still no Aero though. But for now I am Ok.

And now I have 3 screens!

Update Re: stretched/squished screen appearance with external monitor/laptop combo.

If you also have a widescreen monitor determined to stick to a resolution that makes the desktop & Web pages look stretched or squished and/or displays pages in letterbox and not full screen, try this suggestion from our all caps loving friend. Don’t bother clicking the link at the top of the post, the YouTube video is not available.

Holy Crap

Sleep deprived much?
6 days ago I updated to WordPress 3.1.3. Before I upgraded I de-activated all my plugins. The upgrade completed successfully & I forgot to re-activate all my plugins. This means my contact form as well as all my downloads were unavailable for 6 days.

I might have been tipped off a few days ago when someone emailed me saying they Whois’d my domain name to get my email address. I thought it was odd that they didn’t just use my contact form and now I know why they didn’t: because they couldn’t!