Two sets of rank images?

Discussion in 'vBulletin Discussions' started by Medora, Nov 27, 2009.

  1. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    Hi.

    I have two templates, and since one is bright while the other is dark, the rank images I prefer on one look far from good on the other one (even if it had the right matting). Hours of searching have lead to me reading a bit about replacement variables, but right now I'm still confused about how to use them. Here's the relevant portion of what I said elsewhere:

    I'm assuming that I should be making replacements one rank icon at a time, which is why I was experimenting with the administrator rank, which has the file name "stars_orange.gif".

    Also, the "rank" files contained in each template already existed in those directories, but were empty. I'm wondering if it was OK for me to use those, or if I should have created new files.

    Any ideas?

    Regards,

    Kevin
     
  2. Shelley

    Shelley Regular Member

    Joined:
    May 26, 2009
    Messages:
    826
    Likes Received:
    61
    At the bottom of each styles main css you have the option to add replacement variables.

    At the very bottom of your "all style options" page for each style (where you input the css values, etc) you'll see a box titled "Replacements Variables". Click "Add new replacement variable", select the style you want different images to show in. In the Search for Text box type in the original url, eg /images/icons/originalformat.gif and in the Replace with Text box type in the new url to the images, for example /newstyle/images/icons/whateverformat.png


    awww.adminaddict.net_data_MetaMirrorCache_c041544fb04cfa95d292db7f741d86b0.gif
     
  3. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    Shelley,

    Thank you for the help. Unfortunately, this seems to be where the problem lies. The original location, or the location entered for "User Rank File Path" is "/enlighten/ranks/stars_orange.gif". Since that is the one I want to display for the enlighten template, I have the greenfox template set to replace that with "/images/greenfox/ranks/stars_orange.gif".

    In other words, I followed the instructions by selecting greenfox from the Style drop-down menu, putting the following in the Search for Text box:

    /enlighten/ranks/stars_orange.gif

    And put the following in the Replace with Text box:

    /images/greenfox/ranks/stars_orange.gif

    I have confirmed that I have a different rank image uploaded to /image/greenfox/ranks/, but it still displays the rank image uploaded to /enlighten/ranks/ when I view the greenfox template.

    I've been using "Update User Titles and Ranks", too, but that doesn't solve the problem.
     
  4. Shelley

    Shelley Regular Member

    Joined:
    May 26, 2009
    Messages:
    826
    Likes Received:
    61
    you may need to insert the full url. have you tried inserting the ful url?
     
  5. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
  6. Shelley

    Shelley Regular Member

    Joined:
    May 26, 2009
    Messages:
    826
    Likes Received:
    61
    Try the following:

    In the search for text insert... enlighten/ranks/stars_orange.gif

    and in the replacement box insert..... greenfox/ranks/stars_orange.gif and if that doesn't work insert.... images/greenfox/ranks/stars_orange.gif


    Let us know when you tried that. Hopefully that will work.
     
  7. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    Shelley,

    Unfortunately, that had no effect.
     
  8. FullMetalBabe

    FullMetalBabe Zealot

    Joined:
    May 30, 2009
    Messages:
    2,912
    Likes Received:
    339
    ~_~ Man, if this was MyBB it would be as simple as putting {theme}....

    Anyways, let me see if I get you, Mudora. You have two themes and two different rank image set which look better with it's respective themes. You want to be able to display the rank images based on the themes?

    So if I am with the theme Enlighten I will see enlighten rank images and the ones with the theme Greenfox will see a whole different set of rank images, no?

    I don't think it's possible on vB.
     
  9. Chani

    Chani Grand Master

    Joined:
    Sep 1, 2009
    Messages:
    884
    Likes Received:
    54
    First Name:
    Chani
  10. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    FMB,

    Correct.

    Chani,

    Thanks. I actually found similar instructions last night. I'm wondering how (if) I can use these conditionals to prevent the rank images from displaying in greenfox, while allowing rank text to still appear. Meanwhile, rank text and image should appear in enlighten.

    Here's the thing, though: in the User Rank Manager, under "Rank Type," in the second field that says "OR you may enter text / HTML is allowed," I entered the following because I don't want to have to sacrifice rank text for rank images in enlighten:

    <b>Administrator</b><br /><img src="/enlighten/ranks/stars_orange.gif"/>

    I don't suppose there's an easy way to have greenfox ignore the images while still displaying the text?
     
  11. Chani

    Chani Grand Master

    Joined:
    Sep 1, 2009
    Messages:
    884
    Likes Received:
    54
    First Name:
    Chani
    I haven't tried yet, but I wonder if you could insert a conditional in the HTML section there for your templates...

    I'll need to give that a try. :)
     
  12. Chani

    Chani Grand Master

    Joined:
    Sep 1, 2009
    Messages:
    884
    Likes Received:
    54
    First Name:
    Chani
    try:

    HTML:
    <b>Administrator</b><br /><if condition="$bbuserinfo[styleid] == X"><img src="/enlighten/ranks/stars_orange.gif"/><else /><img src="/images/greenfox/ranks/stars_orange.gif" /></if>
    Replace X with your styleid.
     
  13. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    I actually tried that earlier, and was most saddened to find that the conditionals have no effect when placed in that HTML section.
     
  14. Chani

    Chani Grand Master

    Joined:
    Sep 1, 2009
    Messages:
    884
    Likes Received:
    54
    First Name:
    Chani
    Grrr...well, hadn't tried it, so I didn't know. :(

    There HAS to be a way of getting this to work!
     
  15. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    Why don't you just enter the rank HTML directly in the style's postbit template, and skip using the rank manager?
     
  16. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    Nick,

    I suspect my question may be stupid, but I have to ask to get it out of the way:

    How would I do that so that the postbit would show the appropriate image based on the person's rank? For example, if he's a moderator it will show the image with the file name stars_red.gif, or if he's a member with a certain amount of posts he'll have the image with the file name stars_5.gif show up.
     
  17. Medora

    Medora Regular Member

    Joined:
    Sep 18, 2009
    Messages:
    134
    Likes Received:
    18
    Location:
    California
    Never mind; I've discovered the solution. After my previous post in this topic, I resumed my efforts by searching and reading anything relevant I could find. Finally, I stumbled upon this somewhat relevant but epic(-ly?) helpful post dating all the way back to 2004:

    vBulletin.org Forum - View Single Post - Groupicons

    Anyways, I took that, and looked at my postbit for enlighten, specifically this portion:

    Code:
                    <if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
    <if condition="$post['rank']"><div class="smallfont">$post[rank]</div>
    $template_hook[postbit_userinfo_left]
    Now look how I altered it:

    Code:
                    <if condition="$post['rank']"><div class="smallfont">$post[rank]</div><if condition="$post[usergroupid]==6"><img src="enlighten/ranks/stars_orange.gif"/></if><if condition="$post[usergroupid]==5"><img src="enlighten/ranks/stars_red.gif"/></if><if condition="$post[usergroupid]==26"><img src="enlighten/ranks/stars_0.gif"/></if><if condition="$post[usergroupid]==15"><img src="enlighten/ranks/stars_1.gif"/></if><if condition="$post[usergroupid]==16"><img src="enlighten/ranks/stars_1.gif"/></if><if condition="$post[usergroupid]==17"><img src="enlighten/ranks/stars_2.gif"/></if><if condition="$post[usergroupid]==18"><img src="enlighten/ranks/stars_2.gif"/></if><if condition="$post[usergroupid]==19"><img src="enlighten/ranks/stars_3.gif"/></if><if condition="$post[usergroupid]==20"><img src="enlighten/ranks/stars_3.gif"/></if><if condition="$post[usergroupid]==21"><img src="enlighten/ranks/stars_4.gif"/></if><if condition="$post[usergroupid]==22"><img src="enlighten/ranks/stars_4.gif"/></if><if condition="$post[usergroupid]==23"><img src="enlighten/ranks/stars_5.gif"/></if></if>
    I repeated the file name for some of the ranks because I want regular members to be promoted two ranks before receiving another star.

    I still have to do the same thing to my other template. Also, I still need to add this to at least one more place: the view profile page. (I'm wondering where else I may need to add this code, hm).

    In any case, it is apparent that this method works, and allows you to keep your text rank. The image will automatically place itself below the text rank, if you implement it the way I did above.

    You can see a demo on any page on my forum. :)

    Thanks again for the help, everyone. I hope that this information, in turn, may help a future reader of this thread.
     
    2 people like this.
  18. FullMetalBabe

    FullMetalBabe Zealot

    Joined:
    May 30, 2009
    Messages:
    2,912
    Likes Received:
    339
    I might need it for Pisoga ~_~ When I make the new skin for New Years, maybe I'll make new rank images, but I'll keep the old skin.

    Thanks, Mudora~
     
  19. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218

Share This Page