MyBB Community Forums

Full Version: thanks plugin css - help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi guys i need some help Sad

Im trying to get the thanks plugin buttons to match the rest but its giving me a hard time .

Normal button code
<a class="button" href="editpost.php?pid=241693" onclick="Thread.deletePost(241693); return false;" style="" id="quick_delete_241693"><img src="images/goon/english/icons/postbit_delete.png" alt="Delete this post" title="Delete this post">Delete</a>

thnx button code
<a id="a241693" onclick="javascript:return thx(241693);" href="showthread.php?action=remove_thank&amp;pid=241693">
			<img src="images/goon/postbit_rthx.gif" border="0" alt="Thanks" title="Thanks" id="i241693"></a>

To make them match i need to edit the php code but everythime i try this it breaks the site with error.

I think it should be class needs to be added here somewhere
			$post['thanks'] = "<a id=\"a{$post['pid']}\" onclick=\"javascript:return thx({$post['pid']});\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\">
			<img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_thx.gif\" border=\"0\" alt=\"$lang->thx_main\" title=\"$lang->thx_main\" id=\"i{$post['pid']}\" /></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_rthx.gif\" border=\"0\" alt=\"$lang->thx_remove\" title=\"$lang->thx_remove\" id=\"i{$post['pid']}\" /></a>";

I tried it like this
$post['thanks'] = "<a class="button" id=\"a{$post['pid']}\" onclick=\"javascript:return thx({$post['pid']});\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\">
But it gives me a erro and the page doesnt even work lol . I tried to insert it some where els but stilll the same problem .

This is the plugin im using
http://mods.mybb.com/view/thanks

Can anyone tell me where to add the "class="button"" to make it match my theme ?
At line no. 310 of the plugin, modify like this:

if($mybb->user['uid'] != 0 && $mybb->user['uid'] != $post['uid']) 
	{
		if(!$b)
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" onclick=\"javascript:return thx({$post['pid']});\" href=\"showthread.php?action=thank&tid={$post['tid']}&pid={$post['pid']}\">
			<span class=\"button\" alt=\"$lang->thx_main\" title=\"$lang->thx_main\" id=\"i{$post['pid']}\"><img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_thx.gif\" border=\"0\" /></span></a>";
		}
		else if($mybb->settings['thx_del'] == "1")
		{
			$post['thanks'] = "<a id=\"a{$post['pid']}\" onclick=\"javascript:return rthx({$post['pid']});\" href=\"showthread.php?action=remove_thank&tid={$post['tid']}&pid={$post['pid']}\">
			<span class=\"button\" alt=\"$lang->thx_remove\" title=\"$lang->thx_remove\" id=\"i{$post['pid']}\"><img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_rthx.gif\" border=\"0\" /></span></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}

I am still confused, if you are using button images, why you need the button class? Button class is meant to be applied for the CSS buttons.
Perfect !! Thnx a lot

Im using both the button image with css effect
Hello
how to delete the .gif image used by plugin and use css button style?
What code should I put/modify?
I don't want the post_thx and rthx.gif buttons, I want the css buttons as others in the theme.
On Global Templates I didn't find anything to modify, same in postbit.
Help me pls, it's important!
Wrap postbit thanks variable (in postbit and in postbit_classic templates) with a span tag and add a class to it (for example: <span class="postbit_thanks_button"> !thanks variable! </span>).

Add following content at the bottom of your global.css

Quote:.postbit_thanks_button a img {
display: none !important;
}

a[href*="showthread.php?action=thank"]:before {
content: "Add thanks";
}

a[href*="showthread.php?action=remove_thank"]:before {
content: "Remove thanks";
}

.postbit_thanks_button a {
/*your styling for thanks button goes here*/
display:inline-block;
background-color:red;
padding:2px 3px;
border-radius:2px;
}
Well i do not recomend to remove images or some parts of code, if you do this, you have an error message if use AJAX i told you for sure.

You may use my mod, is bassed on that plugin, but i send a new thread on plugins area and waiting validation, i know they have much work because i reported too an error on plugins area and don't fixed yet.

Well i release this mod...

http://mods.mybb.com/view/thank-you-mybb...p-myalerts

They have css stilization and create thx_buttons.css styleshet on your theme when activate and you can edit values right there. This mod works equal the mentioned, but have another new improvements.

But you can download on Github the latest release, i fixed AJAX and other minor things, but works fine, you can see it on my forum and i can give support for my plugins as soon as i can.

https://github.com/WhiteNeo/thankyou-mybb-system

When they (forum staff) validated my theme on plugins you can give support right there too, cheers.
(2013-11-18, 11:26 PM)Dark Neo Wrote: [ -> ]Well i do not recomend to remove images or some parts of code, if you do this, you have an error message if use AJAX i told you for sure.

You may use my mod, is bassed on that plugin, but i send a new thread on plugins area and waiting validation, i know they have much work because i reported too an error on plugins area and don't fixed yet.

Well i release this mod...

http://mods.mybb.com/view/thank-you-mybb...p-myalerts

They have css stilization and create thx_buttons.css styleshet on your theme when activate and you can edit values right there. This mod works equal the mentioned, but have another new improvements.

But you can download on Github the latest release, i fixed AJAX and other minor things, but works fine, you can see it on my forum and i can give support for my plugins as soon as i can.

https://github.com/WhiteNeo/thankyou-mybb-system

When they (forum staff) validated my theme on plugins you can give support right there too, cheers.

Tried your plugin but it didn't work at all, the others instead work at 50%. Your plugin is too much big for the use that I need.



(2013-11-17, 07:29 PM)Johnny S Wrote: [ -> ]Wrap postbit thanks variable (in postbit and in postbit_classic templates) with a span tag and add a class to it (for example: <span class="postbit_thanks_button"> !thanks variable! </span>).

Add following content at the bottom of your global.css

Quote:.postbit_thanks_button a img {
display: none !important;
}

a[href*="showthread.php?action=thank"]:before {
content: "Add thanks";
}

a[href*="showthread.php?action=remove_thank"]:before {
content: "Remove thanks";
}

.postbit_thanks_button a {
/*your styling for thanks button goes here*/
display:inline-block;
background-color:red;
padding:2px 3px;
border-radius:2px;
}

Did as you said.
Installed plugin and wrapped in postbit and postbit classic:

<span class="postbit_thanks_button">{$post['thanks']}</span>


I added all in global.css but see what happens if I click on it:

[Image: 16910041b17d6612759fcad3d6c00ee7.png]

[Image: 5cf9ac66fde7b6b2ae6fb6730669fb37.png]
The plugins works at 100% it's on my site, maybe you have a conflict inside your jscripts, thats a reason to plugins does not work, or a configuration mistake.

About that error i told you, you have some troubles with that.

And in my plugin you have to configure plugin inside adminCP to tell in wich forums by id apply the mod, sepparated by comma, and have to configure all tasks before you use it, this replace rep button inside forums with thanks mod, and others only show rep button.

You have to configure all plugins, but anyway maybe you don't need all improvements, but i told you if you mod that part you have that error, so you could disable AJAX for this plugin to make redirection and assume your plugins works fine, cheers.
Dark, your plugin doesn't work at all on my site because of these conflicts. Why install a plugin that doesn't work? I'm not saying that your plugin ISN'T GOOD but in this case in which I have BIG problems with jscripts I can't use it.
I'm waiting Johnny response.
Since you have Javascript conflicts can you paste your headerinclude template ?
Pages: 1 2 3