Ticket #14 (closed enhancement: fixed)

Opened 10 months ago

Last modified 7 months ago

support for status changes without AJAX support (regular http post)

Reported by: _ck_ Assigned to: so1o
Priority: normal Component: support-forum
Keywords: Cc:

Description

Here's some code I inserted to allow non-javascript users or topics pages loaded without scripts to still allow Support Forum to work.

around line 75 I put:

add_action('bb_init', array(&$support_forum, 'setTopicStatusProcess'));

Then after the function AJAX_setTopicStatusProcess, I added this new routine based on your other functions:

	function setTopicStatusProcess() 	{
		if (isset($_POST['action']) && $_POST['action']=="support_forum_post_process") { 
			global $topic;
			$topic_id = (integer) @$_POST['id'];
			$resolved = @$_POST['resolved'];
		
			if ($this->getChangeableStatus($topic_id)) {
				$topic = get_topic($topic_id);
				if ($topic) {				
					$this->setTopicStatus($topic_id, $resolved);
		
				}
			}
		}			
	}

I don't know if the two will peacefully co-exist and there may be other issues I haven't considered but it seems to work. Post data could be removed with a wp_redirect but I don't like to reload bbpress more it has to.

Change History

04/24/08 18:20:04 changed by sambauers

  • status changed from new to closed.
  • resolution set to fixed.

AJAX status switching is removed from support-forum as of 3.0.2

Now using very similar function to the above instead.

props _ck_