[Customisation Database Commits] r816 - /trunk/titania/includes/objects/queue.php

Nathan Guse exreaction at phpbb.com
Sun Mar 21 22:16:40 GMT 2010


Author: exreaction
Date: Sun Mar 21 22:16:40 2010
New Revision: 816

Log:
When deleting a queue topic unlink it on the revisions table

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

Modified: trunk/titania/includes/objects/queue.php
==============================================================================
*** trunk/titania/includes/objects/queue.php (original)
--- trunk/titania/includes/objects/queue.php Sun Mar 21 22:16:40 2010
***************
*** 301,306 ****
--- 301,312 ----
  		}
  		phpbb::$db->sql_freeresult($result);
  
+ 		// Clear the revision queue id from the revisions table
+ 		$sql = 'UPDATE ' . TITANIA_REVISIONS_TABLE . '
+ 			SET revision_queue_id = 0
+ 			WHERE revision_id = ' . $this->revision_id;
+ 		phpbb::$db->sql_query($sql);
+ 
  		// Assplode
  		parent::delete();
  	}
***************
*** 367,375 ****
  		//For now, we fix, poster_id and forum to post
  		$poster 	= 2;
  		$forum_id	= 2;
! 		
  		$contrib->get_download($this->revision_id);
! 		
  		$options = array(
  			'poster_id'				=> $poster,
  			'forum_id' 				=> $forum_id,
--- 373,381 ----
  		//For now, we fix, poster_id and forum to post
  		$poster 	= 2;
  		$forum_id	= 2;
! 
  		$contrib->get_download($this->revision_id);
! 
  		$options = array(
  			'poster_id'				=> $poster,
  			'forum_id' 				=> $forum_id,
***************
*** 386,404 ****
  			'topic_type'			=> POST_NORMAL,
  			'post_approved'			=> true,
  		);
! 		
  		if ($contrib->contrib_release_topic_id)
  		{
  			$body = sprintf(phpbb::$user->lang[titania_types::$types[$contrib->contrib_type]->update_public],
  				$revision->revision_version
  			);
! 			
  			$options_details = array(
  				'topic_id'				=> $contrib->contrib_release_topic_id,
  				'topic_title'			=> 'Re: ' . $contrib->contrib_name,
  				'post_text'				=> $body
  			);
! 			
  			$options = array_merge($options, $options_details);
  			phpbb_post_add($options);
  		}
--- 392,410 ----
  			'topic_type'			=> POST_NORMAL,
  			'post_approved'			=> true,
  		);
! 
  		if ($contrib->contrib_release_topic_id)
  		{
  			$body = sprintf(phpbb::$user->lang[titania_types::$types[$contrib->contrib_type]->update_public],
  				$revision->revision_version
  			);
! 
  			$options_details = array(
  				'topic_id'				=> $contrib->contrib_release_topic_id,
  				'topic_title'			=> 'Re: ' . $contrib->contrib_name,
  				'post_text'				=> $body
  			);
! 
  			$options = array_merge($options, $options_details);
  			phpbb_post_add($options);
  		}
***************
*** 415,437 ****
  				$contrib->download['filesize'],
  				$contrib->get_url()
  			);
! 			
  			$options_details = array(
  				'topic_title'			=> $contrib->contrib_name,
  				'post_text'				=> $body
  			);
! 			
  			$options = array_merge($options, $options_details);
  			$topic_id = phpbb_topic_add($options);
  		}
! 		
  		$sql_ary = array(
  			'contrib_last_update' 		=> titania::$time,
  			'contrib_release_topic_id' 	=> ($contrib->contrib_release_topic_id) ? $contrib->contrib_release_topic_id : $topic_id,
  		);
! 		
  		unset($contrib);
! 		
  		// Update contrib last update time and release topic ic
  		$sql = 'UPDATE ' . TITANIA_CONTRIBS_TABLE . '
  			SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '
--- 421,443 ----
  				$contrib->download['filesize'],
  				$contrib->get_url()
  			);
! 
  			$options_details = array(
  				'topic_title'			=> $contrib->contrib_name,
  				'post_text'				=> $body
  			);
! 
  			$options = array_merge($options, $options_details);
  			$topic_id = phpbb_topic_add($options);
  		}
! 
  		$sql_ary = array(
  			'contrib_last_update' 		=> titania::$time,
  			'contrib_release_topic_id' 	=> ($contrib->contrib_release_topic_id) ? $contrib->contrib_release_topic_id : $topic_id,
  		);
! 
  		unset($contrib);
! 
  		// Update contrib last update time and release topic ic
  		$sql = 'UPDATE ' . TITANIA_CONTRIBS_TABLE . '
  			SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . '




More information about the customisationdb-commits mailing list