HTML Code:
" . $CommentOrderBy);
if ($comments2) {
echo '<div style="margin-left:40px">';
require_once(mnminclude.'comment.php');
$comment2 = new Comment;
foreach($comments2 as $comment_id) {
$comment2->id=$comment_id;
$comment2->read();
$comment2->print_summary($link);
}
echo "</div>\n";
}
}
}
}
function insert_comment () {
global $link, $db, $current_user;
require_once(mnminclude.'comment.php');
$comment = new Comment;
$cancontinue = false;
if($_POST['link_id'] == $link->id && $current_user->authenticated && $_POST['user_id'] == $current_user->user_id && $_POST['randkey'] > 0) {
if(strlen($_POST['comment_content']) > 0){
$comment->content=$_POST['comment_content'];
$cancontinue = true;
// this is a normal new comment
}
if(strlen($_POST['reply_comment_content-'.$_POST['comment_parent_id']]) > 0){
$comment->content = $_POST['reply_comment_content-'.$_POST['comment_parent_id']];
$comment->parent=$_POST['comment_parent_id'];
$cancontinue = true;
// this is a reply to an existing comment
}
if($cancontinue == true){
$comment->link=$link->id;
$comment->randkey=$_POST['randkey'];
$comment->author=$_POST['user_id'];
$comment->store();
header('Location: '.$_SERVER['REQUEST_URI']);
die;
}
} else {
if($_POST['link_id'] == $link->id && $_POST['randkey'] > 0) {
if(strlen($_POST['comment_content']) > 0){
$comment->content=$_POST['comment_content'];
$cancontinue = true;
// this is a normal new comment
}
if(strlen($_POST['reply_comment_content-'.$_POST['comment_parent_id']]) > 0){
$comment->content = $_POST['reply_comment_content-'.$_POST['comment_parent_id']];
$comment->parent=$_POST['comment_parent_id'];
$cancontinue = true;
// this is a reply to an existing comment
}
if($cancontinue == true){
$comment->link=$link->id;
$comment->randkey=$_POST['randkey'];
$comment->author=6;
$comment->store();
header('Location: '.$_SERVER['REQUEST_URI']);
die;
}
}
?>
i added an extra 2 } and now im getting error.
unexpected else public_html/templates_c/c_7c6a85f87188d2b8f1fc8932ce9ab48b.php on line 46
update / fix
ok i undestand now. My downfall was that i did not remove all the code on step 1.
i didnt replace all of the code
HTML Code:
{if $user_authenticated neq ""}
{include file=$the_template."/comment_form.tpl"}
{else}
<br/>
<div align="center" style="clear:both;margin-left:auto;font-weight:bold;margin-right:auto;border-color:#ccc; border-style:solid; border-width:1px;width:400px;text-align:center; padding-bottom: 8px;">
<a href="{$login_url}">{#PLIGG_Visual_Story_LoginToComment#}</a> {#PLIGG_Visual_Story_Register#} <a href="{$register_url}">{#PLIGG_Visual_Story_RegisterHere#}</a>.
</div>
{/if}
HTML Code:
{include file=$the_template."/comment_form.tpl"}




Linear Mode

