Location: PHPKode > projects > Cadence Guestbook Host > cadence/sources/help.php
<?php

/************************************
 * Cadence
 * Remotely Hosted Guestbook Script.
 * (c) 2006, Dennis Pedrie
 * www.CadenceBook.com
 * help.php
 ***********************************
 * Cadence Guestbook is licensed under
 * a Creative Commons License.
 * More information is available by visiting
 * http://creativecommons.org/licenses/by/3.0/
 * or the LICENSE file in the Cadence Root Folder
 ***********************************/

if(!defined('IN_CADENCE')) {
	trigger_error("You may not access this file directly",E_USER_ERROR);
}

$code = $post->clean_var(intval($_GET['code']));

//If we're looking for smilies.
if($code == 01) {
	$tpl->display($gbook->style .'/smilie.tpl');
}

//bbCode help popup.
if($code == 02) {
	// Create list of bbCodes.
	// Build bbCode Tags
	include "class/bbcode.php";
	$bbcode = new bbcode;
	$bbcode_query = $db->get_results("SELECT * FROM ". TABLE_PREFIX ."bbcode WHERE bbc_enabled = 1");
	foreach($bbcode_query as $bbc) {
		$new_tag = array(
			'tag_name'			=>	$bbc->bbc_name,
			'Name'				=>	$bbc->bbc_key,
			'HasParam'			=>	($bbc->bbc_has_param == 1) ? true : false,
			'ParamRegex'		=>	($bbc->bbc_param_regex == 'false') ? "[^\\]]+" : $bbc->bbc_param_regex,
			'HtmlBegin'			=>	$bbc->bbc_html_start,
			'HtmlEnd'			=>	$bbc->bbc_html_end,
			'ParamRegexReplace'	=>	($bbc->bbc_param_regex_replace != '') ? unserialize($bbc->bbc_param_regex_replace) : array(),
			'HasEnd'			=>	($bbc->bbc_has_end == 1) ? true : false);
		echo $bbcode->add_tag($new_tag);
	}

	foreach($bbcode->tags as $t) {
		echo array_keys($t);
		echo "hi";
		$html .= "<tr>
    <td class=\"left\">
     <strong>". $t->tag_name ."</strong>
    </td>
    <td class=\"right\">
     <a href='javascript:add_bbCode(\"[". $t->key ."][/". $t->key ."]\")'>[". $t->key ."][/". $t->key ."]</a>
    </td>
   </tr>";
	}
	$tpl->assign("tags",$html);
	$tpl->display($gbook->style .'/bbcode.tpl');
}

?>
Return current item: Cadence Guestbook Host