Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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;
}
Comments
Comment #1
jerdiggity CreditAttribution: jerdiggity commentedGood idea -- I like it.
Comment #2
cata.vancea CreditAttribution: cata.vancea commentedGlad you like it !
I also like your module and I have made made some adjustments for my needs :9 this was one of them !
THX !
Comment #3
tony barnes CreditAttribution: tony barnes commentedThanks for this, in 7.x-1.2 this needed a little tweaking - in fblikebuttonadmin.inc, do the same as step one, basically add in the $form['fblikebutton_node_ids'] = array bit below:
Then in fblikebutton.module, look for:
change to:
Works a charm (as far as I can tell!!)
Comment #4
AcidRam CreditAttribution: AcidRam commentedHello :)
@ catalin.vancea
I'm looking to remove the like button and hide the page from public,for a mafiawars group page at facebook.com .
I see where I can add people as admins but any one could post on the page im thinking due to the fact it might be open ,and not a hidden or closed group.because maybe the like button or settings for the page . In script that is needed to hide and remove from public view.
I use greasemonkey ./mafiawars addon .
Im a little new to this type of script (above) that you were kind too your post.
Where can I post this script or should I ask what runs the script ? for this to work so that i can follow your instructions 200%.
Comment #5
plato1123 CreditAttribution: plato1123 commentedThis is all swell but if you have a multi-site config with a number of independent sysadmins you can't give them php access :'( Is there no CSS solution to this? I'm going to have to create an adjacent div with negative margins just to hide a (duplicate) fblike widget. This should be part of the module config.
edit: CSS didn't really do it, I ended up putting an iframe over the top (a youtube video) and it hides it in firefox and chrome but in IE the like widget floats on top of the youtube video (which is kind of a trip)
edit2: It seems like an easy way to solve this would be to have the like button appear in a div with a unique ID
Comment #6
binaryjc CreditAttribution: binaryjc commentedso which changes should I make if I'm using version 6.x-2.2??