Users editing posts

Discussions about the phpBB2 Forum. How to get the best from this powerful script.

Moderator: Moderators

Postby HB » Sat Dec 08, 2007 1:33 am

ultimatehandyman wrote:Thanks SeO,

If people want their posts deleting then that is not a problem, but the main reason to stop people from editing posts after say 30 mins is so that a spammer cannot join the forum and post a post about light bulbs and then in six months time go back and edit it and fill it with a hundred links to porn sites. If they did do this it is unlikely that it would be noticed and so could be potentially damaging for the site.

I hadn't thought about that possibility.

It may be worth writing a scanner that dumps out all the linked sites in the posts_text table and then manually validating it. After each validation, add to the "approved" list of link-able sites and after a few months, the scan will return only truly new sites. Who knows, there may already be a mod for it, there's one for everything else under the sun...
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1220
Joined: Mon Oct 16, 2006 2:25 am

Advertisement

Postby HB » Sun Dec 09, 2007 4:11 pm

Here's a quickly coded "revisionist" MOD. By default, it shows the posts whose edit time is 30 days or more past the original post time. It should make it easy to spot your "light bulb to porn site" posters.

Upload to your forum directory. You can specify the desired number of days:

revisionists.php?threshold=60

No warranty expressed, implied, or given.

Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$revisionist_threshold = (60 * 60 * 24) * 30; // 30 days
$page_title = "Check for Revisionists";

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
//
// End session management
//

if ($userdata['user_level'] != ADMIN) {
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}

if (isset($HTTP_GET_VARS["threshold"])) {
   $revisionist_threshold = intval($HTTP_GET_VARS["threshold"]) * (60 * 60 * 24);
}

include($phpbb_root_path . 'includes/page_header.'.$phpEx);

echo "<h1>Revisionists of " . ($revisionist_threshold / (60 * 60 * 24)) . " days or more</h1>";

$sql = "SELECT p.post_id, u.username, t.topic_title FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE .
      " u WHERE p.topic_id = t.topic_id AND p.poster_id = u.user_id AND p.post_edit_count != 0 AND (p.post_edit_time - p.post_time) >= $revisionist_threshold ORDER BY u.username";
if ( !($result = $db->sql_query($sql)) ) {
   message_die(GENERAL_ERROR, "Could not obtain posts.", '', __LINE__, __FILE__, $sql);
}

if (mysql_num_rows($result) == 0) {
   message_die(GENERAL_INFO, "No matches");
}

while ($row = $db->sql_fetchrow($result)) {
   $post_id = $row['post_id'];
   $url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id");
   echo $row['username'] . ': <a href="' . $url . '">' . $row['topic_title'] . '</a><br>';
}
$db->sql_freeresult($result);

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1220
Joined: Mon Oct 16, 2006 2:25 am

Postby SeO » Sun Dec 09, 2007 6:08 pm

Interesting.

That's a pretty good idea actually.

And ultimatehandyman, I was only mentioning, hopefully most users are not of this kind, restricting the edit time can of course be helpful.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby merlinaras » Sun Dec 16, 2007 11:25 pm

can you please tell me if inserting that line will be enough?

INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0')

I should probably change the 0 into the number of minutes I like...but what happens with all the other changes that need to take place?

I was looking at the script and apparently there is quite a few changes that need to take place. Would that script do these changes automatically?

I just don't want to break my website but I badly need this.

Also can the administrator or the moderator continue making changes to posts as and when necessary?

Many thanks in advance,

m
merlinaras
 
Posts: 1
Joined: Sun Dec 16, 2007 11:14 pm

Postby ultimatehandyman » Mon Dec 17, 2007 10:35 am

merlinaras wrote:can you please tell me if inserting that line will be enough?

INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0')

I should probably change the 0 into the number of minutes I like...but what happens with all the other changes that need to take place?

I was looking at the script and apparently there is quite a few changes that need to take place. Would that script do these changes automatically?

I just don't want to break my website but I badly need this.

Also can the administrator or the moderator continue making changes to posts as and when necessary?

Many thanks in advance,

m


If you download the Limited Post Edit Time mod that peter77 has posted a link to and then you follow the rest of advice by peter77 and make an sql file and upload and execute it. Then install the rest of the mod you can then change the amount of time allowed to edit posts by going into the admin panel/configuration.

Mods and admin can still edit all posts without any limits or problems.
ultimatehandyman
PR2
PR2
 
Posts: 250
Joined: Thu Mar 15, 2007 12:55 am

Re: Users editing posts

Postby dgromova » Fri Jan 07, 2011 3:44 am

I just installed the Limited Post Edit Time mod, just following the mod instructions. And it doesn't work. Searching for help, I've found this topic, where you were discussing this mod and other ways to install it. But I already installed it.
Apparently I had to change the 0 value to 30 everywhere. But the instructions didn't tell where to change. So I changed it only in one place, and I left the 0 value here:
Code: Select all
INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0')


Do I have to change the above code too? And if so, how to fix it now? I am not familiar with SQL.

And the second question. Do I have to change 0 to 30 everywhere in the code or there are some places where the 0 should be kept?

Please, help me. Completely confused. :(
dgromova
 
Posts: 1
Joined: Fri Jan 07, 2011 3:24 am

Previous

Return to phpBB2 Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 42 guests