|
Puedes ver este artículo en español RequirementsFiles- {component}/kunena.php
- {template}/view.php
- {lib}/kunena.parser.php
- {template}/kunena.forum.css
- {template}/smile.class.php
- {lib}/kunena.bbcode.js.php
Description Geshi is a plugin used by many other projects, such as Joomla. It highlight codes, as chili, but it uses PHP and chili javascript. The width and height of the div (the codes written) will be equal to the width and height of kunena text area. This is modified from the configuration of Kunene. If exceeded, will be a scroll. ChangesSearch Mostrar/Ocultar código php require_once (JPATH_BASE.'/libraries/joomla/template/template.php'); Add after Mostrar/Ocultar código php//JoniJnm: Geshi plugin
JApplication::addCustomHeadTag('
<style type="text/css">
div.highlight pre {
width: '.(($fbConfig->rtewidth * 9) / 10).'px;
max-height: '.$fbConfig->rteheight.'px
}
</style>'); Delete Mostrar/Ocultar código php if ($fbConfig->highlightcode)
{
echo '
<script type="text/javascript" src="'.KUNENA_DIRECTURL . '/template/default/plugin/chili/jquery.chili-2.2.js"></script>
<script id="setup" type="text/javascript">
ChiliBook.recipeFolder = "'.KUNENA_DIRECTURL . '/template/default/plugin/chili/";
ChiliBook.stylesheetFolder = "'.KUNENA_DIRECTURL . '/template/default/plugin/chili/";
</script>
';
} Change Mostrar/Ocultar código php case 'code':
$types = array ("php", "mysql", "html", "js", "javascript");
$code_start_html = '<div class="fbcode" style="width:'. $fbConfig->rtewidth .'px;"><table cellspacing="1" cellpadding="3" border="0"><tr><td><b>'._KUNENA_MSG_CODE.'</b></td></tr><tr><td><hr />';
if (!empty($tag->options["type"]) && in_array($tag->options["type"], $types)) {
$t_type = $tag->options["type"];
}
else {
$t_type = "php";
}
// make sure we show line breaks
$code_start_html .= "<code class=\"{$t_type}\">";
$code_end_html = '</code><hr /></td></tr></table></div>';
// Preserve spaces and tabs in code
$codetext = str_replace("\t", "__FBTAB__", $between);
$codetext = kunena_htmlspecialchars($codetext, ENT_QUOTES);
$codetext = str_replace(" ", " ", $codetext);
$tag_new = $code_start_html. $codetext .$code_end_html;
#reenter regular replacements
$task->in_code = FALSE;
return TAGPARSER_RET_REPLACED;
break; by Mostrar/Ocultar código php case 'code':
//JoniJnm: code para geshi
jimport('geshi.geshi');
$path = JPATH_ROOT.DS.'libraries'.DS.'geshi'.DS.'geshi';
$type = isset($tag->options["type"]) ? $tag->options["type"] : "php";
if ($type == "js") { $type = "javascript"; }
else if ($type == "html") { $type = "html4strict"; }
if (!file_exists($path.DS.$type.".php")) {
$type = "php";
}
// Preserve spaces and tabs in code
$code = str_replace("\t", "__FBTAB__", $between);
$geshi = new GeSHi($code, $type);
//$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS,37);
$geshi->enable_keyword_links(false);
//$geshi->set_header_type(GESHI_HEADER_PRE_TABLE);
$code = $geshi->parse_code();
$code = str_replace("\n","<br />",$code);
//$code = ereg_replace(">([0-9]+)<br \/","><b>\\1.<\/b><br \/",$code);
$tag_new = '<div class="highlight">'.$code.'</div>';
#reenter regular replacements
$task->in_code = FALSE;
return TAGPARSER_RET_REPLACED;
break; Search Mostrar/Ocultar código css div.msgtext pre, div.msgtext .code {
border-left: 5px solid #F4A94F;
border-right: 1px solid #CCC;
border-top: 1px solid #CCC;
border-bottom: 1px solid #CCC;
font-family: "Courier News", monospace;
font-size-adjust: none;
font-stretch: normal;
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 1.5;
margin: 5px 0pt 15px;
padding: 10px 15px;
width: 100%;
overflow:auto;
} Delete Mostrar/Ocultar código css Search Mostrar/Ocultar código html4strict <option value = "5"><?php @print(_SIZE_VBIG); ?></option>
</select> Add after Mostrar/Ocultar código php <?php
jimport( 'joomla.filesystem.folder');
$path = JPATH_ROOT.DS."libraries".DS."geshi".DS."geshi";
$files = JFolder::files($path, ".php");
echo '<select id = "fb-bbcode_code" class = "'.$boardclass.'slcbox" name = "addbbcode22" onmouseover = "javascript:kunenaShowHelp(\''._KUNENA_EDITOR_HELPLINE_CODE.'\')">';
echo "<option value='0'>".JText::_("KUNENA_JONI_API_CODE")."</option>";
foreach ($files as $file) {
echo "<option value = '".substr($file,0,-4)."'>".substr($file,0,-4)."</option>";
}
echo '</select>';
?> Delete Mostrar/Ocultar código html4strict<img class = "fb-bbcode" accesskey = "c" name = "addbbcode8" src="<?php echo KUNENA_LIVEUPLOADEDPATH.'/editor/'; ?>code.png" alt="Code" onclick = "bbfontstyle('[code]', '[/code]');" onmouseover = "javascript:kunenaShowHelp('<?php @print(_KUNENA_EDITOR_HELPLINE_CODE);?>')" /> Search Mostrar/Ocultar código javascript jQuery('select#fb-bbcode_size').change( function()
{
var size = jQuery(this).val();
bbfontstyle('[size=' + size + ']', '[/size]'); return false;
} ); Add after Mostrar/Ocultar código javascript jQuery('select#fb-bbcode_code').change( function() {
var code = jQuery(this).val();
bbfontstyle('[code type=' + code + ']', '[/code]');
document.getElementById('fb-bbcode_code').value = 0;
return false;
});
New files You can add more languages downloading geshi and uploading the new files to {joomla}/libraries/geshi/geshi
|