Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Linebreaking in 'discussion details' line?

edited December 2006 in Vanilla 1.0 Help
Don't know if this is a proper subject. I'm looking for a way to fix the line breaking behaviour when viewing the discussion list.

Image Hosted by ImageShack.us

I want this "New 0" to be linebreaked as one string. I mean it should be moved to the next line but as a complete string ("new" and "0"). The number shouldn't stay alone in the next line. I hope I described the problem properly. :)

Same thing of course for the date (Last Active), Last Comment, ...

Do you see a way to accomplish it?

Comments

  • TomTesterTomTester New
    edited November 2006
    Ink, in themes\discussion.php you could try changing this line:
    <li class="DiscussionNew"> <a href="'.$NewUrl.'"><span>'.$this->Context->GetDefinition('NewCaps').' </span>'.$Discussion->NewComments.'</a> </li>
    into (note: replaced a space before </span> with a non-breaking space)
    <li class="DiscussionNew"> <a href="'.$NewUrl.'"><span>'.$this->Context->GetDefinition('NewCaps').'&nbsp;</span>'.$Discussion->NewComments.'</a> </li>
    I guess you can figure out how to add this non-breaking space elsewhere too. I did not test this.
  • edited November 2006
    Hello TomTester,

    thx for the tip. I was successful for most items expect for the date.
    <li class="DiscussionActive"> <span><a href="'.$LastUrl.'">'.$this->Context->GetDefinition('LastActive').'</a>&nbsp;</span>'.TimeDiff($this->Context, $Discussion->DateLastActive,mktime()).'
    In the date e.g. Nov 5th 2006 there are whitespaces inbetween, too. This means the date gets split in this places. Any tip where to look for this whitespace to replace?
  • That date is generated by the timeDiff function but you don't really want to go changing that stuff.

    By the way, why is this break bothering you so much? If your screen is wide enough it will not break.
    Perhaps it's easier to force the content windows to a fixed width? (via CSS)
  • Ok, I'll leave it that way. :) One word about the timediff function. Is it possible to change the output to another (german) format? Dates are written dd mm yyyy instead of mm dd yyyy. Nov 5th 2006 (vanilla standard) 5. Nov 2006 (germany) Do you see any way to change the output of timediff or a way to change displaying in the discussion grid? Anyway many thanks for your help.
  • edited November 2006
    for the german date format, add <code>$Context->Dictionary['OldPostDateFormatCode'] = 'j. M Y';</code> into conf/language.php
  • Oh Dino, you taught me something new! By the way, this space issue is one that indicates some inconsistency in the labels (some include the spaces, others depend on spaces in the code) I'd prefer the former.
  • edited November 2006
    Thanks a lot, guys.

    I chose /languages/Deutsch/definitions.php for adding the code. Works well too.
  • You could try using:
    $Context->Dictionary['OldPostDateFormatCode'] = 'j.\&\n\b\s\pM\&\n\b\s\pY';
    So the date doesnt split up either...might work?
  • edited November 2006
    oops, forgot what was the issue. Didn't you forget ";"?
    $Context->Dictionary['OldPostDateFormatCode'] = 'j.&\nb\sp;M&\nb\sp;Y';
  • Thx Dinoboff & Minisweeper, Dinoboff's code works. :) Date gets linebreaked as one string. Perfect :)
  • I did forget that yeah. It's early. Cheers dino :)
  • Thank you for this info. By the way, where is Vanilla getting the names for the months ?? I'd like to show the month in spanish language... Thank you !
  • That's generated by the php date function. You may be able to change the setting on your server to display it in spanish but I dont know how. I think the best work around people have found is just to display the numeric month instead of the word. Check out for the options.
This discussion has been closed.