remove fblike button from specific nodes

Created on 21 July 2011, over 13 years ago
Updated 11 November 2024, about 1 month ago

Not much but this code will remove fblike button from specific nodes
( not thoroughly tested and needs review and improvements :) )

in fblikebutton_admin_settings:

$form['fblikebutton_node_ids'] = array(
    '#type' => 'textfield',
    '#title' => t('Don\'t Display the Like button on these nodes'),
    '#default_value' => variable_get('fblikebutton_node_ids', ''),
    '#description' => t('This nodes will not have the "like" button automatically added to them.').'<br />'.
                      '<b>'.t('USE \',\' BETWEEN NODES NUMBERS. EX: 12345,21312, ').'</b>',
  );

in fblikebutton_nodeapi:

//get the array with the nodes from where the like button will be excluded 
$sNodesNotShow = variable_get('fblikebutton_node_ids', '');
$aNodesNotShow = explode(',',$sNodesNotShow);
      
//remove the facebook like button from some nodes  
if (in_array($node->nid, $aNodesNotShow)) {
     break;
}
πŸ’¬ Support request
Status

Closed: outdated

Version

2.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024