CMSimple_XH 開発者ドキュメント
compat.php
[詳解]
1 <?php
2 
29 function autogallery($u)
30 {
31  global $su;
32 
33  trigger_error('Function autogallery() is deprecated', E_USER_DEPRECATED);
34 
35  return preg_replace(
36  "/.*<!-- autogallery -->(.*)<!-- \/autogallery -->.*/is",
37  '$1',
38  preg_replace(
39  "/(option value=\"\?)(p=)/is",
40  '${1}' . $su . '&$2',
41  preg_replace(
42  "/(href=\"\?)/is",
43  '${1}' . $su . '&amp;',
44  preg_replace("/(src=\")(\.)/is", '${1}' . $u . '$2', geturlwp($u))
45  )
46  )
47  );
48 }
49 
60 function rp($p)
61 {
62  trigger_error('Function rp() is deprecated', E_USER_DEPRECATED);
63 
64  if (realpath($p) == '') {
65  return $p;
66  } else {
67  return realpath($p);
68  }
69 }
70 
80 function amp()
81 {
82  global $cf;
83 
84  trigger_error('Function amp() is deprecated', E_USER_DEPRECATED);
85 
86  if ($cf['xhtml']['amp'] == 'true') {
87  return '&amp;';
88  } else {
89  return '&';
90  }
91 }
92 
100 function guestbooklink()
101 {
102  trigger_error('Function ' . __FUNCTION__ . '() is deprecated', E_USER_DEPRECATED);
103  if (function_exists('gblink')) {
104  return gblink();
105  }
106 }
107 
121 function chkdl($fl)
122 {
123  global $pth, $sn;
124 
125  trigger_error('Function ' . __FUNCTION__ . '() is deprecated', E_USER_DEPRECATED);
126  $m = false;
127  if (is_dir($pth['folder']['downloads'])) {
128  if ($fd = opendir($pth['folder']['downloads'])) {
129  while (($p = readdir($fd)) == true) {
130  if (preg_match("/.+\..+$/", $p)) {
131  if ($fl == $sn . '?download=' . $p) {
132  $m = true;
133  }
134  }
135  }
136  closedir($fd);
137  }
138  }
139  return $m;
140 }
141 
151 function rf($fl)
152 {
153  trigger_error('Function ' . __FUNCTION__ . '() is deprecated', E_USER_DEPRECATED);
154  if (!file_exists($fl)) {
155  return;
156  }
157  clearstatcache();
158  return file_get_contents($fl);
159 }
160 
176 function chkfile($fl, $writable)
177 {
178  global $pth;
179 
180  trigger_error('Function '. __FUNCTION__ . '() is deprecated', E_USER_DEPRECATED);
181 
182  $t = isset($pth['file'][$fl]) ? $pth['file'][$fl] : '';
183  if ($t == '') {
184  e('undefined', 'file', $fl);
185  } elseif (!file_exists($t)) {
186  e('missing', $fl, $t);
187  } elseif (!is_readable($t)) {
188  e('notreadable', $fl, $t);
189  } elseif (!is_writable($t) && $writable) {
190  e('notwritable', $fl, $t);
191  }
192 }
193 
226 function preCallPlugins($pageIndex = -1)
227 {
228  global $edit, $c, $s, $u;
229 
230  trigger_error('Function preCallPlugins() is deprecated', E_USER_DEPRECATED);
231 
232  if (!$edit) {
233  if ((int) $pageIndex > - 1 && (int) $pageIndex < count($u)) {
234  $as = $pageIndex;
235  } else {
236  $as = $s < 0 ? 0 : $s;
237  }
238  $c[$as] = evaluate_plugincall($c[$as]);
239  }
240 }
241 
255 function writelog($m)
256 {
257  global $pth;
258 
259  trigger_error('Function ' . __FUNCTION__ . '() is deprecated', E_USER_DEPRECATED);
260  if ($fh = fopen($pth['file']['log'], "a")) {
261  fwrite($fh, $m);
262  fclose($fh);
263  } else {
264  e('cntwriteto', 'log', $pth['file']['log']);
265  }
266 }
rf($fl)
Definition: compat.php:151
chkdl($fl)
Definition: compat.php:121
$su
Definition: cms.php:778
autogallery($u)
Definition: compat.php:29
chkfile($fl, $writable)
Definition: compat.php:176
preCallPlugins($pageIndex=-1)
Definition: compat.php:226
$s
Definition: cms.php:953
rp($p)
Definition: compat.php:60
geturlwp($u)
Definition: functions.php:64
$cf
Definition: cms.php:272
amp()
Definition: compat.php:80
$c
Definition: cms.php:964
$u
Definition: cms.php:990
e($et, $ft, $fn)
Definition: functions.php:655
$sn
Definition: cms.php:434
writelog($m)
Definition: compat.php:255
$pth
Definition: cms.php:230
evaluate_plugincall($text)
Definition: functions.php:186
$edit
Definition: cms.php:602
guestbooklink()
Definition: compat.php:100