diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php
index 304638ba1..560cc7713 100644
--- a/e107_core/shortcodes/batch/comment_shortcodes.php
+++ b/e107_core/shortcodes/batch/comment_shortcodes.php
@@ -20,120 +20,125 @@ if (!defined('e107_INIT')) { exit; }
class comment_shortcodes extends e_shortcode
{
var $var;
-
- function sc_subject_input($parm='')
+
+ function sc_subject_input($parm = '')
{
$tp = e107::getParser();
$pref = e107::getPref();
-
+ $form = e107::getForm();
+
if(vartrue($pref['nested_comments']))
{
- return "";
+ $options = array(
+ 'class' => 'comment subject-input form-control',
+ 'placeholder' => COMLAN_324,
+ 'size' => 61,
+ );
+
+ $text = '
';
+ $text .= $form->text('subject', $tp->toForm($this->var['subject']), 100, $options);
+ $text .= '
';
+
+ return $text;
}
-
- return;
}
-
-
+
+
function sc_subject($parm='')
{
$tp = e107::getParser();
$pref = e107::getPref();
global $SUBJECT, $NEWIMAGE;
-
- if (vartrue($pref['nested_comments']))
+
+ if (vartrue($pref['nested_comments']))
{
- $SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $subject : $tp->toHTML($this->var['comment_subject'], TRUE));
+ $SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $SUBJECT : $tp->toHTML($this->var['comment_subject'], TRUE));
}
else
{
$SUBJECT = '';
}
-
+
return $SUBJECT;
-
+
}
-
-
+
+
function sc_username($parm='')
- {
+ {
global $USERNAME;
- if (isset($this->var['comment_author_id']) && $this->var['comment_author_id'])
+ if (isset($this->var['comment_author_id']) && $this->var['comment_author_id'])
{
- $USERNAME = $parm == 'raw' ? $this->var['comment_author_name'] : " $this->var['comment_author_id'], 'name' => $this->var['comment_author_name']))."'>".$this->var['comment_author_name']."\n";
+ $USERNAME = $parm == 'raw' ? $this->var['comment_author_name'] : " $this->var['comment_author_id'], 'name' => $this->var['comment_author_name']))."'>".$this->var['comment_author_name']."\n";
}
else
{
- $this->var['user_id'] = 0;
- $USERNAME = preg_replace("/[0-9]+\./", '', vartrue($this->var['comment_author_name']));
- $USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
+ $this->var['user_id'] = 0;
+ $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='')
+ {
if($parm == 'relative')
{
- return e107::getDate()->computeLapse($this->var['comment_datestamp'],time(),false, false, 'short');
+ return e107::getDate()->computeLapse($this->var['comment_datestamp'],time(),false, false, 'short');
}
-
+
return e107::getDate()->convert_date($this->var['comment_datestamp'], "short");
}
-
-
- function sc_reply($parm='')
+
+
+ function sc_reply($parm='')
{
global $REPLY, $action, $table, $id, $thisaction, $thistable, $thisid;
-
+
$pref = e107::getPref();
$REPLY = '';
if($this->var['comment_lock'] != "1" && $this->var['comment_blocked'] < 1)
{
- if ($thisaction == "comment" && $pref['nested_comments'])
+ if ($thisaction == "comment" && $pref['nested_comments'])
{
$REPLY = "";
}
}
return $REPLY;
}
-
-
-
- function sc_comment_avatar($parm='')
+
+
+ function sc_comment_avatar($parm = '')
{
- $tp = e107::getParser();
-
- // return $this->var['user_image'];
- // $url = $tp->thumbUrl($this->var['user_image']);
- // $text = $tp->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'],USERIMAGE)."}");
- // $text = $tp->parseTemplate("{USER_AVATAR=".$this->var['user_id']."}");
-
- $text = $tp->toAvatar($this->var);
-
- $text .= "
-
";
- $text .= "
".$this->sc_username()."
";
- // $text .= e107::getDate()-> // convert($this->var['user_lastvisit'],'short');
- $text .= $this->sc_joined()."
".$this->sc_comments()."
".$this->sc_rating().$this->sc_location;
-
- $text .= "
-
-
";
- return $text;
- }
-
-
-
-
- function sc_avatar($parm='')
+ $tp = e107::getParser();
+
+ // return $this->var['user_image'];
+ // $url = $tp->thumbUrl($this->var['user_image']);
+ // $text = $tp->parseTemplate("{USER_AVATAR=".vartrue($this->var['user_image'],USERIMAGE)."}");
+ // $text = $tp->parseTemplate("{USER_AVATAR=".$this->var['user_id']."}");
+
+ $text = $tp->toAvatar($this->var);
+
+ $text .= '';
+ $text .= '
';
+ $text .= '
' . $this->sc_username() . '
';
+ // $text .= e107::getDate()-> // convert($this->var['user_lastvisit'],'short');
+ $text .= $this->sc_joined() . '
' . $this->sc_comments() . '
' . $this->sc_rating() . $this->sc_location;
+ $text .= '';
+ $text .= '
';
+
+ return $text;
+ }
+
+
+ function sc_avatar($parm='')
{
- return $this->sc_comment_avatar($parm);
-
+ return $this->sc_comment_avatar($parm);
+
// --------- Legacy Code for reference
-
+
/*
global $AVATAR;
if (isset($this->var['user_id']) && $this->var['user_id']) {
@@ -150,18 +155,18 @@ class comment_shortcodes extends e_shortcode
return $this->var['user_image'];
*/
-
+
}
-
-
- function sc_comments($parm='')
+
+
+ function sc_comments($parm='')
{
global $COMMENTS;
return (isset($this->var['user_id']) && $this->var['user_id'] ? LAN_COMMENTS.": ".$this->var['user_comments'] : COMLAN_194)."
";
}
-
-
- function sc_joined($parm='')
+
+
+ function sc_joined($parm='')
{
global $JOINED, $gen;
$JOINED = '';
@@ -171,26 +176,27 @@ class comment_shortcodes extends e_shortcode
}
return $JOINED;
}
-
-
+
+
function sc_comment_itemid($parm='') // for ajax item id.
{
- return 'comment-'.intval($this->var['comment_id']);
+ return 'comment-'.intval($this->var['comment_id']);
}
-
+
+
function sc_comment_moderate($parm='')
{
if(!getperms('0') && !getperms("B"))
{
- return;
+ return;
}
-
+
// TODO put into a drop-down format.
$text = " ";
-
+
if($this->var['comment_blocked'] == 2) // pending approval.
{
- $text .= " ";
+ $text .= " ";
}
return $text;
/*
@@ -204,74 +210,102 @@ class comment_shortcodes extends e_shortcode
return $unblock.$block.$delete.$userinfo;
* */
}
-
-
-
- function sc_comment_button($parm='')
+
+
+ function sc_comment_button($parm = '')
{
$pref = e107::getPref('comments_sort');
-
+ $form = e107::getForm();
+
if($this->mode == 'edit')
{
- $value = (varset($this->var['eaction']) == "edit" ? COMLAN_320 : COMLAN_9);
- $pid = ($this->var['action'] == 'reply') ? $this->var['pid'] : 0;
-
- return "";
- }
-
+ $value = (varset($this->var['eaction']) == "edit" ? COMLAN_320 : COMLAN_9);
+ $pid = ($this->var['action'] == 'reply') ? $this->var['pid'] : 0;
+
+ $options = array(
+ 'class' => 'button btn btn-primary e-comment-submit pull-right',
+ 'data-pid' => $pid,
+ 'data-sort' => $pref,
+ 'data-target' => e_HTTP . 'comment.php',
+ );
+
+ return $form->submit($this->var['action'] . 'submit', $value, $options);
+ }
}
-
-
- function sc_author_input($parm='')
+
+
+ function sc_author_input($parm = '')
{
if($this->mode == 'edit')
{
- if (ANON == TRUE && USER == FALSE) // (anonymous comments - if allowed)
+ if(ANON == true && USER == false) // (anonymous comments - if allowed)
{
- $disabled = ($_SESSION['comment_author_name']) ? "disabled='disabled'" : ""; // prevent anon users changing names on the same session.
+ $form = e107::getForm();
- return "";
-
+ $options = array(
+ 'class' => 'comment author form-control',
+ 'placeholder' => COMLAN_16,
+ 'size' => 61,
+ );
+
+ // Prevent anon users changing names on the same session.
+ if(vartrue($_SESSION['comment_author_name']))
+ {
+ $options['disabled'] = 'disabled';
+ }
+
+ $text = '';
+ $text .= $form->text('author_name', $_SESSION['comment_author_name'], 100, $options);
+ $text .= '
';
+
+ return $text;
}
- }
+ }
}
-
-
+
+
function sc_comment_rate($parm='')
{
-
+
if($this->var['comment_blocked'] > 0 || $this->var['rating_enabled'] == false)
{
- return;
+ return;
}
-
+
$curVal = array(
'up' => $this->var['rate_up'],
'down' => $this->var['rate_down'],
'total' => $this->var['rate_votes']
);
-
+
return e107::getRate()->renderLike("comments",$this->var['comment_id'],$curVal);
}
-
-
- function sc_comment_input($parm='')
- {
+
+
+ function sc_comment_input($parm = '')
+ {
$options = array(
- 'class' => 'tbox input-xxlarge comment-input',
- 'placeholder' => "Leave a message..." // TODO Lan
+ 'class' => 'comment-input form-control',
+ 'placeholder' => COMLAN_403,
);
-
+
+ $text = '';
+
if($parm == 'bbcode')
{
- return e107::getForm()->bbarea('comment',$this->var['comval'],'comment','comment-'.$this->var['itemid'],'large',$options);
+ $text .= e107::getForm()->bbarea('comment', $this->var['comval'], 'comment', 'comment-' . $this->var['itemid'], 'large', $options);
}
else
{
- return e107::getForm()->textarea('comment',$this->var['comval'], 3, 80,$options);
- }
- }
-
+ $text .= e107::getForm()->textarea('comment', $this->var['comval'], 3, 80, $options);
+ }
+
+ $text .= '
';
+
+ return $text;
+ }
+
+
/*
function sc_user_avatar($parm='')
{
@@ -280,49 +314,51 @@ class comment_shortcodes extends e_shortcode
return $this->sc_comment_avatar($parm);
}
*/
-
- function sc_comment($parm='')
+
+
+ function sc_comment($parm='')
{
// global $COMMENT, $pref;
$tp = e107::getParser();
if($this->var['comment_blocked'] == 1)
{
- return COMLAN_0;
+ return COMLAN_0;
}
-
- return $tp->toHTML($this->var['comment_comment'], TRUE, FALSE, $this->var['user_id']);
+
+ return $tp->toHTML($this->var['comment_comment'], TRUE, FALSE, $this->var['user_id']);
}
-
+
+
function sc_comment_status($parm='')
{
switch ($this->var['comment_blocked'])
{
case 2:
- $text = "Pending Approval"; // TODO LAN
- break;
-
+ $text = COMLAN_331;
+ break;
+
case 1:
$text = COMLAN_0;
- break;
-
+ break;
+
default:
return;
- break;
+ break;
}
-
+
return "";
- }
-
-
-
- function sc_commentedit($parm='')
+ }
+
+
+
+ function sc_commentedit($parm='')
{
global $COMMENTEDIT, $comment_edit_query;
$pref = e107::getPref();
-
+
if ($pref['allowCommentEdit'] && USER && $this->var['user_id'] == USERID && ($this->var['comment_lock'] < 1))
{
- $adop_icon = (file_exists(THEME."images/commentedit.png") ? "
" : "Edit");
+ $adop_icon = (file_exists(THEME."images/commentedit.png") ? "
" : "Edit");
//Searching for '.' is BAD!!! It breaks mod rewritten requests. Why is this needed at all?
if (strstr(e_QUERY, "&"))
{
@@ -330,7 +366,7 @@ class comment_shortcodes extends e_shortcode
}
else
{
- // return "
";
+ // return "
";
return "";
}
}
@@ -339,72 +375,68 @@ class comment_shortcodes extends e_shortcode
return "";
}
}
-
-
- function sc_rating($parm='')
+
+
+ function sc_rating($parm='')
{
global $RATING;
return $RATING;
}
-
-
- function sc_ipaddress($parm='')
+
+
+ function sc_ipaddress($parm='')
{
global $IPADDRESS, $e107;
//require_once(e_HANDLER."encrypt_handler.php");
return (ADMIN ? "".COMLAN_330." ".e107::getIPHandler()->ipDecode($this->var['comment_ip'])."" : "");
}
-
-
- function sc_level($parm='')
+
+
+ function sc_level($parm='')
{
global $LEVEL, $pref;
//FIXME - new level handler, currently commented to avoid parse errors
//$ldata = get_level($this->var['user_id'], $this->var['user_forums'], $this->var['user_comments'], $this->var['user_chats'], $this->var['user_visits'], $this->var['user_join'], $this->var['user_admin'], $this->var['user_perms'], $pref);
- return ($this->var['user_admin'] ? $ldata[0] : $ldata[1]);
+ return ($this->var['user_admin'] ? vartrue($ldata[0]) : vartrue($ldata[1]));
}
-
-
- function sc_location($parm='')
+
+
+ function sc_location($parm='')
{
global $LOCATION;
$tp = e107::getParser();
return (isset($this->var['user_location']) && $this->var['user_location'] ? COMLAN_313.": ".$tp->toHTML($this->var['user_location'], TRUE) : '');
}
-
-
- function sc_signature($parm='')
+
+
+ function sc_signature($parm='')
{
global $SIGNATURE;
$tp = e107::getParser();
$SIGNATURE = (isset($this->var['user_signature']) && $this->var['user_signature'] ? $tp->toHTML($this->var['user_signature'], true) : '');
return $SIGNATURE;
- }
-
+ }
+
+
function sc_comment_share($parm='')
{
if(!$xup = e107::getUser()->getProviderName())
{
return;
}
-
+
list($prov,$id) = explode("_",$xup);
$prov = strtolower($prov);
-
+
if($prov == 'facebook' || $prov == 'twitter')
{
//TODO Move styling to e107.css
$text = "
";
$text .= e107::getForm()->checkbox('comment_share',$prov,true);
-
- $text .= "Share";
- return $text;
- }
+
+ $text .= "Share";
+ return $text;
+ }
}
-
-
-
+
}
-
-
-?>
\ No newline at end of file
diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php
index 8be8f88f8..175509b7b 100644
--- a/e107_core/shortcodes/batch/news_shortcodes.php
+++ b/e107_core/shortcodes/batch/news_shortcodes.php
@@ -844,7 +844,7 @@ class news_shortcodes extends e_shortcode
}
else
{
- return "None";
+ return LAN_NONE;
}
}
diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php
index d94a68dfd..6a47c87a2 100644
--- a/e107_core/shortcodes/batch/user_shortcodes.php
+++ b/e107_core/shortcodes/batch/user_shortcodes.php
@@ -211,7 +211,7 @@ class user_shortcodes extends e_shortcode
function sc_user_daysregged($parm)
{
- return e107::getDate()->computeLapse($this->var['user_join'])." ".LAN_USER_34;
+ return e107::getDate()->computeLapse($this->var['user_join']);
}
diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php
index c4d554242..6a15564f5 100644
--- a/e107_handlers/date_handler.php
+++ b/e107_handlers/date_handler.php
@@ -620,7 +620,7 @@ class convert
}
if($format == 'short' && count($outputArray) == 1) { break; }
}
- return ($mode ? $outputArray : implode(", ", $outputArray) . " ago"); //XXX LAN
+ return ($mode ? $outputArray : implode(", ", $outputArray) . " " . LANDT_AGO);
}
diff --git a/e107_languages/English/lan_comment.php b/e107_languages/English/lan_comment.php
index 6fe2b27c9..17182be0c 100644
--- a/e107_languages/English/lan_comment.php
+++ b/e107_languages/English/lan_comment.php
@@ -67,6 +67,8 @@ define("COMLAN_400", "approved");
define("COMLAN_401", "blocked");
define("COMLAN_402", "pending");
+define("COMLAN_403", "Leave a message...");
+define("COMLAN_404", "Approve");
define("COMLAN_TYPE_1", "news");
define("COMLAN_TYPE_2", "download");