Advertisement:

Author Topic: unlimited edit time for single board only  (Read 13155 times)

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
unlimited edit time for single board only
« on: June 13, 2008, 09:55:53 AM »
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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #1 on: June 16, 2008, 07:40:02 AM »
Did, I word this wrong or is it something that cannot be done? I did a search but came up empty.

Thanks.

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: unlimited edit time for single board only
« Reply #2 on: June 20, 2008, 03:37:54 AM »
Let's try this:

Post.php

We have 3.

Find:

Code: [Select]
if (!empty($modSettings['edit_disable_time']) && $row['posterTime'] + ($modSettings['edit_disable_time'] + 5) * 60 < time())Replace:

Code: [Select]
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:

Code: [Select]
'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:

Code: [Select]
'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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #3 on: June 20, 2008, 02:42:02 PM »
Great, I will give it a try and let you know. Thanks for the effort!

Pat

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #4 on: June 21, 2008, 07:30:55 AM »
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

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: unlimited edit time for single board only
« Reply #5 on: June 21, 2008, 08:09:40 AM »
It seems that we don't have the board in globals. After doing the edit above, do:

Display.php

Find:

Code: [Select]
global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments;
Replace:

Code: [Select]
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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #6 on: June 21, 2008, 09:12:00 AM »
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)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: unlimited edit time for single board only
« Reply #7 on: June 21, 2008, 09:27:11 AM »
The one in Display.php should be just $board, not $board92.
Former SMF Core Developer | My Mods | SimplePortal

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #8 on: June 21, 2008, 09:36:35 AM »
Ok, I will try again, And I want to thank you for taking your time with this.

Pat

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #9 on: June 21, 2008, 09:59:04 AM »
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.

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: unlimited edit time for single board only
« Reply #10 on: June 21, 2008, 11:48:01 AM »
After you do all the things above. Do this:

Display.php

Find:

Code: [Select]
      '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:

Code: [Select]
'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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #11 on: June 21, 2008, 12:54:39 PM »
I'm testing it now, i'll let you know.

Pat

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #12 on: June 21, 2008, 01:18:54 PM »
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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #13 on: June 22, 2008, 07:34:12 AM »
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

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: unlimited edit time for single board only
« Reply #14 on: June 22, 2008, 07:44:41 AM »
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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #15 on: June 22, 2008, 08:06:23 AM »
I'm sure I did! here is the display


Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #16 on: June 22, 2008, 08:07:11 AM »
here is post

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,524
  • Young and Foolish
    • SimplePortal
Re: unlimited edit time for single board only
« Reply #17 on: June 22, 2008, 08:48:24 AM »
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

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #18 on: June 22, 2008, 09:05:20 AM »
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.

Offline badman2nd

  • Semi-Newbie
  • *
  • Posts: 36
    • Badmans tropical fish forum
Re: unlimited edit time for single board only
« Reply #19 on: June 22, 2008, 09:10:59 AM »
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.