Function for checking poll existance?
#1
Hey, I was just wondering if there is a function to tell if a thread has a poll (via TID)? Cheers in advance.
My Site - My Forum - MyBB
[Image: madmike360.png]
Reply
#2
no there isnt =P

but you can add this function into ./inc/functions.php
function check_poll($tid)
{
	global $db, $mybb;
	$query = $db->simple_select(TABLE_PREFIX."threads", "poll", "tid='".$tid."'");
	$poll = $db->fetch_field($query, "poll");
	if($poll != 0)
	{
		// POLL ID
		return $poll;
	}
}

Usage : check_poll($tid) ; if the thread has a poll, it returns the PollID.
Reply
#3
Cheers Big Grin
My Site - My Forum - MyBB
[Image: madmike360.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)