1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Daily Thread Actions 2016-05-10

Do stuff to threads, eg. closing based on age, moving based on OP group, and many more

  1. sheel

    sheel Member

    sheel submitted a new resource:

    Daily Thread Actions - Do stuff to threads, eg. closing based on age, moving based on OP group, and many more

    Read more about this resource...
     
  2. otto

    otto Well-Known Member

    Hello,

    nice idea - but I think it would be great when you code a log to easy redo wrong going changes. Or a automatic DB backup of the changed tables every time bevore the tool run?
     
  3. Mouth

    Mouth Well-Known Member

    I'd like to see an image of the ACP options page please.
     
  4. sheel

    sheel Member

    @Mouth
    See attached image. (It's not very exiting.)
    The rest, below the displayed part, is just explaining text.
     

    Attached Files:

  5. sheel

    sheel Member

    @otto
    Doing DB backups from an XF Plugin with PHP would introduce a boatload of problems. Storage engine and DB locks, File permissions, DB permissions, PHP timeouts, etc.etc.etc. Sorry, I can't spend years to reimplement eg. PHPmyAdmin. (And, to start with, any sane admin should make proper backups (with existing tools) anyways.)
     
  6. This sounds very interesting for use in "For Sale Forums" where we have posting permissions based on usergroups and paid subscriptions - if someone's subscription expires, their posting is locked / deleted. Automated locking of old posts in those forums.
     
  7. ENF

    ENF Well-Known Member

    Hello,

    I was taking a look at this as an option to manage some forums on a time basis. However, no matter what rule I put in place, the log file during testing always has the same result. I used your sample code as well as tried to write a few of my own, but this is the same result below each time..

    Code:
    Thu, 24 Nov 16 15:51:26 +0000
    
    RULES
    
    Array
    (
    )
    
    
    ACTIONS
    
    ERROR IN LINE 1
    
    Any thoughts?
     
  8. sheel

    sheel Member

    Could you show your current rules?
     
  9. ENF

    ENF Well-Known Member

    Thanks for your reply.

    The below rule is the one that I've been working on to get working:

    Code:
    32 # >7 # 42
    
    The way I read your examples, that should move any threads from forum #32 to #42 if the last post was greater than 7 days ago.
    There doesn't need to be any action such as stick, lock or prefixes in this case.

    Thanks!
     
  10. sheel

    sheel Member

    Hm. And node 32 and 42 really exist?
     
  11. ENF

    ENF Well-Known Member

    Absolutely. We actually have nodes 1 to 55 that are all valid.
    The target nodes are normal, public nodes that don't require any special permission. (except a valid forum account)

    If it matters.. we're on 1.5.11.. and actually, I will try this again later tonight on a fresh copy of our main site to make sure there weren't any possible conflicts. (first install was done on a test site with identical content of the main site)
     
  12. sheel

    sheel Member

    Sorry, until now I can't find any problem.
    For me it works on 1.5.11 too...
     
  13. ENF

    ENF Well-Known Member

    Thank you for the reply. There must be a conflict (within our site)... if I ever find the solution on my own, I'll reply back here later.
     
  14. sheel

    sheel Member

    If you want, try the attached file instead of the original RuleAction.php. When it runs (start the cronjob in XF manually) it creates a file problem.log with some additional informations Post this here then.
     

    Attached Files:

  15. ENF

    ENF Well-Known Member

    Thank you, will give a shot.
     
  16. ENF

    ENF Well-Known Member

    Just quickly ran this and the problem.log file has this content:

    Code:
    mark1
    32 # >7 # 42
    mark2
    mark3
    mark4
    mark5
    
    I will have more results from my own conflict tests a little later today.
     
  17. sheel

    sheel Member

    Ok, we're getting closer. Please this too:
     

    Attached Files:

  18. ENF

    ENF Well-Known Member

    Thanks... ran that and this what the output was in the problem.log:

    Code:
    mark6
    mark7 53 
    mark8
    forid array (
      0 => 37,
      1 => 38,
      2 => 35,
      3 => 34,
      4 => 30,
      5 => 33,
      6 => 39,
      7 => 40,
      8 => 51,
      9 => 52,
      10 => 49,
      11 => 48,
      12 => 43,
      13 => 47,
      14 => 29,
      15 => 28,
      16 => 13,
      17 => 14,
      18 => 12,
      19 => 8,
      20 => 3,
      21 => 6,
      22 => 15,
      23 => 18,
      24 => 25,
      25 => 26,
      26 => 24,
      27 => 23,
      28 => 19,
      29 => 21,
      30 => 2,
    )prefid array (
      0 => 0,
      1 => 29,
      2 => 30,
      3 => 31,
      4 => 32,
      5 => 28,
      6 => 27,
      7 => 23,
      8 => 24,
      9 => 25,
      10 => 26,
      11 => 33,
      12 => 34,
      13 => 40,
      14 => 41,
      15 => 42,
      16 => 15,
      17 => 39,
      18 => 38,
      19 => 35,
      20 => 36,
      21 => 37,
      22 => 22,
      23 => 21,
      24 => 4,
      25 => 5,
      26 => 6,
      27 => 8,
      28 => 3,
      29 => 44,
      30 => 7,
      31 => 43,
      32 => 2,
      33 => 9,
      34 => 10,
      35 => 17,
      36 => 18,
      37 => 19,
      38 => 20,
      39 => 16,
      40 => 14,
      41 => 11,
      42 => 12,
      43 => 13,
      44 => 1,
    )
    
    I tried a different set that time:

    Rules:
    29 # >7 # 53
     
  19. sheel

    sheel Member

    As you said before, the old rule "32 # >7 # 42" moves the selected thread to forum 42.
    Similar to that, the new rule moves to 53.

    But you have no forum 42 and/or 53...

    See the "forid array" part in the output. The numbers on the right side (37, 38, 35, ...) are all forum IDs you have.

    ( :D )

    ...

    About cleaning up: I suggest using the original unmodifed RuleAction.php again. In theory, it's no problem to keep the current one, it's just that each time it runs it will add more lines to problem.log
     
  20. ENF

    ENF Well-Known Member

    Hmm, that doesn't make sense. They are clearly there... But, now knowing that this addon isn't showing everything, I think I know why...

    Thanks for your help!
     

Share This Page