Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moving Social Bookmarks 2.3.1


cambokev

Recommended Posts

Add the headertags_seo contribution. This will also add social bookmarks to every product.

 

if you dont want to add that contribution, have a read through the code for the contribution and add just the bits for the social bookmarks.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

thanks steve

 

Wasn't aware that i could use just the social bookmarks part of the header tags contribution, if I can work out that it'll be a solution.

 

many thanks

2.3.1 comes standard with the ability to move them where you want in the admin control panel very easily...just select right or left @ social bookmarks link under the module tab...I know its in admin as I has just been toying with it.

 

However, I am currently trying to figure out how to get the bookmarks to show on all the pages rather than the product page alone....which sounds like what you are trying to do...or at least up one level from the product page.

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Link to comment
Share on other sites

hi erikmm

 

yes i could see the move from left to right column, but what i was after was to see the social bookmarks on the main product page, i.e. underneath the picture.

 

this would be much more elegant solution. don't know about your website but putting these in the columns looks crowded.

 

nice one if you can work out how to do that!

 

cheers

Link to comment
Share on other sites

2.3.1 comes standard with the ability to move them where you want in the admin control panel very easily...just select right or left @ social bookmarks link under the module tab...I know its in admin as I has just been toying with it.

 

However, I am currently trying to figure out how to get the bookmarks to show on all the pages rather than the product page alone....which sounds like what you are trying to do...or at least up one level from the product page.

The social bookmarks don't show on all pages because they all use products_id=xxx in the URL as the "share" item.

 

Without that they have nothing to "share".

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

your right germ - i'm not being clear.

 

I mean't I'm trying to put the social bookmarks underneath each product picture, i.e. in the middle of the page for each product, not on the left or right columns.

 

I have taken a look at the headertags_SEO contribution. It clearly states to install as a complete package so this isn't really right for me, mores the pity.

 

Might have to leave the social bookmarks on the left menu, but I'm not entirely happy with that... sad.gif

Link to comment
Share on other sites

You're crystal clear.

 

The content of my post was provided as information to ErikMM.

 

And NOT in a derogatory manner, no offense meant.

:)

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

  • 1 month later...

I have the same issue.

 

Activating the Social Bookmarks from the admin you are limited in that its either in a left or right hand column.

 

What i would like are the links conviently located in the central product info page or wherever I want -

 

NOTE: THIS SOLUTION DOES NOT WORK:

 

 

ANYWHERE IN THE PRODUCT_INFO.php PAGE.

 

<?php

// SOCIAL BOOKMARKS

include('includes/modules/boxes/bm_product_social_bookmarks.php');

?>

 

any ideas??

Link to comment
Share on other sites

bm_social_bookmarks.php, like every box in osCommerce 2.3.1 is a class. So you can not "include" it like this. (!)

 

What do do?

 

We all know that boxes can be placed either lo left or right column and to nowhere else. This happens because they get added to "boxes_column_left" or "boxes_column_right" upon pageload using the function buildBlocks() of class includes/classes/osc_template.php

 

This is what what you see on top of includes/template_top.php

  $oscTemplate->buildBlocks();

 

This function buildBlocks() calls function execute() that exist in each box(class)

 

Now it happens that this function execute() is doing 2 things at the same time:

- to buld the data (like run queries, add stuff into markup etc)

- to add the data to one of the colums

 

I wrote about this inflexibility a time ago, you can read here about. I suggest there to separate "data from execution", so you have the data available for other uses, except of adding it to the columns

 

This you do then easy like this

if (class_exists(bm_social_bookmarks)) {
$boxdata = new bm_social_bookmarks;
echo $boxdata->dataF();
}

 

You could of course include the file in case the class does not exist, or just make sure the box is installed (must not be set to "true")

 

Of course now, there is the problem that this "data" include already all the markup, like info box heading in ui widget style. Here you can either try your best with css, or modify the box file it self (will make it useless in case you want it in a column too) or finally, why not, create a new class (not in folder /boxes/) and handle it in the same way

 

An other option, is to take the code of the box, where the array of social bookmarks get created, and add it directly into your product info file

Link to comment
Share on other sites

  • 4 weeks later...

Place this code in PRODUCTS_INFO.php

 

 

THIS WORKS 100% - OSC.2.3.1

 

--------------------------------

 

<?php

$sbm_array = explode(';', MODULE_SOCIAL_BOOKMARKS_INSTALLED);

$social_bookmarks = array();

foreach ( $sbm_array as $sbm ) {

$class = substr($sbm, 0, strrpos($sbm, '.'));

if ( !class_exists($class) ) {

include(DIR_WS_LANGUAGES . $language . '/modules/social_bookmarks/' . $sbm);

include(DIR_WS_MODULES . 'social_bookmarks/' . $class . '.php');

}

$sb = new $class();

if ( $sb->isEnabled() ) {

$social_bookmarks[] = $sb->getOutput();

}}

if ( !empty($social_bookmarks) ) {

$data = implode( $social_bookmarks);}

echo $data;

?>

 

--------------------------

Link to comment
Share on other sites

  • 3 weeks later...

Place this code in PRODUCTS_INFO.php

 

 

THIS WORKS 100% - OSC.2.3.1

 

--------------------------------

 

<?php

$sbm_array = explode(';', MODULE_SOCIAL_BOOKMARKS_INSTALLED);

$social_bookmarks = array();

foreach ( $sbm_array as $sbm ) {

$class = substr($sbm, 0, strrpos($sbm, '.'));

if ( !class_exists($class) ) {

include(DIR_WS_LANGUAGES . $language . '/modules/social_bookmarks/' . $sbm);

include(DIR_WS_MODULES . 'social_bookmarks/' . $class . '.php');

}

$sb = new $class();

if ( $sb->isEnabled() ) {

$social_bookmarks[] = $sb->getOutput();

}}

if ( !empty($social_bookmarks) ) {

$data = implode( $social_bookmarks);}

echo $data;

?>

 

--------------------------

 

Hello Gemma,

 

This addon looks neat and I would like to add this to my shop.

 

I must be stupid or something, but I didn't get it work.

 

Where can I find the products_info.php?

I tried to add the code in the end of the file /catalog/product_info.php - didn't work. Could you help me please?

 

BR,

Janina

Link to comment
Share on other sites

Hello Gemma,

 

This addon looks neat and I would like to add this to my shop.

 

I must be stupid or something, but I didn't get it work.

 

Where can I find the products_info.php?

I tried to add the code in the end of the file /catalog/product_info.php - didn't work. Could you help me please?

 

BR,

Janina

 

 

Hey Janina!

 

I just figured this out! Go to your product_info.php page. Place the code after any

?>

code.

I placed mine after::

 

<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
 cyclic: true
});
</script>

 

This put the social bookmarks under the item name :]] SO HAPPY!

 

Enjoy :]

Link to comment
Share on other sites

Hey Janina!

 

I just figured this out! Go to your product_info.php page. Place the code after any

?>

code.

I placed mine after::

 

<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
 cyclic: true
});
</script>

 

This put the social bookmarks under the item name :]] SO HAPPY!

 

Enjoy :]

 

Thank you so much Jennifer for your help!

Your advice helped me and now I see the social bookmarks too :) Great!

 

BR, Janina

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...