Announcement

Collapse
No announcement yet.

How do I make it so that when a user is banned a reason can be put in...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I make it so that when a user is banned a reason can be put in...

    How do I make it so that when a user is banned a reason can be put in so that when the banned user tries to log-in it will show the you cannot access this page message along with what they did wrong (reason they were banned)?

  • #2
    Try this...

    Create a new profile field:

    Admin CP -> User Profile Fields -> Add New User Profile Field

    Make a Single-Line Text Box field that is private, not editable, and not required (so it doesn't show up anywhere).

    Then go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> header

    Add this code below the $spacer_open variable:

    Code:
    <!-- content table -->
    $spacer_open
    
    [color=red]<br />
    
    <if condition="$bbuserinfo[usergroupid] == [color=green]X[/color]">
    
    	<div align="left" style="color: red; background-color: white; border: 1px solid black; padding:2px">
    	You have been banned.<br /><br />
    
    	Reason: $bbuserinfo[[color=blue]fieldX[/color]]
    	</div>
    
    </if>[/color]
    
    $_phpinclude_output
    Where fieldX is the field indentifier of the new profile field as shown in your:

    Admin CP -> User Profile Fields -> User Profile Field Manager

    And X is the usergroupid of your banned usergroup:

    Admin CP -> Usergroups -> Usergroup Manager

    Now when you ban some one, edit their profile in your Admin CP to add the reason in the new profile field. This will display a highlighted box at the top of the page with the message.

    Comment


    • #3
      Thanks. One last question, is there a way for my moderators to edit this? Like add the textbox to the banning page?

      Comment


      • #4
        Originally posted by dsites
        Thanks. One last question, is there a way for my moderators to edit this? Like add the textbox to the banning page?
        Not without giving them access to the Admin CP, which would make them admins.

        Comment


        • #5
          Now that is very cool Jake!
          How come I never thought of that

          Comment


          • #6
            Originally posted by Jake Bunce
            Not without giving them access to the Admin CP, which would make them admins.
            Alright, thanks for the help.

            BTW, you should release that as a hack on vb.org.

            Comment


            • #7
              It doesn't require source code changes, so it doesn't fit vBulletin.org However, it could fit perfectly in the 'how do i' sub forum 'quick hints and tips'.

              Comment


              • #8
                Originally posted by Floris
                It doesn't require source code changes, so it doesn't fit vBulletin.org However, it could fit perfectly in the 'how do i' sub forum 'quick hints and tips'.
                What do you mean? It requires editing the header.

                Comment


                • #9
                  How would you ONLY display the message if the value in FIELDx is not null/blank?

                  Comment


                  • #10
                    Originally posted by Dennis Olson
                    How would you ONLY display the message if the value in FIELDx is not null/blank?
                    I believe this should work:

                    <br />
                    <if condition="$bbuserinfo[usergroupid] ==
                    X">

                    <div align="left" style="color: red; background-color: white; border: 1px solid black; padding:2px">
                    You have been banned.<br /><br />

                    <if condition="$bbuserinfo[fieldX]">

                    Reason: $bbuserinfo[fieldX]
                    </if>

                    </div>
                    </if>
                    vb3.5.2 : http://www.LamboForums.com

                    Comment


                    • #11
                      Or you could just make the textbox's default value "unspecified" so it would show: "Reason: unspecified"

                      Comment


                      • #12
                        Originally posted by dsites
                        What do you mean? It requires editing the header.
                        The header is not in the .php files, but in the template.

                        Comment


                        • #13
                          Originally posted by Floris
                          The header is not in the .php files, but in the template.
                          So for it to be put on vb.org, the hack has to edit some php file somewhere in vb?

                          Comment


                          • #14
                            hack == Source code modification == vBulletin.org
                            mod = Template modification == vBulletinTemplates.com

                            Comment


                            • #15
                              Ah, ok. I forgot about vbulletintemplates.com having hacks and not just styles.

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X