1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 10:38:08 +01:00

More shortcode cleanup.

This commit is contained in:
CaMer0n 2012-11-02 01:50:28 +00:00
parent f2c7bad663
commit 586af71243
7 changed files with 20 additions and 21 deletions

View File

@ -533,7 +533,7 @@ class e_bbcode
'size' => $helpsize
);
$bbcode_shortcodes->setParserVars($data);
$bbcode_shortcodes->setVars($data);
return "<div id='bbcode-panel-".$id."' class='mceToolbar bbcode-panel' {$visible}>".$tp->parseTemplate($BBCODE_TEMPLATE,TRUE)."</div>";
}
@ -545,6 +545,8 @@ class e_bbcode
{
$text = str_replace("<!-- bbcode-html-start -->","[html]",$text);
$text = str_replace("<!-- bbcode-html-end -->","[/html]",$text);
// $text = str_replace('<!-- pagebreak -->',"[newpage=]",$text);
if(substr($text,0,6)=='[html]')
{
@ -552,8 +554,11 @@ class e_bbcode
}
// Youtube conversion (TinyMce)
// return $text;
$text = preg_replace('/<img class="youtube-([\w]*)" style="([^"]*)" src="([^"]*)" alt="([^"]*)" \/>/i',"[youtube=$1]$4[/youtube]",$text);
$text = preg_replace('/<!-- Start YouTube-([\w,]*)-([\w]*) -->.*<!-- End YouTube -->/i','[youtube=$1]$2[/youtube]',$text);
$text = preg_replace('/<!-- Start YouTube-([\w,]*)-([\w]*) -->([^!]*)<!-- End YouTube -->/i','[youtube=$1]$2[/youtube]',$text);
$text = preg_replace("/<a.*?href=\"(.*?)?request.php\?file=([\d]*)\".*?>(.*?)<\/a>/i","[file=$2]$3[/file]",$text);
@ -587,6 +592,7 @@ class e_bbcode
// Mostly closing tags.
$convert = array(
array( "\n", '<br />'),
// array( "\n", '<p>'),
array( "\n[/list]", '</ul>'),
array( "[h=2]", '<h2 class="bbcode-center" style="text-align: center;">'), // e107 bbcode markup
array( "[h=2]", '<h2>'),

View File

@ -167,8 +167,10 @@ class faq
function __construct()
{
$sc = e107::getScBatch('faqs',TRUE);
$this->pref = e107::getPlugConfig('faqs')->getPref();
setScVar('faqs_shortcodes', 'pref', $this->pref);
$sc->pref = $this->pref;
// setScVar('faqs_shortcodes', 'pref', $this->pref);
}
function view_all() // new funtion to render all FAQs
@ -191,7 +193,6 @@ class faq
while ($rw = $sql->db_Fetch())
{
// setScVar('faqs_shortcodes', 'row', $rw);
$sc->setVars($rw);
if($rw['faq_info_order'] != $prevcat)
@ -239,11 +240,9 @@ class faq
while ($rw = $sql->db_Fetch())
{
// setScVar('faqs_shortcodes', 'var', $rw);
$sc->setVars($rw);
$text .= $tp->parseTemplate($FAQ_LIST_LOOP, true);
$caption = "&nbsp;Category: <b>".$rw['faq_info_title']."</b>";
}
$text .= $tp->parseTemplate($FAQ_LIST_END, true);
@ -285,7 +284,6 @@ class faq
while ($row = $sql->db_Fetch())
{
$sc->setVars($row);
// setScVar('faqs_shortcodes', 'row', $row);
if ($row['faq_info_parent'] == '0') //
{

View File

@ -17,9 +17,6 @@
*/
if (!defined('e107_INIT')) { exit; }
// register_shortcode('faqs_shortcodes', true);
// initShortcodeClass('faqs_shortcodes');
class faqs_shortcodes extends e_shortcode
{
// var $var;

View File

@ -76,9 +76,7 @@ if(isset($_GET['f']))
if($_GET['f'] != 'last') { $thread->init(); }
}
//e107::getScParser();
//require_once (e_PLUGIN . 'forum/forum_shortcodes.php');
//setScVar('forum_shortcodes', 'thread', $thread);
e107::getScBatch('view', 'forum')->setScVar('thread', $thread);
$pm_installed = plugInstalled('pm');
@ -96,7 +94,7 @@ define('MODERATOR', (USER && $forum->isModerator(USERID)));
e107::getScBatch('view', 'forum')->setScVar('forum', $forum);
//var_dump(e107::getScBatch('forum', 'forum'));
//setScVar('forum_shortcodes', 'forum', $forum);
if (MODERATOR && isset($_POST['mod']))
{
@ -259,7 +257,7 @@ foreach ($postList as $postInfo)
{
$_style = (isset($FORUMREPLYSTYLE_ALT) && $alt ? $FORUMREPLYSTYLE_ALT : $FORUMREPLYSTYLE);
}
// setScVar('forum_shortcodes', 'postInfo', $postInfo);
e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
$forrep .= $e107->tp->parseTemplate($_style, true, $forum_shortcodes) . "\n";
}

View File

@ -26,7 +26,6 @@ class plugin_forum_post_shortcodes extends e_shortcode
for($i = count($tmp); $i > 0; $i--)
{
$bach->setScVar('postInfo', $tmp[$i-1]);
//setScVar('forum_shortcodes', 'postInfo', $tmp[$i]);
$txt .= $this->e107->tp->parseTemplate($LATESTPOSTS_POST, true);
}
$txt .= $this->e107->tp->parseTemplate($LATESTPOSTS_END, true);

View File

@ -45,8 +45,9 @@ class tagwords
e107::includeLan(e_PLUGIN."tagwords/languages/".e_LANGUAGE.".php");
//shortcodes
require_once(e_PLUGIN.'tagwords/tagwords_shortcodes.php');
$this->shortcodes = $tagwords_shortcodes;
//require_once(e_PLUGIN.'tagwords/tagwords_shortcodes.php');
$this->shortcodes = e107::getScBatch('tagwords',TRUE);
//$this->shortcodes = $tagwords_shortcodes;
//template
if (is_readable(THEME."tagwords_template.php"))

View File

@ -31,11 +31,11 @@ foreach($tmp as $c)
}
}
*/
register_shortcode('tagwords_shortcodes', TRUE);
// register_shortcode('tagwords_shortcodes', TRUE);
initShortcodeClass('tagwords_shortcodes');
// initShortcodeClass('tagwords_shortcodes');
class tagwords_shortcodes
class tagwords_shortcodes extends e_shortcode
{
var $e107;