Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC Socializer v1.0


dailce

Recommended Posts

Share your product pages with social bookmarking.

 

I know there are a bunch of these out there. I looked around, and didn't like the look of most plugins. addthis.com is a good site, but they track user stats/data, if your like me and don't like sending people off to other sites, or having multiple popups, or having to advertise other sites, then this is for you.

 

I think it has the same look and feel to addthis.com, but it is different. Basically, a user clicks the share button and a nice menu will fade in (using mootools), they can then select which social site they want to share the page with, OR they can even email a link of the page to a friend. Great way to share and get yourself noticed.

 

 

OSC_Socializer_v1.0

Edited by dailce
Link to comment
Share on other sites

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Share your product pages with social bookmarking.

 

I know there are a bunch of these out there. I looked around, and didn't like the look of most plugins. addthis.com is a good site, but they track user stats/data, if your like me and don't like sending people off to other sites, or having multiple popups, or having to advertise other sites, then this is for you.

 

I think it has the same look and feel to addthis.com, but it is different. Basically, a user clicks the share button and a nice menu will fade in (using mootools), they can then select which social site they want to share the page with, OR they can even email a link of the page to a friend. Great way to share and get yourself noticed.

 

 

OSC_Socializer_v1.0

Hi Dailce

 

This is really easy to install. Thank you.

 

Just a couple of things (there always is).

 

When you say "and change MYSITE (line above) to your website" is this the store name or web address.

 

Also, I changed to this

 

3. Place this button code somewhere in catalog/products_info.php

 

<tr>

<td align="center" class="smallText"><br><br>

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="MYSITE: <?php echo $product_info['products_name']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

</td>

</tr>

Link to comment
Share on other sites

Hi Dailce

 

This is really easy to install. Thank you.

 

Just a couple of things (there always is).

 

When you say "and change MYSITE (line above) to your website" is this the store name or web address.

 

Also, I changed to this

 

3. Place this button code somewhere in catalog/products_info.php

 

<tr>

<td align="center" class="smallText"><br><br>

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="MYSITE: <?php echo $product_info['products_name']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

</td>

</tr>

 

Never mind, I changed the line to read

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title=" <?php echo (STORE_NAME); ?> : <?php echo $product_info['products_name']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

Link to comment
Share on other sites

Never mind, I changed the line to read

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title=" <?php echo (STORE_NAME); ?> : <?php echo $product_info['products_name']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

 

Further testing that the moo tools js causes an error on my website (test site was ok). Is there a restriction on the php version (seems to be the only difference that I can think of).

Link to comment
Share on other sites

hi,

 

I have tested your contrib, but i can not send the page to my friend. i ve got an email error...

 

xav

I removed that part of the contrib for security reasons. How did the rest of the testing go? Is it on php 4 or 5?

Link to comment
Share on other sites

I removed that part of the contrib for security reasons. How did the rest of the testing go? Is it on php 4 or 5?

 

 

I run my site on php 4. Everything is allright..except the email.

 

How can I remove this part too ?

Link to comment
Share on other sites

Hi, thanks for a nice addition! :)

 

Mine seem to work fine without any error messages. I'm on php5 and mysql5.

 

I think the email feature is nice and like to keep it...perhaps someone with the sufficient knowledge can make the necessary changes for security, if any is required?!

 

Also how would I make the various texts in the javascript file multilanguage, like: "Share this page", etc, and the button itself, where I'd like to change the word "Share" (to keep the buttons in: mylanguage/images/buttons)? And I'd like to add "Add to My Favorites", so that one can bookmark the page to the web browser, the one with the yellow star sign, you know. How do I do that?

 

Once again, thanks!

Edited by kbking
Link to comment
Share on other sites

I've tried it and have not had any mootools errors. I'm using PHP4.

My emails are also working.

Here are some answers.

 

 

 

================================

Never mind, I changed the line to read

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title=" <?php echo (STORE_NAME); ?> : <?php echo product_info['products_name']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

================================

This is fine too, or you can manually enter the store name, or place some other message like "Check this out: "

 

 

 

 

================================

Further testing that the moo tools js causes an error on my website (test site was ok). Is there a restriction on the php version (seems to be the only difference that I can think of).

================================

Do you have any other js on that page, there could be a conflict somewhere, try to track it down.

 

 

 

================================

I have tested your contrib, but i can not send the page to my friend. i ve got an email error.

================================

Did you change the email address in the send_to_friend.php? Maybe that is causing an issue?

 

 

 

================================

I run my site on php 4. Everything is allright..except the email.

How can I remove this part too ?

================================

To remove it:

 

open: socializer.js

and simply remove lines 392 to 434

 

 

 

================================

think the email feature is nice and like to keep it...perhaps someone with the sufficient knowledge can make the necessary changes for security, if any is required?!

 

Also how would I make the various texts in the javascript file multilanguage, like: "Share this page", etc, and the button itself, where I'd like to change the word "Share" (to keep the buttons in: mylanguage/images/buttons)?

================================

For security I think it's ok for sending the emails. I will look at adding something more like:

 

$_POST['email'] = str_replace("Content-Type:","",$_POST['email']); AND tep_validate_email($email_address

 

but I think it's ok for now, since it will not send anything unless an email is entered. It also strips the contents of any message

such as is done here: http://www.anders.com/projects/sysadmin/formPostHijacking/

 

I also use a similar method in my contact_us page and haven't had any trouble with it yet.

 

I'm sure there is a way to change the button for send, haven't looked at it, but take a look at:

sendme.setAttribute('value',"Send"); in socializer.js

that's where it starts.

Edited by dailce
Link to comment
Share on other sites

Hi, thanks for a nice addition! :)

 

I'd like to add "Add to My Favorites", so that one can bookmark the page to the web browser, the one with the yellow star sign, you know. How do I do that?

 

Once again, thanks!

 

Yes, I tried it and had it working for Explorer, but doesn't work in Firefox, maybe I just got the code wrong. I then decided to remove it because I figure they can easily bookmark a page using their browser. I forget what I did to get it to work though.

 

BUT

 

Add something like this to socializer.php:

 

onClick='window.external.AddFavorite(location.href, document.title);

 

Try this:

 

// BOOKMARK ADD TO FAVORITES

var img = new Element('img');
img.alt = 'add to favorites';
img.src = 'social/images/favourites.png';
img.injectInside(right);

var myLink = new Element('a');
myLink.href  = 'java script: void(0)';
myLink.onclick = 'window.external.AddFavorite('+encodeURIComponent(url)+', '+title+');';
myLink.title = 'bookmark this page';
myLink.rel = 'nofollow';
myLink.innerHTML = 'bookmark';
myLink.injectInside(right);

Link to comment
Share on other sites

Hi folks,

 

Thank you dailce for a cool contrib, very easy to install and use!!

 

Could I please ask how I can stop the product 'page title' from being used as the Subject / Info in each of the links.

Instead I'd like to make it the product name.

 

I assume (I'm no coder) I can change this in the 'socializer.js' file at about this line:

var title= this.title;

 

I thought it might be in this variable but not sure how to edit the js correctly...

$products_name . ' [ ' . $products_model . ' ]

 

ALSO

Any help / advice appreciated on this stuff...

 

When using Firefox2 or Firefox3 the email send works (it sends the email) but the "Your mail has been sent" never appears and the spinning icon never goes away.

When using IE7 I get nothing at all when I click on the "+ SHARE" button any any of my products. (The menu never appears)

 

If I can fix these issues I'm a happy boy! :)

Link to comment
Share on other sites

================================

Further testing that the moo tools js causes an error on my website (test site was ok). Is there a restriction on the php version (seems to be the only difference that I can think of).

================================

Do you have any other js on that page, there could be a conflict somewhere, try to track it down.

You are indeed correct. It is the scriptaculous.js that is causing the problem. It was installed when I installed the

several_random_products_v1.2 add on. Have posted in that support thread, but if I can't get it resolved, I will remove that contribution.

 

Thanks for the advice.

Link to comment
Share on other sites

Hi folks,

 

Thank you dailce for a cool contrib, very easy to install and use!!

 

Could I please ask how I can stop the product 'page title' from being used as the Subject / Info in each of the links.

Instead I'd like to make it the product name.

 

I assume (I'm no coder) I can change this in the 'socializer.js' file at about this line:

var title= this.title;

 

I thought it might be in this variable but not sure how to edit the js correctly...

$products_name . ' [ ' . $products_model . ' ]

 

 

No, simply change the button code, like this:

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="MYSITE: <?php echo  $product_info['products_model']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

 

 

 

Any help / advice appreciated on this stuff...

 

When using Firefox2 or Firefox3 the email send works (it sends the email) but the "Your mail has been sent" never appears and the spinning icon never goes away.

When using IE7 I get nothing at all when I click on the "+ SHARE" button any any of my products. (The menu never appears)

 

If I can fix these issues I'm a happy boy! :)

 

There may be a conflict in your CSS file or another javascript file may be causing the issue. If you provide a link maybe we can help you track it down? Try the demo on your site too, see if it works.

Link to comment
Share on other sites

You are indeed correct. It is the scriptaculous.js that is causing the problem. It was installed when I installed the

several_random_products_v1.2 add on. Have posted in that support thread, but if I can't get it resolved, I will remove that contribution.

 

Thanks for the advice.

 

 

Yes, unfortunately, mootools and scriptaculous are not compatible, it has something to with the DOM function :(

 

OSC_Socializer_v1.1 just added

Edited by dailce
Link to comment
Share on other sites

Yes, unfortunately, mootools and scriptaculous are not compatible, it has something to with the DOM function :(

 

OSC_Socializer_v1.1 just added

Hi Dailce

 

Thank you for the DOM advice.

 

The new version works and easy to install (as did the first version). I have left out the email function just to prevent abuse.

Link to comment
Share on other sites

No, simply change the button code, like this:

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="MYSITE: <?php echo  $product_info['products_model']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

 

Thank you for the button change but this seems to only change the link to add the model number... I perhaps didn't explain very clearly...

When I surf to one of my product pages (product_info.php) and 'Share' the product to my FaceBook account it makes the subject of the post into the full product 'page' title (from across the browser title) which in my case is too long because I have other stuff strung on to it. I would just like the FaceBook (and other sites) to have the name of the product from the 'product_name' value in the code.

 

Please, if you wouldn't mind, take a look at the site to see what I mean:

BikeBling.com.au

 

 

There may be a conflict in your CSS file or another javascript file may be causing the issue. If you provide a link maybe we can help you track it down? Try the demo on your site too, see if it works.

 

You were exactly right!

In fact it was caused by the "Lightbox" contribution it would seem... Just for others to keep in mind there is a "Shadowbox" contrib which I am using now to replace the Lightbox and it's working with the Socializer js scripts just great it would seem.

 

I'll also go get myself that version 1.1 now dailce... thank you again.

Link to comment
Share on other sites

You were exactly right!

In fact it was caused by the "Lightbox" contribution it would seem... Just for others to keep in mind there is a "Shadowbox" contrib which I am using now to replace the Lightbox and it's working with the Socializer js scripts just great it would seem.

 

I'll also go get myself that version 1.1 now dailce... thank you again.

EuroTimmy

Thanks for that advice, that is my next "project".

Link to comment
Share on other sites

EuroTimmy, I guess I was up too late.

 

$product_info['products_name'] is what is added to the title.

 

 <img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="MYSITE: <?php echo $product_info['model number']; ?>" alt="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'], 'NONSSL'); ?>" />

 

unless there is something wrong with using:

 

myLink.href = 'http://www.facebook.com/sharer.php?u='+encodeURIComponent(url)+'&t='+title;

 

I think mine is doing the same thing, maybe I have the href code wrong? But I just think that is how Facebook does it.

 

When I first log in facebook does say: "You must log in to share mySite.com: product_name”

 

I think Facebook then parses the page for the description and actual title. If you check the google link it works and so do others.

Edited by dailce
Link to comment
Share on other sites

EuroTimmy, I guess I was up too late.

I only wish I functioned that well when Im up late!! :)

 

 

I think Facebook then parses the page for the description and actual title. If you check the google link it works and so do others.

I agree... I've signed up and tested a couple more of these services and it appears FaceBook is the only one to do that.

 

Thank you again... its a fantastic contrib!!

Link to comment
Share on other sites

Hello all, nice contrib. works perfectly tested in IE7 and FF3.

I believe that the nice add-on would be possibility to display the code on the category page.

I think something like that would work:

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="MYSITE : <?php echo $category['categories_heading_title']; ?>" alt="<?php echo tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('')) . ''); ?>" />

 

Works for me.

Good luck.

Link to comment
Share on other sites

Hi Mike and All,

 

Thanks for a nice mod. Was looking for something like this.

 

One feature that would be nice is it would be good to let the friend add their name / e-mail like on addthis.com when they tell a friend as if it comes form the store it might be considered spam or abused.

 

The other is a question:

 

The .js files are quite large, will it slow down a busy file much ? I know browsers heavily cache .js and .css so after the first load it should be zippy. Any comments ?

 

Greetings,

 

Martin

Link to comment
Share on other sites

Aha another one would be to make it workable on index.php i.e. not product sensitive so that people could share a site / bookmark a site.

 

Thanks,

 

Martin

But that can be done with the browser.

Link to comment
Share on other sites

Hi Mike and All,

 

Thanks for a nice mod. Was looking for something like this.

 

One feature that would be nice is it would be good to let the friend add their name / e-mail like on addthis.com when they tell a friend as if it comes form the store it might be considered spam or abused.

 

The other is a question:

 

The .js files are quite large, will it slow down a busy file much ? I know browsers heavily cache .js and .css so after the first load it should be zippy. Any comments ?

 

Greetings,

 

Martin

 

Mootools isn't too large, but it can work wonders.

Just updated to 1.4, now includes the TO and FROM for emails

 

 

Aha another one would be to make it workable on index.php i.e. not product sensitive so that people could share a site / bookmark a site.

 

Thanks,

 

Martin

 

To add to another page just use:

 

<img src="social/buttonshare_trans.png" class="socializer" id="social_but" title="<?php echo TITLE; ?>" alt="<?php echo tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('')) . ''); ?>" />

 

For each button:

Title = THE TITLE

ALT = THE WEB_ADDRESS

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...