1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

Added Glyph bbcode.

This commit is contained in:
Cameron
2014-05-31 23:16:47 -07:00
parent 04afb156ae
commit 2eb638f05e
2 changed files with 60 additions and 6 deletions

View File

@@ -0,0 +1,41 @@
<?php
/**
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
*
* DIV block bbcode
*/
if (!defined('e107_INIT')) { exit; }
// This is a generic glyph bbcode.
class bb_glyph extends e_bb_base
{
/**
* Called prior to save
* Re-assemble the bbcode
*/
function toDB($code_text, $parm)
{
return '[glyph]'.$code_text.'[/glyph]';
}
/**
* Glyph tag.
* @param $code_text : xxxxxxx.youtube or xxxxxxx.mp4
*/
function toHTML($code_text, $parm='')
{
return e107::getParser()->toIcon($code_text);
}
}
?>

View File

@@ -44,7 +44,7 @@ class e_bbcode
'b', 'justify', 'file', 'stream', 'b', 'justify', 'file', 'stream',
'textarea', 'list', 'time', 'textarea', 'list', 'time',
'spoiler', 'hide', 'youtube', 'sanitised', 'spoiler', 'hide', 'youtube', 'sanitised',
'p', 'h', 'nobr', 'block','table','th', 'tr','tbody','td','markdown','video' 'p', 'h', 'nobr', 'block','table','th', 'tr','tbody','td','markdown','video','glyph'
); );
foreach($this->core_bb as $c) foreach($this->core_bb as $c)
@@ -310,11 +310,7 @@ class e_bbcode
$code_text = $code_text_par; $code_text = $code_text_par;
if (E107_DEBUG_LEVEL)
{
global $db_debug;
$db_debug->logCode(1, $code, $parm, $postID);
}
if (is_array($this->bbList) && array_key_exists($code, $this->bbList)) if (is_array($this->bbList) && array_key_exists($code, $this->bbList))
{ // Check the bbcode 'cache' { // Check the bbcode 'cache'
@@ -326,11 +322,13 @@ class e_bbcode
{ {
$bbPath = e_CORE.'bbcodes/'; $bbPath = e_CORE.'bbcodes/';
$bbFile = strtolower(str_replace('_', '', $code)); $bbFile = strtolower(str_replace('_', '', $code));
$debugFile = $bbFile;
} }
else else
{ // Add code to check for plugin bbcode addition { // Add code to check for plugin bbcode addition
$bbPath = e_PLUGIN.$this->bbLocation[$code].'/'; $bbPath = e_PLUGIN.$this->bbLocation[$code].'/';
$bbFile = strtolower($code); $bbFile = strtolower($code);
$debugFile = $bbFile;
} }
if (file_exists($bbPath.'bb_'.$bbFile.'.php')) if (file_exists($bbPath.'bb_'.$bbFile.'.php'))
{ // Its a bbcode class file { // Its a bbcode class file
@@ -338,11 +336,13 @@ class e_bbcode
//echo "Load: {$bbFile}.php<br />"; //echo "Load: {$bbFile}.php<br />";
$className = 'bb_'.$code; $className = 'bb_'.$code;
$this->bbList[$code] = new $className(); $this->bbList[$code] = new $className();
$debugFile = $bbPath.'bb_'.$bbFile.'.php';
} }
elseif (file_exists($bbPath.$bbFile.'.bb')) elseif (file_exists($bbPath.$bbFile.'.bb'))
{ {
$bbcode = file_get_contents($bbPath.$bbFile.'.bb'); $bbcode = file_get_contents($bbPath.$bbFile.'.bb');
$this->bbList[$code] = $bbcode; $this->bbList[$code] = $bbcode;
$debugFile = $bbPath.$bbFile.'.bb';
} }
else else
{ {
@@ -351,6 +351,19 @@ class e_bbcode
return false; return false;
} }
} }
if (E107_DEBUG_LEVEL)
{
global $db_debug;
$info = array(
'class' =>$className,
'path' => $debugFile
);
$db_debug->logCode(1, $code, $parm, print_a($info,true));
}
global $e107_debug; global $e107_debug;
if (is_object($this->bbList[$code])) if (is_object($this->bbList[$code]))