Location: PHPKode > projects > pkZoos Website > includes/config.php
<?php
	if(!defined('PK_MAGIC'))
		die('hack or what?');





	/* */

    $def = array();
    $config = array();





	/* */

    $def['lang_id'] = 1;
    $def['style_id'] = 1;

    $def['date_format'] = 'd.m.Y, H:i';

    $def['name_min_length'] = 3;
    $def['name_max_length'] = 10;
    $def['name_regex'] = '#[\\-\\. _\\\'0-9a-zA-Z]+#';

    $def['password_min_length'] = 6;
    $def['password_max_length'] = 32;
    $def['password_chars'] = '0123456789!"ยง$%&/()=?{[]}\\\'+-*~#_.,:;<>|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $def['password_length'] = 8;

    $def['email_max_length'] = 255;
    $def['email_regex'] = '#^(?:[a-zA-Z0-9._+-]+)+@(?:[a-zA-Z0-9._+-]+\\.)+[a-zA-Z]+$#U';

    $def['post_min_length'] = 1;
    $def['post_max_length'] = 10240;

    $def['title_min_length'] = 1;
    $def['title_max_length'] = 64;

    $def['sigtext_max_length'] = 255;

    $def['infotext_max_length'] = 10240;

    $def['posts_per_page'] = 15;
    $def['posts_min_per_page'] = 2;
    $def['posts_max_per_page'] = 100;
    $def['posts_max_per_topic'] = 1000;
    $def['posts_wait_time'] = 0;
    $def['posts_max_running_per_user'] = 2;
    $def['posts_max_edit_count'] = 0;

    $def['topics_min_per_page'] = 2;
    $def['topics_max_per_page'] = 100;
    $def['topics_per_page'] = 20;
    $def['topics_wait_time'] = 0;
    $def['topics_archive_time'] = 2592000;

    $def['users_per_page'] = 20;

    $def['session_expire_time'] = 3600;
    $def['session_online_time'] = 300;

    $def['search_expire_time'] = 3600;
    $def['search_results_per_page'] = 20;
    $def['search_min_word_length'] = 3;

    $def['view_default'] = 'news';

    $def['cookie_domain'] = '.pkzoos.de';
    $def['cookie_path'] = '/';
    $def['cookie_name'] = 'pkzoos';
    $def['cookie_secure'] = 0;
    $def['cookie_expire_time'] = 31536000;

	$def['site_name'] = 'PunkInParkZoos';
    $def['site_email'] = 'hide@address.com';

    $def['site_protocol'] = 'http://';
    $def['site_domain'] = 'pkzoos.de';
    $def['site_port'] = 80;
    $def['site_path'] = '/';

    $def['script_path'] = '/www/htdocs/v133319/domain/';

    $def['compression_simple'] = 1;
    $def['compression_gzip'] = 1;
    $def['compression_gzip_level'] = 5;

    $def['news_cat_id'] = 10;
    $def['news_count'] = 10;

    if($_SERVER["SERVER_NAME"] == 'pkzoos.de')
    {
        $def['cookie_domain'] = '.pkzoos.de';
        $def['cookie_path'] = '/';

        $def['site_domain'] = 'pkzoos.de';
        $def['site_path'] = '/';

        $def['script_path'] = '/www/htdocs/v133319/domain/';

	    $def['news_cat_id'] = 5;
    }
    else
    {
        $def['cookie_domain'] = ''; //.moe.wg.local';
        $def['cookie_path'] = '/pkzoos/';

        $def['site_domain'] = 'moe'; //.wg.local';
        $def['site_path'] = '/pkzoos/';

        $def['script_path'] = 'D:/wamp/htdocs/pkzoos/';

	    $def['news_cat_id'] = 10;
    }





	/* */

    function config_load()
    {
    	global $db;
    	global $def;
    	global $config;

        $config = $def;

        $q = "
            SELECT
                config_name,
                config_value
            FROM " . CONFIG_TABLE . "
        ";

        $config_res = $db->query($q);

        while($config_row = $db->fetch_row($config_res))
        {
            $config[$config_row['config_name']] = $config_row['config_value'];
        }

        $config['lang_path'] = $config['script_path'] . 'langs/en/';
        $config['mail_path'] = $config['script_path'] . 'langs/en/mails/';
        $config['style_path'] = $config['script_path'] . 'styles/default/';
        $config['cache_path'] = $config['script_path'] . 'cache/';
        $config['style_url'] = base_url() . 'styles/default/';
    }





	/* */

    function config_restore_defaults()
    {
    	global $db;
    	global $def;

        $q = "
            DELETE FROM " . CONFIG_TABLE . "
        ";

        $db->query($q);

		foreach($def as $name => $value)
		{
            $q = "
                INSERT INTO " . CONFIG_TABLE . "
                SET
                    config_name  = '" . $db->escape($name) . "',
                    config_value = '" . $db->escape($value) . "'
            ";

            $db->query($q);
        }
    }
?>
Return current item: pkZoos Website