MyBB Community Forums

Full Version: Why does this enable CAPTCHA?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have this function in a plugin of mine:

function support_display_guest_ad_inline(&$post){
		global $mybb, $postcounter, $templates;
		if ($mybb->user['uid'] = 0 || !$mybb->user['uid']) {
			if ($postcounter == 1) {
				eval("\$post['postbit_inline_ad'] = \"".$templates->get("vtfm_inline_ad")."\";");

Its hooked by the "postbit" hook. For some reason it makes the captcha appear when posting, and stops the display of the "edit" button and "pm" bttons on the second last (or second) post Confused Any ideas?
$mybb->user['uid'] = 0
Oh lord. That's annoying Smile Thanks Frostschutz Smile
things like that annoy me. I've been doing .NET all week for hours on end and then last night tried some PHP and it took a bit to get back into the syntax. lots of little things like that that stumped me for a while
I spent 30 minutes trying to debug something in javascript that was caused by using = instead of ==. I hate it when that happens.
I am always stuck with errors which take me hours or sometimes days to figure out.

I understand the errors, but fixing them never works well for me.
/offtopic Didn't Jammer and I ban talk on VTFM? Toungue
In /me thread Wink