## ## ## Mod title: Edit Grace Period ## ## Mod version: 1.0 ## Works on PunBB: 1.2.x ## Release date: 2006-09-19 ## Author: guardian34 (publicbox@fmguy.com) ## ## Description: This mod gives users an editing grace period; The "Last ## edited by…" message will not be displayed if a post is ## edited during this period. ## ## Affected files: edit.php ## ## Affects DB: No ## ## DISCLAIMER: Please note that "mods" are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ## ## # #---------[ 1. OPEN ]--------------------------------------------------------- # edit.php # #---------[ 2. FIND (line: 38) ]---------------------------------------------- # // Fetch some info about the post, the topic and the forum $result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); # #---------[ 3. REPLACE WITH ]------------------------------------------------- # // Fetch some info about the post, the topic and the forum // mod: edit grace period $result = $db->query('SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted as p_posted FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON t.id=p.topic_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id='.$id) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); # #---------[ 4. FIND (line: 111) ]--------------------------------------------- # $edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : ''; # #---------[ 5. REPLACE WITH ]------------------------------------------------- # // mod: edit grace period // You can change `300`; It's the grace period time, in seconds. if (($is_admmod && isset($_POST['silent'])) || (($cur_post['p_posted'] + 300) >= time())) $edited_sql = ''; else $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\''; # #---------[ 6. SAVE/UPLOAD ]-------------------------------------------------- #