aboutsummaryrefslogtreecommitdiffstats
path: root/include/config.inc.php
blob: f0a348a243783da10865ba99d0b0288b5605440d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/***************************************************************************
 *                              config.inc.php                             *
 *                            -------------------                          *
 *   application          : PhpWebGallery 1.3                              *
 *   author               : Pierrick LE GALL <pierrick@z0rglub.com>        *
 *                                                                         *
 ***************************************************************************

 ***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation;                                         *
 *                                                                         *
 ***************************************************************************/
unset( $conf, $page, $user, $lang );
$conf = array();
$page = array();
$user = array();
$lang = array();

include_once( PREFIXE_INCLUDE.'./include/mysql.inc.php' );
include_once( PREFIXE_INCLUDE.'./include/functions.inc.php' );
include_once( PREFIXE_INCLUDE.'./include/vtemplate.class.php' );
//
// How to change the order of display for images in a category ?
//
// You have to modify $conf['order_by'].
// There are several fields that can order the display :
//  - date_available : the date of the adding to the gallery
//  - file : the name of the file
// Once you've chosen which field(s) to use for ordering,
// you must chose the ascending or descending order for each field.
// examples :
// 1. $conf['order_by'] = " order by date_available desc, file asc";
//    will order pictures by date_available descending & by filename ascending
// 2. $conf['order_by'] = " order by file asc";
//    will only order pictures by file ascending
//    without taking into account the date_available
$conf['order_by'] = " order by date_available desc, file asc";

$conf['repertoire_image']   = './images/';
$conf['nb_image_row']       = array ('4','5','6','7','8');
$conf['nb_row_page']        = array ('2','3','4','5','6','7','10','20','1000');
$conf['version']            = '1.3';
$conf['site_url']           = 'http://www.phpwebgallery.net';
$conf['forum_url']          = 'http://forum.phpwebgallery.net';

database_connection();
// rertieving the configuration informations for site
// $infos array is used to know the fields to retrieve in the table "config"
// Each field becomes an information of the array $conf.
// Example :
//            prefixe_thumbnail --> $conf['prefixe_thumbnail']
$infos = array( 'prefixe_thumbnail', 'webmaster', 'mail_webmaster', 'acces',
                'session_id_size', 'session_keyword', 'session_time',
                'max_user_listbox', 'show_comments', 'nb_comment_page',
                'upload_available', 'upload_maxfilesize', 'upload_maxwidth',
                'upload_maxheight', 'upload_maxwidth_thumbnail',
                'upload_maxheight_thumbnail' );

$query  = 'select';
for ( $i = 0; $i < sizeof( $infos ); $i++ )
{
  if ( $i > 0 )
  {
    $query.= ',';
  }
  else
  {
    $query.= ' ';
  }
  $query.= $infos[$i];
}
$query .= ' from '.$prefixeTable.'config;';

$row = mysql_fetch_array( mysql_query( $query ) );

// affectation of each field of the table "config" to an information of the
// array $conf.
for ( $i = 0; $i < sizeof( $infos ); $i++ )
{
  $conf[$infos[$i]] = $row[$infos[$i]];
  // If the field is true or false, the variable is transformed into a boolean
  // value.
  if ( $row[$infos[$i]] == 'true' || $row[$infos[$i]] == 'false' )
  {
    $conf[$infos[$i]] = get_boolean( $row[$infos[$i]] );
  }
}
$conf['log']                        = false;
$conf['top_number']                 = 10;
?>