mirror of
https://github.com/e107inc/e107.git
synced 2025-07-09 17:16:20 +02:00
More shortcode cleanup.
This commit is contained in:
@ -533,7 +533,7 @@ class e_bbcode
|
|||||||
'size' => $helpsize
|
'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>";
|
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-start -->","[html]",$text);
|
||||||
$text = str_replace("<!-- bbcode-html-end -->","[/html]",$text);
|
$text = str_replace("<!-- bbcode-html-end -->","[/html]",$text);
|
||||||
|
// $text = str_replace('<!-- pagebreak -->',"[newpage=]",$text);
|
||||||
|
|
||||||
|
|
||||||
if(substr($text,0,6)=='[html]')
|
if(substr($text,0,6)=='[html]')
|
||||||
{
|
{
|
||||||
@ -552,8 +554,11 @@ class e_bbcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Youtube conversion (TinyMce)
|
// Youtube conversion (TinyMce)
|
||||||
|
|
||||||
|
// return $text;
|
||||||
|
|
||||||
$text = preg_replace('/<img class="youtube-([\w]*)" style="([^"]*)" src="([^"]*)" alt="([^"]*)" \/>/i',"[youtube=$1]$4[/youtube]",$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);
|
$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.
|
// Mostly closing tags.
|
||||||
$convert = array(
|
$convert = array(
|
||||||
array( "\n", '<br />'),
|
array( "\n", '<br />'),
|
||||||
|
// array( "\n", '<p>'),
|
||||||
array( "\n[/list]", '</ul>'),
|
array( "\n[/list]", '</ul>'),
|
||||||
array( "[h=2]", '<h2 class="bbcode-center" style="text-align: center;">'), // e107 bbcode markup
|
array( "[h=2]", '<h2 class="bbcode-center" style="text-align: center;">'), // e107 bbcode markup
|
||||||
array( "[h=2]", '<h2>'),
|
array( "[h=2]", '<h2>'),
|
||||||
|
@ -167,8 +167,10 @@ class faq
|
|||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
$sc = e107::getScBatch('faqs',TRUE);
|
||||||
$this->pref = e107::getPlugConfig('faqs')->getPref();
|
$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
|
function view_all() // new funtion to render all FAQs
|
||||||
@ -191,7 +193,6 @@ class faq
|
|||||||
|
|
||||||
while ($rw = $sql->db_Fetch())
|
while ($rw = $sql->db_Fetch())
|
||||||
{
|
{
|
||||||
// setScVar('faqs_shortcodes', 'row', $rw);
|
|
||||||
$sc->setVars($rw);
|
$sc->setVars($rw);
|
||||||
|
|
||||||
if($rw['faq_info_order'] != $prevcat)
|
if($rw['faq_info_order'] != $prevcat)
|
||||||
@ -239,11 +240,9 @@ class faq
|
|||||||
|
|
||||||
while ($rw = $sql->db_Fetch())
|
while ($rw = $sql->db_Fetch())
|
||||||
{
|
{
|
||||||
// setScVar('faqs_shortcodes', 'var', $rw);
|
|
||||||
$sc->setVars($rw);
|
$sc->setVars($rw);
|
||||||
$text .= $tp->parseTemplate($FAQ_LIST_LOOP, true);
|
$text .= $tp->parseTemplate($FAQ_LIST_LOOP, true);
|
||||||
$caption = " Category: <b>".$rw['faq_info_title']."</b>";
|
$caption = " Category: <b>".$rw['faq_info_title']."</b>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= $tp->parseTemplate($FAQ_LIST_END, true);
|
$text .= $tp->parseTemplate($FAQ_LIST_END, true);
|
||||||
@ -285,7 +284,6 @@ class faq
|
|||||||
while ($row = $sql->db_Fetch())
|
while ($row = $sql->db_Fetch())
|
||||||
{
|
{
|
||||||
$sc->setVars($row);
|
$sc->setVars($row);
|
||||||
// setScVar('faqs_shortcodes', 'row', $row);
|
|
||||||
|
|
||||||
if ($row['faq_info_parent'] == '0') //
|
if ($row['faq_info_parent'] == '0') //
|
||||||
{
|
{
|
||||||
|
@ -17,9 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
// register_shortcode('faqs_shortcodes', true);
|
|
||||||
// initShortcodeClass('faqs_shortcodes');
|
|
||||||
|
|
||||||
class faqs_shortcodes extends e_shortcode
|
class faqs_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
// var $var;
|
// var $var;
|
||||||
|
@ -76,9 +76,7 @@ if(isset($_GET['f']))
|
|||||||
if($_GET['f'] != 'last') { $thread->init(); }
|
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);
|
e107::getScBatch('view', 'forum')->setScVar('thread', $thread);
|
||||||
|
|
||||||
$pm_installed = plugInstalled('pm');
|
$pm_installed = plugInstalled('pm');
|
||||||
@ -96,7 +94,7 @@ define('MODERATOR', (USER && $forum->isModerator(USERID)));
|
|||||||
e107::getScBatch('view', 'forum')->setScVar('forum', $forum);
|
e107::getScBatch('view', 'forum')->setScVar('forum', $forum);
|
||||||
//var_dump(e107::getScBatch('forum', 'forum'));
|
//var_dump(e107::getScBatch('forum', 'forum'));
|
||||||
|
|
||||||
//setScVar('forum_shortcodes', 'forum', $forum);
|
|
||||||
|
|
||||||
if (MODERATOR && isset($_POST['mod']))
|
if (MODERATOR && isset($_POST['mod']))
|
||||||
{
|
{
|
||||||
@ -259,7 +257,7 @@ foreach ($postList as $postInfo)
|
|||||||
{
|
{
|
||||||
$_style = (isset($FORUMREPLYSTYLE_ALT) && $alt ? $FORUMREPLYSTYLE_ALT : $FORUMREPLYSTYLE);
|
$_style = (isset($FORUMREPLYSTYLE_ALT) && $alt ? $FORUMREPLYSTYLE_ALT : $FORUMREPLYSTYLE);
|
||||||
}
|
}
|
||||||
// setScVar('forum_shortcodes', 'postInfo', $postInfo);
|
|
||||||
e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
|
e107::getScBatch('view', 'forum')->setScVar('postInfo', $postInfo);
|
||||||
$forrep .= $e107->tp->parseTemplate($_style, true, $forum_shortcodes) . "\n";
|
$forrep .= $e107->tp->parseTemplate($_style, true, $forum_shortcodes) . "\n";
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
|||||||
for($i = count($tmp); $i > 0; $i--)
|
for($i = count($tmp); $i > 0; $i--)
|
||||||
{
|
{
|
||||||
$bach->setScVar('postInfo', $tmp[$i-1]);
|
$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_POST, true);
|
||||||
}
|
}
|
||||||
$txt .= $this->e107->tp->parseTemplate($LATESTPOSTS_END, true);
|
$txt .= $this->e107->tp->parseTemplate($LATESTPOSTS_END, true);
|
||||||
|
@ -45,8 +45,9 @@ class tagwords
|
|||||||
e107::includeLan(e_PLUGIN."tagwords/languages/".e_LANGUAGE.".php");
|
e107::includeLan(e_PLUGIN."tagwords/languages/".e_LANGUAGE.".php");
|
||||||
|
|
||||||
//shortcodes
|
//shortcodes
|
||||||
require_once(e_PLUGIN.'tagwords/tagwords_shortcodes.php');
|
//require_once(e_PLUGIN.'tagwords/tagwords_shortcodes.php');
|
||||||
$this->shortcodes = $tagwords_shortcodes;
|
$this->shortcodes = e107::getScBatch('tagwords',TRUE);
|
||||||
|
//$this->shortcodes = $tagwords_shortcodes;
|
||||||
|
|
||||||
//template
|
//template
|
||||||
if (is_readable(THEME."tagwords_template.php"))
|
if (is_readable(THEME."tagwords_template.php"))
|
||||||
|
@ -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;
|
var $e107;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user