Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

if discussion older than X days display text.

VazVaz New
edited May 2007 in Vanilla 1.0 Help
Hi, I'm not fluent at all with php. I was wondering if someone could write up some code to display text if the the last post if older than X days. psuedo code: if last post > 30 days write "This discussion has be inactive for more than 30 days. Please consider starting a new discussion" else nothing also where would the template edit need to be made in order for it to appear just above 'enter your comments' box. Kind regards, Vaz


  • Options
    edited May 2007
    that isn't hard to make.
    Where do u want the message to appear.
  • Options
    "it to appear just above 'enter your comments' box." :) This could be a useful addition to the functionality of your expiration extension, or a sister extension, schizo?
  • Options
    edited May 2007
    if you are willing to compromise on the position then you can use Nuggets extension to do that. for ex instead of above "Enter your comment" it will appear above "Add Comments" in big fonts so you don't miss it

    Create a new nugget
    Select "Hide Nugget name"
    Pan: "Below Content"
    Weight: -10
    Pages: Comment List only
    <?php global $CommentGrid; if (strtotime("now") > $CommentGrid->Discussion->DateLastActive+(30*24*60*60)) { echo '<div style="border:#FFEDAE 1px solid; background-color:#FEF9E9;padding:10px;margin:10px 0;text-align:center;font-size:20px;" >This discussion has be inactive for more than 30 days. Please consider starting a new discussion</div>'; } ?>
    style it as you wish

    Mini you are right. the Discussion expiration should state as to why the discussion is closed. it will help admins know the cause of foreclosure :P
  • Options
    Thank you guys. You're the best :)
  • Options
    is this the fastest solution. within 30 min problem solved.
This discussion has been closed.