|
4 | 4 | $config = array( |
5 | 5 |
|
6 | 6 | 'page' => array( |
7 | | - 'date_format' => 'M j, Y G:i A', |
8 | | - 'time_offset' => 0, |
9 | | - 'footer' => |
| 7 | + /** |
| 8 | + * The format that dates constructed via PHP are displayed in. See |
| 9 | + * http://php.net/manual/en/function.date.php for more information. |
| 10 | + */ |
| 11 | + 'php_date_format' => 'M j, Y G:i A', |
| 12 | + |
| 13 | + /** |
| 14 | + * The offset in seconds of the default time zone used for displaying dates. |
| 15 | + */ |
| 16 | + 'php_time_offset' => 0, |
| 17 | + |
| 18 | + /** |
| 19 | + * The format that dates constructed via JavaScript are displayed in. See |
| 20 | + * https://github.com/phstc/jquery-dateFormat for more information. |
| 21 | + * |
| 22 | + * This is used when possible to ensure that dates match the visitor's local |
| 23 | + * time zone. It should be equivalent to the PHP date format. |
| 24 | + */ |
| 25 | + 'js_date_format' => 'MMM d, yyyy h:mm a', |
| 26 | + |
| 27 | + /** |
| 28 | + * Footer HTML. |
| 29 | + */ |
| 30 | + 'footer' => |
10 | 31 | 'Please direct feedback to <a href="http://www.pathofexile.com/forum/view-thread/69448" target="_blank">this thread</a>. '. |
11 | 32 | 'Want a new feature? <a href="https://github.com/ccbrown/gggtracker" target="_blank">Add it yourself!</a>', |
12 | 33 | ), |
13 | 34 |
|
14 | | - 'mysql' => array( |
15 | | - 'host' => '', |
16 | | - 'username' => '', |
17 | | - 'password' => '', |
18 | | - 'db_name' => '', |
19 | | - 'pconnect' => false, |
| 35 | + /** |
| 36 | + * MySQL information. |
| 37 | + */ |
| 38 | + 'mysql' => array( |
| 39 | + 'host' => '', |
| 40 | + 'username' => '', |
| 41 | + 'password' => '', |
| 42 | + 'db_name' => '', |
| 43 | + 'pconnect' => false, |
20 | 44 | ), |
21 | 45 |
|
| 46 | + /** |
| 47 | + * To poll forum posts and Twitter updates, two cron jobs should be set up to invoke |
| 48 | + * scan_posts.cron.php and update_tweets.cron.php. These are publically accessible |
| 49 | + * files, so to prevent abuse, you must create a random secret here. Then, when |
| 50 | + * invoking the scripts, pass that secret as a GET parameter. |
| 51 | + * |
| 52 | + * Make this long and random. |
| 53 | + */ |
22 | 54 | 'cron' => array( |
23 | | - 'secret' => '', |
| 55 | + 'secret' => '', |
24 | 56 | ), |
25 | 57 |
|
26 | 58 | 'poe' => array( |
27 | | - 'forum_timezone' => '', |
28 | | - 'forum_sessid' => '', |
29 | | - 'news_forum_id' => 54, |
30 | | - 'forum_posters' => array( |
| 59 | + /** |
| 60 | + * The timezone of the forum account used (e.g. 'GMT' or 'PST'). |
| 61 | + */ |
| 62 | + 'forum_timezone' => '', |
| 63 | + |
| 64 | + /** |
| 65 | + * The value of the PHPSESSID cookie for a valid login session. |
| 66 | + */ |
| 67 | + 'forum_sessid' => '', |
| 68 | + |
| 69 | + /** |
| 70 | + * The id of the news forum. |
| 71 | + */ |
| 72 | + 'news_forum_id' => 54, |
| 73 | + |
| 74 | + /** |
| 75 | + * An array of forum posters to track. |
| 76 | + */ |
| 77 | + 'forum_posters' => array( |
31 | 78 | 'Chris', 'Jonathan', 'Erik', 'Mark_GGG', 'Samantha', 'Rory', 'Rhys', 'Qarl', |
32 | 79 | 'Andrew_GGG', 'Damien_GGG', 'Russell', 'Joel_GGG', 'Ari', 'Thomas', |
33 | 80 | 'BrianWeissman', 'Edwin_GGG', 'Support', 'Dylan', 'MaxS', 'Ammon_GGG', |
34 | 81 | 'Jess_GGG', 'Robbie_GGG', 'GGG_Neon', 'Jason_GGG', 'Henry_GGG', |
35 | 82 | 'Michael_GGG', 'Bex_GGG', 'Cagan_GGG', 'Daniel_GGG', 'Kieren_GGG', |
36 | 83 | 'Yeran_GGG', 'Gary_GGG', |
37 | 84 | ), |
38 | | - 'twitter_name' => 'pathofexile', |
| 85 | + |
| 86 | + /** |
| 87 | + * The Twitter user to track. |
| 88 | + */ |
| 89 | + 'twitter_name' => 'pathofexile', |
39 | 90 | ), |
40 | 91 |
|
| 92 | + /** |
| 93 | + * Twitter-supplied credentials. Create an app at https://apps.twitter.com and obtain |
| 94 | + * these through the "Keys and Access Tokens" tab for your app. |
| 95 | + */ |
41 | 96 | 'twitter' => array( |
42 | 97 | 'consumer_key' => '', |
43 | 98 | 'consumer_secret' => '', |
|
46 | 101 | ), |
47 | 102 | ); |
48 | 103 |
|
| 104 | +/** |
| 105 | +* Any of the above can be overridden in a local configuration file. Simply create a file named |
| 106 | +* local_config.php that looks like this: |
| 107 | +* |
| 108 | +* <?php |
| 109 | +* return array( |
| 110 | +* '[thing you want to override]' => [the value you want to use], |
| 111 | +* ... |
| 112 | +* ); |
| 113 | +* ?> |
| 114 | +* |
| 115 | +*/ |
49 | 116 | $local = @include('local_config.inc.php'); |
50 | 117 |
|
| 118 | +if (isset($local['date_format']) || isset($local['time_offset'])) { |
| 119 | + die('out-dated configuration. review the changes to config.inc.php'); |
| 120 | +} |
| 121 | + |
51 | 122 | return $local ? array_replace_recursive($config, $local) : $config; |
52 | 123 | ?> |
0 commit comments