Forums, Lost options to edit, delete ect

Hello all,

   it seems that reg members can post in forums and then go back into it and edit, delete ect and everything is fine. But after an hour of so when they go back into it they have lost the options to edit and delete. Can anyone tell me why this is happening or how I might fix this problem?

Thanks, John

www.CycleMadness.net
Quote · 5 Feb 2014

check the header.inc.php file in modules/boonex/forum/inc

There you'll find the settings for that

Dedicated servers for as little as $32 (28 euro) - See http://denre.com for more information
Quote · 5 Feb 2014

 

Hello all,

   it seems that reg members can post in forums and then go back into it and edit, delete ect and everything is fine. But after an hour of so when they go back into it they have lost the options to edit and delete. Can anyone tell me why this is happening or how I might fix this problem?

Thanks, John

Yes, it is the same feature that is on the Boonex forum here.  Members have a limited time to edit their posts (titles of topics can only be edited through the database).  There is a timer that will count down.

Now, you can either set this timer for a very long time; using the file that Denre pointed out to you, or remove it altogether.  I outlined in a forum post, somewhere on here, about removing the timer thing completely.

Geeks, making the world a better place
Quote · 5 Feb 2014

Ok Thanks guys, I'll have to see if I can find someone that can maybe remove the timer for me.

www.CycleMadness.net
Quote · 5 Feb 2014

PM me if you are looking to post a job Smile

However, here is the solution if you can edit code.  Note that I just opted to hide the non-functional timer:

Here is the solution for breaking the edit timer from the delete.

In forum/inc/header.inc.php add a new variable:

$gConf['delete_timeout'] = 3600; // delete timeout in sec

Now in the forum.php, there is one in /forum/classes and one in /forum/classes/en

Clone the function: _isEditTimeout to _isDelTimeout and use your new variable delete_timeout

    function _isDelTimeout ($post_id)
    {
        if ((time() - $this->fdb->getPostWhen($post_id) - 10) > $GLOBALS['gConf']['delete_timeout'])
            return true;
        return false;
    }

Then you have to go through the forum.php and where the del function is used, you replace _isEditTimeout with _isDelTimeout.  You will now be able to set a separate time for deleting forum posts from editing forum posts.

For example:

if (!$allow_edit && $r['user'] == $this->_getLoginUserName()) {
            if ($this->_checkUserPerm ($r['user'], 'own', 'edit', $forum_id) && !$this->_isEditTimeout($r['post_id']) && !$t['topic_locked'])
                $allow_edit = 1;
        }

        if (!$allow_del && $r['user'] == $this->_getLoginUserName()) {
            if ($this->_checkUserPerm ($r['user'], 'own', 'del', $forum_id) && !$this->_isDelTimeout($r['post_id']) && !$t['topic_locked'])
                $allow_del = 1;
        }

Before, the second if was using the same function for checking if the time allowed had ended.

 

Final piece of the puzzle.  To disable the edit timer completely; or at least the way I hack at it :

//$access = $timeout > 10 && !$t['topic_locked'] ? 'allow' : 'deny';
$access = !$t['topic_locked'] ? 'allow' : 'deny';

This keeps the locked forum topics from being edited

Then set the function _isEditTimeout to return false

    function _isEditTimeout ($post_id)
    {
       return false;
    }

Then you need to set the "allow edit" message to display none in the CSS otherwise it displays a negative time message.

Geeks, making the world a better place
Quote · 5 Feb 2014

Thank you very much, Very good info..  Done and works the way I want now...

www.CycleMadness.net
Quote · 6 Feb 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.