Code Duplication    Length = 8-8 lines in 3 locations

controller/acp/validation.php 1 location

@@ 151-158 (lines=8) @@
148
		$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
149
		$direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
150
151
		if (is_array($sort_by_sql[$sort_key]))
152
		{
153
			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
154
		}
155
		else
156
		{
157
			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
158
		}
159
160
		$sql = 'SELECT COUNT(1) AS total_links
161
			FROM ' . $this->links_table . '

search/fulltext_directory.php 1 location

@@ 79-86 (lines=8) @@
76
		}
77
		$direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
78
79
		if (is_array($sort_by_sql[$sort_key]))
80
		{
81
			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
82
		}
83
		else
84
		{
85
			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
86
		}
87
88
		$sql_array = array(
89
			'SELECT'	=> 'l.link_id',

controller/categories.php 1 location

@@ 265-272 (lines=8) @@
262
			$sql_start = $start;
263
		}
264
265
		if (is_array($sort_by_sql[$sort_key]))
266
		{
267
			$sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
268
		}
269
		else
270
		{
271
			$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
272
		}
273
274
		// Grab just the sorted link ids
275
		$sql_array = array(