Source for file config.inc.php

Documentation is available at config.inc.php

  1. <?php //-*-php-*-
  2. /* ******************************************************************** **
  3. ** Copyright notice **
  4. ** **
  5. ** (c) 1995-2003 PHPOpenChat Development Team **
  6. ** http://phpopenchat.sourceforge.net/ **
  7. ** **
  8. ** All rights reserved **
  9. ** **
  10. ** This script is part of the PHPOpenChat project. The PHPOpenChat **
  11. ** project is free software; you can redistribute it and/or modify **
  12. ** it under the terms of the GNU General Public License as published by **
  13. ** the Free Software Foundation; either version 2 of the License, or **
  14. ** (at your option) any later version. **
  15. ** **
  16. ** The GNU General Public License can be found at **
  17. ** http://www.gnu.org/copyleft/gpl.html. **
  18. ** A copy is found in the textfile GPL and important notices to the **
  19. ** license from the team is found in the textfile LICENSE distributed **
  20. ** with these scripts. **
  21. ** **
  22. ** This script is distributed in the hope that it will be useful, **
  23. ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
  24. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
  25. ** GNU General Public License for more details. **
  26. ** **
  27. ** This copyright notice MUST APPEAR in all copies of the script! **
  28. ** ******************************************************************** */
  29.  
  30. /*
  31. $Author: jjaeschke $
  32. $Date: 2004/05/27 09:11:25 $
  33. $Source: /cvsroot/phpopenchat/chat3/config.inc.php,v $
  34. $Revision: 1.52 $
  35. */
  36.  
  37. // configuration file for PHPOpenChat
  38. // will be included by almost all source files
  39.  
  40. define('POC_BASE', dirname(__FILE__));
  41.  
  42. // quick-hack:
  43. // allow 2nd configfile which is not to be included in CVS
  44. // for privacy reasons.
  45. // since constants cannot be overriden, everything defined there
  46. // overrides the definitions below.
  47. // **** This is not true for variables like $supported_languages ****
  48. // **** so extra care is taken in this case ****
  49. // a better way might be to test everything if defined --> ??
  50.  
  51.  
  52.  
  53. if ( file_exists(POC_BASE.'/config.private.inc.php') ) {
  54. include_once(POC_BASE.'/config.private.inc.php');
  55. }
  56.  
  57. if( strtoupper( substr(PHP_OS,0,3) ) == 'WIN' )
  58. {
  59. define('POC_OS','win');
  60. define('DELI','\\');
  61. /**
  62. * Temp-directory where we write the channel lock files
  63. *
  64. * This define will either be 'Unix' or 'Windows'
  65. */
  66. if( ini_get('open_basedir') ) {
  67. define('TMPDIR', ini_get('open_basedir'));
  68. } else {
  69. if ( isset($_ENV['TEMP']) )
  70. define('TMPDIR', $_ENV['TEMP']);
  71. elseif( isset($_ENV['TMP']) )
  72. define('TMPDIR', $_ENV['TMP']);
  73. elseif( isset($_ENV['WINDIR']) )
  74. define('TMPDIR', $_ENV['WINDIR'].'\\TEMP');
  75. elseif( isset($_ENV['windir']) )
  76. define('TMPDIR', $_ENV['windir'].'\\TEMP');
  77. else
  78. define('TMPDIR', 'C:\\WINDOWS\\TEMP');
  79. }
  80. } else {
  81. //This is the Linux/Unix case
  82. define('POC_OS','unix');
  83. define('DELI','/');
  84. if( ini_get('open_basedir') ) {
  85. /** @ignore */('TMPDIR', ini_get('open_basedir'));
  86. } else {
  87. /** @ignore */('TMPDIR',POC_BASE.'/tmp');//For security reasons change TMPDIR to a directory,
  88. //outsite of your webroot. NOTE: This directory must be
  89. //writeable for the webserver.
  90. }
  91. }
  92.  
  93. /*
  94. * set include path for phpopenchat includes
  95. */
  96. define('POC_INCLUDE_PATH', POC_BASE.'/include');
  97. //ini_set('include_path', POC_BASE.'/include');
  98. /*
  99. * use_trans_sid produce unvalid XHTML (strict)!
  100. * The form element requires a blocklevel element before using elements like input or select
  101. * see http://www.w3.org/TR/html4/interact/forms.html#h-17.3
  102. * because of this fact, we switch off this feature
  103. */
  104. //ini_set('session.use_trans_sid','0');
  105. /*
  106. * Name of PHPOpenChat's session cookie (session name)
  107. */
  108. //if( function_exists('pnUserGetVar') ) ini_set('session.name', 'POCSID');
  109. /*
  110. * Lifetime of cookies
  111. */
  112. define('COOKIE_EXPIRE', time() + 60*60*24*30*12*25,true);
  113. define('COOKIE_PATH',"/",true);
  114. define('COOKIE_DOMAIN','',true);
  115. define('COOKIE_SECURE','0',true);
  116. //ini_set('session.cookie_lifetime', COOKIE_EXPIRE);//currently set to 25 years
  117. /*
  118. * It is highly recommended that you configure/compile
  119. * php so, that session data are stored in shared
  120. * memory, not in files. In the 'file' case, we setup
  121. * the directory where php will store the session-files
  122. * NOTE: This directory MUST be writeable by the webserver
  123. */
  124. //ini_set('session.save_path',TMPDIR);
  125. session_save_path(TMPDIR);
  126.  
  127. /*
  128. * At this time there are two authentification methods
  129. * available. PHPOpenChat's own authentification database
  130. * or authentification using a LDAP server.
  131. */
  132. define('AUTHENTICATION_METHOD','poc');
  133.  
  134. /**
  135. * LDAP settings.
  136. * Used if you choose 'ldap' as authentication method (see above)
  137. * Enter the DNS of you local ldap server.
  138. */
  139. define('LDAP_SERVER','ldap.pixelpark.com');
  140.  
  141. /*
  142. * If you don't know the 'dn' of your local ldap server,
  143. * use test/ldap.php to ask the ldap server for it
  144. */
  145. define('LDAP_DN','ou=NTUser,ou=Accounts,o=pixelpark.com');
  146.  
  147. /*
  148. * Ringbuffer settings
  149. * If you have:
  150. * - shared memory and semaphores compiled in,
  151. * (search for 'sysvshm' and 'sysvsem' in a page generated by phpinfo() ) and,
  152. * - specified the initial memory size for the shared memory
  153. * (add 'sysvshm.init_mem = 32595000' to your php.ini)
  154. * set this to 'Mem' for the best performance of your chat.
  155. * otherwise set to 'DB'
  156. */
  157. define('CHANNEL_BUFFER_TYPE','DB');
  158.  
  159. /*
  160. * database account settings
  161. */
  162. define('DATABASE_HOST','localhost');
  163. define('DATABASE_USER','root');
  164. define('DATABASE_PASSWORD','');
  165. define('DATABASE_TABLESPACE','poc');/* The value 'poc' is an example only!
  166. * a tablespace contains your sql-tables
  167. * MySQL calls it 'database', so you have to enter the name of your database here.
  168. * If you don't have such a tablespace already, MySQL users have to do:
  169. * # mysqladmin create DATABASE_TABLESPACE
  170. * # mysql -u DATABASE_USER -pDATABASE_PASSWORD DATABASE_TABLESPACE < /your/path/to/phpopenchat/db.schema
  171.  
  172. /*
  173. * As a database layer we use ADODB (http://php.weblogs.com/adodb) to be
  174. * database independent.
  175. * Possible database drivers are mysql, mssql, oracle, oci8,
  176. * postgres, sybase, vfp, access, ibase and many others. (see adodb homepage)
  177. * NOTE: mysql is tested only!
  178. */
  179. define('DATABASE_DRIVER','mysql');
  180.  
  181. /*
  182. * Set this true, if you like a persistant database connection for each user
  183. * NOTE: You will have one database instance per chatter.
  184. */
  185. define('USE_PCONNECT',false);
  186.  
  187. /*
  188. * Template related settings
  189. */
  190. define('TEMPLATE_EXTENSION','tpl');
  191. define('DEFAULT_THEME','openchat');
  192. define('BASETEMPLATE_PATH','/include/templates');
  193. define('ALLOW_TEMPLATE_CHANGES',true);
  194. // the following configuration are nessesary only if POC is used as PostNuke module
  195. // Integration into postnuke
  196.  
  197.  
  198.  
  199. define('PN_MODULE_NAME','phpopenchat-3.1.0-dev');//directory name of POC in /path/to/postnuke/modules
  200.  
  201. define('OPERATOR_LABEL','@');//this character labels operators in the chatter list.
  202. /*
  203. * removes unnecessary white spaces and line breaks from html-output
  204. * to decrease traffic
  205. * NOTE: Setting this true makes only sense if you can't use gzip compression for your webserver output.
  206. */
  207. define('TRIM_OUTPUT',true);
  208.  
  209. /*
  210. * Generic settings
  211. */
  212.  
  213. /*
  214. * To add a language, copy the desired language file to the
  215. * directory /path/to/poc/include/languages
  216. * and add the language code here. Language codes are described by ISO-639
  217. * (see http://www.oasis-open.org/cover/iso639a.html)
  218. */
  219. if( !isset ($supported_languages) ) {
  220. $supported_languages = array('en','br','cn','de','dk','es','fr','it','nl','pl','se','tr','tw'); //first language will be choosen,
  221. //in case of no language are specified by client browser
  222. //or no supported language we are found
  223. //in the list of languages of client browser
  224.  
  225. }
  226.  
  227. /*
  228. * The name of your chat. Mostly used to label HTML-pages
  229. */
  230. define('CHAT_NAME','PHPOpenChat');
  231.  
  232. /*
  233. * Exit URL
  234. */
  235. define('EXIT_URL','');//Example: http://phpopenchat.org/
  236. /*
  237. * Kick URL
  238. */
  239. define('KICK_URL','');//Example: http://www.geocities.com/aniquiz/hero/reason.html
  240. /*
  241. * Context menu
  242. */
  243. define('DISABLE_CONTEXT_MENU','false');//Context menu in the output frame shown on right click (It MUST be a string!)
  244. define('DISABLE_CONTEXT_MENU_ICONS',false);
  245.  
  246. /*
  247. * If this true, a login without a password is possible.
  248. * Format of guest nickname: 'Guest_23543'
  249. */
  250. define('ALLOW_GUEST_LOGIN',true);
  251.  
  252. /*
  253. * Status messages within the chat will be spoken by this name
  254. */
  255. define('STATUS_BOT_NAME','System');
  256.  
  257. /*
  258. * Maximum length of a line
  259. */
  260. define('MAX_LINE_LENGTH',300);//chars per line
  261. /*
  262. * Maximum length of a nickname
  263. */
  264. define('NICKNAME_MAX_LENGTH',16);
  265.  
  266. /*
  267. * Minimum length of user passwords
  268. */
  269. define('PASSWORD_MIN_LENGTH', 5);
  270.  
  271. /*
  272. * If it is set to true POC will store the passwords as a md5-checksum in the db
  273. */
  274. define('MD5_PASSWORDS', false);
  275.  
  276. /*
  277. * Maximum of concurrent chatters within one channel
  278. */
  279. define('MAX_CONCURRENT_CHATTER', 50);//a max. of 100 chatters is recommended
  280. /*
  281. * If a confirmation of registration by email desired
  282. * set this true.
  283. */
  284. define('SEND_CONFIRMATION_MAIL', true);
  285.  
  286. /*
  287. * The confirmation mail contains a link for confirming a registration.
  288. * If this mail ought to contain an other host within the URL,
  289. * set this property otherwise leave it blank.
  290. * Nesessary only, if the generated mail contains an wrong host within the link
  291. * in the mail.
  292. */
  293. define('CONFIRMATION_HOST','');
  294.  
  295. /*
  296. * Set this to false to exclude the most of chatters with freemail-accounts.
  297. *
  298. * For Windows users: If this set to true, you can likely set the SMTP directive in the php.ini
  299. * configuration file to your isp's SMTP mail server - the same as you use for outgoing mail
  300. * in your email client (Eudora, Outlook, etc.) . However, check with your ISP before doing this!
  301. * eg
  302. * SMTP = mail.your_isp.com
  303. */
  304. define('SEND_MAIL_TO_FREEMAIL_ACCOUNTS',true);
  305.  
  306. /*
  307. * Your email address
  308. * NOTE: This email address MUST exist to send confirmation mails!
  309. */
  310. define('ADMIN_MAIL_ADDRESS','me@mydomain.com');
  311. define('ADMIN_MAIL_NAME','Chat-Team');
  312.  
  313. /*
  314. * Entered URLs within the chat becomes to links automatically.
  315. * A forward to such a site will be canceled,
  316. * if this specified words in the content are found.
  317. */
  318. define('UNACCEPTABLE_CONTENT','fuck|cunt|bitch');
  319.  
  320. /*
  321. * Prohibited nicknames
  322. */
  323. $NO_NICKS = array('me','you','operator','admin','moderator','vip','join','msg','help','quit','ignore','unignore','query','locate','kick','ban','roll','hitler','adolf','nazi', STATUS_BOT_NAME);
  324.  
  325. /*
  326. * nicknames which will newer die
  327. */
  328. if (! defined ($DEATHLESS_CHATTERS) )
  329. $DEATHLESS_CHATTERS = array('operator','admin','micha','superman','tux');
  330.  
  331. /*
  332. * Words which are forbidden in the chat
  333. */
  334. $NONO_WORDS = array('asshole','fuck');
  335.  
  336. /*
  337. * If you want to integrate your PHPOpenChat-Installation
  338. * into an other PHP-based application with it's own account
  339. * management, you have to define an entry-channel, which the chatter
  340. * will join automatically.
  341. * NOTE: This channel name MUST exist!
  342. */
  343. define('ENTRY_CHANNEL','default');
  344. define('AUTOLOGIN_DIRECTLY', false);//if is set to false, ENTRY_CHANNEL doesn't matter
  345. /*
  346. * here you can define a channel which are selected per
  347. * default within the login form
  348. */
  349. define('CHANNEL_SELECTED','default');
  350.  
  351. /*
  352. * Every chat client polls lines from the server.
  353. * Setup the sleep time for clients here.
  354. * NOTE: The more time, the better the load of server! But, you know,
  355. * your chatters must wait this time for new lines!
  356. */
  357. define('LINE_POLLING_INTERVAL', 8);//Time in seconds.
  358. /*
  359. * After a while without activity, a client will be disconnected
  360. * automatically.
  361. * Define a maximum of inactive time, after the client will be disconnected.
  362. */
  363. define('MAX_INACTIVE_ONLINETIME', 600);//Time in seconds
  364.  
  365. define('MAX_INACTIVE_LIFETIME', 60);//Time in days
  366. /*
  367. * There are two possibilities for the IRC-command /query
  368. * first: inviting to the own private channel
  369. * second: opening a chat request in a separat window
  370. */
  371. define('IRC_QUERY_OPENS_WINDOW',true);
  372.  
  373. /*
  374. * Set this true and all emoticons will be replaced by an image.
  375. */
  376. define('SMILEYS_AS_IMAGES', true);
  377.  
  378. /*
  379. * Max count of images per line
  380. */
  381. define('MAX_SMILEYS_PER_LINE', 3);
  382.  
  383. /*
  384. * Set this true and users are able to upload private
  385. * images. Users can use this images by enter ':me' or ':you'
  386. * within the chat.
  387. */
  388. define('ALLOW_PRIVATE_ICONS', true);
  389. define('ALLOW_PRIVATE_IMAGES', true);
  390.  
  391. /*
  392. * Set this true to allow users to overwrite text line styles of other users
  393. * See configuration dialog.
  394. */
  395. define('ALLOW_LINE_STYLE_OVERWRITE', true);
  396.  
  397. /*
  398. * If this true, a gender icon is shown in front of every nickname in the output frame
  399. */
  400. define('SHOW_GENDER_ICON', true);
  401.  
  402. /*
  403. * Max bytes of private icon
  404. */
  405. define('PRIVATE_ICON_MAX_BYTES', 20000);
  406.  
  407. /*
  408. * Max icon height in pixels
  409. */
  410. define('PRIVATE_ICON_SIZE_X', 16);
  411.  
  412. /*
  413. * Max icon width in pixels
  414. */
  415. define('PRIVATE_ICON_SIZE_Y', 16);
  416.  
  417. /*
  418. * Max bytes of private image
  419. */
  420. define('PRIVATE_IMAGE_MAX_BYTES', 2000000);
  421.  
  422. /*
  423. * Max image height in pixels
  424. */
  425. define('PRIVATE_IMAGE_SIZE_X', 150);
  426.  
  427. /*
  428. * Max image width in pixels
  429. */
  430. define('PRIVATE_IMAGE_SIZE_Y', 250);
  431.  
  432. /*
  433. * Accepted mime types for private image
  434. */
  435. $ACCEPTED_MIME_TYPES = array('image/gif','image/png','image/jpeg','image/x-png');//for private images used by chatters by typing ':me' or ':you' within the chat
  436. /*
  437. * Save mode for private images
  438. * 1: overwrite mode
  439. * 2: do nothing if exists, highest protection
  440. */
  441. define('PRIVATE_ICON_SAVE_MODE', 1);
  442. define('PRIVATE_IMAGE_SAVE_MODE', 1);
  443.  
  444. /*
  445. * used in profile
  446. */
  447. define('MIN_BIRTHDAY_YEAR', 1930);
  448.  
  449. /*
  450. * Minimum length of a mail body
  451. */
  452. define('MIN_MAIL_LENGTH', 3);//in characters
  453. /*
  454. * Maximum length of a note
  455. */
  456. define('MAX_NOTE_SIZE', 1024);//in bytes
  457. /*
  458. * Colum count of online-chatter table on chat home page
  459. */
  460. define('COL_COUNT_CHATTER_LIST', 3);
  461.  
  462. /*
  463. * Show ranking icons
  464. *
  465. */
  466. define('SHOW_GRADE_ICONS',true);
  467.  
  468. /*
  469. * Multiple line input
  470. *
  471. * true: chatters are able to insert more than only one line, this means the chatters can submit line breaks
  472. * false: chatters can't send line breaks
  473. */
  474. define('MULTIPLE_LINE_INPUT',false);
  475.  
  476. /*
  477. * Limits for the ranking system
  478. *
  479. * line count / days since registration = lines per day
  480. * five logins per week = (5 / 7 = 0.7)
  481. * over-all online time in hours
  482. * Grade 'GRADE_ROOKIE' is default
  483. */
  484. $GRADES = array(
  485. //50 lines averaged per day (since registration); 0,1 logins per week; over-all online time in hours
  486. 'GRADE_MEMBER' => array('50' , 0.1, 10),
  487. 'GRADE_REGULAR'=> array('100', 0.4, 50),
  488. 'GRADE_ELITE' => array('200', 0.7, 100),
  489. );
  490.  
  491. /*
  492. * Content caching
  493. *
  494. * Cached pages: max. cache life time:
  495. * - HomePage 2 minutes
  496. * - Administration 1 week
  497. * - UserPage 10 minutes
  498. * - Registration 1 month
  499. * - RegularsPage 1 day
  500. * - Help 1 month
  501. */
  502. define('CACHE_ENGINE', false);
  503. define('DEFAULT_CACHE_LIFE_TIME', 86400);//in seconds (one day = 86400 sec.)
  504.  
  505. define('HTML_BEFORE_LINE','');
  506. define('HTML_AFTER_LINE','');
  507.  
  508. /* It's not necessary to setup things below this line */
  509. /* no_logging is kept for historical purposes (docs etc.), not needed
  510. anymore but still used.
  511. */
  512.  
  513. define('NO_LOGGING', false);
  514.  
  515. /* wether to log to syslog */
  516. define('LOG_TO_SYSLOG', false);
  517. define('LOG_SYSLOG_FACIL', LOG_LOCAL0);
  518.  
  519. /* wether to log to a file. Use "false" to deactivate or a pathname
  520. to activate. For a daily log use something like
  521. define('LOG_TO_FILE', '/var/log/chat-log/test-'.date("Y-m-d"));
  522. */
  523. //define('LOG_TO_FILE', false );
  524. define('LOG_TO_FILE', '/var/log/chat-log/test-'.date("Y-m-d"));
  525.  
  526. define('LOG_POC_TRAFFIC', true);
  527. define('LOG_POC_INFOS', true);
  528. define('LOG_POC_LINES', true);
  529. define('LOG_POC_RAW_POST', false);
  530. define('LOG_POC_DEBUG', false);
  531. define('LOG_POC_WARNING', false);
  532. define('LOG_POC_ERROR', false);
  533. define('LOG_POC_EMERG', false);
  534.  
  535. define('LOGFILE_HISTORY_RAW', false);
  536. define('LOGFILE_HISTORY_HTML', false);
  537.  
  538. //channel related
  539. define('CB_MAX_LINE', 50); // channel buffer maximum line number.
  540. // Depends on db-scheme, if CHANNEL_BUFFER_TYPE = 'DB'!
  541.  
  542.  
  543.  
  544. define('NL',"\r\n");
  545. define('TAB',"\t");
  546. //set version information
  547. include_once(POC_BASE.'/Version.php');
  548. require_once(POC_INCLUDE_PATH.'/functions.inc');
  549.  
  550. ?>

Documentation generated on Tue, 29 Jun 2004 14:42:17 +0200 by phpDocumentor 1.3.0RC3