MyBB Community Forums

Full Version: Another PHP help? IMPORTANT!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have created a column on my SQL but now I need to include a link into my postbit that will update that column with 1 or 0 any ideas? I mean the specific thread will get updated with value 1 rest will remain 0


Basically I am trying to hide Adsense on threads that I feel don't meet Adsense terms and conditions!!

So it's like hide button for Adsense code!


Please it's simple PHP anybody help me!


$db->update_query("threads", array('hide_adsense' => 1), "uid IN (".implode(",", $uids).")");
I can't believe nobody wants to tell me how to create a simple link that will update query with 1 or 0 come one please
You need to make a POST form with a clickable input that will submit it and add it to any showthread template. Then hook to showthread to check the $mybb->input, verify post key, check tid and lastly, after everything had been checked, use that update query.
D666 please this is serious stuff messing with DB PLEASE my man post the code here:

This code is from akismet plugin!

showthread.php?action=mark_as_spam&pid={$post[\'pid\']}&fid={$post[\'fid\']}

Mysupport

<a href=\"{\$mybb->settings['bburl']}/showthread.php?action=bestanswer&amp;pid={\$post['pid']}&amp;my_post_key={\$mybb->post_code}\">

elseif($mybb->input['action'] == "bestanswer")
	{
		verify_post_check($mybb->input['my_post_key'])

$status_update = array(
				"bestanswer" => 0
			);
			// update the bestanswer column for this thread with 0
			$db->update_query("threads", $status_update, "tid = '" . intval($post_info['tid']) . "'");

Table: Threads
Column name: hide_adsense
Type: INT
Lenght/Value: 1
$db->query("UPDATE threads SET hide_adsense = 1 WHERE tid = '" . intval($post_info['tid']) . "');

Try this.
Cedric baby thanks very much man
Finally nailed this plugin cool!