[16591] | 1 | <?php |
---|
| 2 | defined('USER_COLLEC_PATH') or die('Hacking attempt!'); |
---|
| 3 | |
---|
[24421] | 4 | function get_random_key($length=32) |
---|
| 5 | { |
---|
| 6 | $chars = '0123456789abcdefabcdef'; |
---|
| 7 | for ($s=''; strlen($s)<$length; ) |
---|
| 8 | { |
---|
| 9 | $s.= $chars[rand(0, strlen($chars) - 1)]; |
---|
| 10 | } |
---|
| 11 | return $s; |
---|
| 12 | } |
---|
| 13 | |
---|
[20093] | 14 | function get_collection_preferred_image_orders() |
---|
| 15 | { |
---|
[23361] | 16 | global $conf; |
---|
[25678] | 17 | |
---|
[28626] | 18 | return trigger_change('get_category_preferred_image_orders', array( |
---|
[20093] | 19 | array(l10n('Date added to collection, new → old'), 'add_date DESC', true), |
---|
| 20 | array(l10n('Date added to collection, old → new'), 'add_date ASC', true), |
---|
| 21 | array(l10n('Photo title, A → Z'), 'name ASC', true), |
---|
| 22 | array(l10n('Photo title, Z → A'), 'name DESC', true), |
---|
| 23 | array(l10n('Date created, new → old'), 'date_creation DESC', true), |
---|
[25678] | 24 | array(l10n('Date created, old → new'), 'date_creation ASC', true), |
---|
[20093] | 25 | array(l10n('Date posted, new → old'), 'date_available DESC', true), |
---|
| 26 | array(l10n('Date posted, old → new'), 'date_available ASC', true), |
---|
| 27 | array(l10n('Rating score, high → low'), 'rating_score DESC', $conf['rate']), |
---|
| 28 | array(l10n('Rating score, low → high'), 'rating_score ASC', $conf['rate']), |
---|
| 29 | array(l10n('Visits, high → low'), 'hit DESC', true), |
---|
| 30 | array(l10n('Visits, low → high'), 'hit ASC', true), |
---|
| 31 | )); |
---|
| 32 | } |
---|
| 33 | |
---|
[23361] | 34 | function get_collections_preferred_orders() |
---|
| 35 | { |
---|
| 36 | return array( |
---|
| 37 | array(l10n('Name, A → Z'), 'name ASC', true), |
---|
| 38 | array(l10n('Name, Z → A'), 'name DESC', true), |
---|
| 39 | array(l10n('Date created, new → old'), 'date_creation DESC', true), |
---|
[25678] | 40 | array(l10n('Date created, old → new'), 'date_creation ASC', true), |
---|
[23361] | 41 | array(l10n('Photos number, high → low'), 'nb_images DESC', true), |
---|
| 42 | array(l10n('Photos number, low → high'), 'nb_images ASC', true), |
---|
| 43 | ); |
---|
| 44 | } |
---|