root/branches/multiuser/constants.php

Revision 1759, 5.4 kB (checked in by mdodoo, 12 months ago)

Lots of things are still not working, but I think this code is better than what was currently committed ([1639]
should have been reverted, and the person who committed should have had their SVN access pulled, for example).
Created this by grabbing the trunk code and then manually inserting the MU branch's changes in. This is probably
not usable in an actual installation (no support for creating new user accounts yet, for example), but patches are
welcome.

Not sure why I write so much here - I am not sure anyone other than my fellow devs actually read them...

  • Property svn:eol-style set to native
  • Property svn:eolstyle set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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
29define ('_TITLE_', "GregariusMU");
30
31
32// Application version
33define ('_VERSION_', "0.5.5");
34define ('MINUTE',60);
35
36define ('COOKIE_LIFESPAN',60*60*24*999);
37// The useragent used when retrieving the feeds
38define ('MAGPIE_USER_AGENT', "" . _TITLE_ . "/" . _VERSION_ . " (+http://devlog.gregarius.net/docs/ua)");
39ini_set('user_agent',MAGPIE_USER_AGENT);
40       
41// feedback
42assert_options(ASSERT_ACTIVE, 1);
43assert_options(ASSERT_WARNING, 1);
44assert_options(ASSERT_QUIET_EVAL, 0);
45
46
47// default output encoding, can be overrided in the config.
48define ('DEFAULT_OUTPUT_ENCODING', 'UTF-8');
49 
50
51// Create a handler function
52function 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');
58define('RSS_USER_COOKIE', 'gregariusUser');
59
60define ('RSS_USER_LEVEL_NOLEVEL',0);
61define ('RSS_USER_LEVEL_BASIC',1);
62define ('RSS_USER_LEVEL_PRIVATE',80);
63define ('RSS_USER_LEVEL_ADMIN',90);
64
65
66// Max number of results we want from a query
67define ('RSS_DB_MAX_QUERY_RESULTS', 9999);
68
69// Set up the callback
70assert_options(ASSERT_CALLBACK, 'my_assert_handler');
71
72define ('TITLE_SEP', '&#187;');
73
74define ('LOCATION_HOME',1);
75define ('LOCATION_UPDATE',2);
76define ('LOCATION_SEARCH',3);
77define ('LOCATION_ADMIN',4);
78define ('LOCATION_ABOUT',5);
79
80
81// Options passed to util::itemsList
82define ('IL_NONE',   0x00);
83define ('IL_DO_NAV', 0x01);
84define ('IL_NO_COLLAPSE', 0x02);
85define ('IL_DO_STATS',0x04);
86define ('IL_CHANNEL_VIEW',0x08);
87define ('IL_TITLE_NO_ESCAPE',0x10);
88define ('IL_FOLDER_VIEW',0x20);
89
90// Options for rss_header
91define ('HDR_NONE', 0x00);
92define ('HDR_NO_OUPUTBUFFERING', 0x01);
93define ('HDR_NO_CACHECONTROL', 0x02);
94
95
96// options for show unread-only/all
97define ('SHOW_UNREAD_ONLY',1);
98define ('SHOW_READ_AND_UNREAD',2);
99define ('SHOW_WHAT','show');
100
101// feed "modes": (default is 00001: unread)
102// xxxx0 read / xxxx1: unread
103define ('RSS_MODE_UNREAD_STATE', 0x01);
104// xxx0x not sticky / xxx1x: sticky
105define ('RSS_MODE_STICKY_STATE', 0x02);
106// xx0xx public / xx1xx: private
107define ('RSS_MODE_PRIVATE_STATE', 0x04);
108// x0xxx available / x1xxx: deleted
109define ('RSS_MODE_DELETED_STATE', 0x08);
110// 0xxxx not flagged / 1xxxx: flagged
111define ('RSS_MODE_FLAG_STATE', 0x10);
112
113// these are just helpers for the above
114define ('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   
120define ('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
126define ('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
132define ('SET_MODE_FLAG_STATE',
133   RSS_MODE_STICKY_STATE  |
134   RSS_MODE_PRIVATE_STATE |
135   RSS_MODE_DELETED_STATE);
136
137define ('SET_MODE_STICKY_STATE',
138   RSS_MODE_PRIVATE_STATE |
139   RSS_MODE_DELETED_STATE |
140   RSS_MODE_FLAG_STATE);
141
142define ('RSS_STATE_STICKY', 'sticky');
143define ('RSS_STATE_FLAG', 'flag');
144   
145// Where do themes and plugins reside?
146define ('RSS_THEME_DIR','themes');
147define ('RSS_PLUGINS_DIR','plugins');
148   
149   
150// Error levels   
151define ('RSS_ERROR_ERROR',0);
152define ('RSS_ERROR_WARNING',1);
153define ('RSS_ERROR_NOTICE',2);   
154
155
156define ('ITEM_SORT_HINT_UNREAD', 0x00);
157define ('ITEM_SORT_HINT_READ', 0x01);
158define ('ITEM_SORT_HINT_MIXED', 0x02);
159
160// an item should have this many tags, at most
161define('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
166define('ALLOWED_TAGS_REGEXP', '//');
167
168// Sanitizer constants
169define ('RSS_SANITIZER_SIMPLE_SQL', 0x01);
170define ('RSS_SANITIZER_NO_SPACES', 0x02);
171define ('RSS_SANITIZER_NUMERIC', 0x04);
172define ('RSS_SANITIZER_CHARACTERS',0x08);
173define ('RSS_SANITIZER_CHARACTERS_EXT',0x10);
174define ('RSS_SANITIZER_WORDS',0x20);
175define ('RSS_SANITIZER_URL',0x40);
176
177// Profiling
178//  - The profiling information is "html commented out" at the end of every html page
179//define('PROFILING', 1);
180//define('PROFILING_DB', 1);
181
182?>
Note: See TracBrowser for help on using the browser.