Code Duplication    Length = 16-16 lines in 2 locations

qte.php 2 locations

@@ 502-517 (lines=16) @@
499
		// time !
500
		$current_time = time();
501
502
		if ($attribute_id == self::REMOVE)
503
		{
504
			$fields = array(
505
				'topic_attr_id'		=> 0,
506
				'topic_attr_user'	=> 0,
507
				'topic_attr_time'	=> 0,
508
			);
509
		}
510
		else
511
		{
512
			$fields = array(
513
				'topic_attr_id'		=> $attribute_id,
514
				'topic_attr_user'	=> $this->user->data['user_id'],
515
				'topic_attr_time'	=> $current_time,
516
			);
517
		}
518
519
		$sql = 'UPDATE ' . TOPICS_TABLE . '
520
			SET ' . $this->db->sql_build_array('UPDATE', $fields) . '
@@ 604-619 (lines=16) @@
601
		}
602
		$this->db->sql_freeresult($result);
603
604
		if ($attribute_id == -1)
605
		{
606
			$fields = array(
607
				'topic_attr_id'		=> 0,
608
				'topic_attr_user'	=> 0,
609
				'topic_attr_time'	=> 0,
610
			);
611
		}
612
		else
613
		{
614
			$fields = array(
615
				'topic_attr_id'		=> $attribute_id,
616
				'topic_attr_user'	=> $this->user->data['user_id'],
617
				'topic_attr_time'	=> $current_time,
618
			);
619
		}
620
621
		$sql = 'UPDATE ' . TOPICS_TABLE . '
622
			SET ' . $this->db->sql_build_array('UPDATE', $fields) . '