source: trunk/config.php.sample @ 1155

Revision 1155, 5.0 KB checked in by adrian.budau, 3 months ago (diff)

Avatar Optimization

This is an optimization for managing avatars on the server. Because
there are only 5 sizes used on all the site it's more useful to resize
all of the images to those 5(thus increasing the space usage by less
than 100%) and when a client asks for a size give it directly rather
then resizing all the time. The 5 sizes are tiny (old L16x16),
small(old L32x32), normal(old L50x50), forum(old L75xL75, used only on

the forum at the moment), big(old 100x100) and full(the original picture).


To get the avatar on a size from the server simply use the page
avatar/%some_size%/%some_user where %some_user% is a username and
%some_size$ is a one the 5 sizes. In case the user doesn't exists or he
doesn't have an avatar we use a placeholder image. If the size given is
not from the list or is omitted the server return a classic
404 Error(File not found)

The script which resizes the image for the current users is called
make-avatar-folder found in the scripts folder. It requires the attach
folder to have permission for read and write.

The setup has also been modified so fresh installes will work without
calling the script.

Reviewboard Link:  http://reviewboard.infoarena.ro/r/176/

  • Property svn:eol-style set to native
Line 
1<?php
2
3// Global configuration file.
4// This is just a sample file. Copy this over to config.php and edit.
5
6// Here is the essential configuration. You only need to modify this
7// to get it working.
8
9// This is the subversion checkout directory. include trailing slash.
10define("IA_ROOT_DIR", '--write-me-IA_ROOT_DIR--');
11
12// Database host. Probably localhost.
13define("IA_DB_HOST", '--write-me-IA_DB_HOST--');
14
15// Database name.
16define("IA_DB_NAME", '--write-me-IA_DB_NAME--');
17
18// Database user.
19define("IA_DB_USER", '--write-me-IA_DB_USER--');
20
21// Database password
22define("IA_DB_PASS", '--write-me-IA_DB_PASS--');
23
24// Keep database connection alive when lost
25define("IA_DB_KEEP_ALIVE", false);
26
27// Web host. This is probably localhost. no trailing slash here
28define("IA_URL_HOST", "--write-me-IA_URL_HOST--");
29
30// URL prefix, without the IA_URL_HOST part
31// (only the part relative to the web server).
32// Slashes at both ends.
33define("IA_URL_PREFIX", "--write-me-IA_URL_PREFIX--");
34
35// Define the place the avatars are being stored
36define("IA_AVATAR_FOLDER", "--write-me-IA_AVATAR_FOLDER--");
37
38
39// Congratulations! You're done with the essential configuration.
40// --------------------------------------------------------------
41// There are some more settings to adjust but they are optional.
42
43// Enable this when working on your own local copy. It gives you a few
44// debugging & profiling tools. Additionally, it disables Google Analytics
45// or other external resources.
46define("IA_DEVELOPMENT_MODE", true);
47
48// Determine if script is runing in an HTTP environment. Otherwise it is
49// probably running in CLI mode. Don't change it.
50// FIXME: move to common/common.php
51define("IA_HTTP_ENV", isset($_SERVER['REQUEST_URI']));
52
53// SMF database prefix (required!)
54define("IA_SMF_DB_PREFIX", 'ia_smf_');
55
56// "The" url to infoarena home page.
57define("IA_URL", IA_URL_HOST . IA_URL_PREFIX);
58
59// URL to SMF. No trailing slash
60// Example: http://localhost/infoarena_smf
61define("IA_SMF_URL", IA_URL . 'forum');
62
63// cookie domain
64// leave null when working on localhost
65define("IA_COOKIE_DOMAIN", null);
66
67// infoarena session lifetime
68// defaults to 5days
69define("IA_SESSION_LIFETIME_SECONDS", 5*24*3600);
70
71// Fatal error mask.
72// These are the errors the scripts halts on.
73// E_ALL & ~ (E_USER_NOTICE | E_USER_WARNING)
74// FIXME: Why isn't this configurable in php.ini?
75define("IA_PHP_FATAL_ERROR_MASK", 0x19FF);
76
77// If this is true then the site is in debug.
78// NOTE: set this to false when public.
79define("IA_DEBUG_MODE", true);
80
81// This aren't really settings.
82// FIXME: Couldn't find a better place to put this in.
83//  - NOTE: it can't reside in common/db/*.php files since SMF
84//    cannot link db api.
85//  - NOTE: it can't reside in www/* since judge needs it too
86define("IA_TASK_TEXTBLOCK_PREFIX", 'problema/');
87define("IA_USER_TEXTBLOCK_PREFIX", 'utilizator/');
88define("IA_NEWSLETTER_TEXTBLOCK_PREFIX", 'newsletter/');
89// FIXME: Do we really need this?
90define("IA_ROUND_TEXTBLOCK_PREFIX", 'runda/');
91
92// Secret code
93// Random string used as salt in various places where hashing is needed.
94// For security reasons, this should be changed when uploading to a production
95// website.
96define("IA_SECRET", "developersetup");
97
98// Mail setup
99
100// Enable this only if you have a SMTP server around
101define("IA_SMTP_ENABLED", false);
102
103if (IA_SMTP_ENABLED) {
104    // only if SMTP is enabled, you can configure these
105    define("IA_SMTP_HOST", "localhost");
106    define("IA_SMTP_PORT", "25");
107}
108
109// Disable mysql_unbuffered_query
110define("IA_DB_MYSQL_UNBUFFERED_QUERY", false);
111
112// Enable the DB cache by default.
113// If it's broken then you have a bug.
114// Disabling it might still be usefull for mysql tweaking.
115define("IA_ENABLE_DB_CACHE", true);
116
117// Enabled the create_function_cached cached.
118// If false then create_function_cached_cached is the same as create_function_cached
119define("IA_ENABLE_CREATE_FUNCTION_CACHE", true);
120
121
122// Disable memory cache by default because it requires additional stuff
123define("IA_MEM_CACHE_METHOD", "none");
124
125// Default TTL for cache items.
126define("IA_MEM_CACHE_EXPIRATION", 3600);
127
128// Round TTL. Smaller because of evaluator.
129define("IA_MEM_CACHE_ROUND_EXPIRATION", 10);
130
131// Task TTL. Smaller because of evaluator.
132define("IA_MEM_CACHE_TASK_EXPIRATION", 10);
133
134// TTL for tag caches.
135define("IA_MEM_CACHE_TAGS_EXPIRATION", 600);
136
137// Logging options. Anything else in normal operation is a bug.
138// Filling error_log on a production machine sucks.
139
140// If true then log all security checks.
141// Warning: tons of output.
142define("IA_LOG_SECURITY", false);
143
144// If true then log disk cache hits/misses
145define("IA_LOG_DISK_CACHE", false);
146
147// If true then log mem cache hits/misses
148define("IA_LOG_MEM_CACHE", false);
149
150// Log each and every SQL query. Not for the faint of heart.
151define("IA_LOG_SQL_QUERY", false);
152
153// Try to EXPLAIN every select query, useful when optimizing.
154define("IA_LOG_SQL_QUERY_EXPLAIN", false);
155
156// CAPTHCA Keys
157define("IA_CAPTCHA_PUBLIC_KEY", "6LesuwQAAAAAAPHgdh9Hem1KJfvd5Ng1yRoIweio");
158define("IA_CAPTCHA_PRIVATE_KEY", "6LesuwQAAAAAAF3FUPWFGQD1xPITFagjqWUO9Urs");
159
160?>
Note: See TracBrowser for help on using the repository browser.