/[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.1.1.1 - (hide annotations) (vendor branch)
Fri Aug 3 09:56:32 2001 UTC (22 years, 7 months ago) by ravilov
Branch: pliva
CVS Tags: r0
Changes since 1.1: +0 -0 lines
initial import

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     return $str;
8     }
9     function ParseNewline($str) {
10     if (!$str) return $str;
11     $str = preg_replace('/\s*(\r\n\r\n|\n\r\n\r|\n\n|\r\r)/m', '</p> <p class="ptext">', $str);
12     $str = preg_replace('/\s*(\r\n|\n\r|\r|\n)/m', '<br>', $str);
13     return $str;
14     }
15     function MyQuote($str) {
16     global $dbh;
17     if (!$dbh) return "'$str'";
18     return $dbh->quote($str);
19     }
20     function MyMove($src, $dest) {
21     $cmd = "mv -f '".EscapeShellCmd($src)."' '".EscapeShellCmd($dest)."'";
22     return exec($cmd);
23     }
24     function MyDelete($src) {
25     @unlink($src);
26     }
27     function error($msg) {
28     if (is_array($msg)) $msg = implode(" ", $msg);
29     echo "<BR>\n<FONT COLOR=\"#FF0000\">[".HTMLSpecialChars($msg).
30     "]</FONT><BR>\n";
31     }
32     function PicSize($pic) {
33     global $syspicdir;
34     $ret = array(0, 0);
35     if ($pic) {
36     @$size = GetImageSize($syspicdir."/".$pic);
37     $ret = array($size[0], $size[1]);
38     }
39     return $ret;
40     }
41     ?>

  ViewVC Help
Powered by ViewVC 1.1.26