Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 1.7, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Question Kunena Duplicate Post Time limit and MySQL Query changing

  • C0n
  • C0n's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Only the strongest will survive
More
14 years 3 months ago - 14 years 3 months ago #115985 by C0n
So the follow piece of code located in :

com_kunena/lib/kunena.posting.class.php Lines : 907
Code:
protected function isAlreadyPosted() { // Ignore identical messages (posted within 15 minutes) $duplicatetimewindow = CKunenaTimeformat::internalTime () - 15 * 60; $this->_db->setQuery ( "SELECT m.id FROM #__kunena_messages AS m JOIN #__kunena_messages_text AS t ON m.id=t.mesid WHERE m.userid={$this->_db->quote($this->message['userid'])} AND m.name={$this->_db->quote($this->message['name'])} AND m.subject={$this->_db->quote($this->message['subject'])} AND m.ip={$this->_db->quote($this->message['ip'])} AND t.message={$this->_db->quote($this->message['message'])} AND m.time>={$this->_db->quote($duplicatetimewindow)}" ); $id = $this->_db->loadResult (); $dberror = $this->checkDatabaseError (); if ($dberror) return $this->setError ( '-duplicate-', JText::_ ( 'COM_KUNENA_POST_ERROR_SAVE' ) ); return ( bool ) $id; }

You can change the string to fix the timelimit you wish each duplicate post to be blocked at
"$duplicatetimewindow = CKunenaTimeformat::internalTime () - 15 * 60;" (Default is set to be 5mins i changed it to be 15mins.)

But i dont belive that is enough :) since when checking for a duplicate post.. not all duplicate posts contain the same Subject aswell as if a user has a dynamic IP then there ip will not match up every time they reconnect within the set time frame.

So changing the query to this should fix that issue :D
Code:
$this->_db->setQuery ( "SELECT m.id FROM #__kunena_messages AS m JOIN #__kunena_messages_text AS t ON m.id=t.mesid WHERE m.userid={$this->_db->quote($this->message['userid'])} AND m.name={$this->_db->quote($this->message['name'])} AND t.message={$this->_db->quote($this->message['message'])} AND m.time>={$this->_db->quote($duplicatetimewindow)}" ); $id = $this->_db->loadResult ();


This is only for users who want a little extra layer of anti spam security since kunena's duplicate spam filter is good but not good enough.
Last edit: 14 years 3 months ago by C0n.

Please Log in or Create an account to join the conversation.

Time to create page: 0.201 seconds