https://www.icyphoenix.com/viewtopic.php?f=26&t=2517&p=19192#p19192
-----------------------------------
mipavluk
Sat 01 Sep, 2007 18:37

FAP 1.4.1. & Counted Comments
-----------------------------------
Hi there!

Well... I install FAP 1.4.1. and now... the comments is not counted again!

With my FAP 1.4.0 I use this solution:
http://smartor.is-root.com/viewtopic.php?t=11661&postdays=0&postorder=asc&highlight=post+count&start=0

[code]In album_showpage.php find:

 // --------------------------------  
 // Insert into DB  
 // --------------------------------  
 
 $SQL = "INSERT INTO ". ALBUM_COMMENT_TABLE ." (comment_id, comment_pic_id, comment_user_id, comment_username, comment_user_ip, comment_time, comment_text)  
     VALUES ('$comment_id', '$pic_id', '$comment_user_id', '$comment_username', '$comment_user_ip', '$comment_time', '$comment_text')";  
 if( !$result = $DB->sql_query($SQL) )  
 {  
   message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $SQL);  
 }  

*****After add*****

$SQL = "UPDATE " . USERS_TABLE . " SET user_posts = user_posts + 1 WHERE user_id = " . $userdata['user_id'];  
 if( !$result = $DB->sql_query($SQL) )  
 {  
   message_die(GENERAL_ERROR, 'Could not update post count', '', __LINE__, __FILE__, $SQL);  
 } [/code]

But now... with FAP 1.4.1. my album_showpage.php is different... the only similar line is:

[code]		// Insert into DB
		// If user only rated, but didn't enter a comment... only update rating
		if ( $comment_text != '' )
		{
			$sql = "INSERT INTO " . ALBUM_COMMENT_TABLE ." (comment_id, comment_pic_id, comment_cat_id, comment_user_id, comment_username, comment_user_ip, comment_time, comment_text)
					VALUES ('$comment_id', '$pic_id', '$cat_id', '$comment_user_id', '$comment_username', '$comment_user_ip', '$comment_time', '$comment_text')";
			if( !$result = $db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not insert new entry', '', __LINE__, __FILE__, $sql);
			}[/code]

But if I add the solution... I obtain this error:

[quote]Fatal error: Call to a member function on a non-object in /home/golfplea/public_html/scrapperszone/Forum/album_showpage.php on line 1466[/quote]

Please, anybody can help me? Thanks in advance!


