1 | <?php |
---|
2 | /*************************************************************************** |
---|
3 | * config.inc.php * |
---|
4 | * ------------------- * |
---|
5 | * application : PhpWebGallery 1.3 * |
---|
6 | * author : Pierrick LE GALL <pierrick@z0rglub.com> * |
---|
7 | * * |
---|
8 | *************************************************************************** |
---|
9 | |
---|
10 | *************************************************************************** |
---|
11 | * * |
---|
12 | * This program is free software; you can redistribute it and/or modify * |
---|
13 | * it under the terms of the GNU General Public License as published by * |
---|
14 | * the Free Software Foundation; * |
---|
15 | * * |
---|
16 | ***************************************************************************/ |
---|
17 | unset( $conf, $page, $user, $lang ); |
---|
18 | $conf = array(); |
---|
19 | $page = array(); |
---|
20 | $user = array(); |
---|
21 | $lang = array(); |
---|
22 | |
---|
23 | include_once( PREFIXE_INCLUDE.'./include/mysql.inc.php' ); |
---|
24 | include_once( PREFIXE_INCLUDE.'./include/functions.inc.php' ); |
---|
25 | include_once( PREFIXE_INCLUDE.'./include/vtemplate.class.php' ); |
---|
26 | // |
---|
27 | // How to change the order of display for images in a category ? |
---|
28 | // |
---|
29 | // You have to modify $conf['order_by']. |
---|
30 | // There are several fields that can order the display : |
---|
31 | // - date_available : the date of the adding to the gallery |
---|
32 | // - file : the name of the file |
---|
33 | // Once you've chosen which field(s) to use for ordering, |
---|
34 | // you must chose the ascending or descending order for each field. |
---|
35 | // examples : |
---|
36 | // 1. $conf['order_by'] = " order by date_available desc, file asc"; |
---|
37 | // will order pictures by date_available descending & by filename ascending |
---|
38 | // 2. $conf['order_by'] = " order by file asc"; |
---|
39 | // will only order pictures by file ascending |
---|
40 | // without taking into account the date_available |
---|
41 | $conf['order_by'] = " order by date_available desc, file asc"; |
---|
42 | |
---|
43 | $conf['repertoire_image'] = './images/'; |
---|
44 | $conf['nb_image_row'] = array ('4','5','6','7','8'); |
---|
45 | $conf['nb_row_page'] = array ('2','3','4','5','6','7','10','20','1000'); |
---|
46 | $conf['version'] = '1.3'; |
---|
47 | $conf['site_url'] = 'http://www.phpwebgallery.net'; |
---|
48 | $conf['forum_url'] = 'http://forum.phpwebgallery.net'; |
---|
49 | |
---|
50 | database_connection(); |
---|
51 | // rertieving the configuration informations for site |
---|
52 | // $infos array is used to know the fields to retrieve in the table "config" |
---|
53 | // Each field becomes an information of the array $conf. |
---|
54 | // Example : |
---|
55 | // prefixe_thumbnail --> $conf['prefixe_thumbnail'] |
---|
56 | $infos = array( 'prefixe_thumbnail', 'webmaster', 'mail_webmaster', 'acces', |
---|
57 | 'session_id_size', 'session_keyword', 'session_time', |
---|
58 | 'max_user_listbox', 'show_comments', 'nb_comment_page', |
---|
59 | 'upload_available', 'upload_maxfilesize', 'upload_maxwidth', |
---|
60 | 'upload_maxheight', 'upload_maxwidth_thumbnail', |
---|
61 | 'upload_maxheight_thumbnail' ); |
---|
62 | |
---|
63 | $query = 'select'; |
---|
64 | for ( $i = 0; $i < sizeof( $infos ); $i++ ) |
---|
65 | { |
---|
66 | if ( $i > 0 ) |
---|
67 | { |
---|
68 | $query.= ','; |
---|
69 | } |
---|
70 | else |
---|
71 | { |
---|
72 | $query.= ' '; |
---|
73 | } |
---|
74 | $query.= $infos[$i]; |
---|
75 | } |
---|
76 | $query .= ' from '.$prefixeTable.'config;'; |
---|
77 | |
---|
78 | $row = mysql_fetch_array( mysql_query( $query ) ); |
---|
79 | |
---|
80 | // affectation of each field of the table "config" to an information of the |
---|
81 | // array $conf. |
---|
82 | for ( $i = 0; $i < sizeof( $infos ); $i++ ) |
---|
83 | { |
---|
84 | $conf[$infos[$i]] = $row[$infos[$i]]; |
---|
85 | // If the field is true or false, the variable is transformed into a boolean |
---|
86 | // value. |
---|
87 | if ( $row[$infos[$i]] == 'true' || $row[$infos[$i]] == 'false' ) |
---|
88 | { |
---|
89 | $conf[$infos[$i]] = get_boolean( $row[$infos[$i]] ); |
---|
90 | } |
---|
91 | } |
---|
92 | $conf['log'] = false; |
---|
93 | $conf['top_number'] = 10; |
---|
94 | ?> |
---|