MyBB Community Forums

Full Version: Thank You/Like Plugin Button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to add FontAwesome to the "Like" and "Unlike" button for the plugin "Thank You/Like"

I basically want
http://fortawesome.github.io/Font-Awesom...thumbs-up/
when it says "Like" and
http://fortawesome.github.io/Font-Awesom...umbs-down/
when it says "Unlike"

Quote:$l['add_l'] = "Like";

$l['del_l'] = "Unlike";
(Copied from "thankyoulike.lang.php")

Thanks

(Website in signature) Shy
You can do this in the CSS or via templates.

CSS:

Templates & Style > Themes > Default > g33k_thankyoulike.css > Advanced

Replace with:
div[id^=tyl_btn_] {
	display: inline-block;
}

a.add_tyl_button span{
	background-image: none;
	margin-left: -20px;
	font-weight: bold;
}
a.add_tyl_button span:before {
	content: "\f164";
	font-family:FontAwesome;
}

a.del_tyl_button span{
	background-image: none;
	margin-left:-20px;
	font-weight: normal;
}

a.del_tyl_button span:before {
	content: "\f165";
	font-family:FontAwesome;
}

.tyllist{
	background-color: #f5f5f5;
	border-top: 1px dotted #ccc;
	border-bottom: 1px dotted #ccc;
	padding: 2px 5px;
}

.tyllist_classic{
	background-color: #f5f5f5;
	border-top: 1px dotted #ccc;
	border-bottom: 1px dotted #ccc;
	padding: 2px 5px;
}

img[id^=tyl_i_expcol_]{
	vertical-align: bottom;
}

Templates:
Edit template: thankyoulike_button_add
Replace with:
<div id="tyl_btn_{$post['pid']}" class="postbit_buttons"><a class="add_tyl_button" href="thankyoulike.php?action=add&amp;pid={$post['pid']}&amp;my_post_key={$mybb->post_code}" onclick="return thankyoulike.add({$post['pid']}, {$post['tid']});" title="{$lang->add_tyl}" id="tyl_a{$post['pid']}"><span id="tyl_i{$post['pid']}" style="background-image:none;margin-left:-20px;"><i class="fa fa-thumbs-up fa-fw"></i>{$lang->add_tyl}</span></a></div>

Edit template: thankyoulike_button_del
Replace with:
<div id="tyl_btn_{$post['pid']}" class="postbit_buttons"><a class="del_tyl_button" href="thankyoulike.php?action=del&amp;pid={$post['pid']}&amp;my_post_key={$mybb->post_code}" onclick="return thankyoulike.del({$post['pid']}, {$post['tid']});" title="{$lang->del_tyl}" id="tyl_a{$post['pid']}"><span id="tyl_i{$post['pid']}" style="background-image:none;margin-left:-20px;"><i class="fa fa-thumbs-down fa-fw"></i>{$lang->del_tyl}</span></a></div>

Please note: With the templates, I've overwrited some CSS properties (background-image and margin-left), you can modify these to your own needs or even modify it in the CSS file itself, rather than inline.