is_parent) return; echo ''; if ($item->children) foreach($item->children as $child) showTreeOptions($child, $showOnlyFolders, $selectedId, $level+1); } function truncate($string, $length, $append='...') { if (strlen($string)<$length) return $string; $string = substr($string,0,$length); return substr($string,0,strrpos($string,' ')).$append; } function summarize($string, $length, $append='...') { return truncate(trim(strip_tags($string)), $length, $append); } function get_seo_alias($string) { $string = strip_tags($string); $string = preg_replace("`\[.*\]`U","",$string); $string = str_replace('\'','',$string); $string = str_replace('&','en',$string); $string = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$string); $string = htmlentities($string, ENT_COMPAT, 'utf-8'); $string = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string ); $string = preg_replace( array("`[^a-z0-9\.]`i","`[-]+`") , "-", $string); $string = strtolower(trim($string, '-')); return $string; } function alias_already_exists($a, $item) { global $db, $config; $found = false; foreach($config['alias_tables'] as $table) if ($db->getOne('SELECT id FROM '.$table.' WHERE alias = '.$db->escape($a) . (($table==$item->table && $item->id) ? ' AND id !='.$item->id : ''))) return true; return false; } function get_unique_alias($item,$field='name') { $alias = get_seo_alias($item->$field); if (alias_already_exists($alias, $item)) { $i = 2; while(alias_already_exists($alias.'-'.$i, $item)) $i++; $alias = $alias.'-'.$i; } return $alias; } function get_unique_id() { $id = base64_encode(sha1(uniqid(),true)); $id = str_replace('+','-',$id); $id = str_replace('/','_',$id); $id = substr($id,0,-1); return $id; } function get_youtube_id_from_url($ytURL) { $ytvIDlen = 11; if (strlen($ytURL)==$ytvIDlen) return $ytURL; $idStarts = strpos($ytURL, "?v="); if($idStarts === FALSE) $idStarts = strpos($ytURL, "&v="); if($idStarts === FALSE) return false; $idStarts +=3; $ytvID = substr($ytURL, $idStarts, $ytvIDlen); return $ytvID; } function get_vimeo_id_from_url($url) { sscanf(parse_url($url, PHP_URL_PATH), '/%d', $video_id); return $video_id; } ?> '-', '20'=>'20 pixels', '40'=>'40 pixels', '60'=>'60 pixels', '80'=>'80 pixels', '100'=>'100 pixels', '120'=>'120 pixels', '140'=>'140 pixels', '160'=>'160 pixels', '180'=>'180 pixels', '200'=>'200 pixels' ); $margin_hor_lookup = array( '0'=>'-', '10'=>'10%', '20'=>'20%', '30'=>'30%', '40'=>'40%', '50'=>'50%', '60'=>'60%', '70'=>'70%', '80'=>'80%' ); $width_lookup = array( '1'=>'1 kolom', '2'=>'2 kolommen', '3'=>'3 kolommen', '4'=>'4 kolommen' ); ?>