MyBB Hacks

Full Version: Forum warning/disclaimer/rules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
This is a simple modification which is useful for:
  • Forums in which you want to display a warning/disclaimer before people enter
  • Forums in which you want to force users to view some rules before doing anything in them

This makes use of the rarely used password feature of MyBB.



  1. Edit the forum you wish to force a message display; set a template prefix if there isn't one set (in this example, we'll use the prefix fwarn_)
  2. Set the forum password to agree
  3. Add a template named fwarn_forumdisplay_password (change if you're using a different prefix)

    HTML Code
    <html>
    <head>
    <title>{$mybb->settings['bbname']} - {$lang->password_required} </title>
    {$headerinclude}
    </head>
    <body>
    {$header}
    <form action="{$_SERVER['REQUEST_URI']}" method="post">
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
    <tr>
    <td class="thead" align="center"><strong>
    
    
    
    
    Warning
    
    
    
    
    
    </strong></td>
    </tr>
    <tr>
    <td class="trow2">
    
    
    
    
    You are entering a forum which may be too awesome for you. If you continue, you implicitly acknowledge that we are not responsible for any harm caused by excessive awesomeness.
    
    
    
    
    
    </td>
    </tr>
    </table>
    <br />
    <input type="hidden" name="pwverify" value="agree" />
    <div align="center"><input type="submit" class="button" name="submit" value="Agree" /></div>
    </form>
    {$footer}
    </body>
    </html>

    Edit the above message to suit your needs.  I've spaced out the parts which you may be interested in editing (title and body).



Now when users try to enter this forum through any means, they'll be brought up with a simple message before they enter.  Once they've clicked the "Agree" button, they'll be able to view the forum.  Works for guests too.
Very neat - I just tested this. It does appear to be added to cookies though - like once I entered it in a session, then I could keep entering. However, once I logged out and logged back in again then I had to agree again. Also, as a guest (from same PC and IP address) the sessions work. This is good, because otherwise it COULD get very annoying.

Very coolSmile
Hmm, I guess maybe a MyBB plugin which enters in the password once a user already has done so should be made...
(10-05-2010 04:12 PM)ZiNgA BuRgA Wrote: [ -> ]This makes use of the rarely used password feature of MyBB.

It is very very rare (I think never) for me to use the feature Biggrin
But now, with this modification, I can use it in that way.
Thank you very much, Yumi Smile
Tongue I amused at this;
Yumi Wrote:ou are entering a forum which may be too awesome for you. If you continue, you implicitly acknowledge that we are not responsible for any harm caused by excessive awesomeness.

Nice tip Yumi ! Smile
Can someone help me out here? Every time I try and follow the instructions for this mod, when I go to the forum I set it up for, I just get a request to enter the password from MyBB - no warning. How come?

Thanks!
I presume you actually have XThreads installed?
(08-24-2011 09:18 PM)ZiNgA BuRgA Wrote: [ -> ]I presume you actually have XThreads installed?

Yes, MyBB says the plugin is correctly installed.
(08-24-2011 09:18 PM)ZiNgA BuRgA Wrote: [ -> ]I presume you actually have XThreads installed?

Yes, MyBB says the plugin is correctly installed.

Let me just verify I am doing things right. I go to configuration->thread prefixes to add the prefix. Then in the templates area under default templates, add new template and copy/paste the code. Then set the forum password to "agree".
(08-25-2011 06:20 AM)Codyy Wrote: [ -> ]Let me just verify I am doing things right. I go to configuration->thread prefixes to add the prefix. Then in the templates area under default templates, add new template and copy/paste the code. Then set the forum password to "agree".

You need to create the templates under Global Templates...not Default.
Got it!
Thanks guys!

Two things - turns out I was using the forum's built in thread prefix thing, not that of Xthread's. And I also needed to move the template to global.

I've been out of the web/forum game for a few years so I appreciate your patience and guidance. Thanks for the awesome plugin.
Pages: 1 2 3
Reference URL's