Announcement

Collapse
No announcement yet.

Display a notice for specific usergroups for any specific pages

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Free Mod Display a notice for specific usergroups for any specific pages

    In some cases, you would want to display a notice for specific usergroups on specific page(s).

    Click image for larger version  Name:	image.png Views:	1 Size:	16.5 KB ID:	13210

    You would normally do this by adding a Notice in AdminCP and then choosing a usergroup in the "User belongs to usergroup" dropdown. But this has the following limitations:
    • You can only select one usergroup. If you need to select multiple usergroups, you'd have to create a separate notice and duplicate it and then change the usergroup. This is cumbersome and hard to maintain especially if you need this for 3 or more usergroups.
    • The "User is browsing channel" dropdown doesn't have the option for all pages on the forum. For example, if you want to display a notice in the "Create New Topic" page, there's no option to display a notice there.

    Enter this mod...(trumpet sound)

    Add this custom CSS in css_additional template in AdminCP or in Sitebuilder > Style > CSS Editor.

    The style I used is the same style used in the Notice by default. Depending on how many usergroups and pages you want to display a notice for and to, choose from one of these:

    For single usergroup on a single page: (Change XX and YY to corresponding page id and usergroup id, respectively)
    Code:
    #vb-page-body.pageXX[data-usergroupid="YY"] .page-title-widget .module-title:after {
        content: 'NOTE: Your post will be moderated.'; /* Update the message accordingly */
        border: 1px solid #E1D47E;
        background: #FCF7D7;
        font-weight: normal;
        font-size: 13px;
        display: block;
        padding: 6px 10px;
        margin-top: 15px;
        border-radius: 3px;
    }
    For single usergroup on multiple pages: (Change XX/ZZ and YY to corresponding page id and usergroup id, respectively)
    Code:
    #vb-page-body.pageXX[data-usergroupid="YY"] .page-title-widget .module-title:after,
    #vb-page-body.pageZZ[data-usergroupid="YY"] .page-title-widget .module-title:after {
        content: 'NOTE: Your post will be moderated.'; /* Update the message accordingly */
        border: 1px solid #E1D47E;
        background: #FCF7D7;
        font-weight: normal;
        font-size: 13px;
        display: block;
        padding: 6px 10px;
        margin-top: 15px;
        border-radius: 3px;
    }
    For multiple usergroups on a single page: (Change XX and YY/ZZ/AA to corresponding page id and usergroup id, respectively)
    Code:
    #vb-page-body.pageXX[data-usergroupid="YY"] .page-title-widget .module-title:after,
    #vb-page-body.pageXX[data-usergroupid="ZZ"] .page-title-widget .module-title:after,
    #vb-page-body.pageXX[data-usergroupid="AA"] .page-title-widget .module-title:after {
        content: 'NOTE: Your post will be moderated.'; /* Update the message accordingly */
        border: 1px solid #E1D47E;
        background: #FCF7D7;
        font-weight: normal;
        font-size: 13px;
        display: block;
        padding: 6px 10px;
        margin-top: 15px;
        border-radius: 3px;
    }
    For multiple usergroups on multiple pages: (Change XX/YY/ZZ and AA/BB/CC to corresponding page id and usergroup id, respectively)
    Code:
    #vb-page-body.pageXX[data-usergroupid="AA"] .page-title-widget .module-title:after,
    #vb-page-body.pageYY[data-usergroupid="BB"] .page-title-widget .module-title:after,
    #vb-page-body.pageZZ[data-usergroupid="CC"] .page-title-widget .module-title:after {
        content: 'NOTE: Your post will be moderated.'; /* Update the message accordingly */
        border: 1px solid #E1D47E;
        background: #FCF7D7;
        font-weight: normal;
        font-size: 13px;
        display: block;
        padding: 6px 10px;
        margin-top: 15px;
        border-radius: 3px;
    }
    To find the page id, right click on the target page, and choose "Inspect element" (or equivalent), search for the <body> tag. The <body> tag has a class attribute that has a value that includes "pageXX" (e.g. page19).

    To find the usergroup id, go to AdminCP > Usergroups > Usergroup Manager. Each usergroup displays the id in the Edit Usergroup dropdown.

    Enjoy!
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    #2
    Nice Mod Glenn!!!

    Comment


      #3
      Unfortunately, it does not work for me. I have installed your hook require prefix, can this cause any problem? I tried different user groups and different pages
      A cordial greeting

      Comment


        #4
        Ignore the previous message works perfectly. Thank you for your time and your work. regards
        A cordial greeting

        Comment


        • glennrocksvb
          glennrocksvb commented
          Editing a comment
          Glad the mod works and you sorted out your issue yourself.

        #5
        Excellent. Thanks much.

        Comment


          #6
          THANKS so much!

          very helpful

          Comment

          Users Viewing This Page

          Collapse

          There is 1 user viewing this forum topic.

          • Guest Guest

          Latest Posts

          Collapse

          • Kubes
            Reply to New here
            by Kubes
            Welcome i am learning too. What version you running? I just upgraded to 6.0.3
            Yesterday, 04:45 PM
          • nekro711
            New here
            by nekro711
            Hello guys,

            Im new in this vbulletin thing and while i googled for some info i found this forum.
            Yesterday, 04:12 PM
          • MikeSD
            Hi, I'm starting over
            by MikeSD
            My web host went out of business after nearly 20 years. I had to do backups of all my Forums to a new site. That's when I started having problems....
            Yesterday, 03:57 AM
          Working...
          X
          Searching...Please wait.
          An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

          Please push the back button and reload the previous window.'
          An unexpected error was returned: 'Your submission could not be processed because the token has expired.

          Please push the back button and reload the previous window.'
          An internal error has occurred and the module cannot be displayed.
          There are no results that meet this criteria.
          Search Result for "|||"