MyBB Community Forums
[1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) (/thread-59652.html)



RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - mujeebdgk - 2015-01-30

a.add_tyl_button span:before{
font-family:FontAwesome;
  content: "\f087";
}

above mention are my code , and result is 

[attachment=33646]

for removing search icon i have to remove this code mention below :

<span id="tyl_i{$post['pid']}">{$lang->add_tyl}</span>



RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - SvePu - 2015-01-30

Don't remove any parts of plugin templates, because there could be a deinstalling problem.

You can remove the original button icons and add custom "Font Awesome" icons with css changes in g33k_thankyoulike.css

Change:
a.add_tyl_button span{
background-image: url(images/thankyoulike/thx_add.png);
}

a.del_tyl_button span{
background-image: url(images/thankyoulike/thx_del.png);
}

to:
a.add_tyl_button span{
background-image: none;
}

a.del_tyl_button span{
background-image: none;
}

a.add_tyl_button span:before{
content: "\f087";
}

a.del_tyl_button span:before{
content: "\f088";
}



RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - mujeebdgk - 2015-01-30

actually i tried as you mention before , but it shows extra space in button , you may see attachment 

[attachment=33648]


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - SvePu - 2015-01-30

OK...I see the problem - try this in css file:
a.add_tyl_button span{
background-image: none;
padding-left: 0;
}

a.del_tyl_button span{
background-image: none;
padding-left: 0;
}

a.add_tyl_button span:before{
content: "\f087";
margin-right: 5px;
}

a.del_tyl_button span:before{
content: "\f088";
margin-right: 5px;
}



RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - mujeebdgk - 2015-01-30

thank you very much it just work fine Smile now everything seems ok

one question , for example i want few forums first post only like/thanks , but other few forums with all post like /thanks option , is there any way that i can do this ?


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Eldenroot - 2015-01-31

(2015-01-30, 09:36 PM)mujeebdgk Wrote: thank you very much it just work fine Smile  now everything seems ok


one question , for example i want few forums first post only like/thanks , but other few forums with all post like /thanks option , is there any way that i can do this ?

No, you can just use likes or thank you system Smile


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - mujeebdgk - 2015-01-31

may be i didn't clear my point .

for example i have two forums A & B , in A i want like button for only first post , but in forum B i want like buttons for all posts Smile

is it possible ?


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Eldenroot - 2015-01-31

I understood, no it is not possible. But feel free to make any changes and push your code into github


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - SvePu - 2015-01-31

(2015-01-31, 02:38 PM)mujeebdgk Wrote: may be i didn't clear my point .

for example i have two forums A & B , in A i want like button for only first post , but in forum B i want like buttons for all posts Smile

is it possible ?

It's possible with some changes in plugin main php file ony.

If you want do this, open /inc/plugins/thankyoulike.php to edit.

Search for (line #771):
else if(($mybb->settings[$prefix.'firstall'] == "first" && $thread['firstpost'] == $post['pid']) || $mybb->settings[$prefix.'firstall'] == "all")
{
	// Same as above but show add button
	eval("\$post['button_tyl'] = \"".$templates->get("thankyoulike_button_add")."\";");
}

Replace this whole part with:
else if(($mybb->settings[$prefix.'firstall'] == "first" && $thread['firstpost'] == $post['pid']) || $mybb->settings[$prefix.'firstall'] == "all")
{
	if ((my_strpos("FIDsXXX", $post['fid']) !== false) && $thread['firstpost'] != $post['pid'])
	{
		$post['button_tyl'] = '';
	}
	else
	{
		// Same as above but show add button
		eval("\$post['button_tyl'] = \"".$templates->get("thankyoulike_button_add")."\";");
	}
}

Replace FIDsXXX in "" with the forum id (separeted by comma) where you want add the TYL button only in first post.


RE: [1.4.x/1.6.x] Thank You/Like System v1.5 (Updated: 10/26/2011) - Eldenroot - 2015-01-31

@SvePu - ok, what about to add this as a new feature into 1.8.2?