Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         media
6
 * @author          Ryan Djurovich (2004-2009), WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: parameters.php 2098 2014-02-11 01:37:03Z darkviper $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/media/parameters.php $
14
 * @lastmodified    $Date: 2014-02-11 02:37:03 +0100 (Tue, 11 Feb 2014) $
15
 *
16
 */
17

    
18
/* -------------------------------------------------------- */
19
// Must include code to stop this file being accessed directly
20
if(!defined('WB_URL')) {
21
	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
22
	throw new IllegalFileException();
23
}
24
/* -------------------------------------------------------- */
25

    
26
function __unserialize($sObject) {  // found in php manual :-)
27
    if($sObject=='') { return array( 'global' => array( 'admin_only' => false,'show_thumbs' => false ) );}
28
	$__ret = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $sObject );
29
	return unserialize($__ret);
30
}
31
$oDb = WbDatabase::getInstance();
32
$pathsettings = array( 'global' => array( 'admin_only' => false,'show_thumbs' => false ) );
33
if(DEFAULT_THEME != '') {
34
	$sql = 'SELECT * FROM `'.$oDb->TablePrefix.'settings` '
35
         . 'WHERE `name`=\'mediasettings\'';
36
	$query = $oDb->doQuery($sql);
37
    if ($query && (($settings = $query->fetchRow(MYSQL_ASSOC)))) {
38
		$pathsettings = __unserialize($settings['value']);
39
	} else {
40
		$sql = 'INSERT INTO `'.$oDb->TablePrefix.'settings` '
41
             . 'SET `name`=\'mediasettings\', '
42
             .     '`value`=\'\'';
43
		$oDb->doQuery($sql);
44
	}
45
}
(9-9/14)