I am hoping that it is possible to remove the editing time limit from a single board only while keeping all the rest at the forum standard. I run a tropical fish website and would like to create a board where the members can input their setups for other members to see. As these are always changing I would like the member to be able to change their post as they add or remove livestock. I do not want unlimited editing on any other section of the forum. Is this possible.
Thanks for your help and input.
Pat
Did, I word this wrong or is it something that cannot be done? I did a search but came up empty.
Thanks.
Let's try this:
Post.php
We have 3.
Find:
if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time())
Replace:
if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time() && $board != BOARD_ID)
Change the BOARD_ID as the board id.
Display.php
Find:
'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time()))),
Replace:
'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time())) && $board != BOARD_ID),
Change the BOARD_ID as the board id.
Great, I will give it a try and let you know. Thanks for the effort!
Pat
SiNan, I tried what you suggested and it did not work. the edit icon went away after the regular time period and I am getting this error in the log
Undefined variable: board
File: /home/badman/public_html/forum/Sources/Display.php
Heres how the code lookes after I did what you suggested in all areas
post.php
if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time() && $board != 92.0)
display.php
'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time())) && $board != 92.0),
Any thoughts or should I just abandon this?
Thanks
Pat
It seems that we don't have the board in globals. After doing the edit above, do:
Display.php
Find:
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments;
Replace:
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $board;
For the board ID, just enter 92 if your board is 92.0.
SiNaN, it still does not work, the edit option goes away after the ten minutes and I still get this error
8: Undefined variable: board
File: /home/badman/public_html/forum/Sources/Display.php
here is the display php now
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $board92;
and
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments, $board92;
and the post.php, all three areas
if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time() && $board != 92)
The one in Display.php should be just $board, not $board92.
Ok, I will try again, And I want to thank you for taking your time with this.
Pat
Ok, the board error seems to be gone now, but now the edit (modify) icon does not show up at all this board is in local mode like you said.
After you do all the things above. Do this:
Display.php
Find:
'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time())) && $board != 92),
Replace:
'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $board == 92 || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time()))),
Just I missed a small point, sorry.
I'm testing it now, i'll let you know.
Pat
SiNaN, It seems to be working fine! Thank you!, I will test it a little more before marking it solved. It may be useful to other members.
Pat
One problem that now has come up is with the preview screen. When you hit preview the Fetching preview... just sits there and nothing happens. When I put the unmodified pages back it works fine.
Thanks SiNaN
Preview is also okay for me. Can you attach the edited files here? Maybe you've missed something.
I'm sure I did! here is the display
here is post
I've changed my files, with yours and still do not get any errors. Maybe I misunderstood. Can you provide a screenshot?
SiNaN, I am showing no errors in the error log, its just that the previwe never loads attached is a screen shot showing the "feetching preview" which it never gets past, I aso get I believe a javascript error showing in the IE browser and have attached what they say in a screen shot.
OK, some other info. When you reply with the quick reply it seems to be OK, if you use the modify or the regular reply link it will not go through the preview screen, it just hangs.
SiNaN, did the shots help at all? I think I will just have to keep the board time limit.
I didn't look at it. Can you remind it to me tomorrow? I will check it tomorrow.
sure and thanks again!
I tested in both FF2 and IE7 but couldn't reproduce your error. Can you try it with the files attached? I set the board ID as 92.
Sinan, I see your post php was version 1.1.4 and mine is 1.1.5 and when compared using text pad there were a few differences. I also have a mod installed call "no spam by guest "which changes this code
$post_errors[] = 'bad_email';
}
to this
$post_errors[] = 'bad_email';
// by NoSpamByGuests mod
if (isset($_POST['message']))
{
$linkpos = strpos ($_POST['message'], "://"); // look for ://
if ($linkpos !== false) $post_errors[] = 'guest_no_link';
else {
$linkpos = strpos ($_POST['message'], "www."); // look for www.
if ($linkpos !== false) $post_errors[] = 'guest_no_link';
}
}
}
could this be the reason?
attached are the results of the differences
Sorry I'm still olldd, try this files then.
By the way, it can be because of that mod. Did you try editing a message without an url -http://-?
SiNaN, I downloaded your files and then copied you changes to my unedited files and everything seems to be working fine. I don't know if it was something I did or added when I was making your modifications but by using the code from your files it works with my other modification intact! I am sorry for the delay I had a 24 hour bug and was not thinking straight for a day or so. I do want to thank you again for your help. I will test this for a day or so and hen mark it solved.
Pat
I think the problem is with the NoSpamByGuests. Because as I see, you have url in the message that you are trying to edit.
Reckon there is any way to make this work for a single membergroup, rather than a single board?
I'll try to write codes and post it into the Tips and Tricks board. Will inform you from this topic.
Thanks, appreciated.
Attempted myself to do it, didn't work. :P
Both of them are added to the Tips and Tricks:
http://www.simplemachines.org/community/index.php?topic=257304.0
http://www.simplemachines.org/community/index.php?topic=257307.0
Thank you SiNan,
The unlimited edit time for a single board trick is just perfect for our "for sale" board.