Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorWanderer
    • CommentTimeJul 13th 2006
     # 1
    Here's hoping I don't get blasted for this idea...

    I would like to see nice little icons to replace Private, Sticky, and Closed labels.

    There I said it!

    Anyone up to writing an extension to accomplish this?
    •  
      CommentAuthorJazzman
    • CommentTimeJul 13th 2006
     # 2
    You don't need an extension :) It's a matter of CSS. Take a look at my Jazzmanforum theme. There you will see how to accomplish such a thing :)
    •  
      CommentAuthorlament
    • CommentTimeJul 13th 2006
     # 3
    yup..

    .Sticky .DiscussionType {
    background: url('ico.sticky.gif') no-repeat center left;
    }
    .Closed .DiscussionType,
    .Hidden .DiscussionType {
    background: url('ico.closed.gif') no-repeat center left;
    }
    •  
      CommentAuthorWanderer
    • CommentTimeJul 13th 2006 edited
     # 4
    OK thanks, the discussion icon works OK but the Sticky and Closed icons have "Sticky" and "Closed" overlapping them.

    If I take these labels out (in Application Settings) the icons don't appear at all.

    I tried a non-breaking space but the encoding stuffed up (appeared as an unknown character).

    So what's the trick?
    •  
      CommentAuthorTrey
    • CommentTimeJul 13th 2006
     # 5
    my trick I was doing before was kinda funny I think..
    you can go to the application settings page and then for the Label prefix put <img alt="pic" src=" and then Label suffix put " />
    and you'll need a short url for the images, (you can always use tinypic.com or tinyurl.com for this) and then put in the small url to the pictures in the spots where the titles would be. The only bad thing about doing it like that is you would need an image for each label there.

    I'm sure you could still do it with just css though if you would like to. Try adding padding-left:XXpx to the classes that are messing up a bit for ya, or margin-left one of them might work
    • CommentAuthorlowbenzo
    • CommentTimeJul 13th 2006
     # 6
    simple to do, in the css class for the labels just add,

    display: block;
    width: [your icon pic width]px;
    height: [your icon pic height]px;
    text-indent: -900000px;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    background: url('[yourimagepath]');


    This will tell the text to go offscreen and hide once its out of the viewable width and height of that area this means you can still have [Sticky] text as your label and inside the code but all that will show up is the image.
    •  
      CommentAuthorWanderer
    • CommentTimeJul 13th 2006
     # 7
    Thanks lowbenzo, it worked with a little tweak or two...
    display: block;
    width: 0px;
    height: 18px;
    text-indent: -2000px;
    overflow: hidden;
    font-size: 0;
    line-height: 20px;
  1.  # 8
    It's much better to just use padding:
    .Sticky, .DiscussionType {
    background: url('icon.gif') no-repeat left center transparent;
    padding-left: 15px }
    •  
      CommentAuthorWanderer
    • CommentTimeJul 13th 2006
     # 9
    OK so, thanks to the good people here
    I've worked out how to put icons beside Closed and Sticky,
    where do I find the CSS tag for Bookmarked?
    •  
      CommentAuthora_j
    • CommentTimeJul 13th 2006 edited
     # 10
    .Bookmarked .DiscussionType {
    background: url('ico.bookmark.gif') no-repeat center left;
    }


    ~line 438 in vanilla.css

    you can usually find what you're looking for by searching vanilla.css
    •  
      CommentAuthorWanderer
    • CommentTimeJul 14th 2006
     # 11
    Thanks a_j it added the bookmark icon as well as the discussion icon but that's OK, I can live with it.
    •  
      CommentAuthorBergamot
    • CommentTimeJul 14th 2006
     # 12
    You can separate those if you want to style them differently.
    •  
      CommentAuthorWanderer
    • CommentTimeJul 14th 2006
     # 13
    Thanks Bergamot, I have a discussion icon and a bookmark icon.

    I expected the bookmark icon to replace the discussion icon, instead it sits beside it.

    That's OK, I created a new bookmark icon, it looks OK...

    •  
      CommentAuthorAssProphet
    • CommentTimeJul 15th 2006
     # 14
    Wanderer, You may already be aware of this, but if you're looking for a good set 1of icons check out famfamfam's silk icon's set There are 1,000 different icons in that set and you'll probably either find something to use, or get inspired to design a better icon yourself.
    •  
      CommentAuthorJazzman
    • CommentTimeJul 15th 2006
     # 15
    those icons are the best!! I love em!! Too bad almost everyone is using them... they're not special anymore :P
    •  
      CommentAuthorAssProphet
    • CommentTimeJul 15th 2006
     # 16
    yeah, I use them as a libarary for inspiration. There are a lot of spatial problems that these icons have already solved. I find that they help you get into the right frame of mind for minimalist designing.
    • CommentAuthorDaniel_L
    • CommentTimeJul 18th 2006
     # 17
    my trick I was doing before was kinda funny I think..
    you can go to the application settings page and then for the Label prefix put <img alt="pic" src=" and then Label suffix put " />


    i've done something similar. but i dropped out the label prefix and suffix, and added a whole img-tag to the return string. by that, i can easily "add" several img-tags, which is necessary if you have a closed bookedmark sticky discussion, which is hidden.
    •  
      CommentAuthora_j
    • CommentTimeAug 2nd 2006 edited
     # 18
    hmmm, I just noticed that this is working correctly with the sticky icon. In other words, on a sticky topic (that's not closed; closed stickies retain the closed symbol whether bookmarked or not), if you bookmark it the bookmark symbol replaces the sticky icon.

    I can't for the life of me figure out how to do this with regular discussion icons. If you bookmark a regular discussion, it just moves over the discussion icon and adds the bokkmark icon to the left:



    Anyone have any ideas what's going on?



    Any help appreciated :)
    •  
      CommentAuthora_j
    • CommentTimeAug 2nd 2006
     # 19
    OK, to get it to show only one icon next to the topic name, you need to have this in your vanilla.css file underneath where you assign the icons to the topic:


    .Bookmarked .DiscussionTopic,
    .Whispered .DiscussionTopic,
    .Sticky .DiscussionTopic,
    .Closed .DiscussionTopic,
    .Hidden .DiscussionTopic {
    background: none;
    padding-left: 0px !important;
    }


    Part of it will already be there, but you need to add what's not in order to get it to work.

    Thanks.
    •  
      CommentAuthorWanderer
    • CommentTimeAug 2nd 2006
     # 20
    Cool a_j, that worked a treat!
    Now a I have an icon for closed, and one for sticky which work OK
    but a closed-sticky just gets a closed icon,
    can we give it a closed-sticky icon?

    I just have to learn more CSS!
    •  
      CommentAuthora_j
    • CommentTimeAug 2nd 2006 edited
     # 21
    I'm really flying by the seat of my pants here, so my solutions may not be the best way, but they seem to work...

    The only way I can see to have a closed-sticky is to create a seperate closed-sticky icon, and add this to the css below the icon definitions you already have:

    .Sticky.Closed .DiscussionType {
    background: url('sticky_closed.png') no-repeat center left;
    }


    This should do the trick.

    btw, since you're using these icons, I got the legend up and running indicating what the icons mean. If you're interested I can get you the code for it.

    •  
      CommentAuthorWanderer
    • CommentTimeAug 2nd 2006
     # 22
    Nope a_j, that brought up both icons, the closed_sticky icon and the sticky icon.

    ico

    The top one is [Sticky] only
    The bottom one is [Sticky] and [Closed]
    •  
      CommentAuthora_j
    • CommentTimeAug 2nd 2006
     # 23
    did you forget to add the code mentioned above to eliminate the double icons?


    .Bookmarked .DiscussionTopic,
    .Whispered .DiscussionTopic,
    .Sticky .DiscussionTopic,
    .Closed .DiscussionTopic,
    .Hidden .DiscussionTopic {
    background: none;
    padding-left: 0px !important;
    }


    if not, I'm not sure what's going on.... Here is the icon part of my vanilla.css, it works for me...

    .NewComments,
    #Discussions li.Read.NewComments ul {
    background-color:#f1f1f1 !important;
    background: url('new.png') no-repeat center left ;
    }

    .Sticky .DiscussionType {
    background: url('Sticky.png') no-repeat center left;
    }
    .Bookmarked .DiscussionType {
    background: url('bookmark.png') no-repeat center left;
    }
    .Whispered .DiscussionType {
    background: url('whisper.png') no-repeat center left;
    }
    .Closed .DiscussionType {
    background: url('closed.png') no-repeat center left;
    }

    .Hidden .DiscussionType {
    background: url('closed.png') no-repeat center left;
    }
    .Sticky.Closed .DiscussionType {
    background: url('sticky_closed.png') no-repeat center left;
    }

    .DiscussionTopic {
    background: url('comments.png') no-repeat center left;
    padding-left: 30px !important;
    }
    .Bookmarked .DiscussionTopic,
    .Whispered .DiscussionTopic,
    .Sticky .DiscussionTopic,
    .Closed .DiscussionTopic,
    .Hidden .DiscussionTopic {
    background: none;
    padding-left: 0px !important;
    }
    •  
      CommentAuthorWanderer
    • CommentTimeAug 3rd 2006
     # 24
    Ouch, now I have a headache, I think I'll put it back the way it was.
    •  
      CommentAuthorbugsmi0
    • CommentTimeAug 21st 2006 edited
     # 25
    i can get the dicussiontopic links to lineup right of the icon but the sticky and close topics have a large gap, been trying different things but so far no solution

    update: fixed it, had to do a padding-left: 10px for the sticky and close to line them up with the regular dicussiontopics
    •  
      CommentAuthorbugsmi0
    • CommentTimeAug 23rd 2006
     # 26
    how come without the icons, if you sticky and close a dicussion it will appear as

    sticky, closed

    but when you replace with icon, it doesn't show 2 icons one for sticky and 1 for closed, is it possible ?
    •  
      CommentAuthorBergamot
    • CommentTimeAug 23rd 2006 edited
     # 27
    "but when you replace with icon, it doesn't show 2 icons one for sticky and 1 for closed, is it possible ?"

    Because an element can only have one background image at a time. Whichever selector you specify last overrides the background image from the other.

    It is possible to make a third image for discussions that have both classes, but IE6 chokes on the syntax.
    • CommentAuthororty
    • CommentTimeAug 23rd 2006
     # 28
    Boy, it'd sure be nice if somebody could make this a drop in extension so we wouldn't have to hack the CSS file to pieces. I know that may not be possible, but I can wish, right? ;-)
    •  
      CommentAuthorWallPhone
    • CommentTimeAug 23rd 2006 edited
     # 29
    No extension is necessary.

    Go to application settings, then in label prefix put in <img src="images/
    Lable suffix should have .gif" />
    Then upload some images named private.gif, sticky.gif, sink.gif, closed.gif, deleted.gif, bookmarked.gif in that images folder.
    •  
      CommentAuthorBergamot
    • CommentTimeAug 23rd 2006
     # 30
    That's brilliant.

    I always tried to put the whole thing in the label text field, which caused problems.
    •  
      CommentAuthorWanderer
    • CommentTimeAug 23rd 2006
     # 31
    WallPhone, this causes problems here when viewing a comment...

    Forum Help: [Sticky, Closed] Getting Started

    The comma and space are still there.

    An extension would be cool.
    •  
      CommentAuthorbugsmi0
    • CommentTimeAug 23rd 2006 edited
     # 32
    yes very brilliant indeed ;-)

    unfortunate that it won't work with duel icons,
    i tried to sticky and close and it did manage to show this image path images/Sticky,%20Closed.png
    •  
      CommentAuthorpbear
    • CommentTimeAug 23rd 2006
     # 33
    Doh! Since the solution is so... easy, maybe a preference (or extension that adds a preference) to enclose each label in its own delimiters?

    Forum Help: [Sticky] [Closed] Getting Started

    etc.
    •  
      CommentAuthorWanderer
    • CommentTimeAug 23rd 2006
     # 34
    Hey pbear

    Exactly, what I asked for way back on Jul 13th 2006!
    •  
      CommentAuthorpbear
    • CommentTimeAug 23rd 2006
     # 35
    We obviously are now going in circles... lol!
    •  
      CommentAuthorWanderer
    • CommentTimeAug 23rd 2006 edited
     # 36
    I did get it to work, in a fashion, using CSS (and help from a_j), but it gets complicated with dual or more characteristics of a post like [Sticky, Closed].
    •  
      CommentAuthoricouto
    • CommentTimeAug 29th 2006
     # 37
    @Mark: this is quite an easy one for YOU to solve. All we need to be able to do here is to have LONGER label definition fields in the Application Settings screen. Right now the fields for defining the "Sticky", "Bookmarked", etc., labels are only short (about 30 characters max allowed). If the fields were longer, we could, without any problems, use the html <img> tag solution proposed above.
    •  
      CommentAuthorWallPhone
    • CommentTimeAug 29th 2006
     # 38
    The function that makes those commas is in library\Vanilla\Vanilla.Functions.php. Replace it with this to get icons working as I mentioned five days ago.


    function DiscussionPrefix(&$Configuration, &$Discussion) {
    $delimiter = $Configuration['TEXT_SUFFIX'] . $Configuration['TEXT_PREFIX'];
    // $delimiter = ', '; // Uncomment this line to return Vanilla to its factory default behavior

    $Prefix = '';
    if (!$Discussion->Active && $Configuration['TEXT_HIDDEN'] != '') $Prefix = $Configuration['TEXT_HIDDEN'];

    if ($Discussion->Sticky && $Configuration['TEXT_STICKY'] != '' && $Prefix != '') $Prefix .= $delimiter;
    if ($Discussion->Sticky && $Configuration['TEXT_STICKY'] != '') $Prefix .= $Configuration['TEXT_STICKY'];

    if ($Discussion->Closed && $Configuration['TEXT_CLOSED'] != '' && $Prefix != '') $Prefix .= $delimiter;
    if ($Discussion->Closed && $Configuration['TEXT_CLOSED'] != '') $Prefix .= $Configuration['TEXT_CLOSED'];

    if ($Discussion->Bookmarked && $Configuration['TEXT_BOOKMARKED'] != '' && $Prefix != '') $Prefix .= $delimiter;
    if ($Discussion->Bookmarked && $Configuration['TEXT_BOOKMARKED'] != '') $Prefix .= $Configuration['TEXT_BOOKMARKED'];

    if ($Discussion->Sink && $Configuration['TEXT_SINK'] != '' && $Prefix != '') $Prefix .= $delimiter;
    if ($Discussion->Sink && $Configuration['TEXT_SINK'] != '') $Prefix .= $Configuration['TEXT_SINK'];

    if ($Discussion->WhisperUserID > 0 && $Configuration['TEXT_WHISPERED'] != '' && $Prefix != '') $Prefix .= $delimiter;
    if ($Discussion->WhisperUserID > 0 && $Configuration['TEXT_WHISPERED'] != '') $Prefix .= $Configuration['TEXT_WHISPERED'];

    if ($Prefix != '') return $Configuration['TEXT_PREFIX'].$Prefix.$Configuration['TEXT_SUFFIX'].' ';
    }
  2.  # 39
    Here's my code on how I did it for http://herbiv.org/forum:


    .DiscussionType {
    text-indent:-9999px;
    float:left;
    margin:0 !important; padding:0 !important;
    height:16px; width:16px;
    }

    /* Discussion type icons */
    .Sticky .DiscussionType{
    background:url(sticky.png) 0 0 no-repeat;
    }
    .Sink .DiscussionType{
    background:url(sink.png) 0 0 no-repeat;
    }
    .Closed .DiscussionType{
    background:url(closed.png) 0 0 no-repeat;
    }
    .Bookmarked .DiscussionType{
    background:url(fav.png) 0 0 no-repeat;
    }
    .Whispered .DiscussionType{
    background:url(whisper.png) 0 0 no-repeat;
    }
    .Sticky.Closed .DiscussionType{ /* This one is for when we have two statuses on a topic: sticky and closed */
    background: url('sticky-closed.png') 0 0 no-repeat;
    }
    .Sticky .DiscussionType,
    .Sink .DiscussionType,
    .Closed .DiscussionType,
    .Bookmarked .DiscussionType,
    .Whispered .DiscussionType{ /* Add margins */
    margin:2px 3px 0 0 !important; padding:0;
    }
    •  
      CommentAuthorØ
    • CommentTimeSep 6th 2006 edited
     # 40
    Any news about this potential extension? I've tried all of the methods above, and none worked perfectly. IE is unable to display icons correctly with DraganBabic's method, and Wallphone's works great but only with one icon at the same time...

    Forget it, Wallphone's method works perfectly :D
    • CommentAuthorAndrewVos
    • CommentTimeSep 21st 2006
     # 41
    We just need one extra setting "Add comma", and more than (n) characters in the discussion label, where (n) is a number im to lazy to work out :>
    • CommentAuthorInkscape
    • CommentTimeSep 24th 2006
     # 42
    I tried to use Wallphone's method:

    At first:
    Go to application settings, then in label prefix put in <img src="images/
    Lable suffix should have .gif" />
    Then upload some images named private.gif, sticky.gif, sink.gif, closed.gif, deleted.gif, bookmarked.gif in that images folder.

    After this I changed the library\Vanilla\Vanilla.Functions.php like proposed.

    Works well, but I have a question. My icons/images don't have white space between themselves. This means when I've got a bookmarked, closed sticky the three icons look like one big picture. That doesn't look very good. I would prefer some space between the pictures. Do you see a method to achieve this?
    Maybe replacing the comma with a "non breaking space"? Or do you see a way to provide some margin for the icons?

    I would be grateful for any help.

    Cheers
    Inkscape
    •  
      CommentAuthorWallPhone
    • CommentTimeSep 24th 2006
     # 43
    It can be done either by what you proposed, by adding white space in your icons themselves, or with CSS: .DiscussionType img{
    margin-left:5px!important;
    }
    • CommentAuthorInkscape
    • CommentTimeSep 24th 2006
     # 44
    Works like a charm. :)

    thx WallPhone. I wonder why I haven't thought about a CSS solution myself.

    >> ... by adding white space in your icons

    I didn't mean it that way in case you think of editing the icons. I thought about replacing the separating comma within the brackets ( [ Closed, Sticky ] ) with a "non breaking space". So to speak tell vanilla to use a "non breaking space" instead of a comma.
    But enough of this. CSS solution works great. :)
    •  
      CommentAuthorØ
    • CommentTimeSep 24th 2006
     # 45
    For some really strange reason, Wallphone's method works fine on local but no icons appear on my live site. I also noticed there may be a small conflict with the Next Unread Discussion extension: it also uses the suffixes & prefixes defined in application settings, so .gif"> appears at the end of the page list and nothing before.
    •  
      CommentAuthorØ
    • CommentTimeOct 5th 2006
     # 46
    I finally managed to make icons work on my live site. For information, the labels names are case sensitive. For example, if an icon is called "sticky.gif", the label "sticky" works, but not "Sticky".
    • CommentAuthorcarnold
    • CommentTimeOct 7th 2006
     # 47
    Well, i have tried both the css and wallphone method to get sticky icons to work and no love though. Anyone got any pointers on getting this to work?
    • CommentAuthorcircuit
    • CommentTimeJan 2nd 2007
     # 48
    carnold, make sure your filenames begin with capital letters.
    • CommentAuthorlabelnoir
    • CommentTimeFeb 3rd 2007 edited
     # 49
    @carnold

    been working on this for quite a long time as well and i just couldn't get the methods to work. But in the end, i managed it like

    prefix: <img src="http://

    suffix: > (yes, nothing else)

    and in the labels i put

    www.myaccount.com/Sticky.ico"

    works for me. cannot handle sticky AND closed but it's not of a big necessity for my forum.
    you might have solved it by now, but there might be some more frustrated readers of this info who will find my words helpful
    •  
      CommentAuthorWanderer
    • CommentTimeMar 20th 2007
     # 50
    Is there a definitive solution for this icons issue?

    I would like to have icons for...

    picsticky
    picclosed sticky
    picdiscussion
    picclosed discussion
    picbookmarked

    I thought I had it beat (although there were slight differences between Firefox and Safari) but I just got back from the library testing on Exploder and the sticky icons are way too far right and half cut off.

    Ideally an extension would be the best solution but if a CSS guru has a little free time on their hands I'm sure many people would love to see something that works better than the incomplete and half-baked hacks we're currently suffering with.
    pic

    Posted: Wednesday, 21 March 2007 at 3:38PM (AEDT)