The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
+3
tikky
YoshiGM
كونان2000
7 posters

    Add a color + image to a specific group at the top of posts without JavaScript

    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Thu 11 Apr - 0:17

    Hello everyone

    With this trick, you can add a color to a specific group that appears at the top of posts
    and You can also add photos to a specific group,

    I know it's a common trick, but it was using JavaScript

    Now you don't need to use JavaScript-jQuery

    A trick I discovered that I wanted to share with you Bingo

    Add a color + image to a specific group at the top of posts without JavaScript Ocia_a12
    ----------------------------------------------




    phpBB2:



    All versions
    -------------

    Find the next part in viewtopic_body template
    Code:
    <!-- BEGIN displayed -->

    replace it with
    Code:
     
    <!-- BEGIN displayed -->
    <div class="conan2000-flower">{postrow.displayed.POSTER_NAME}</div>


    Save and publish Add a color + image to a specific group at the top of posts without JavaScript 644535217

    Installing the CSS
    Go to Administration Panel > Display > Colors > CSS stylesheet and paste the following rules in your stylesheet.
    Code:
    .conan2000-flower [style="color:؟؟؟؟؟"] {
    pointer-events: none;
        cursor: default;
        color: #0000 !important;
        display: block;
        background: ؟؟؟؟؟;
    }
     
    .conan2000-flower,.conan2000-flower strong {
      pointer-events: none;
        cursor: default;
        color: #0000 !important;
    }
    .conan2000-flower {
      pointer-events: none;
        background: #bcc2c7;
      color: #0000 !important;
    }
    Replace question marks in CSS code with group color (HEX color OR color name i.e : red)


    Add a color + image to a specific group at the top of posts without JavaScript Ocia_a14

    CSS: An image of a specific group
    Code:
    .conan2000-flower [style="color:?????"] strong {
     Â   background: url(https://i.servimg.com/u/f73/11/60/75/36/admini10.png) no-repeat;
    }
    Replace question marks in CSS code with group color


    Add a color + image to a specific group at the top of posts without JavaScript Admini10 Add a color + image to a specific group at the top of posts without JavaScript Helper10 Add a color + image to a specific group at the top of posts without JavaScript Top10




    Last edited by كونان2000 on Tue 17 Sep - 5:34; edited 2 times in total

    skouliki, YoshiGM, SarkZKalie, TonnyKamper, poesia-verses and Wizzard like this post

    YoshiGM
    YoshiGM
    Active Poster


    Male Posts : 1557
    Reputation : 146
    Language : Spanish & English
    Location : Mexico

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by YoshiGM Thu 11 Apr - 16:21

    Hmm interesting.. We can save some loading resources using a simple template edit instead of a JS.

    Good job :p
    tikky
    tikky
    Forumember


    Posts : 922
    Reputation : 159
    Language : 🇵🇹

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by tikky Thu 11 Apr - 18:46

    better is use the group as a reference (demo) but it's a good trick
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Thu 11 Apr - 23:55

    Thanks @YoshiGM and @tikky ^^

    tikky wrote:better is use the group as a reference (demo) but it's a good trick
    Oh I didn't know about it before but Glasses
    The trick is in my first post
    It is easy to modify and does not require expert programmers
    It works on all versions the same way
    lol!






    Mihai
    Mihai
    Forumember


    Male Posts : 926
    Reputation : 38
    Language : Romanian, English
    Location : Bucharest, Romania

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Mihai Fri 26 Apr - 3:11

    كونان2000 wrote:
    Hello everyone

    With this trick, you can add a color to a specific group that appears at the top of posts
    and You can also add photos to a specific group,

    I know it's a common trick, but it was using JavaScript

    Now you don't need to use JavaScript-jQuery

    A trick I discovered that I wanted to share with you Bingo

    Add a color + image to a specific group at the top of posts without JavaScript Ocia_a12
    ----------------------------------------------




    phpBB2:



    All versions
    -------------

    Find the next part in viewtopic_body template
    Code:
    <!-- BEGIN displayed -->

    replace it with
    Code:
     
    <!-- BEGIN displayed -->
    <div class="conan2000-flower">{postrow.displayed.POSTER_NAME}</div>


    Save and publish Add a color + image to a specific group at the top of posts without JavaScript 644535217

    Installing the CSS
    Go to Administration Panel > Display > Colors > CSS stylesheet and paste the following rules in your stylesheet.
    Code:
    * {
     Â   text-decoration: none;
    }

    .conan2000-flower [style="color:?????"] {
     Â   cursor: default;
     Â   color: #0000 !important;
     Â   display: block;
     Â   background: ?????;
    }

    .conan2000-flower,.conan2000-flower strong {
     Â   cursor: default;
     Â   color: #0000 !important;
    }
    .conan2000-flower {
     Â   background: #bcc2c7;
    }
    Replace question marks in CSS code with group color (HEX color OR color name i.e : red)


    Add a color + image to a specific group at the top of posts without JavaScript Ocia_a14

    CSS: An image of a specific group
    Code:
    .conan2000-flower [style="color:?????"] strong {
     Â   background: url(https://i.servimg.com/u/f73/11/60/75/36/admini10.png) no-repeat;
    }
    Replace question marks in CSS code with group color


    Add a color + image to a specific group at the top of posts without JavaScript Admini10 Add a color + image to a specific group at the top of posts without JavaScript Helper10 Add a color + image to a specific group at the top of posts without JavaScript Top10


    _____________________________________________________________________
    banana

    Hello,

    my suggestion is to make that color for each group for ModernBB and AwesomeBB for the header, where the title is included for the topic creations - and when someone replys (from the staff ofc, to show the color also... and so on!) - and for members to show default color...

    كونان2000 likes this post

    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Sat 27 Apr - 1:01

    hi @Mihai
    ok Dawa
    : AwesomeBB:

    TonnyKamper likes this post

    Mihai
    Mihai
    Forumember


    Male Posts : 926
    Reputation : 38
    Language : Romanian, English
    Location : Bucharest, Romania

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Mihai Sat 27 Apr - 3:15

    كونان2000 wrote:hi @Mihai
    ok Dawa
    : AwesomeBB:
    can you send an screenshot please? Also the tag </span-div> is totally wrong!
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Sat 27 Apr - 4:37

    Beyonder
    Beyonder
    Forumember


    Male Posts : 723
    Reputation : 29
    Language : English
    Location : Beyond Realm

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Beyonder Mon 29 Apr - 10:45

    Interesting!
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Tue 30 Apr - 1:06

    Thanks @Beyonder ^^
    Joost
    Joost
    Active Poster


    Male Posts : 1402
    Reputation : 194
    Language : Dutch, English
    Location : The Netherlands

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Joost Thu 29 Aug - 17:22

    @كونان2000 ,

    For the PhpBB2 version, on my forum have i a problem to add the CSS for multiple group colors i can set only one color for all posts. Smile

    TonnyKamper likes this post

    YoshiGM
    YoshiGM
    Active Poster


    Male Posts : 1557
    Reputation : 146
    Language : Spanish & English
    Location : Mexico

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by YoshiGM Thu 29 Aug - 17:39

    I'm testing this in my forum (phpBB3 version) and the username for normal users appears repeated in the background:

    Add a color + image to a specific group at the top of posts without JavaScript Image653
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Thu 29 Aug - 19:22

    Welcome @Joost @YoshiGM

    Are you sure you did all the steps correctly?

    phpBB3
    Add a color + image to a specific group at the top of posts without JavaScript Png-tr10

    PhpBB2
    Add a color + image to a specific group at the top of posts without JavaScript Png-tr11
    Joost
    Joost
    Active Poster


    Male Posts : 1402
    Reputation : 194
    Language : Dutch, English
    Location : The Netherlands

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Joost Thu 29 Aug - 20:04

    كونان2000 wrote:Welcome @Joost @YoshiGM

    Are you sure you did all the steps correctly?

    Yes, i have followed all the steps. guitar

    TonnyKamper likes this post

    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Thu 29 Aug - 21:17

    hi

    If you want more than one color, you have to repeat the code and put the new group color in the code.

    Code:
    .conan2000-flower [style="color:؟؟؟؟؟"] {
    pointer-events: none;
        cursor: default;
        color: #0000 !important;
        display: block;
        background: ؟؟؟؟؟;
    }
    Add a color + image to a specific group at the top of posts without JavaScript Ocia_a26

    Joost likes this post

    Joost
    Joost
    Active Poster


    Male Posts : 1402
    Reputation : 194
    Language : Dutch, English
    Location : The Netherlands

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Joost Fri 30 Aug - 17:21

    I don't know what happened, it works now. Smile

    TonnyKamper likes this post

    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Sat 31 Aug - 1:26

    Great, it's good that things are going well now
    Dawa
    Shek
    Shek
    Active Poster


    Male Posts : 1697
    Reputation : 61
    Language :  
    Location : Brazil

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by Shek Sat 31 Aug - 2:35

    Nice idea! With script this is possible also:
    Code:
    $(document).ready(function() {
        var vf_vs = _userdata["tpl_used"];var isso;var cor;var post_ = $('.post,.post-wrap');
       var classes = {
            'subsilver': 'tr.post .name strong a[href^="/u"] span',
            'prosilver': 'div.postprofile a[href^="/u"] span',
            'invision': '.postprofile-details a[href^="/u"] span',
            'punbb': 'div.user h4.username a[href^="/u"] span',
            'modernbb': 'div.postprofile-name a[href^="/u"] span',
            'awesomebb': '.post-body .post-author a[href^="/u"] span'
        };
        if(classes.hasOwnProperty(vf_vs)) {
          var selector = classes[vf_vs];
          post_.each(function() {
             isso = $(this);
             cor = isso.find(selector).attr('style').replace('color:', '');
             isso.find('div.post-head,div.post,tr.post').css('border-top', '5px solid ' + cor).addClass('st-rank');
          });
        } else {console.error('template no found on "classes". You use ' + vf_vs + ' version.');}
    });
    CSS:
    Code:
    .st-rank[style] {
        background-image: url(https://i.servimg.com/u/f21/16/89/96/68/chrome10.png);
        background-repeat: no-repeat;
        background-position: right 50%;
    }
    @كونان2000, you can suggest this on script also, please?
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Sat 31 Aug - 7:54

    Shek wrote:@كونان2000, you can suggest this on script also, please?
    hi @Shek
    I did not understand your request, mwii
    do you explain to me what you mean more?
    YoshiGM
    YoshiGM
    Active Poster


    Male Posts : 1557
    Reputation : 146
    Language : Spanish & English
    Location : Mexico

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by YoshiGM Mon 2 Sep - 17:20

    Hello @كونان2000 , yes i checked twice the codes.

    Even i changed the name of the div and the username still repeats in the bar

    Add a color + image to a specific group at the top of posts without JavaScript Image98
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Mon 2 Sep - 18:31

    hi @YoshiGM
    It seems to me that your CSS codes are different
    Here https://www.yoshifansclub.com/t25909-anunciado-un-nintendo-direct-partnershowcase-indie-world-para-el-27-08-24#229908

    For this you have to add the code as follows:
    Code:
    .bak-st-yfc, .bak-st-yfc strong {
        pointer-events: none;
        cursor: default;
        color: #0000 !important;
    }
    YoshiGM
    YoshiGM
    Active Poster


    Male Posts : 1557
    Reputation : 146
    Language : Spanish & English
    Location : Mexico

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by YoshiGM Mon 2 Sep - 18:36

    Hmm not worked, sorry :/

    If you pass your cursor in my profile and select the exact point of the username appears as i've showed before

    Also, the code for a strange reason ignores the background of the staff bar :S
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Mon 2 Sep - 18:50

    If you pass your cursor in my profile and select the exact point of the username appears as i've showed before
    You can delete names using the following code:
    Code:
    .bak-st-yfc, .bak-st-yfc strong {
        pointer-events: none;
        cursor: default;
        color: #0000 !important;
        font-size: 0;
        padding: 8px;
    }

    Also, the code for a strange reason ignores the background of the staff bar :S
    If you want more than one color, you have to repeat the code and put the new group color in the code.
    Add a color + image to a specific group at the top of posts without JavaScript Ocia_a26
    YoshiGM
    YoshiGM
    Active Poster


    Male Posts : 1557
    Reputation : 146
    Language : Spanish & English
    Location : Mexico

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by YoshiGM Mon 2 Sep - 20:22

    Ok for the repeated usernames in the bar. Add a color + image to a specific group at the top of posts without JavaScript 2705

    But the CSS is not adding the staff color that i have in group.

    Add a color + image to a specific group at the top of posts without JavaScript Image100

    I'm doing anything wrong?
    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Mon 2 Sep - 21:33

    Yes because you changed the codes
    You need a method that suits your forum

    previous code
    Code:
    .bak-st-yfc, .bak-st-yfc strong {
        pointer-events: none;
        cursor: default;
        color: #0000 !important;
        font-size: 0;
        padding: 8px;
    }

    replace
    Code:
    padding: 8px;

    Replace it with
    Code:
    height: 15px;


    In the following way, set the color of the groups:
    Code:
    .bak-st-yfc [style="color:#04B50F"] {
        height: 15px;
    pointer-events: none;
        cursor: default;
        color: #0000 !important;
        display: block;
        background: #04B50F;
    }

    YoshiGM and TonnyKamper like this post

    YoshiGM
    YoshiGM
    Active Poster


    Male Posts : 1557
    Reputation : 146
    Language : Spanish & English
    Location : Mexico

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by YoshiGM Tue 3 Sep - 1:29

    Alright!
    Now works perfectly!

    Thank you Very Happy

    كونان2000 likes this post

    كونان2000
    كونان2000
    Forumember


    Male Posts : 271
    Reputation : 113
    Language : Arabic

    Add a color + image to a specific group at the top of posts without JavaScript Empty Re: Add a color + image to a specific group at the top of posts without JavaScript

    Post by ÙƒÙˆÙ†Ø§Ù†2000 Tue 3 Sep - 8:45

    YoshiGM wrote:Alright!
    Now works perfectly!

    Thank you Very Happy
    You're welcome! I'm glad to hear everything is working well. Shake

      Current date/time is Sun 22 Sep - 22:28