addCode ( 'gallery', // tag name: this will go between square brackets 'callback_replace_single', // type of action: we'll use a callback function 'plugin_quickgallery_gallery', // name of the callback function array('usecontent_param' => array ('default')), // supported parameters: "default" is [acronym=valore] 'inline', // type of the tag, inline or block, etc array ('listitem', 'block', 'inline', 'link'), // type of elements in which you can use this tag array () // type of elements where this tag CAN'T go (in this case, none, so it can go everywhere) ); $bbcode->setCodeFlag ('acronym', 'closetag', BBCODE_CLOSETAG_FORBIDDEN); // a closing tag is forbidden (no [/tag]) } // $content is the text between the two tags, i.e. [tag]CONTAINED TEXT[/tag] $content='CONTAINED TEXT' // $attributes is an associative array where keys are the tag properties. default is the [tagname=value] property function plugin_quickgallery_gallery($action, $attr, $content, $params, $node_object) { if ($action == 'validate') { // not used for now return true; } global $lightbox_rel; $dir = $attr['default']; if (substr($dir, -1)!='/') $dir .= '/'; $d = substr_replace ($dir, IMAGES_DIR, 0, 7 ); $fs = new fs_filelister($d); $l = $fs->getlist(); natsort($l); $imgattr = $attr; $lightbox_rel = sanitize_title($dir); $str = ''; }