From a0743652def42f0dce5c0bf0e78d1b8f3e946684 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 20 Jun 2012 01:12:33 +0000 Subject: [PATCH] More batch-shortcode cleanup. --- contact.php | 6 +- .../shortcodes/batch/comment_shortcodes.php | 54 +++---- .../shortcodes/batch/contact_shortcodes.php | 147 ++++++++++++------ .../shortcodes/batch/user_shortcodes.php | 84 +++++----- e107_files/jslib/core/front.jquery.js | 7 +- e107_handlers/form_handler.php | 9 +- e107_handlers/userclass_class.php | 35 +++-- e107_themes/templates/contact_template.php | 10 +- e107_web/css/e107.css | 9 +- 9 files changed, 228 insertions(+), 133 deletions(-) diff --git a/contact.php b/contact.php index f40ced53c..a3437b9e8 100644 --- a/contact.php +++ b/contact.php @@ -44,7 +44,8 @@ if (!$CONTACT_FORM) { } } -if(isset($_POST['send-contactus'])){ +if(isset($_POST['send-contactus'])) +{ $error = ""; @@ -163,7 +164,8 @@ if(SITECONTACTINFO && $CONTACT_INFO) if(isset($pref['sitecontacts']) && $pref['sitecontacts'] != 255) { - require_once(e_CORE."shortcodes/batch/contact_shortcodes.php"); + // require_once(e_CORE."shortcodes/batch/contact_shortcodes.php"); + $contact_shortcodes = e107::getScBatch('contact'); $text = $tp->parseTemplate($CONTACT_FORM, TRUE, $contact_shortcodes); if(trim($text) != "") diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php index 6b9516d8a..9714889b8 100644 --- a/e107_core/shortcodes/batch/comment_shortcodes.php +++ b/e107_core/shortcodes/batch/comment_shortcodes.php @@ -21,7 +21,7 @@ class comment_shortcodes extends e_shortcode { var $var; - function sc_subject_input($parm) + function sc_subject_input($parm='') { $tp = e107::getParser(); $pref = e107::getPref(); @@ -35,7 +35,7 @@ class comment_shortcodes extends e_shortcode } - function sc_subject($parm) + function sc_subject($parm='') { $tp = e107::getParser(); $pref = e107::getPref(); @@ -56,7 +56,7 @@ class comment_shortcodes extends e_shortcode } - function sc_username($parm) + function sc_username($parm='') { global $USERNAME; if (isset($this->var['user_id']) && $this->var['user_id']) @@ -66,14 +66,14 @@ class comment_shortcodes extends e_shortcode else { $this->var['user_id'] = 0; - $USERNAME = preg_replace("/[0-9]+\./", '', $this->var['comment_author_name']); + $USERNAME = preg_replace("/[0-9]+\./", '', vartrue($this->var['comment_author_name'])); $USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME); } return $USERNAME; } - function sc_timedate($parm) + function sc_timedate($parm='') { global $TIMEDATE, $datestamp, $gen; $datestamp = $gen->convert_date($this->var['comment_datestamp'], "short"); @@ -81,7 +81,7 @@ class comment_shortcodes extends e_shortcode } - function sc_reply($parm) + function sc_reply($parm='') { global $REPLY, $action, $table, $id, $thisaction, $thistable, $thisid; @@ -99,14 +99,14 @@ class comment_shortcodes extends e_shortcode - function sc_comment_avatar($parm) + function sc_comment_avatar($parm='') { $tp = e107::getParser(); // - $text = $tp->parseTemplate("{USER_AVATAR=".$this->var['user_image']."}"); - $text .= "
+ $text = $tp->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'])."}"); + $text .= "