"Edit Post" hack
Posted by Gertjan
|
"Edit Post" hack March 21, 2002 03:41PM |
Registered: 24 years ago Posts: 8 |
This hack is based on a post by Age Manocchia and tested on Phorum 3.3.2a. Posters can edit their own messages. It includes another minor hack enabling Moderators to edit/remove posts in flat view (normally only possible from threaded view). The hack consists of a few changes in read.php and a new file edit.php which is adapted from moderator.php with a little bit out of form.php.
When you a have a clean Phorum install, you can just put read.php and edit.php in your Phorum directory, after you've saved the original files for your own safety.
Regards,
Gertjan de Back
When you a have a clean Phorum install, you can just put read.php and edit.php in your Phorum directory, after you've saved the original files for your own safety.
Regards,
Gertjan de Back
|
Re: "Edit Post" hack March 21, 2002 03:51PM |
Registered: 24 years ago Posts: 8 |
|
Re: "Edit Post" hack March 22, 2002 11:35PM |
When I installed this with 3.3.2a, on a phorum that has a mix of login-users ang annon-users, I could edit **anyones** message - not just my own.
I am set as a moderator.. but I logged out and posted under a new name..
Any ideas? I would **die** to be able to actually use this..
[www.noahonline.net]
Matt Runo
I am set as a moderator.. but I logged out and posted under a new name..
Any ideas? I would **die** to be able to actually use this..
[www.noahonline.net]
Matt Runo
|
Re: "Edit Post" hack March 23, 2002 05:35AM |
Registered: 24 years ago Posts: 8 |
Matt Runo wrote:
>
> When I installed this with 3.3.2a, on a phorum that has a mix
> of login-users ang annon-users, I could edit **anyones**
> message - not just my own.
Oops. The board I run does not allow anonymous posts, that may be causing the trouble. I'll look into it but can use suggestions of course.
Regards,
Gertjan
>
> When I installed this with 3.3.2a, on a phorum that has a mix
> of login-users ang annon-users, I could edit **anyones**
> message - not just my own.
Oops. The board I run does not allow anonymous posts, that may be causing the trouble. I'll look into it but can use suggestions of course.
Regards,
Gertjan
|
Re: "Edit Post" hack March 23, 2002 11:18AM |
Registered: 24 years ago Posts: 8 |
As the hack is based on session_id info from the users database, it does not work for open forums. At least to prevent anonoymous users to edit everbodies posts, change line 516 from:
<?php } else if ( $thissess==$phorum_auth ) { ?>
to:
<?php } else if ( $head_row["userid"]>0 && isset($users[$head_row["userid"]]) && $thissess==$phorum_auth ) { ?>
Regards,
Gertjan
<?php } else if ( $thissess==$phorum_auth ) { ?>
to:
<?php } else if ( $head_row["userid"]>0 && isset($users[$head_row["userid"]]) && $thissess==$phorum_auth ) { ?>
Regards,
Gertjan
|
<b>Re: "Edit Post" hack</b> March 24, 2002 06:59PM |
|
Great feature.... April 02, 2002 12:35AM |
....and sure worth to be implemented in one of the next releases.
Its works perfectly with open forums with mixed logged and unregistered users
But: In the flat-view mode there usually (3.3.2b2) links to reply to one of the messages. So if you don“t want to answer the "parent message" but one of the others, you have to change to the the threaded view, because these links vanished.
Elmar
Its works perfectly with open forums with mixed logged and unregistered users
But: In the flat-view mode there usually (3.3.2b2) links to reply to one of the messages. So if you don“t want to answer the "parent message" but one of the others, you have to change to the the threaded view, because these links vanished.
Elmar
|
Re: Great feature.... April 09, 2002 11:43AM |
Registered: 24 years ago Posts: 48 |
Gertjan wrote:
>
> ...
> change
> line 516 from:
>
> <?php } else if ( $thissess==$phorum_auth ) { ?>
>
> to:
>
> <?php } else if ( $head_row["userid"]>0 &&
> isset($users[$head_row["userid"]]) && $thissess==$phorum_auth
> ) { ?>
I found that anonymous users could still edit registered user's posts, if the registere user has logged off!
It turns out that $sess_id is "" for anonymous users, and the line
$thissess=$user["sess_id"]; // EDIT HACK: store original session id[
produces "" when the registered user is not logged on. Adding the line
if($thissess==""){$thissess="not logged in";}
after the // EDIT HACK: line above seems to fix it
Note that "not logged in" is just so I can remember why I did it, anything that doesn't look like an MD5 checksum will do.
>
> ...
> change
> line 516 from:
>
> <?php } else if ( $thissess==$phorum_auth ) { ?>
>
> to:
>
> <?php } else if ( $head_row["userid"]>0 &&
> isset($users[$head_row["userid"]]) && $thissess==$phorum_auth
> ) { ?>
I found that anonymous users could still edit registered user's posts, if the registere user has logged off!
It turns out that $sess_id is "" for anonymous users, and the line
$thissess=$user["sess_id"]; // EDIT HACK: store original session id[
produces "" when the registered user is not logged on. Adding the line
if($thissess==""){$thissess="not logged in";}
after the // EDIT HACK: line above seems to fix it
Note that "not logged in" is just so I can remember why I did it, anything that doesn't look like an MD5 checksum will do.
|
Re: "Edit Post" hack April 14, 2002 05:09PM |
Registered: 24 years ago Posts: 11 |
|
Re: "Edit Post" hack April 14, 2002 05:22PM |
Registered: 24 years ago Posts: 8 |
|
Re: "Edit Post" hack April 16, 2002 04:44PM |
This is the ticket!
If only...
I just posted a hack request that is similar to this, except that it would allow any user to completly delete his post (and anything under it).
Would you consider adding this feature?
It would make admin on an "I've got a car for sale" type of board easy to admin. Once the car is sold there is no need for the topic to continue to cluter the forum. Why not allow the user to delete it himself?
If only...
I just posted a hack request that is similar to this, except that it would allow any user to completly delete his post (and anything under it).
Would you consider adding this feature?
It would make admin on an "I've got a car for sale" type of board easy to admin. Once the car is sold there is no need for the topic to continue to cluter the forum. Why not allow the user to delete it himself?
|
Re: "Edit Post" hack April 16, 2002 06:58PM |
I just modified the "Edit Post" hack to allow any logged in poster to delete his own posts.
I added this to edit.php:
<?php echo "<a href=\"$forum_url/delbyuser.php?f=$ForumId&i=$rec_id&t=$thread$GetVars\">";?><FONT color='<?php echo $ForumTableBodyFontColor1; ?>' class="PhorumNav">Delete</a>] </font>
Then copied the admin/del.php file to delbyuser.php in the top level phorum directory and edited it to look like this:
<?php
require "/web/htdocs/phorum/common.php";
require "/web/htdocs/phorum/include/delete_message.php";
delete_messages($i);
header("Location: $forum_url");
exit();
?>
This needs some cleaning up, but it seems to work on both top level threads and any other level post.
Thanks guys!
I added this to edit.php:
<?php echo "<a href=\"$forum_url/delbyuser.php?f=$ForumId&i=$rec_id&t=$thread$GetVars\">";?><FONT color='<?php echo $ForumTableBodyFontColor1; ?>' class="PhorumNav">Delete</a>] </font>
Then copied the admin/del.php file to delbyuser.php in the top level phorum directory and edited it to look like this:
<?php
require "/web/htdocs/phorum/common.php";
require "/web/htdocs/phorum/include/delete_message.php";
delete_messages($i);
header("Location: $forum_url");
exit();
?>
This needs some cleaning up, but it seems to work on both top level threads and any other level post.
Thanks guys!
|
Re: "Edit Post" hack April 20, 2002 06:06AM |
|
"Edit Post" hack, v0.2 April 21, 2002 02:28PM |
Registered: 24 years ago Posts: 8 |
This is the second version of the "Edit Post" hack, tested on Phorum 3.3.2a/b. Registered posters can edit and/or delete their own messages. v0.2 fixed a few quirks found by others. It now works fine on boards with mixed registered and unregistered users and it reinitiates the "reply to this message" link which appears to be lost in the first one.
The hack consists of a few changes in read.php and a new file edit.php which is adapted from moderator.php. Near the top of read.php are two configurable boolean values to toggle the "edit" and "delete" links. This is default:
$enable_edit=true; // allow registered users to EDIT their own posts
$enable_delete=false; // allow registered users to DELETE their own posts
When you a have a clean Phorum install, you can just put read.php and edit.php in your Phorum directory, after you've saved the original files for your own safety.
Contributions by Age Manocchia, B Spade and Rob Walls.
Regards,
Gertjan de Back
gertjan@deback.nl
|
"Edit Post" hack, v0.2 April 21, 2002 02:28PM |
Registered: 24 years ago Posts: 8 |
This is the second version of the "Edit Post" hack, tested on Phorum 3.3.2a/b. Registered posters can edit and/or delete their own messages. v0.2 fixed a few quirks found by others. It now works fine on boards with mixed registered and unregistered users and it reinitiates the "reply to this message" link which appears to be lost in the first one.
The hack consists of a few changes in read.php and a new file edit.php which is adapted from moderator.php. Near the top of read.php are two configurable boolean values to toggle the "edit" and "delete" links. This is default:
$enable_edit=true; // allow registered users to EDIT their own posts
$enable_delete=false; // allow registered users to DELETE their own posts
When you a have a clean Phorum install, you can just put read.php and edit.php in your Phorum directory, after you've saved the original files for your own safety.
Contributions by Age Manocchia, B Spade and Rob Walls.
Regards,
Gertjan de Back
gertjan@deback.nl
|
Re: "Edit Post" hack, v0.2 April 25, 2002 09:05AM |
|
Re: "Edit Post" hack May 08, 2002 11:15PM |
Registered: 24 years ago Posts: 16 |
|
Re: "Edit Post" hack May 19, 2002 05:21AM |
Registered: 24 years ago Posts: 3 |
Sorry, you do not have permission to post/reply in this forum.
