CMSimple_XH
Functions
compat.php File Reference

Functions

 autogallery ($u)
 Returns the code to display a photogallery. More...
 
 rp ($p)
 Returns the canonicalized absolute pathname on success. More...
 
 amp ()
 Returns & or & according to the setting of ‘$cf['xhtml’]['amp']`. More...
 
 guestbooklink ()
 Returns the link to the guestbook. More...
 
 chkdl ($fl)
 Returns whether the file exists in the download folder and is available for download. More...
 
 rf ($fl)
 Returns the content of file $filename, if it does exist, null otherwise. More...
 
 chkfile ($fl, $writable)
 Checks wether the file exists, is readable, and if $writeable is true, is writeable. More...
 
 preCallPlugins ($pageIndex=-1)
 Function preCallPlugins() => Pre-Call of Plugins. More...
 
 writelog ($m)
 Appends a message to the logfile. More...
 
 h ($n)
 Returns a page heading. More...
 
 l ($n)
 Returns a page's menu level. More...
 
 initvar ($name)
 Initializes a global variable according to a GET or POST parameter. More...
 
 stsl ($t)
 Returns the un-quoted $t, i.e. More...
 
 tag ($s)
 Returns an HTML stand alone tag. More...
 
 XH_decodeJson ($string)
 Returns the JSON string decoded as PHP value. More...
 
 XH_encodeJson ($value)
 Returns the JSON representation of a value. More...
 
 XH_lastJsonError ()
 Returns whether an error has occurred during the last XH_decodeJson(). More...
 
 XH_renameFile ($oldname, $newname)
 Attempts to rename oldname to newname, and returns whether that succeeded. More...
 

Detailed Description

Backward compatible functionality.

Author
Peter Harteg peter.nosp@m.@har.nosp@m.teg.d.nosp@m.k
The CMSimple_XH developers devs@.nosp@m.cmsi.nosp@m.mple-.nosp@m.xh.o.nosp@m.rg

Function Documentation

◆ amp()

amp ( )

Returns & or & according to the setting of ‘$cf['xhtml’]['amp']`.

Returns
string HTML
Deprecated:
since 1.5.4. Use & instead.

◆ autogallery()

autogallery (   $u)

Returns the code to display a photogallery.

Parameters
string$uAutogallery's installation folder.
Returns
string HTML
Deprecated:
since 1.5.4. Use a gallery plugin instead.

◆ chkdl()

chkdl (   $fl)

Returns whether the file exists in the download folder and is available for download.

Parameters
string$flThe download URL, e.g. ?download=file.ext
Returns
bool
Deprecated:
since 1.6.

◆ chkfile()

chkfile (   $fl,
  $writable 
)

Checks wether the file exists, is readable, and if $writeable is true, is writeable.

Appends an according message to $e otherwise.

Parameters
string$flA key of $pth['file'].
bool$writableWhether the file has to writable.
Returns
void
Deprecated:
since 1.6.

◆ guestbooklink()

guestbooklink ( )

Returns the link to the guestbook.

Returns
string HTML
Deprecated:
since 1.5.4

◆ h()

h (   $n)

Returns a page heading.

Parameters
int$nThe index of the page.
Returns
string
See also
$h
Deprecated:
since 1.7. Use $h instead.

◆ initvar()

initvar (   $name)

Initializes a global variable according to a GET or POST parameter.

Parameters
string$nameThe name of the global variable.
Returns
void
Deprecated:
since 1.7.0

◆ l()

l (   $n)

Returns a page's menu level.

Parameters
int$nThe index of the page.
Returns
int
See also
$l
Deprecated:
since 1.7. Use $l instead.

◆ preCallPlugins()

preCallPlugins (   $pageIndex = -1)

Function preCallPlugins() => Pre-Call of Plugins.

All Plugins which are called through a function-call can use this. At the moment it is'nt possible to do this with class-based plugins. They need to be called through standard-CMSimple-Scripting.

Call a plugin: place this in your code (example): {{{PLUGIN:pluginfunction('parameters');}}}

Call a built-in function (at the moment only one for demonstration): {{{HOME}}} or: {{{HOME:name_of_Link}}} This creates a link to the first page of your CMSimple- Installation.

Parameters
int$pageIndexThe page index.
Returns
void
Author
mvwd
Since
1.0
Deprecated:
since 1.6

◆ rf()

rf (   $fl)

Returns the content of file $filename, if it does exist, null otherwise.

Parameters
string$flThe file name.
Returns
?string
Deprecated:
since 1.6

◆ rp()

rp (   $p)

Returns the canonicalized absolute pathname on success.

Otherwise returns its input.

Parameters
string$pThe file name.
Returns
string
Deprecated:
since 1.5.4. Use realpath() instead.

◆ stsl()

stsl (   $t)

Returns the un-quoted $t, i.e.

reverses the effect of magic_quotes_gpc/magic_quotes_sybase.

Since magic_quotes are gone, it is a NOP now.

Parameters
string$tA string.
Returns
string
Deprecated:
since 1.8

◆ tag()

tag (   $s)

Returns an HTML stand alone tag.

Used to returns an (X)HTML compliant stand alone tag according to the settings of $cf['xhtml']['endtags'].

Parameters
string$sThe contents of the tag.
Returns
string HTML
Deprecated:
since 1.7
Todo:
Add deprecation warning (XH 1.8?)

◆ writelog()

writelog (   $m)

Appends a message to the logfile.

On failure an according message is appended to $e.

Parameters
string$mThe log message.
Returns
void
Deprecated:
since 1.6

◆ XH_decodeJson()

XH_decodeJson (   $string)

Returns the JSON string decoded as PHP value.

Parameters
string$stringA JSON string.
Returns
mixed
Since
1.6
Deprecated:
since 1.8.

◆ XH_encodeJson()

XH_encodeJson (   $value)

Returns the JSON representation of a value.

Parameters
mixed$valueA PHP value.
Returns
string or bool false on JSON error
Since
1.6
Deprecated:
since 1.8.

◆ XH_lastJsonError()

XH_lastJsonError ( )

Returns whether an error has occurred during the last XH_decodeJson().

Returns
bool
Since
1.6
Deprecated:
since 1.8.

◆ XH_renameFile()

XH_renameFile (   $oldname,
  $newname 
)

Attempts to rename oldname to newname, and returns whether that succeeded.

The file is moved between directories if necessary. If newname exists, it will be overwritten.

This is a wrapper around rename(), which offers a fallback for the limitation of PHP < 5.3 on Windows that the rename operation fails, if $newfile already exists. Note, that the fallback solution is not atomic.

Parameters
string$oldnameA filename.
string$newnameA filename.
Returns
bool
Since
1.6
Deprecated:
since 1.8.