Source for file functions.inc

Documentation is available at functions.inc

  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. function escape_html ( $text ) {
  31. $text = preg_replace("/\'/", '&#39;', $text );
  32. $text = preg_replace('/(.{70})/', '\0&#173;', $text );//&shy; forces a line break if needed
  33. $text = preg_replace('/</', '&lt;', $text ); //disallow html
  34. return ( $text );
  35. }
  36.  
  37. function html_breaklines ($text) {
  38. if(MULTIPLE_LINE_INPUT) {
  39. $text = preg_replace('/\r\n|\n|\r/', '<br />', $text );
  40. $text = preg_replace('/><br \/>/', '>', $text );
  41. $text = '<p style="padding-left:50px;margin-top:0">'.$text.'</p>';
  42. }
  43. return($text);
  44. }
  45.  
  46. function handle_adodb ($text) {
  47. // adodb doesn't update, if old value equals new value.
  48. // To force an update, we add a random comment (to the html line)
  49. // $text = $text.'<!--'.rand(0,15).'-->';
  50. return($text);
  51. }
  52.  
  53. function deb ( $line, $what = 'all' ) {
  54. $_SESSION['logger']->debug($line);
  55. }
  56.  
  57.  
  58. ?>

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