for($i=0; $i<10; $i++)
{
$shuffle = shuffle($images);
$a1 = array_sum(array_slice($shuffle, 0, 5));
$a2 = array_sum(array_slice($shuffle, 5, 5));
$a3 = array_sum(array_slice($shuffle, -5));
$variants[max($a1, $a2, $a3)-min($a1, $a2, $a3)] = $shuffle;
}
sql_query_pre = SET NAMES UTF8
# Set our forum PID counter
sql_query_pre = REPLACE INTO ipbcache_store VALUES( 'sphinx_core_counter', (SELECT max(id) FROM ipbfaq), '', 0, UNIX_TIMESTAMP() )
# Query posts for the main source
sql_query = SELECT f.*, f.id as search_id, \
REPLACE( pi.perm_view, '*', 0 ) as perm_view \
FROM ipbfaq f \
LEFT JOIN ipbpermission_index pi ON ( pi.perm_type_id=1 AND pi.perm_type='help' ) \
WHERE f.id <= ( SELECT cs_value FROM ipbcache_store WHERE cs_key='sphinx_core_counter' )
# Fields
sql_attr_uint = search_id
sql_ranged_throttle = 0