Have seen that it is possible with wp. Have tried this plugin, but then there is not showing any buttons, but what I can see in the code, it should be possible (but I'm not a coding person)
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("postbit", "fblike_start");
$plugins->add_hook("showthread_start", "fblike_showthread_start");
function fblike_info()
{
return array(
"name" => "FBLike",
"description" => "Displays Facebook like button",
"website" => "http://mybbmodding.net",
"author" => "Nayar",
"authorsite" => "",
"version" => "1.2.1",
"compatibility" => "16*",
"guid" => "",
);
}
function fblike_activate()
{
global $db;
$fblike_group = array(
"gid" => "NULL",
"name" => "fblike",
"title" => "FBLike",
"description" => "Displays facebook like buttons",
"disporder" => "15",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $fblike_group);
$gid = $db->insert_id();
/*$fblike_setting_1 = array(
"sid" => "NULL",
"name" => "fblike1",
"title" => "Enable/Disable fblike",
"description" => "",
"optionscode" => "onoff",
"value" => '1',
"disporder" => '1',
"gid" => intval($gid),
);*/
$fblike_setting_2 = array(
"sid" => "NULL",
"name" => "fblike2",
"title" => "Is MyBB SEO enabled",
"description" => "",
"optionscode" => "onoff",
"value" => '1',
"disporder" => '2',
"gid" => intval($gid),
);
$fblike_setting_3 = array(
"sid" => "NULL",
"name" => "fblike3",
"title" => "Show on All posts",
"description" => "",
"optionscode" => "onoff",
"value" => '1',
"disporder" => '3',
"gid" => intval($gid),
);
$fblike_setting_8 = array(
"sid" => "NULL",
"name" => "fblike8",
"title" => "Show a like button with faces above thread",
"description" => "",
"optionscode" => "onoff",
"value" => '1',
"disporder" => '4',
"gid" => intval($gid),
);
$fblike_setting_9 = array(
"sid" => "NULL",
"name" => "fblike9",
"title" => "Where to show like button in posts",
"description" => "",
"optionscode" => "radio
1 = Right
2 = Left",
"value" => '1',
"disporder" => '5',
"gid" => intval($gid),
);
$fblike_setting_4 = array(
"sid" => "NULL",
"name" => "fblike4",
"title" => "Like/Recommend",
"description" => "",
"optionscode" => "radio
1 = Like
2 = Recommend",
"value" => 'like',
"disporder" => '6',
"gid" => intval($gid),
);
$fblike_setting_5 = array(
"sid" => "NULL",
"name" => "fblike5",
"title" => "Light/Dark",
"description" => "",
"optionscode" => "radio
1 = Light
2 = Dark",
"value" => '1',
"disporder" => '7',
"gid" => intval($gid),
);
$fblike_setting_7 = array(
"sid" => "NULL",
"name" => "fblike7",
"title" => "Height",
"description" => "",
"optionscode" => "text",
"value" => '20px',
"disporder" => '8',
"gid" => intval($gid),
);
$fblike_setting_6 = array(
"sid" => "NULL",
"name" => "fblike6",
"title" => "Forum ID where NOT to display like button in posts",
"description" => "Enter Forum ID separated with commas",
"optionscode" => "text",
"value" => '',
"disporder" => '9',
"gid" => intval($gid),
);
//$db->insert_query("settings", $fblike_setting_1);
$db->insert_query("settings", $fblike_setting_2);
$db->insert_query("settings", $fblike_setting_3);
$db->insert_query("settings", $fblike_setting_4);
$db->insert_query("settings", $fblike_setting_5);
$db->insert_query("settings", $fblike_setting_6);
$db->insert_query("settings", $fblike_setting_7);
$db->insert_query("settings", $fblike_setting_8);
$db->insert_query("settings", $fblike_setting_9);
//$db->insert_query("settings", $fblike_setting_10);
//$db->insert_query("settings", $fblike_setting_11);
}
function fblike_deactivate()
{
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='fblike'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike1'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike2'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike3'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike4'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike5'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike6'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike7'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike8'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike9'");
//$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike10'");
//$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='fblike11'");
}
function fblike_start($post)
{
global $postcounter,$mybb,$tid;
// Set button blank
$fblike = '';
$display = true;
// Fetch forum id for which not to display button
$lmao1 = explode(",",$mybb->settings['fblike6']);
// I don't know how this works. Just copied it from another plugin. And yes, i really don't know PHP. LOL xD
foreach($lmao1 as $lmao2)
{
// If current forum id doesn't match prohibited forum id
if (trim($lmao2) == $post['fid'])
{
$display = false;
}
}
if ($display)
{
// Lets get started now. Yahooo!!!!!!
// You want Like or Recommend ?
If ($mybb->settings['fblike4'] == 1)
{
$rofl1 = "like";
// and set the width
$rofl3 = "80px";
}
Else
{
$rofl1 = "recommend";
// Recommend button is wider so we set a wider width ;)
$rofl3 = "125px";
}
// You, yes You! Are you dumb? I am talking and you just stare at me :@
If ($mybb->settings['fblike5'] == 1)
{
// I will stay quiet now unless you say sorry.
$rofl2 = "light";
}
else
{
// Louder! I can't hear.
$rofl2 = "dark";
}
// Ok. Thats like a good kid. I forgive you.
// So now, we fetch the height the user set.
$rofl4 = $mybb->settings['fblike7'];
// First post is exceptional!!!
if ($postcounter == "1")
{
// We now generate the button. Liking it will like the thread's URL
// Ask if SEO is ON
if ($mybb->settings['fblike2'] == 1)
{
$fblike = '<iframe src="http://www.facebook.com/plugins/like.php?href=' . $mybb->settings['bburl'] . '/thread-' . $tid . '.html&layout=button_count&show_faces=false&width=450&action='.$rofl1.'&font=verdana&colorscheme='.$rofl2.'&height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$rofl3.'; height:'.$rofl4.';"></iframe>';
}
else
{
$fblike = '<iframe src="http://www.facebook.com/plugins/like.php?href=' . $mybb->settings['bburl'] . '/showthread.php?tid='.$tid.'&layout=button_count&show_faces=false&width=450&action='.$rofl1.'&font=verdana&colorscheme='.$rofl2.'&height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$rofl3.'; height:'.$rofl4.';"></iframe>';
}
}
// Other posts are now dealt.
// But only if the user wants it. hehe
elseif ($mybb->settings['fblike3'] == 1)
{
// Generate button for individual posts
// Ask if SEO is on again
if ($mybb->settings['fblike2'] != 1)
{
$fblike = '<iframe src="http://www.facebook.com/plugins/like.php?href='.$mybb->settings['bburl'].'/showthread.php?pid='.$post['pid'].'&layout=button_count&show_faces=false&width=450&action='.$rofl1.'&font=verdana&colorscheme='.$rofl2.'&height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$rofl3.'; height:'.$rofl4.';"></iframe>';
}
else
{
$fblike = '<iframe src="http://www.facebook.com/plugins/like.php?href=' . $mybb->settings['bburl'] . '/post-' . $post['pid'] . '.html&layout=button_count&show_faces=false&width=450&action='.$rofl1.'&font=verdana&colorscheme='.$rofl2.'&height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$rofl3.'; height:'.$rofl4.';"></iframe>';
}
}
}
// Now, we display the button. *Firecrackers*
// Ask where to display button
if ($mybb->settings['fblike9'] == 1)
{
$post['button_delete_pm'] = $post['button_delete_pm'].$fblike;
}
else
{
$post['button_email'] = $fblike.$post['button_email'];
}
}
function fblike_showthread_start()
{
global $mybb,$templates,$rofl1,$rofl2,$thread;
// Ask if display above post.
// Fetch forum id for which not to display button
$display = 1;
$lmao1 = explode(",",$mybb->settings['fblike6']);
// I don't know how this works. Just copied it from another plugin. And yes, i really don't know PHP. LOL xD
foreach($lmao1 as $lmao2)
{
// If current forum id does matches prohibited forum id
if (trim($lmao2) == $thread['fid'])
{
$display = 0;
}
}
if ($mybb->settings['fblike8'] == 1 && $display == 1)
{
// You want Like or Recommend ?
If ($mybb->settings['fblike4'] == 1)
{
$rofl1 = "like";
}
Else
{
$rofl1 = "recommend";
}
If ($mybb->settings['fblike5'] == 1)
{
// I will stay quiet now unless you say sorry.
$rofl2 = "light";
}
else
{
// Louder! I can't hear.
$rofl2 = "dark";
}
if ($mybb->settings['fblike2'] == 1)
{
// SEO On
$templates->cache['showthread'] = str_replace('{$posts}','<iframe src="http://www.facebook.com/plugins/like.php?href={$mybb->settings[\'bburl\']}/thread-{$tid}.html&layout=standard&show_faces=true&width=450&action={$rofl1}&colorscheme={$rofl2}&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:73px;" allowTransparency="true"></iframe>{$posts}',$templates->cache['showthread']);
}
else
{
// SEO Off
global $tid;
$templates->cache['showthread'] = str_replace('{$posts}','<iframe src="http://www.facebook.com/plugins/like.php?href={$mybb->settings[\'bburl\']}/showthread.php?tid={$tid}&layout=standard&show_faces=true&width=450&action={$rofl1}&colorscheme={$rofl2}&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:73px;" allowTransparency="true"></iframe>{$posts}',$templates->cache['showthread']);
}
}
}
?>