diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php
index dd2db5e43..033093973 100644
--- a/e107_handlers/shortcode_handler.php
+++ b/e107_handlers/shortcode_handler.php
@@ -426,14 +426,11 @@ class e_parse_shortcode
}
elseif(E107_DBG_BBSC || E107_DBG_SC)
{
- echo "
Couldn't Find Class '".$className."' in ".$path."
";
+ // echo "Couldn't Find Class '".$className."' in ".$path."
";
+ echo "Couldn't Load: ".$path." with class-name: {$className} and pluginName {$pluginName}
";
}
}
- elseif(E107_DBG_BBSC || E107_DBG_SC)
- {
- echo "Couldn't Load: ".$path." with class-name: {$className} and pluginName {$pluginName}
";
-
- }
+
// TODO - throw exception?
return null;
diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php
index 2c6d59662..8c048e5b1 100644
--- a/e107_plugins/forum/forum_post.php
+++ b/e107_plugins/forum/forum_post.php
@@ -353,6 +353,7 @@ class forum_post_handler
*/
function getTemplate($type = 'post')
{
+ $pref = e107::pref('core');
global $FORUMPOST, $subjectbox, $userbox, $poll_form, $fileattach, $fileattach_alert; // needed for BC.
@@ -380,9 +381,217 @@ class forum_post_handler
}
}
+ // ----------------- Legacy -------------------------
+
+ if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); }
+
+ if(empty($userbox))
+ {
+ $userbox = "
+
+
+
";
+ }
+
+ if(empty($subjectbox))
+ {
+ $subjectbox = "
+
+
+
";
+ }
+
+ if(empty($fileattach))
+ {
+ $fileattach = "
+
+ ".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)." |
+
+
+
+
+
+ ";
+
+ }
+ // If the upload directory is not writable, we need to alert the user about this.
+ if(empty($fileattach_alert))
+ {
+ $fileattach_alert = "
+
+ ".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)." |
+
+
+
+
\n";
+ }
+ // ------------
+
+ if(empty($FORUMPOST))
+ {
+ $FORUMPOST = "
+
+
+ {FORMSTART}
+
+
+ {BACKLINK}
+ |
+
+ {USERBOX}
+ {SUBJECTBOX}
+
+
+
+
+ {POLL}
+ {FILEATTACH}
+
+
+
+
+
+ {FORMEND}
+
+
+
+ ";
+ }
+
+ if(empty($FORUMPOST_REPLY))
+ {
+ $FORUMPOST_REPLY = "
+
+
+ {FORMSTART}
+
+
+ {BACKLINK}
+ |
+
+ {USERBOX}
+ {SUBJECTBOX}
+
+
+
+
+
+ {POLL}
+
+ {FILEATTACH}
+
+
+
+
+
+ {FORMEND}
+
+
+
+
+ {THREADTOPIC}
+ {LATESTPOSTS}
+
+ ";
+ }
+
+ if(empty($LATESTPOSTS_START))
+ {
+ $LATESTPOSTS_START = "
+
+
+ ".str_replace('[y]', "{LATESTPOSTSCOUNT}", LAN_FORUM_3022)." |
+
";
+ }
+
+ if(empty($LATESTPOSTS_POST))
+ {
+ $LATESTPOSTS_POST = "
+
+
+
+
+ ";
+ }
+
+ if(empty($LATESTPOSTS_END))
+ {
+ $LATESTPOSTS_END = "
+
+ ";
+ }
+
+ if(empty($THREADTOPIC_REPLY))
+ {
+ $THREADTOPIC_REPLY = "
+
+
+ ".LAN_FORUM_1003." |
+
+
+
+
+
+
+ ";
+ }
+
+
+ // -------------------------------- End Legacy Code ----------------------------------//
+
+
+
+
+
if($type == 'post')
{
- return (deftrue('BOOTSTRAP')) ? $FORUM_POST_TEMPLATE : array('form'=>$FORUMPOST);
+ $template= (deftrue('BOOTSTRAP')) ? $FORUM_POST_TEMPLATE : array('form'=>$FORUMPOST);
+ // print_a($template);
+ return $this->upgradeTemplate($template);
}
else
{
@@ -408,6 +617,39 @@ class forum_post_handler
}
+ private function upgradeTemplate($template)
+ {
+ $arr = array(
+ 'POSTOPTIONS' => "FORUM_POST_OPTIONS",
+ 'POSTOPTIONS_LABEL' => "FORUM_POST_OPTIONS_LABEL",
+ 'POLL' => 'FORUM_POST_POLL',
+ 'FORUM_AUTHOR' => 'FORUM_POST_AUTHOR',
+ 'FORUM_SUBJECT' => 'FORUM_POST_SUBJECT',
+ 'BUTTONS' => 'FORUM_POST_BUTTONS',
+ 'FORMSTART' => 'FORUM_POST_FORM_START',
+ 'FORMEND' => 'FORUM_POST_FORM_END',
+ 'POSTBOX' => 'FORUM_POST_TEXTAREA',
+ 'EMAILNOTIFY' => 'FORUM_POST_EMAIL_NOTIFY',
+ 'BACKLINK' => 'FORUM_POST_BREADCRUMB',
+ 'POSTTYPE' => 'FORUM_POST_TEXTAREA_LABEL'
+ );
+
+ foreach($arr as $old => $new)
+ {
+ //$template = str_replace("{".$old."}", "{".$new."}", $template);
+ $reg = '/\{'.$old.'((?:=|:)?[^\}]*)\}/'; // handle variations.
+ $repl = '{'.$new.'$1}';
+ $template = preg_replace($reg,$repl, $template);
+
+ }
+
+ // print_a($template);
+
+ return $template;
+
+ }
+
+
function renderFormMove()
{
if(!deftrue('MODERATOR'))
diff --git a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php
index bfe6dfa0b..91df5147a 100644
--- a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php
+++ b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php
@@ -18,7 +18,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
$this->e107 = e107::getInstance();
}
- function sc_latestposts($parm)
+ function sc_latestposts($parm) //TODO move elsewhere?
{
$parm = ($parm ? $parm : 10);
global $LATESTPOSTS_START, $LATESTPOSTS_END, $LATESTPOSTS_POST;
@@ -48,12 +48,12 @@ class plugin_forum_post_shortcodes extends e_shortcode
return e107::getParser()->parseTemplate($THREADTOPIC_REPLY, true);
}
- function sc_formstart()
+ function sc_forum_post_form_start()
{
return "