source: extensions/UserCollections/include/functions.inc.php @ 28445

Last change on this file since 28445 was 26854, checked in by mistic100, 11 years ago

keep old trigger functions (PHP 5.2 issue)

File size: 1.9 KB
Line 
1<?php
2defined('USER_COLLEC_PATH') or die('Hacking attempt!');
3
4function 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
14function 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 &rarr; old'), 'add_date DESC', true),
20    array(l10n('Date added to collection, old &rarr; new'), 'add_date ASC',  true),
21    array(l10n('Photo title, A &rarr; Z'),        'name ASC',             true),
22    array(l10n('Photo title, Z &rarr; A'),        'name DESC',            true),
23    array(l10n('Date created, new &rarr; old'),   'date_creation DESC',   true),
24    array(l10n('Date created, old &rarr; new'),   'date_creation ASC',    true),
25    array(l10n('Date posted, new &rarr; old'),    'date_available DESC',  true),
26    array(l10n('Date posted, old &rarr; new'),    'date_available ASC',   true),
27    array(l10n('Rating score, high &rarr; low'),  'rating_score DESC',    $conf['rate']),
28    array(l10n('Rating score, low &rarr; high'),  'rating_score ASC',     $conf['rate']),
29    array(l10n('Visits, high &rarr; low'),        'hit DESC',             true),
30    array(l10n('Visits, low &rarr; high'),        'hit ASC',              true),
31    ));
32}
33
34function get_collections_preferred_orders()
35{
36  return array(
37    array(l10n('Name, A &rarr; Z'),               'name ASC',           true),
38    array(l10n('Name, Z &rarr; A'),               'name DESC',          true),
39    array(l10n('Date created, new &rarr; old'),   'date_creation DESC', true),
40    array(l10n('Date created, old &rarr; new'),   'date_creation ASC',  true),
41    array(l10n('Photos number, high &rarr; low'), 'nb_images DESC',     true),
42    array(l10n('Photos number, low &rarr; high'), 'nb_images ASC',      true),
43    );
44}
Note: See TracBrowser for help on using the repository browser.