~joshli/coalgames/trunk

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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
/**
 * This file contains all the settings needed to run Coal Games.
 *
 * Unlike WordPress' settings file, this file is
 * to be changed. This file contains all the settings
 * to run Coal Games. WordPress uses the database
 * to store settings but although that can be easy to
 * manipulate, it is very slow.
 *
 * Maybe, in the future, we will implement the settings in the database and have
 * a cache of the sessions but for now, we are only working on the basic
 * features.
 *
 * @package Coal Games Project
 */

/**
 * If file was accessed directly, exit to prevent problems.
 * First, it tries to go to cg-directfile.php. If that file
 * is not found, then it just displays a generic message.
 * This is so that you can place a link or other message on
 * a file so that if a search engine linked to it, you could
 * get a link back to your main site.
 *
 * This file SHOULD automatically edited by the installer and
 * by the administration panel but users can also edit this/
 * The installer is not yet created so the installer does not
 * use this file.
 */
if ( !defined('IN_CG') ) {
	if ( !( @include( './cg-directfile.php' ) ) ) {
		die("File can not be accessed directly");
	}
}

error_reporting(E_ALL);

/**
 * Root of all settings
 *
 * Can be accessed by either $cg_settings or $GLOBALS['cg_settings']
 */
$cg_settings =
array(
/**
 * The must change settings for the website
 */
'site_url'           => 'http://localhost/trunk' // No trailing slash
,'site_url_strict'   => false // Set to true if the site url is forced to be the 'site_url'. If false, then it will use the $_SERVER['HTTP_HOST'].
,'site_name'         => 'Coal Games Project'
,'site_email'        => 'admin@localhost' 
,'admin_name'        => 'admin'
/**
 * Some important settings
 */
,'cur_theme'         => 'avacado'
/**
 * The three main folders for Coal Games.
 */
,'memory_limit'      => '32M' // Default is 32M
,'folder.includes'   => 'cg-includes' // Includes folder
,'folder.content'    => 'cg-content' // Content Folder
,'folder.admin'      => 'cg-admin' // Admin Folder
/**
 * Secondary folders for Coal Games
 */
,'folder.flashgames'      => 'flashgames'
,'folder.themes'          => 'themes'
,'folder.gameicons'       => 'gameicons'
,'time.general'           => 'j F Y'
/**
 * User Settings. 
 */
,'user.min_username'      => 4
,'user.max_username'      => 12
,'user.min_password'      => 5
,'user.max_password'      => 30
,'user.username_pattern'  => '/^[A-Z0-9_-]*$/i' // Must conform to this. If an admin made a custom username for this, the user would not be able to log in.
,'user.default_usergroup' => 1
,'user.active_interval'   => 300 // How much seconds between requests can we count them "active"
,'user.time_interval'     => 5 // Security feature: How many seconds between each request should we update the total_active or last_active. Prevents DDOS
/**
 * Points sytem for the user
 */
,'points.register'        => 30
,'points.today_on'        => 20
/**
 * Some styles
 */
,'style.error_pfx'        => '<p class="error">'
,'style.error_sfx'        => '</p>'
/**
 * Session stuff
 */
,'session.expire'         => 7200 // How long it will be until the login expires (7200 seconds = 2 hours)
,'session.refresh'        => 3600 // How much time should we refresh the user's session if it is nearing the end. This is so that the user will not be suddenly logged out
,'session.min_refresh'    => 1200 // Minimum of time before we can refresh the session. This is so that there is less stress on the database and we wont have to update every request
/**
 * Cookie stuff
 */
,'cookie.session'         => 'session_cookie'
/**
 * Misc stuff
 */
,'misc.redirect_time'     => 3 // How many seconds before redirecting
/**
 * Power switches to thrn stuff on and off
 */
,'on.today_on'            => true // Set if users can get points for getting on every day
,'on.total_active'        => true
,'on.mail'                => false // Since this is still in beta and we dont expect people to use this in development, a demo could be used for spamming therefore defaults to false
/**
 * Task Settings
 */
,'task.unlock_time'       => 60 // How long until we can unlock a task
);
/**
 * The title to be used by the templates.
 * The default is the site name.
 */
$cg_page_title = $cg_settings['site_name'];

/**
 * This is the way titles are to be formatted.
 */
$cg_title = array(
 'frontpage_title' => $cg_settings['site_name']
,'playgame.title'  => '{game_title} - ' . $cg_settings['site_name']
);
/**
 * Settings for the url.
 *
 * Currently, there is no such thing as permalinks implemented
 * so we will have to go with ugly urls.
 */
$cg_url = array(
 'game_get'  => 'flash'
,'game_page' => 'games.php'
,'user_page' => 'users.php'
,'user_get'  => 'do'
,'register'  => '?do=register'
,'login'     => '?do=login'
,'logout'    => '?do=logout'
,'usercp'    => '?action=usercp'
,'usercp_get'=> 'action'
,'change_password' => '?action=change_password'
,'change_email' => '?action=change_email'
,'process_change_email' => '?action=process_change_email'
,'forgot_password' => '?do=forgot_password'
,'reset_password' => '?do=reset_password'
,'category_page'   => 'index.php'
,'category_get'    => 'category'
);
/**
 * Array with the list of tables.
 *
 * @var mixed
 */
$cg_tables =
array(
/**
 * List of the tables (In the order they were added)
 */
 'games'          => $cg_table_prefix . 'games'
,'users'          => $cg_table_prefix . 'users'
,'userdata'       => $cg_table_prefix . 'userdata'
,'sessions'       => $cg_table_prefix . 'sessions'
,'tasks'          => $cg_table_prefix . 'tasks'
,'usergroups'     => $cg_table_prefix . 'usergroups'
,'categories'     => $cg_table_prefix . 'categories'
,'confirm'        => $cg_table_prefix . 'confirm'
,'tasklog'        => $cg_table_prefix . 'tasklog'
);