| 1 | <?php |
|---|
| 2 | ############################################################################### |
|---|
| 3 | # Gregarius - A PHP based RSS aggregator. |
|---|
| 4 | # Copyright (C) 2003 - 2006 Marco Bonetti |
|---|
| 5 | # |
|---|
| 6 | ############################################################################### |
|---|
| 7 | # This program is free software and open source software; you can redistribute |
|---|
| 8 | # it and/or modify it under the terms of the GNU General Public License as |
|---|
| 9 | # published by the Free Software Foundation; either version 2 of the License, |
|---|
| 10 | # or (at your option) any later version. |
|---|
| 11 | # |
|---|
| 12 | # This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 13 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 14 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 15 | # more details. |
|---|
| 16 | # |
|---|
| 17 | # You should have received a copy of the GNU General Public License along |
|---|
| 18 | # with this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 19 | # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit |
|---|
| 20 | # http://www.gnu.org/licenses/gpl.html |
|---|
| 21 | # |
|---|
| 22 | ############################################################################### |
|---|
| 23 | # E-mail: mbonetti at gmail dot com |
|---|
| 24 | # Web page: http://gregarius.net/ |
|---|
| 25 | # |
|---|
| 26 | ############################################################################### |
|---|
| 27 | |
|---|
| 28 | // Application title |
|---|
| 29 | define ('_TITLE_', "Gregarius"); |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | // Application version |
|---|
| 33 | define ('_VERSION_', "0.5.5"); |
|---|
| 34 | define ('MINUTE',60); |
|---|
| 35 | |
|---|
| 36 | define ('COOKIE_LIFESPAN',60*60*24*999); |
|---|
| 37 | // The useragent used when retrieving the feeds |
|---|
| 38 | define ('MAGPIE_USER_AGENT', "" . _TITLE_ . "/" . _VERSION_ . " (+http://devlog.gregarius.net/docs/ua)"); |
|---|
| 39 | @ini_set('user_agent',MAGPIE_USER_AGENT); |
|---|
| 40 | |
|---|
| 41 | // feedback |
|---|
| 42 | assert_options(ASSERT_ACTIVE, 1); |
|---|
| 43 | assert_options(ASSERT_WARNING, 1); |
|---|
| 44 | assert_options(ASSERT_QUIET_EVAL, 0); |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | // default output encoding, can be overrided in the config. |
|---|
| 48 | define ('DEFAULT_OUTPUT_ENCODING', 'UTF-8'); |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | // Create a handler function |
|---|
| 52 | function my_assert_handler($file, $line, $code) { |
|---|
| 53 | echo "<span class=\"error\">Assertion Failed: File '$file'; Line '$line'; Code '$code'"; |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | // Admin cookie name |
|---|
| 57 | // Deprecated: define('PRIVATE_COOKIE', 'prv'); |
|---|
| 58 | define('RSS_USER_COOKIE', 'gregariusUser'); |
|---|
| 59 | |
|---|
| 60 | define ('RSS_USER_LEVEL_NOLEVEL',0); |
|---|
| 61 | define ('RSS_USER_LEVEL_BASIC',1); |
|---|
| 62 | define ('RSS_USER_LEVEL_PRIVATE',80); |
|---|
| 63 | define ('RSS_USER_LEVEL_ADMIN',90); |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | // Max number of results we want from a query |
|---|
| 67 | define ('RSS_DB_MAX_QUERY_RESULTS', 9999); |
|---|
| 68 | |
|---|
| 69 | // Set up the callback |
|---|
| 70 | assert_options(ASSERT_CALLBACK, 'my_assert_handler'); |
|---|
| 71 | |
|---|
| 72 | define ('TITLE_SEP', '»'); |
|---|
| 73 | |
|---|
| 74 | define ('LOCATION_HOME',1); |
|---|
| 75 | define ('LOCATION_UPDATE',2); |
|---|
| 76 | define ('LOCATION_SEARCH',3); |
|---|
| 77 | define ('LOCATION_ADMIN',4); |
|---|
| 78 | define ('LOCATION_ABOUT',5); |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | // Options passed to util::itemsList |
|---|
| 82 | define ('IL_NONE', 0x00); |
|---|
| 83 | define ('IL_DO_NAV', 0x01); |
|---|
| 84 | define ('IL_NO_COLLAPSE', 0x02); |
|---|
| 85 | define ('IL_DO_STATS',0x04); |
|---|
| 86 | define ('IL_CHANNEL_VIEW',0x08); |
|---|
| 87 | define ('IL_TITLE_NO_ESCAPE',0x10); |
|---|
| 88 | define ('IL_FOLDER_VIEW',0x20); |
|---|
| 89 | |
|---|
| 90 | // Options for rss_header |
|---|
| 91 | define ('HDR_NONE', 0x00); |
|---|
| 92 | define ('HDR_NO_OUPUTBUFFERING', 0x01); |
|---|
| 93 | define ('HDR_NO_CACHECONTROL', 0x02); |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | // options for show unread-only/all |
|---|
| 97 | define ('SHOW_UNREAD_ONLY',1); |
|---|
| 98 | define ('SHOW_READ_AND_UNREAD',2); |
|---|
| 99 | define ('SHOW_WHAT','show'); |
|---|
| 100 | |
|---|
| 101 | // feed "modes": (default is 00001: unread) |
|---|
| 102 | // xxxx0 read / xxxx1: unread |
|---|
| 103 | define ('RSS_MODE_UNREAD_STATE', 0x01); |
|---|
| 104 | // xxx0x not sticky / xxx1x: sticky |
|---|
| 105 | define ('RSS_MODE_STICKY_STATE', 0x02); |
|---|
| 106 | // xx0xx public / xx1xx: private |
|---|
| 107 | define ('RSS_MODE_PRIVATE_STATE', 0x04); |
|---|
| 108 | // x0xxx available / x1xxx: deleted |
|---|
| 109 | define ('RSS_MODE_DELETED_STATE', 0x08); |
|---|
| 110 | // 0xxxx not flagged / 1xxxx: flagged |
|---|
| 111 | define ('RSS_MODE_FLAG_STATE', 0x10); |
|---|
| 112 | |
|---|
| 113 | // these are just helpers for the above |
|---|
| 114 | define ('SET_MODE_READ_STATE', |
|---|
| 115 | RSS_MODE_STICKY_STATE | |
|---|
| 116 | RSS_MODE_PRIVATE_STATE | |
|---|
| 117 | RSS_MODE_DELETED_STATE | |
|---|
| 118 | RSS_MODE_FLAG_STATE); |
|---|
| 119 | |
|---|
| 120 | define ('SET_MODE_PUBLIC_STATE', |
|---|
| 121 | RSS_MODE_UNREAD_STATE | |
|---|
| 122 | RSS_MODE_STICKY_STATE | |
|---|
| 123 | RSS_MODE_DELETED_STATE | |
|---|
| 124 | RSS_MODE_FLAG_STATE); |
|---|
| 125 | |
|---|
| 126 | define ('SET_MODE_AVAILABLE_STATE', |
|---|
| 127 | RSS_MODE_UNREAD_STATE | |
|---|
| 128 | RSS_MODE_STICKY_STATE | |
|---|
| 129 | RSS_MODE_PRIVATE_STATE | |
|---|
| 130 | RSS_MODE_FLAG_STATE); |
|---|
| 131 | |
|---|
| 132 | define ('SET_MODE_FLAG_STATE', |
|---|
| 133 | RSS_MODE_STICKY_STATE | |
|---|
| 134 | RSS_MODE_PRIVATE_STATE | |
|---|
| 135 | RSS_MODE_DELETED_STATE); |
|---|
| 136 | |
|---|
| 137 | define ('SET_MODE_STICKY_STATE', |
|---|
| 138 | RSS_MODE_PRIVATE_STATE | |
|---|
| 139 | RSS_MODE_DELETED_STATE | |
|---|
| 140 | RSS_MODE_FLAG_STATE); |
|---|
| 141 | |
|---|
| 142 | define ('RSS_STATE_STICKY', 'sticky'); |
|---|
| 143 | define ('RSS_STATE_FLAG', 'flag'); |
|---|
| 144 | |
|---|
| 145 | // Where do themes and plugins reside? |
|---|
| 146 | define ('RSS_THEME_DIR','themes'); |
|---|
| 147 | define ('RSS_PLUGINS_DIR','plugins'); |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | // Error levels |
|---|
| 151 | define ('RSS_ERROR_ERROR',0); |
|---|
| 152 | define ('RSS_ERROR_WARNING',1); |
|---|
| 153 | define ('RSS_ERROR_NOTICE',2); |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | define ('ITEM_SORT_HINT_UNREAD', 0x00); |
|---|
| 157 | define ('ITEM_SORT_HINT_READ', 0x01); |
|---|
| 158 | define ('ITEM_SORT_HINT_MIXED', 0x02); |
|---|
| 159 | |
|---|
| 160 | // an item should have this many tags, at most |
|---|
| 161 | define('MAX_TAGS_PER_ITEM', 5); |
|---|
| 162 | |
|---|
| 163 | // This regexp is used both in php and javascript, basically |
|---|
| 164 | // it is used to filter out everything but the allowed tag |
|---|
| 165 | // characters, plus a whitespace |
|---|
| 166 | define('ALLOWED_TAGS_REGEXP', '//'); |
|---|
| 167 | |
|---|
| 168 | // Sanitizer constants |
|---|
| 169 | define ('RSS_SANITIZER_SIMPLE_SQL', 0x01); |
|---|
| 170 | define ('RSS_SANITIZER_NO_SPACES', 0x02); |
|---|
| 171 | define ('RSS_SANITIZER_NUMERIC', 0x04); |
|---|
| 172 | define ('RSS_SANITIZER_CHARACTERS',0x08); |
|---|
| 173 | define ('RSS_SANITIZER_CHARACTERS_EXT',0x10); |
|---|
| 174 | define ('RSS_SANITIZER_WORDS',0x20); |
|---|
| 175 | define ('RSS_SANITIZER_URL',0x40); |
|---|
| 176 | |
|---|
| 177 | |
|---|
| 178 | // Character separating uri elements (for e.g. permalinks) |
|---|
| 179 | define('RSS_URI_SEPARATOR','_'); |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | // Profiling |
|---|
| 183 | // - The profiling information is "html commented out" at the end of every html page |
|---|
| 184 | //define('PROFILING', 1); |
|---|
| 185 | //define('PROFILING_DB', 1); |
|---|
| 186 | |
|---|
| 187 | ?> |
|---|