MyBB Community Forums

Full Version: Adding my own postbit function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
if($mybb->user['uid'] && $mybb->user['fid4'])

try that
It's the same effect. I have set fid4 as an html link. However when the page loads, people who have not set fid4 field also are displaying the same link (my fid4 link). The table fields in db are showing null values, so I'm thinking its still a code bug
Hmm.. this works..

		if($post['fid4'])
		{
			eval("\$post['donatefield'] = \"".$templates->get("postbit_donate")."\";");            
		}
		else
		{
			$post['donatefield'] = "";
		}

I shouldnt have used $mybb->user['fid4'] I guess? It works with $post['fid4']

So the fid value is a property of that particular post rather than the user? It's a bit confusing!

Whats even more perplexing is that the template which is called to evaluate the code uses $mybb->user['fid4'] to evaluate fid..

Donation Link: <br><a href="{$mybb->user['fid4']}"><img src="images/donate.png"></a>	<br>

Where am I using the logic incorrectly, guys? Is this because of the property passed to functions_post.php?
$post should be used within the postbit as it contains information specific to the author of the post. $mybb->user contains data relevant to the currently logged in user.

The template should use $post['fid4'] too though...
Thanks, that explains it. Smile
Pages: 1 2