1 | <?php |
---|
2 | defined('USER_COLLEC_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
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 | |
---|
14 | function get_collection_preferred_image_orders() |
---|
15 | { |
---|
16 | global $conf; |
---|
17 | |
---|
18 | return trigger_event('get_category_preferred_image_orders', array( |
---|
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), |
---|
24 | array(l10n('Date created, old → new'), 'date_creation ASC', true), |
---|
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 | |
---|
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), |
---|
40 | array(l10n('Date created, old → new'), 'date_creation ASC', true), |
---|
41 | array(l10n('Photos number, high → low'), 'nb_images DESC', true), |
---|
42 | array(l10n('Photos number, low → high'), 'nb_images ASC', true), |
---|
43 | ); |
---|
44 | } |
---|