include(ROOT_PATH.'includes/page_header.php');
/* MOD AJAX COMMENTS BEGIN INSERT*/include(ROOT_PATH."ajaxcomments.php");/* MOD AJAX COMMENTS END INSERT*/
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
,c.comment_rating,c.comment_votes,c.comment_rating_users
$commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">\n";
/* MOD AJAX COMMENTS REPLACE START*/$commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ return CommentsPerPage(this.form); }\" class=\"select\">\n";/* MOD AJAX COMMENTS REPLACE END*/
if ($action == "postcomment") {
/* MOD AJAX COMMENTS REPLACE START*/if (($action == "postcomment" || (!isset($HTTP_POST_VARS['page']) && !isset($HTTP_GET_VARS['page']))) && !COMMENTS_ORDER) {/* MOD AJAX COMMENTS REPLACE END*/
"paging" => $getpaging->get_paging(),
/* MOD AJAX COMMENTS REPLACE START*/ "paging" => str_replace(array("<a ", 'onSubmit="'), array('<a onclick="return CommentsPage(this);" ', 'onSubmit="return CommentsPerPage(this);'), $getpaging->get_paging()),/* MOD AJAX COMMENTS REPLACE END*/
ORDER BY c.comment_date ASC
ORDER BY c.comment_date DESC
ORDER BY c.comment_date ".(COMMENTS_ORDER ? "DESC" : "ASC")."
$comments .= $site_template->parse_template("comment_bit");
/* MOD AJAX COMMENTS BEGIN INSERT*/ if (COMMENT_RATING_ANABLE) { $comment_row[$i]['cat_id'] = $cat_id; $comment_row[$i]['image_allow_comments'] = $image_allow_comments; comment_rating_template($comment_row[$i]); }/* MOD AJAX COMMENTS END INSERT*/
$site_template->register_vars("comments", $comments);
/* MOD AJAX COMMENTS START REPLACE*/ $site_template->register_vars(array( "comments" => $comments, "comments_num" => $num_comments, "commentbg" => (isset($row_bg_number)) ? $row_bg_number : 0, "page" => $page, "perpage" => $commentperpage, ));/* MOD AJAX COMMENTS END REPLACE*/
$lang['comment_rating'] = "Vote for this comment";$lang['comment_rating_good'] = "Good comment";$lang['comment_rating_bad'] = "Bad comment";$lang['comment_rating_success'] = "Thank you for rating this comment";$lang['comment_rating_error'] = "Sorry, your vote was rejected:";$lang['comment_rating_check'] = array( 0 => "Not rated yet", 1 => "Invalid comment id", 2 => "Guests are not allowed to vote", 3 => "Permission denied", 4 => "You can't vote on your own comments", 5 => "You've already voted for this comment", 6 => "Comment rating disabled",);
.comment_rating0 {}.comment_rating1 { color: green;}.comment_rating2 { color: red;}
<!--mod ajax comments insert start--><script type="text/javascript">var ajaxCommentBG = parseInt('{commentbg}');var ajaxCommentRatingHide = parseInt('{commentratinghide}');var ajaxCommentsUrl = '{ajaxcommentsurl}';var URL_ID = '{url_id}';var Page = parseInt('{page}');var PerPage = parseInt('{perpage}');</script><script type="text/javascript" src="js/ajax.js"></script><script type="text/javascript" src="js/ajaxcomments.js"></script><!-- uncomment and place this div where you want messages related to comment rating to be showed (additionally to tooltips), you can use this div to display floating messages --><!-- <div id="commentratingmsg"></div> --><!--mod ajax comments insert end-->
<!--mod ajax comments insert start--><span id="pagingstats"><!--mod ajax comments insert end-->{paging_stats}<!--mod ajax comments insert start--></span><!--mod ajax comments insert end-->
<!--mod ajax comments insert start--><div id="pagingtable"{ifno paging} style="display:none;"{endifno paging}><!--mod ajax comments insert end-->
<!--mod ajax comments insert start--><div id="pagingtable2"{ifno paging} style="display:none;"{endifno paging}><!--mod ajax comments insert end-->
<!--mod ajax comments insert start--><span id="paging"><!--mod ajax comments insert end-->{paging}<!--mod ajax comments insert start--></span><!--mod ajax comments insert end-->
<!--mod ajax comments insert start--><span id="paging2"><!--mod ajax comments insert end-->{paging}<!--mod ajax comments insert start--></span><!--mod ajax comments insert end-->
<!--mod ajax comments insert start--></div><!--mod ajax comments insert end-->
<!--COMMENTSTART-->{comments}<!--COMMENTEND-->
<table width="100%" border="0" cellpadding="3" cellspacing="1"> <tr> <td valign="top" class="head1">{lang_author}</td> <td valign="top" class="head1">{lang_comment}</td> </tr> {comments}</table>
<span id="commentstable"> <table width="100%" border="0" cellpadding="3" cellspacing="1"> <tr> <td valign="top" class="head1">{lang_author}</td> <td valign="top" class="head1">{lang_comment}</td> </tr> {comments} </table></span>
<!--mod ajax comments insert start in "commentformmsg" will be displayed any messages related to posting comments.keep in mind a <br /> will be automatically appended to the front of the message--><b><div id="commentformmsg"></div></b><!--mod ajax comments insert end-->
<!--mod ajax comments insert start -->{if comment_rating_enable}<span id="cmsg{comment_id}" title="{comment_vote_tooltip}"><span id="cr{comment_id}" class="comment_rating{comment_class}">{comment_rating_str}</span> {comment_rating_link_good} {comment_rating_link_bad} <span id="crv{comment_id}">{comment_votes}</span> {lang_votes}</span>{endif comment_rating_enable}<!--mod ajax comments insert end -->
<!--mod ajax comments insert start --><a href="#" id="cilh{comment_id}" onClick="return aCTog({comment_id});" style="{if comment_hide}display:inline;{endif comment_hide}{ifno comment_hide}display:none;{endifno comment_hide}"><img id="cih{comment_id}" src="{template_image_url}/plus.png" border="0" /></a><div id="commentbox{comment_id}"{if comment_hide} style="display:none;"{endif comment_hide}><!--mod ajax comments insert end --> {comment_text}<!--mod ajax comments insert start --></div><!--mod ajax comments insert end -->
<form name="commentform" action="{self}" method="post" onsubmit="postbutton.disabled=true;">
<form name="commentform" action="{self}" method="post" onsubmit="return ajaxCommentSubmit(this,'{self}');">
<form method="post" action="{self}#comments" name="commentsperpage">
<form method="post" action="{self}#comments" name="commentsperpage" onsubmit="return CommentPerPage(this);">
define("COMMENT_RATING_ENABLE", 1); //enable ratings for comments?define("COMMENT_RATING_GUEST", 0); //allow guests to vote?define("COMMENT_RATING_OWN", 0); //allow rate own comments?define("COMMENT_RATING_HIDE", -3); //comment with rating below this number will be hidden by default (visitors still will be able read them by clicking at + icon)define("COMMENTS_PAGES", 1); //show pages for comments? must install http://www.4homepages.de/forum/index.php?topic=5830.0define("COMMENTS_ORDER", 0); //sort comments 0 = ASC or 1 = DESC
ORDER BY c.comment_date ".(COMMENTS_ORDER ? "DESC" : "ASC")."";
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" />