View Single Post
  #738  
Old 10-30-2014, 03:44 PM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,966
 

Default Re: X-Cart - reBOOT - Responsive Template

Great idea. Excellent implementation by Phil! I did have to do 2 things.

I changed the "i" to an "a" in the file name. function.gravitar.php --> function.gravatar.php and I had to paste the file into notepad and then save. I seemed to have some hidden control characters which kept the function from working.

Thank you so much! Works Great!

Paul



Quote:
Originally Posted by PhilJ
ok, here's how...

1) Upload the attached file, function.gravitar.php, to include/templater/plugins

2) In skin/reboot/modules/Testimonials/testimonials.tpl

Replace...
Code:
{$t.testimonial}
With...
Code:
<img src="{gravatar email=$t.email rating='PG' size='80'}" alt="{$t.name}" style="float:left;margin:0 10px 10px 0"> {$t.testimonial} <div class="clearing"></div>
Default icon size is 80 pixels. To adjust, edit size='80'.

To set your own default icon (for those who submit testimonials and have not registered a Gravitar icon), instead use...

Code:
<img src="{gravatar email=$t.email rating='PG' size='80' default='http://www.yourstore.com/skin/reboot/modules/Testimonials/images/default_avatar.jpg'}" alt="{$t.name}" style="float:left;margin:0 10px 10px 0">

Then upload your default_avatar.jpg image to skin/reboot/modules/Testimonials/images/

3) In skin/reboot/modules/Testimonials/testimonial_add.tpl

After...
Code:
<input name="email" type="text" id="email" maxlength="255" class="testimonial_input" placeholder="Required" required>
Insert...
Code:
<span style="font-size:12px">{$lng.lbl_testimonial_gravitar}</span>

4) Apply SQL patch...

Code:
REPLACE INTO xcart_languages SET code='en', name='lbl_testimonial_gravitar', value='If you have a <a href=\"https://gravatar.com/site/signup/\" target=\"_blank\">Gravitar icon</a> associated with your email address, we will display it next to your testimonial.', topic='Labels';

5) Run a template cleanup.

Demo here. More info on the plugin here. More info on the icons here. Very useful and could be used elsewhere around your store
__________________
WooCommerce as of 10/2022
Reply With Quote