Need help with plugin to allow only one thread in selected forums
flash.tato Offline
Junior Member
**
Posts: 11
Joined: Jun 2010
Post: #5
RE: Need help with plugin to allow only one thread in selected forums
Only a suggestion delegating a job which MySQL can do to PHP i think is wrong.

PHP Code:
1
2
3
4
5
6
7
8
9
		$query = $db->simple_select("threads", "uid");		
		$uid = explode(",", $db->threads['uid']);
		$forum = $new_thread['fid'];	

		if (in_array($forum,$uid))			

		{
			exit("You cannot post more than one thread in this forum");
		}


Nah! Add a WHERE clause with UID supplied and LIMIT 1 and you're done. Wink
The point is that now you're fetching all uids of the forums when you need to know only if it exists.

07-07-2010 07:31 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Need help with plugin to allow only one thread in selected forums - flash.tato - 07-07-2010 07:31 AM

 Standard Tools
Forum Jump: