Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 08-30-2007, 09:11 AM
New Pligger
 
Join Date: Aug 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Talking error unexpected - $end in story.php - ver9.7

Im new to programming more a bodger of others work.. can someone tell me where im going wrong as im getting error on line 215 unexpected $end. Ive tried a few variations but am not yet educated enough in coding. ty in advance

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;
			}
		}
?>
update........................
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}
with

HTML Code:
{include file=$the_template."/comment_form.tpl"}
i was just a bit unclear about step 1..... i only removed PART of the code (top part) but got there in the end. thanks for this hack and i hope my mistakes here will help other noobs avoid the same

Last edited by lazynewt; 08-30-2007 at 09:32 AM..
Reply With Quote
  #12 (permalink)  
Old 09-07-2007, 12:01 PM
clems365's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: CMS Theme
 
Join Date: May 2007
Location: santiago chile
Posts: 60
Thanks: 5
Thanked 9 Times in 6 Posts
I have the same trouble

error unexpected - $end in story.php line 216

I made all the change and I have the same error.... An other solution maybe ?

Clément
Reply With Quote
  #13 (permalink)  
Old 09-12-2007, 02:18 AM
New Pligger
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
which release are these instructions for?

parterburn,

which release are these instructions for? i'm trying it with 9.8 and am having no luck. after adding two close-brackets to debug, non-logged-in users still get the "Log in to comment or register here" box, with no comment entry box.

thanks....
Reply With Quote
  #14 (permalink)  
Old 09-12-2007, 04:20 PM
New Pligger
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
solved it

a-ha. here are a few instructions to add to parterburn's method to make it work:

-two close-brackets ( } ) need to be added to the end of the new code in story.php.

-story_center.tpl is actually in the templates directory, not template

-if you're using pligg 9.8, there are two story_center.tpl files. One is in templates/mobile, the other in templates/yget. You must edit the one in the yget directory to make this work (I presume the one in the mobile directory is only for phone-based templates)

Last edited by burton; 09-12-2007 at 04:25 PM..
Reply With Quote
  #15 (permalink)  
Old 09-22-2007, 11:35 PM
New Pligger
 
Join Date: Apr 2007
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
easy solution:

1) create anonymous user

on template write: use anonymous and anonymous

......
Reply With Quote
  #16 (permalink)  
Old 09-25-2007, 06:38 PM
Pligg Donor
 
Join Date: Mar 2007
Posts: 54
Thanks: 7
Thanked 1 Time in 1 Post
Guys wow! Thanks a million! Works great! You all rock!

check it!

do1thing.net

Cheers!
Reply With Quote
  #17 (permalink)  
Old 11-02-2007, 02:42 PM
New Pligger
Pligg Version: 0.98
Pligg Template: none
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
I have this working too!!! thanks!!
Reply With Quote
  #18 (permalink)  
Old 11-08-2007, 03:46 PM
New Pligger
 
Join Date: Oct 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Ummm ok, so which code am I suppose to copy? There are four different ones and I'm lost...
Reply With Quote
  #19 (permalink)  
Old 11-10-2007, 06:27 PM
New Pligger
Pligg Version: 9.8
Pligg Template: deafult
 
Join Date: Oct 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
So this script it works on pligg 9.8
Reply With Quote
  #20 (permalink)  
Old 11-10-2007, 07:32 PM
New Pligger
 
Join Date: Oct 2007
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
What other methods are you guys using to combat spam?
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solution] Limit Comments in Story page. manya1011 General Help 9 03-12-2008 06:26 PM
Star Vote Problems 9.6 - 9.7 not2serious Bug Report 7 03-03-2008 06:00 AM
Problem with comments in sidebar grimusm General Help 0 01-01-2008 08:11 AM
Allow anonymous comments netstar Modification Tutorials 19 08-10-2007 01:40 AM
Comments, MYSQL Queries Simon General Help 7 05-06-2007 09:10 AM


Search Engine Friendly URLs by vBSEO 3.2.0