You are here

function xbbcode_get_custom_tag in Extensible BBCode 6

Same name and namespace in other branches
  1. 5 xbbcode-misc.php \xbbcode_get_custom_tag()
3 calls to xbbcode_get_custom_tag()
xbbcode_custom_tags in ./xbbcode.admin.inc
xbbcode_xbbcode in ./xbbcode.module
xbbcode_xbbcode_render in ./xbbcode.module

File

./xbbcode.inc, line 120

Code

function xbbcode_get_custom_tag($tag = NULL) {
  static $tags;
  if (!isset($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 && !empty($tags[$tag])) {
    return $tags[$tag];
  }
  else {
    if (!empty($tags)) {
      return array_keys($tags);
    }
  }
}