| | 47 | case 'tags': |
|---|
| | 48 | $lang_file = 'lang_faq_bbcode.php'; |
|---|
| | 49 | |
|---|
| | 50 | function parse_faq_lang ( &$faq ) { |
|---|
| | 51 | global $root_path, $lang; |
|---|
| | 52 | static $bb_code; |
|---|
| | 53 | |
|---|
| | 54 | require ($root_path . 'include/bbcode/config/tags.php'); |
|---|
| | 55 | require ($root_path . 'include/bbcode/bbcode.lib.php'); |
|---|
| | 56 | |
|---|
| | 57 | $faq_tags = array(); |
|---|
| | 58 | $tags = array_keys($tags); |
|---|
| | 59 | |
|---|
| | 60 | if ( !isset($bb_code) ) { |
|---|
| | 61 | $bb_code = new bbcode(); |
|---|
| | 62 | } |
|---|
| | 63 | |
|---|
| | 64 | for($i = 0, $count = sizeof($faq); $i < $count; $i++) { |
|---|
| | 65 | if ( $faq[$i][0] != '--' ) { |
|---|
| | 66 | list($name, $tag, $descr, $explain) = $faq[$i]; |
|---|
| | 67 | |
|---|
| | 68 | $parsed = $explain; |
|---|
| | 69 | |
|---|
| | 70 | $bb_code->parse($parsed); |
|---|
| | 71 | $parsed = $bb_code->get_html(); |
|---|
| | 72 | |
|---|
| | 73 | $faq_text = $lang['tag'] . ': [' . $tag . ']<br />'; |
|---|
| | 74 | $faq_text .= $lang['description'] . ': ' . $descr . '<br />'; |
|---|
| | 75 | $faq_text .= '<div class="codetitle"><b>' . $lang['example'] . ':</b></div><div class="codecontent">' . $explain . '</div>'; |
|---|
| | 76 | $faq_text .= '<div class="codetitle"><b>' . $lang['result'] . ':</b></div><div class="codecontent">' . $parsed . '</div>'; |
|---|
| | 77 | |
|---|
| | 78 | $faq[$i] = array( |
|---|
| | 79 | 0 => '[' . $tag . '] ' . $name, |
|---|
| | 80 | 1 => $faq_text, |
|---|
| | 81 | ); |
|---|
| | 82 | |
|---|
| | 83 | $faq_tags[] = $tag; |
|---|
| | 84 | } |
|---|
| | 85 | } |
|---|
| | 86 | |
|---|
| | 87 | $tags_diff = array_diff($tags, $faq_tags); |
|---|
| | 88 | |
|---|
| | 89 | if ( sizeof($tags_diff) ) { |
|---|
| | 90 | $faq[$i] = array( |
|---|
| | 91 | 0 => $lang['other_tags'], |
|---|
| | 92 | 1 => implode(', ', $tags_diff), |
|---|
| | 93 | ); |
|---|
| | 94 | } |
|---|
| | 95 | } |
|---|
| | 96 | break; |
|---|
| | 97 | |
|---|