Skip to content

Commit

Permalink
Fixes #2425 Fixes #2281 Fixes #2937 Comment navigation issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Jul 28, 2018
1 parent e5af746 commit 64d821a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
5 changes: 4 additions & 1 deletion e107_core/shortcodes/batch/page_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ function cpagecomments()
{
$com = $this->var['comments'];
//if($parm && isset($com[$parm])) return $com[$parm];
return $com['comment'].$com['comment_form'];

return e107::getComment()->parseLayout($com['comment'],$com['comment_form'],$com['moderate']);

// return $com['comment'].$com['moderate'].$com['comment_form'];
}

function sc_cpagenav()
Expand Down
12 changes: 7 additions & 5 deletions e107_core/shortcodes/batch/user_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,15 @@ function sc_user_extended_all($parm)

function sc_profile_comments($parm)
{
if(e107::getPref('profile_comments'))
if(!e107::getPref('profile_comments'))
{
$ret = e107::getComment()->compose_comment('profile', 'comment', $this->var['user_id'], null, $this->var['user_name'], FALSE,true);

return e107::getRender()->tablerender($ret['caption'],$ret['comment_form']. $ret['comment'], 'profile_comments', TRUE);
return '';
}
return "";

return e107::getComment()->compose_comment('profile', 'comment', $this->var['user_id'], null, $this->var['user_name'], false,'html');

// return e107::getRender()->tablerender($ret['caption'],$ret['comment_form']. $ret['comment'], 'profile_comments', TRUE);

}


Expand Down
16 changes: 10 additions & 6 deletions e107_core/templates/user_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@
$USER_WRAPPER['view']['USER_SIGNATURE'] = '<div>{---}</div>';
$USER_WRAPPER['view']['USER_RATING'] = '<div>{---}</div>';
$USER_WRAPPER['view']['USER_SENDPM'] = '<div>{---}</div>';
$USER_WRAPPER['view']['PROFILE_COMMENTS'] = '<div class="panel panel-default clearfix">{---}';
$USER_WRAPPER['view']['PROFILE_COMMENT_FORM'] = '{---} </div>';
$USER_WRAPPER['view']['PROFILE_COMMENTS'] = '<div class="clearfix">{---}</div>';
// $USER_WRAPPER['view']['PROFILE_COMMENT_FORM'] = '{---} </div>';

$USER_TEMPLATE['view'] = '
{SETIMAGE: w=600}
Expand Down Expand Up @@ -372,12 +372,16 @@
</ul>
</div>
</div>
{PROFILE_COMMENTS}
{PROFILE_COMMENT_FORM}
</div>
</div>
<!-- Start Comments -->
{PROFILE_COMMENTS}
<!-- End Comments -->
';
}

Expand Down
25 changes: 19 additions & 6 deletions e107_handlers/comment_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1174,11 +1174,9 @@ function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE,
{
$text = "<ul class='media-list' id='comments-container'><li><!-- --></li></ul>";
}

$search = array("{MODERATE}","{COMMENTS}","{COMMENTFORM}","{COMMENTNAV}");
$pagination = '';
$replace = array($modcomment,$text,$comment,$pagination);
$TEMPL = str_replace($search,$replace,$this->template['layout']);


$TEMPL = $this->parseLayout($text,$comment,$modcomment);


// $return = null;
Expand Down Expand Up @@ -1209,8 +1207,8 @@ function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE,
}




$ret = array();
$ret['comment'] = $text;
$ret['moderate'] = $modcomment;
$ret['comment_form'] = $comment;
Expand All @@ -1219,7 +1217,22 @@ function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE,
return (!$return) ? "" : $ret;
}

/**
* Parse the Comment Layout template
* @param $comment
* @param $form
* @param $modcomment
* @return mixed
*/
public function parseLayout($comment, $form, $modcomment)
{
$search = array("{MODERATE}","{COMMENTS}","{COMMENTFORM}","{COMMENTNAV}");
$pagination = '';
$replace = array($modcomment,$comment,$form,$pagination);

return str_replace($search,$replace,$this->template['layout']);

}



Expand Down
2 changes: 0 additions & 2 deletions e107_plugins/news/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -1193,9 +1193,7 @@ private function renderComments($news)

if(!empty($text))
{
// $text = $comments['comment_form'] . $comments['comment'] .$comments['moderate'];
return $text;
// return e107::getRender()->tablerender($comments['caption'], $text,'comment', true);
}

}
Expand Down

0 comments on commit 64d821a

Please sign in to comment.