Manual

common functions

debuggable() {#debuggable}

returns true if debug info allowed for your ip and debugging is enabled. if ips are not set, debug info only visible to myportal loged users.

{{lang:php}}
if(debuggable()){
    $DB->debug = true;
    print_r($_SESSION);
    ...
}

ifelse($if,$else=false) {#ifelse}

shorter syntax for

{{lang:php}}
$a = $a ? $a : $b;

//shorter
$a = ifelse($a,'');   // return '' if $a is false else $a
$a = ifelse($a);   // return false if $a is false else $a

shorten($string,$len) {#shorten}

string shortener to given lenght

{{lang:php}}
echo shorten('123456789',3);
// 123...
Try myPortal 2: