View Single Post
  #10 (permalink)  
Old 08-10-2007, 01:38 AM
parterburn parterburn is offline
New Pligger
 
Join Date: Feb 2007
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
If you haven't already got the solution, here's what I ended up doing:

- Create an "anonymous" user & find the ID in the database
- Edit the code below:

template/Story_Center.tpl
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}
Take out the if..then statement so it will always display a textarea for comments:
Code:
{include file=$the_template."/comment_form.tpl"}
Story.php
Code:
	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;
		}
	}
}
change to:
Code:
	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=14;
				$comment->store();
				header('Location: '.$_SERVER['REQUEST_URI']);
				die;
			}
		}
You will need to change the 14 in "$comment->author=14;" to the ID of the new anonymous user. Hope this helps.
Reply With Quote