diff --git a/e107_admin/image.php b/e107_admin/image.php
index 28fb58513..345993d33 100644
--- a/e107_admin/image.php
+++ b/e107_admin/image.php
@@ -1612,16 +1612,15 @@ function show_avatars()
$tp = e107::getParser();
$mes = e107::getMessage();
- $handle = opendir(e_UPLOAD."avatars/"); //TODO replace with $fl
+
+ $avFiles = e107::getFile()->get_files(e_MEDIA."avatars/",".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
+
$dirlist = array();
- while ($file = readdir($handle))
+
+ foreach($avFiles as $f)
{
- if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db' && !is_dir($file))
- {
- $dirlist[] = $file;
- }
+ $dirlist[] = $f['fname'];
}
- closedir($handle);
$text = '';
@@ -1655,10 +1654,10 @@ function show_avatars()
}
//directory?
- if(is_dir(e_UPLOADE."avatars/".$image_name))
+ if(is_dir(e_MEDIA."avatars/".$image_name))
{
//File info
- $users = "
".IMALAN_69."";
+ $users = "
".IMALAN_69."";
//Friendly UI - click text to select a form element
$img_src = ''.IMALAN_70.'';
@@ -1667,16 +1666,18 @@ function show_avatars()
else
{
//File info
- $users = "
".$users;
+ // $users = "
".$users;
// Control over the image size (design)
- $image_size = getimagesize(e_UPLOAD."avatars/".$image_name);
+ $image_size = getimagesize(e_MEDIA."avatars/".$image_name);
//Friendly UI - click text to select a form element
- $img_src = "";
+ $img_src = "";
if ($image_size[0] > $pref['im_width'] || $image_size[1] > $pref['im_height'])
{
- $img_src = "".IMALAN_57."";
+ $img_src = "".IMALAN_57."";
}
}
diff --git a/e107_admin/users.php b/e107_admin/users.php
index ae83063f7..6579cc5a1 100644
--- a/e107_admin/users.php
+++ b/e107_admin/users.php
@@ -185,6 +185,7 @@ if (isset ($_POST['test_mail']))
// ------- Update Options. --------------
if (isset ($_POST['update_options']))
{
+ $mes = e107::getMessage();
$temp = array();
$temp['avatar_upload'] = (FILE_UPLOADS ? $_POST['avatar_upload'] : 0);
$temp['im_width'] = $_POST['im_width'];
diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php
index d1c205749..51c1e54e6 100644
--- a/e107_core/shortcodes/batch/comment_shortcodes.php
+++ b/e107_core/shortcodes/batch/comment_shortcodes.php
@@ -15,8 +15,199 @@
*/
if (!defined('e107_INIT')) { exit; }
-include_once(e_HANDLER.'shortcode_handler.php');
-$comment_shortcodes = e107::getScParser()->parse_scbatch(__FILE__);
+//include_once(e_HANDLER.'shortcode_handler.php');
+//$comment_shortcodes = e107::getScParser()->parse_scbatch(__FILE__);
+
+
+class comment_shortcodes extends e_shortcode
+{
+ var $var;
+
+ function sc_subject($parm)
+ {
+
+ global $SUBJECT, $comrow, $pref, $NEWIMAGE, $tp;
+ if (isset($pref['nested_comments']) && $pref['nested_comments']) {
+ $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['user_id']) && $this->var['user_id'])
+ {
+ $USERNAME = $parm == 'raw' ? $this->var['user_name'] : " $this->var['user_id'], 'name' => $this->var['user_name']))."'>".$this->var['user_name']."\n";
+ }
+ else
+ {
+ $this->var['user_id'] = 0;
+ $USERNAME = preg_replace("/[0-9]+\./", '', $this->var['comment_author_name']);
+ $USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
+ }
+ return $USERNAME;
+ }
+
+
+ function sc_TIMEDATE($parm)
+ {
+ global $TIMEDATE, $datestamp, $gen;
+ $datestamp = $gen->convert_date($this->var['comment_datestamp'], "short");
+ return $datestamp;
+ }
+
+ function sc_reply($parm)
+ {
+ global $REPLY, $action, $pref, $table, $id, $thisaction, $thistable, $thisid;
+ $REPLY = '';
+ if($this->var['comment_lock'] != "1"){
+ if ($thisaction == "comment" && $pref['nested_comments']) {
+ $REPLY = "".COMLAN_326."";
+ }
+ }
+ return $REPLY;
+ }
+
+
+ function sc_comment_avatar($parm)
+ {
+ $height = e107::getPref("im_height");
+ $width = e107::getPref("im_width");
+ $tp = e107::getParser();
+
+ if (vartrue($this->var['user_id']))
+ {
+ if (vartrue($this->var['user_image']))
+ {
+ $img = $tp->thumbUrl(e_MEDIA."avatars/".$this->var['user_image'],"aw=".$width."&ah=".$height);
+ $text = "
";
+ }
+ else
+ {
+ $img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","aw=".$width."&ah=".$height);
+ $text = "";
+ }
+ }
+ else
+ {
+ $img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","aw=".$width."&ah=".$height);
+ $text = "";
+ }
+
+ return $text;
+ }
+
+
+
+
+ function sc_avatar($parm)
+ {
+
+
+
+ // --------- Legacy Code below for those who still want to use it.
+
+ global $AVATAR;
+ if (isset($this->var['user_id']) && $this->var['user_id']) {
+ if (isset($this->var['user_image']) && $this->var['user_image']) {
+ // require_once(e_HANDLER."avatar_handler.php");
+ // $this->var['user_image'] = avatar($this->var['user_image']);
+ $this->var['user_image'] = "
";
+ }else{
+ $this->var['user_image'] = '';
+ }
+ }else{
+ $this->var['user_image'] = '';
+ }
+ return $this->var['user_image'];
+ }
+
+ function sc_comments($parm)
+ {
+ global $COMMENTS;
+ return (isset($this->var['user_id']) && $this->var['user_id'] ? COMLAN_99.": ".$this->var['user_comments'] : COMLAN_194)."
";
+ }
+
+ function sc_joined($parm)
+ {
+ global $JOINED, $gen;
+ $JOINED = '';
+ if ($this->var['user_id'] && !$this->var['user_admin']) {
+ $this->var['user_join'] = $gen->convert_date($this->var['user_join'], "short");
+ $JOINED = ($this->var['user_join'] ? COMLAN_145." ".$this->var['user_join'] : '');
+ }
+ return $JOINED;
+ }
+
+ function sc_comment($parm)
+ {
+ global $COMMENT, $pref;
+ $tp = e107::getParser();
+ return (isset($this->var['comment_blocked']) && $this->var['comment_blocked'] ? COMLAN_0 : $tp->toHTML($this->var['comment_comment'], TRUE, FALSE, $this->var['user_id']));
+ }
+
+ function sc_commentedit($parm)
+ {
+ global $COMMENTEDIT, $pref, $comment_edit_query;
+ if ($pref['allowCommentEdit'] && USER && $this->var['user_id'] == USERID && $this->var['comment_lock'] != "1")
+ {
+ $adop_icon = (file_exists(THEME."images/commentedit.png") ? THEME_ABS."images/commentedit.png" : e_IMAGE_ABS."admin_images/edit_16.png");
+ //Searching for '.' is BAD!!! It breaks mod rewritten requests. Why is this needed at all?
+ if (strstr(e_QUERY, "&"))
+ {
+ return "
";
+ }
+ else
+ {
+ // return "
";
+ return "
";
+ }
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ function sc_rating($parm)
+ {
+ global $RATING;
+ return $RATING;
+ }
+
+ 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)
+ {
+ 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]);
+ }
+
+ 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)
+ {
+ global $SIGNATURE;
+ $tp = e107::getParser();
+ $SIGNATURE = (isset($this->var['user_signature']) && $this->var['user_signature'] ? $tp->toHTML($this->var['user_signature'], true) : '');
+ return $SIGNATURE;
+ }
+}
/*
SC_BEGIN SUBJECT
diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php
index 1e8c1e58d..39b1f2db1 100755
--- a/e107_core/shortcodes/batch/usersettings_shortcodes.php
+++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php
@@ -161,7 +161,7 @@ $ret = "
";
$avatarlist[0] = "";
-$handle = opendir(e_IMAGE."avatars/");
+$handle = opendir(e_MEDIA."avatars/");
while ($file = readdir($handle))
{
if ($file != "." && $file != ".." && $file != "index.html" && $file != "CVS")
@@ -173,7 +173,7 @@ closedir($handle);
for($c = 1; $c <= (count($avatarlist)-1); $c++)
{
- $ret .= "

";
+ $ret .= "

";
}
$ret .= "
diff --git a/e107_files/jslib/core/front.jquery.js b/e107_files/jslib/core/front.jquery.js
new file mode 100644
index 000000000..0b82f8e8e
--- /dev/null
+++ b/e107_files/jslib/core/front.jquery.js
@@ -0,0 +1,8 @@
+
+
+$(document).ready(function()
+{
+ $(":input").tipsy({gravity: 'w',fade: true});
+
+
+});
\ No newline at end of file
diff --git a/e107_handlers/bbcode_handler.php b/e107_handlers/bbcode_handler.php
index 8f949ca81..0f9b49acf 100644
--- a/e107_handlers/bbcode_handler.php
+++ b/e107_handlers/bbcode_handler.php
@@ -475,7 +475,7 @@ class e_bbcode
$temp['mailout'] = $BBCODE_TEMPLATE_MAILOUT;
$temp['page'] = $BBCODE_TEMPLATE_CPAGE;
$temp['maintenance']= $BBCODE_TEMPLATE_ADMIN;
- $temp['comment'] = $BBCODE_TEMPLATE;
+ $temp['comment'] = $BBCODE_TEMPLATE_COMMENT;
$temp['signature'] = $BBCODE_TEMPLATE_SIGNATURE;
if(isset($temp[$template]))
@@ -529,7 +529,7 @@ class e_bbcode
array( "[block]", '
'),
array( "[/block]", '
'),
array( "[table]\n", '
'),
- array( "[/table]", '
'),
+ array( "[/table]\n", ''),
array( "[table]\n", '
'),
array( "[tbody]\n", ''),
array( "[tr]", ''),
@@ -537,10 +537,15 @@ class e_bbcode
array( "[tbody]\n", '
'),
array( "[/tbody]\n", ''),
+ array( "[code]\n", ''),
+ array( "[/code]\n", '
'),
array( "[tr]", ''),
array( "\n[/tr]\n", '
'),
array( "\n\t[td]", ''),
- array( "[/td]", ' | '),
+ array( "[/td]", ''),
+ array( "[blockquote]", ''),
+ array( "[blockquote]", ''),
+ array( "[/blockquote]",'
'),
);
foreach($convert as $arr)
@@ -554,11 +559,13 @@ class e_bbcode
$text = preg_replace('/([\s\S]*)<\/div>/i',"[$1]$2[/$1]",$text); // left / right / center
$text = preg_replace('/
![]()
/i',"[img style=width:$4px;height:$5px;$1]$2[/img]",$text );
$text = preg_replace('/
![]()
/i',"[img style=width:$4px;height:$5px;$1]$2[/img]",$text );
- $text = preg_replace('/
(.*?)<\/span>/i',"[color=$1]$2[/color]",$text);
+ // $text = preg_replace('/(.*?)<\/span>/i',"[color=$1]$2[/color]",$text);
$text = preg_replace('/(.*?)<\/span>/i',"[u]$1[/u]",$text);
// $text = preg_replace('//i', "[table $1]",$text);
$text = preg_replace('//i', "[table style=$1]\n",$text);
$text = preg_replace('//i', "[tbody]\n",$text);
+ $text = preg_replace('//i', "[code]\n",$text);
+
$blank = array('','width:px;height:px;');
diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php
index fd39e415e..4f8ce7144 100644
--- a/e107_handlers/comment_class.php
+++ b/e107_handlers/comment_class.php
@@ -41,6 +41,28 @@ class comment
6 => 'bugtrack'
);
+ private $template;
+
+ function __construct()
+ {
+ global $COMMENTSTYLE;
+
+ if (!$COMMENTSTYLE)
+ {
+ require_once(e107::coreTemplatePath('comment'));
+ }
+ else // BC
+ {
+ $COMMENT_TEMPLATE['ITEM_START'] = "";
+ $COMMENT_TEMPLATE['ITEM'] = $COMMENTSTYLE;
+ $COMMENT_TEMPLATE['ITEM_END'] = "";
+ $COMMENT_TEMPLATE['LAYOUT'] = "{COMMENTS}{COMMENTFORM}{MODERATE}";
+ }
+
+ $this->template = $COMMENT_TEMPLATE;
+
+
+ }
/**
* Display the comment editing form
*
@@ -62,7 +84,9 @@ class comment
return;
}
- require_once(e_HANDLER."ren_help.php");
+ // require_once(e_HANDLER."ren_help.php");
+
+
if ($this->getCommentPermissions() == 'rw')
{
$itemid = $id;
@@ -185,7 +209,7 @@ class comment
";
-
+ //TODO Add Template
if ($tablerender)
{
@@ -223,14 +247,25 @@ class comment
function render_comment($row, $table, $action, $id, $width, $subject, $addrating = FALSE)
{
//addrating : boolean, to show rating system in rendered comment
- global $sql, $sc_style, $comment_shortcodes, $COMMENTSTYLE, $rater, $gen;
- global $pref, $comrow, $tp, $NEWIMAGE, $USERNAME, $RATING, $datestamp;
+ global $sc_style, $rater, $gen;
+
+ $tp = e107::getParser();
+ $sql = e107::getDb();
+ $pref = e107::getPref();
+
+
+ global $NEWIMAGE, $USERNAME, $RATING, $datestamp;
global $thisaction,$thistable,$thisid,$e107;
+
+
if (isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE)
{
return;
}
$comrow = $row;
+
+ e107::getScBatch('comment')->setParserVars($row);
+
$thistable = $table;
$thisid = $id;
$thisaction = $action;
@@ -256,35 +291,37 @@ class comment
{
define("IMAGE_new_comments", (file_exists(THEME."images/new_comments.png") ? "
" : "
"));
}
+
$ns = new e107table;
+
if (!$gen || !is_object($gen))
{
$gen = new convert;
}
- $url = e_PAGE."?".e_QUERY;
- $unblock = "[".COMLAN_1."] ";
- $block = "[".COMLAN_2."] ";
- $delete = "[".COMLAN_3."] ";
- $userinfo = "[".COMLAN_4."]";
- if (!$COMMENTSTYLE)
- {
- global $THEMES_DIRECTORY;
- $COMMENTSTYLE = "";
- if (file_exists(THEME."comment_template.php"))
- {
- require_once (THEME."comment_template.php");
- }
- else
- {
- require_once (e_BASE.$THEMES_DIRECTORY."templates/comment_template.php");
- }
- }
+
+ $url = e_PAGE."?".e_QUERY;
+
+ $unblock = "[".COMLAN_1."] ";
+ $block = "[".COMLAN_2."] ";
+ $delete = "[".COMLAN_3."] ";
+ $userinfo = "[".COMLAN_4."]";
+
+
+ $COMMENT_TEMPLATE = $this->template;
+
if ($pref['nested_comments'])
{
$width2 = 100 - $width;
$total_width = "95%";
if ($width)
{
+
+
+ $renderstyle = $COMMENT_TEMPLATE['ITEM_START'];
+ $renderstyle .= "".$COMMENT_TEMPLATE['ITEM']."
";
+ $renderstyle .= $COMMENT_TEMPLATE['ITEM_END'];
+
+ /*
$renderstyle = "
@@ -293,10 +330,14 @@ class comment
";
+ * */
+
}
else
{
- $renderstyle = $COMMENTSTYLE;
+
+ $renderstyle = $COMMENT_TEMPLATE['ITEM_START'].$COMMENT_TEMPLATE['ITEM'].$COMMENT_TEMPLATE['ITEM_END'];
+
}
if ($pref['comments_icon'])
{
@@ -316,13 +357,16 @@ class comment
}
else
{
- $renderstyle = $COMMENTSTYLE;
+ $renderstyle = $COMMENT_TEMPLATE['ITEM'];
}
$highlight_search = FALSE;
+
+
if (isset($_POST['highlight_search']))
{
$highlight_search = TRUE;
}
+
if (!defined("IMAGE_rank_main_admin_image"))
{
define("IMAGE_rank_main_admin_image", (isset($pref['rank_main_admin_image']) && $pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "
" : "
"));
@@ -335,8 +379,17 @@ class comment
{
define("IMAGE_rank_admin_image", (isset($pref['rank_admin_image']) && $pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "
" : "
"));
}
+
$RATING = ($addrating == TRUE && $comrow['user_id'] ? $rater->composerating($thistable, $thisid, FALSE, $comrow['user_id']) : "");
+
+ $comment_shortcodes = e107::getScBatch('comment');
+
+ // $text = $tp->parseTemplate($COMMENT_TEMPLATE['ITEM_START'], TRUE, $comment_shortcodes);
$text = $tp->parseTemplate($renderstyle, TRUE, $comment_shortcodes);
+
+
+
+
if ($action == "comment" && $pref['nested_comments'])
{
$type = $this->getCommentType($thistable);
@@ -362,6 +415,9 @@ class comment
}
}
} // End (nested comment handling)
+
+
+
return $text;
}
@@ -373,7 +429,7 @@ class comment
* @param unknown_type $comment
* @param unknown_type $table
* @param integer $id - reference of item in source table to which comment is linked
- * @param unknown_type $pid
+ * @param unknown_type $pid - parent comment id when it's a reply to a specific comment. t
* @param unknown_type $subject
* @param unknown_type $rateindex
*/
@@ -689,7 +745,13 @@ class comment
{
//compose comment : single call function will render the existing comments and show the form_comment
//rate : boolean, to show/hide rating system in comment, default FALSE
- global $pref, $ns, $e107cache, $tp, $totcc;
+ global $e107cache, $totcc;
+
+ $tp = e107::getParser();
+ $ns = e107::getRender();
+ $pref = e107::getPref();
+
+
if ($this->getCommentPermissions() === FALSE) return;
$sql = e107::getDb();
@@ -734,16 +796,7 @@ class comment
if ($tablerender)
{
- $text = $ns->tablerender(COMLAN_99, $text, '', TRUE);
- }
-
- if (!$return)
- {
- echo $text;
- }
- else
- {
- $ret['comment'] = $text;
+ // $text = $ns->tablerender(COMLAN_99, $text, '', TRUE);
}
if (ADMIN && getperms("B"))
@@ -754,7 +807,7 @@ class comment
if ($lock != '1')
{
- $comment = $this->form_comment($action, $table, $id, $subject, "", TRUE, $rate, $tablerender);
+ $comment = $this->form_comment($action, $table, $id, $subject, "", TRUE, $rate, false); // tablerender turned off.
}
else
{
@@ -763,10 +816,28 @@ class comment
if (!$return)
{
- echo $modcomment.$comment;
+
+ $search = array("{MODERATE}","{COMMENTS}","{COMMENTFORM}");
+ $replace = array($modcomment,$text,$comment);
+ $TEMPL = str_replace($search,$replace,$this->template['LAYOUT']);
+
+ if ($tablerender)
+ {
+ echo $ns->tablerender(COMLAN_99, $TEMPL, 'comment', TRUE);
+ }
+ else
+ {
+ echo $TEMPL;
+ }
+
+ //echo $modcomment.$comment;
+ //echo $text;
}
+
+
+
+ $ret['comment'] = $text . $modcomment;
- $ret['comment'] .= $modcomment;
$ret['comment_form'] = $comment;
$ret['caption'] = COMLAN_99;
diff --git a/e107_themes/templates/bbcode_template.php b/e107_themes/templates/bbcode_template.php
index 214e9fe18..ec6f66eb6 100644
--- a/e107_themes/templates/bbcode_template.php
+++ b/e107_themes/templates/bbcode_template.php
@@ -24,6 +24,8 @@ $BBCODE_TEMPLATE = "
";
+$BBCODE_TEMPLATE_COMMENT = ""; // no buttons on comments by default.
+
// $BBCODE_TEMPLATE .= "{BB=blank}";
$BBCODE_TEMPLATE_SIGNATURE = "
diff --git a/e107_themes/templates/comment_template.php b/e107_themes/templates/comment_template.php
index 017c058ab..0dfcd3ebd 100644
--- a/e107_themes/templates/comment_template.php
+++ b/e107_themes/templates/comment_template.php
@@ -59,7 +59,7 @@ $sc_style['LOCATION']['post'] = "
";
$sc_style['SIGNATURE']['pre'] = "";
$sc_style['SIGNATURE']['post'] = "
";
-
+/*
$COMMENTSTYLE = "
@@ -82,6 +82,92 @@ $COMMENTSTYLE = "
";
+*/
+// from e107.org
+
+
+$sc_style['COMMENTEDIT']['pre'] = '';
+
+$sc_style['COMMENT_AVATAR']['pre'] = '';
+$sc_style['COMMENT_AVATAR']['post'] = '
';
+
+
+$COMMENT_TEMPLATE['ITEM'] = '
+
+
+ ';
+
+$COMMENT_TEMPLATE['ITEM_START'] = '';
+
+$COMMENT_TEMPLATE['LAYOUT'] = '{COMMENTFORM}{COMMENTS}{MODERATE}';
+
+$COMMENT_TEMPLATE['FORM'] = ""; //TODO
+
+
+
+/*
+$COMMENTSTYLE = '
+
+