You are here

function xbbcode_get_custom_tag in Extensible BBCode 5

Same name and namespace in other branches
  1. 6 xbbcode.inc \xbbcode_get_custom_tag()
2 calls to xbbcode_get_custom_tag()
xbbcode_xbbcode in ./xbbcode.module
xbbcode_xbbcode_render in ./xbbcode.module

File

./xbbcode-misc.php, line 109

Code

function xbbcode_get_custom_tag($tag = NULL) {
  static $tags;
  if (!$tags) {
    $res = db_query("SELECT name, sample, description, selfclosing, dynamic, multiarg, replacewith FROM {xbbcode_custom_tags}");
    while ($row = db_fetch_array($res)) {
      $tags[$row['name']] = $row;
    }
  }
  if ($tag) {
    return $tags[$tag];
  }
  else {
    return array_keys($tags);
  }
}