Jump to content
Sign in to follow this  
keijom

Facebook comments plugin. Different every product 2.3.1

Recommended Posts

Facebook comments plugin. Different every product 2.3.1.

 

Download that file: http://addons.oscommerce.com/info/8615/v,23

 

Install it, but change "false" (oscommerse admin)

 

I add that code in product_info.php

 

<div>

<?php

include_once DIR_FS_CATALOG . DIR_WS_INCLUDES . '/modules/social_bookmarks/sb_comentario_p_articulo.php';

$sb_comentario_p_articulo = new sb_comentario_p_articulo();

$sb_comentario_p_articulo->getOutput();

?>

</div>

 

just before that

 

</form>

 

<?php

}

 

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

And then you must fix sb_comentario_p_articulo.php

 

?>

<!-- Code generated on facebook -->

<div id="fb-root"></div>

<script>(function(d, s, id) {

var js, fjs = d.getElementsByTagName(s)[0];

if (d.getElementById(id)) return;

js = d.createElement(s); js.id = id;

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOURADDIPFACEBOOK";

fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));

</script>

 

 

 

<?php echo '

<div class="fb-comments" data-href="http://www.facebook.com/plugins/comments.php?href=' . urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)) . '&width=' . $width . '&height=235" data-num-posts='. "2" . ' data-width= $width></div>';

 

You can change heigt and post ect..

 

 

BUT MODERRAD NOT WORKING. I DONT KNOW WHY. MAYBE I DONT KNOW HOW IT WORKS.

Share this post


Link to post
Share on other sites

Maybe this problem is somewhere tha (I change red)??

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

class sb_comentario_p_articulo {

var $code = 'sb_comentario_p_articulo';

var $title;

var $description;

var $sort_order;

var $icon = 'facebook.png';

var $enabled = false;

 

function sb_comentario_p_articulo() {

$this->title = MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_TITLE;

$this->public_title = MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_PUBLIC_TITLE;

$this->description = MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_DESCRIPTION;

 

if ( defined('MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_STATUS') ) {

$this->sort_order = MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_SORT_ORDER;

$this->enabled = (MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_STATUS == 'True');

}

}

 

function getOutput() {

global $HTTP_GET_VARS;

 

$width = (MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_WIDTH == '450') ? '370' : '275';

$numposts = (MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_NUM_POSTS == '2') ? '5' : '10';

$app_id = MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_APP_ID;

 

?>

<!-- Code generated on facebook -->

<div id="fb-root"></div>

<script>(function(d, s, id) {

var js, fjs = d.getElementsByTagName(s)[0];

if (d.getElementById(id)) return;

js = d.createElement(s); js.id = id;

js.src = "//connect.facebook.net/fi_FI/all.js#xfbml=1";

fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));</script>

 

 

 

<?php echo '

<div class="fb-comments" data-href="http://www.facebook.com/plugins/comments.php?href=' . urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)) . '&width=' . $width . '&height=235" data-num-posts='. "2" . ' data-width= $width></div>';

}

 

function isEnabled() {

return $this->enabled;

}

 

function getIcon() {

return $this->icon;

}

 

function getPublicTitle() {

return $this->public_title;

}

 

function check() {

return defined('MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_STATUS');

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable comments by article', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_STATUS', 'True', 'Do you want to enable comments by article module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Width', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_WIDTH', '450', 'The module width on pixeles', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Orden', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_SORT_ORDER', '0', 'Define the order. Lowests are displayed first', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Number of posts', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_NUM_POSTS', '2', 'Amount of posts showed', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('APP ID', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_APP_ID', '0', 'Your application ID, facebook gives it.', '6', '0', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

return array('MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_STATUS', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_WIDTH', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_SORT_ORDER','MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_APP_ID', 'MODULE_SOCIAL_BOOKMARKS_COMENTARIO_POR_ARTICULO_NUM_POSTS');

}

}

?>

Share this post


Link to post
Share on other sites

Now its working. Moderation works. Yeah. Must fixset template_top. Add facebook meta script here.

 

And this is correct for sb_comentario_p_articulo:

 

<?php echo '

<div class="fb-comments" data-href="' . urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false)) . '' . $width . '" data-num-posts='. "2" . ' data-width= ></div>';

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×