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.

    $DB->debug = true;

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

shorter syntax for

$a = $a ? $a : $b;

$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

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