[Customisation Database Commits] r271 - /trunk/titania/includes/objects/faq.php

Nathan Guse exreaction at phpbb.com
Tue Jun 30 21:05:36 UTC 2009


Author: exreaction
Date: Tue Jun 30 21:05:35 2009
New Revision: 271

Log:
Gah, that was dumb.  I was thinking faq_id instead of contrib_id.

Reverting 266

Modified:
    trunk/titania/includes/objects/faq.php

Modified: trunk/titania/includes/objects/faq.php
==============================================================================
*** trunk/titania/includes/objects/faq.php (original)
--- trunk/titania/includes/objects/faq.php Tue Jun 30 21:05:35 2009
***************
*** 100,109 ****
  	public function move($direction)
  	{
  		$this->load();
! 
  		$sql = 'SELECT faq_order_id
  			FROM ' . TITANIA_CONTRIB_FAQ_TABLE . '
  			WHERE faq_order_id ' . (($direction == 'move_up') ? '<' : '>') . $this->faq_order_id . '
  			ORDER BY faq_order_id ' . (($direction == 'move_up') ? 'DESC' : 'ASC');
  		phpbb::$db->sql_query_limit($sql, 1);
  		$new_order_id = phpbb::$db->sql_fetchfield('faq_order_id');
--- 100,110 ----
  	public function move($direction)
  	{
  		$this->load();
! 		
  		$sql = 'SELECT faq_order_id
  			FROM ' . TITANIA_CONTRIB_FAQ_TABLE . '
  			WHERE faq_order_id ' . (($direction == 'move_up') ? '<' : '>') . $this->faq_order_id . '
+ 				AND contrib_id = ' . $this->contrib_id . '
  			ORDER BY faq_order_id ' . (($direction == 'move_up') ? 'DESC' : 'ASC');
  		phpbb::$db->sql_query_limit($sql, 1);
  		$new_order_id = phpbb::$db->sql_fetchfield('faq_order_id');
***************
*** 115,128 ****
  		}
  
  		// Update the item in the position where want to move it to have the current position
! 		 $sql = 'UPDATE ' . TITANIA_CONTRIB_FAQ_TABLE . '
  			SET faq_order_id = ' . $this->faq_order_id . '
  		 	WHERE faq_order_id = ' . $new_order_id . '
  				AND contrib_id = ' . $this->contrib_id;
  		 phpbb::$db->sql_query($sql);
  
  		// Update the current faq item to have the new position
! 		 $sql = 'UPDATE ' . TITANIA_CONTRIB_FAQ_TABLE . '
  			SET faq_order_id = ' . $new_order_id . '
  		 	WHERE faq_id = ' . $this->faq_id;
  		 phpbb::$db->sql_query($sql);
--- 116,129 ----
  		}
  
  		// Update the item in the position where want to move it to have the current position
! 		 $sql = 'UPDATE ' . TITANIA_CONTRIB_FAQ_TABLE . ' 
  			SET faq_order_id = ' . $this->faq_order_id . '
  		 	WHERE faq_order_id = ' . $new_order_id . '
  				AND contrib_id = ' . $this->contrib_id;
  		 phpbb::$db->sql_query($sql);
  
  		// Update the current faq item to have the new position
! 		 $sql = 'UPDATE ' . TITANIA_CONTRIB_FAQ_TABLE . ' 
  			SET faq_order_id = ' . $new_order_id . '
  		 	WHERE faq_id = ' . $this->faq_id;
  		 phpbb::$db->sql_query($sql);




More information about the customisationdb-commits mailing list