Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
RevCMS Working News Comments!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JustAGame" data-source="post: 421404" data-attributes="member: 10257"><p>Not sure if anyone released this fix, but since I get this whole News Commenting function here, I'll post it here for future user reference.</p><p></p><p>In the codes, there's this :</p><p>[PHP]if($userPosts >= 1)</p><p>{</p><p> define('ERROR', 'Sorry, you are only allowed one comment per article.');</p><p>}[/PHP]</p><p></p><p>which is supposed to restrict player for only 1 comment per article, but it doesn't work.</p><p></p><p>Here's how to make it work:</p><p>Replace</p><p>[PHP]if($userPosts >= 1)</p><p>{</p><p> define('ERROR', 'Sorry, you are only allowed one comment per article.');</p><p>}[/PHP]</p><p></p><p>with</p><p></p><p>[PHP]$userPosts = mysql_query("SELECT * FROM cms_comments WHERE article = '".htmlentities(mysql_real_escape_string($_GET['id']))."' AND userid = '" . $_SESSION['user']['id']. "'");</p><p>$postNum = mysql_num_rows($userPosts);</p><p>if($postNum >= 1)</p><p>{</p><p> define('ERROR', 'Sorry, you are only allowed one comment per article.');</p><p>}[/PHP]</p><p></p><p>Enjoy <img src="/styles/default/xenforo/smilies/emojione/wink.png" class="smilie" loading="lazy" alt=";)" title="Wink ;)" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="JustAGame, post: 421404, member: 10257"] Not sure if anyone released this fix, but since I get this whole News Commenting function here, I'll post it here for future user reference. In the codes, there's this : [PHP]if($userPosts >= 1) { define('ERROR', 'Sorry, you are only allowed one comment per article.'); }[/PHP] which is supposed to restrict player for only 1 comment per article, but it doesn't work. Here's how to make it work: Replace [PHP]if($userPosts >= 1) { define('ERROR', 'Sorry, you are only allowed one comment per article.'); }[/PHP] with [PHP]$userPosts = mysql_query("SELECT * FROM cms_comments WHERE article = '".htmlentities(mysql_real_escape_string($_GET['id']))."' AND userid = '" . $_SESSION['user']['id']. "'"); $postNum = mysql_num_rows($userPosts); if($postNum >= 1) { define('ERROR', 'Sorry, you are only allowed one comment per article.'); }[/PHP] Enjoy ;) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
RevCMS Working News Comments!
Top