News:

Wondering if this will always be free?  See why free is better.

Main Menu

unlimited edit time for single board only

Started by badman2nd, June 13, 2008, 09:55:53 AM

Previous topic - Next topic

badman2nd

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

badman2nd

Did, I word this wrong or is it something that cannot be done? I did a search but came up empty.

Thanks.

[SiNaN]

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.
Former SMF Core Developer | My Mods | SimplePortal

badman2nd

Great, I will give it a try and let you know. Thanks for the effort!

Pat

badman2nd

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

[SiNaN]

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.
Former SMF Core Developer | My Mods | SimplePortal

badman2nd

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)

[SiNaN]

The one in Display.php should be just $board, not $board92.
Former SMF Core Developer | My Mods | SimplePortal

badman2nd

Ok, I will try again, And I want to thank you for taking your time with this.

Pat

badman2nd

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.

[SiNaN]

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.
Former SMF Core Developer | My Mods | SimplePortal

badman2nd

I'm testing it now, i'll let you know.

Pat

badman2nd

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

badman2nd

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

[SiNaN]

Preview is also okay for me. Can you attach the edited files here? Maybe you've missed something.
Former SMF Core Developer | My Mods | SimplePortal

badman2nd



[SiNaN]

I've changed my files, with yours and still do not get any errors. Maybe I misunderstood. Can you provide a screenshot?
Former SMF Core Developer | My Mods | SimplePortal

badman2nd

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.

badman2nd

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.

Advertisement: