MyBB Community Forums

Full Version: fix styles inside of PHP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to add style to this part of a php file I'm editing.
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']}\">
			<img src=\"{$mybb->settings['bburl']}/{$theme['imgdir']}/postbit_thx.png\" 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.png\" border=\"0\" alt=\"$lang->thx_remove\" title=\"$lang->thx_remove\" id=\"i{$post['pid']}\" /></a>";
		}
		else
		{
			$post['thanks'] = "<!-- remove thanks disabled by administrator -->";
		}
	}

I'm trying to add these style to the php
margin-top: -5px;
margin-right: -5px;
margin-bottom: -5px;
border: 1px solid #A3A3A3;

Can anyone help me fix it the correct way?

Trying to add it along where is say:
" border=\"0\"
Add it using inline css.
style=\"margin-top: ...

But why you are doing this way? Add a class in php and use global.css to style it.
(2013-07-31, 04:22 AM)effone Wrote: [ -> ]Add it using inline css.
style=\"margin-top: ...

But why you are doing this way? Add a class in php and use global.css to style it.

Because this stupid plugin didn't make a template to make it easier to edit. Everything is in PHP which is irritating. -_- Thanks though!
Not required to make templates as the tags are inline place a class like this for both instances:

<span class = \"thx_btn\"><a id=\"a{$post['pid']}\" ....... \" /></a></span>

and target the button image from global.css like this:

.thx_btn a img {
/* Your Style Declarations */
}
Hm, where did you find this? That line? All I could see what this
{$post['thanks']}
which is in my postbit_classic

All that was in my postbit line was this
<td class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
		<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
		<span class="smalltext">
			{$post['usertitle']}<br />
			{$post['userstars']}
			{$post['groupimage']}
			{$post['useravatar']}<br />
			{$post['user_details']}
		</span>
	</td>

Oops wrong topic. :/
That code is inside your plugin php, not in templates.
Thank you again effone! Smile I'm glad you told me this which made it so much easier. Big Grin Thanks!