/[health_html]/inc/global.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /inc/global.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Fri Aug 3 11:21:16 2001 UTC (22 years, 8 months ago) by ravilov
Branch: MAIN
Changes since 1.1: +1 -0 lines
Fixed a minor bug, added some more warnings.

1 ravilov 1.1 <?php
2     function MyEscape($str) {
3     $allowed = array("", "B", "I", "U", "UL", "OL", "LI");
4     $str = preg_replace("/(\<\/?\s*(\w+)>[^\>]*\>)/e",
5     "array_search(strtoupper('\\2'),\$allowed,false)?'\\1':HTMLSpecialChars('\\1')",
6     $str);
7 ravilov 1.2 $str = preg_replace("/(^\s+|\s+$)/", "", $str);
8 ravilov 1.1 return $str;
9     }
10     function ParseNewline($str) {
11     if (!$str) return $str;
12     $str = preg_replace('/\s*(\r\n\r\n|\n\r\n\r|\n\n|\r\r)/m', '</p> <p class="ptext">', $str);
13     $str = preg_replace('/\s*(\r\n|\n\r|\r|\n)/m', '<br>', $str);
14     return $str;
15     }
16     function MyQuote($str) {
17     global $dbh;
18     if (!$dbh) return "'$str'";
19     return $dbh->quote($str);
20     }
21     function MyMove($src, $dest) {
22     $cmd = "mv -f '".EscapeShellCmd($src)."' '".EscapeShellCmd($dest)."'";
23     return exec($cmd);
24     }
25     function MyDelete($src) {
26     @unlink($src);
27     }
28     function error($msg) {
29     if (is_array($msg)) $msg = implode(" ", $msg);
30     echo "<BR>\n<FONT COLOR=\"#FF0000\">[".HTMLSpecialChars($msg).
31     "]</FONT><BR>\n";
32     }
33     function PicSize($pic) {
34     global $syspicdir;
35     $ret = array(0, 0);
36     if ($pic) {
37     @$size = GetImageSize($syspicdir."/".$pic);
38     $ret = array($size[0], $size[1]);
39     }
40     return $ret;
41     }
42     ?>

  ViewVC Help
Powered by ViewVC 1.1.26