HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Great plugin, User timezones DO work, but announcements issue

As stated in subject, the date cutoffs are correct as per user timezone and not default timezone (as stated in issue with DateSeparator).

However, it looks like announcements are messing up the plugin somewhat, as per screencap. Van 2.1.6.

«1

Comments

  • peregrineperegrine MVP
    edited January 2015

    .

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Aw man! Can I still post my screencap I just made with squares?

  • Yeah, it looks like 'today' is missing at the top of the yellow box.

  • I guess what would be really nice is if the labels didn't appear at all over the announcements (at least for me, since I try to keep it down to 2 or 3 announced topics at a time). Maybe I'll try to figure that out.

  • peregrineperegrine MVP
    edited January 2015

    good image - displays issue better.

    give me a day or two see what i can come up with, unless I get some energy reserves in a few hours.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks! Beer is providing me with energy reserves.

  • peregrineperegrine MVP
    edited January 2015

    I realize I specifically removed Today postings from the topic list, because I felt it unnecessary but I added it back in. easiest way to work with announcements.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited January 2015

    @AaronWebstey said:
    Thanks! Beer is providing me with energy reserves.

    have one on me. plugin fashioned for your desires.

    and updated!

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited January 2015

    I changed the translations as well.

    "Discussion Today"

    and

    "Comment Today"

    can be changed via definitions in conf/locale.php

    <?php if (!defined('APPLICATION')) exit();
    
    $Definition['Discussion Today'] = "Hoy Discusiones";
    
    $Definition['Comment Today'] = "Hoy Commentitos";
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • TYAP x 1000000!!! I'll have another beer for you while I do a diff to see how you fixed/changed it. Ahh, diff beers.

  • Discussion Today is showing up before every discussion from today. Was that intended?

  • peregrineperegrine MVP
    edited January 2015

    now i know why I removed today :)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I feel like the answer lies in looking what you did in DisplayDateCommentHeading and applying that to DisplayDiscussionDateHeading, but I'm sure you're gonna beat me to it :)

  • Aha! That did it. New DisplayDateCommentHeading:

        private function DisplayDiscussionDateHeading($Sender) {
            $Discussion = $Sender->EventArguments["Discussion"];
    
            static $KeepDate;
            static $x = 1;
            $CurDate = Gdn_Format::Date($Discussion->LastDate);
            if ($CurDate <> $KeepDate) {
                $KeepDate = $CurDate;
    
                if (!strpos($CurDate, ":")) {
                    echo wrap(wrap($CurDate, 'span', array('class' => "DiscussionDateSpacer")), 'li');
                }  else {
                    if ($x < 2) {
                        echo wrap(wrap(T("Discussion Today"), 'span', array('class' => "DiscussionDateSpacer")), 'li');
                        $x++;
                    }
                }
            }
        }
    
  • peregrineperegrine MVP
    edited January 2015

    and I have a different solution than yours! updated.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Aw, yours is better. TYAP!

    Quick question, related to this plugin and how I'm trying to customize it: do you know if I can use

    $Discussion->IsAnnounce;

    or something like it to see if it's an announced discussion? I'm looking for examples but can't find any in the plugins that look obvious.

  • peregrineperegrine MVP
    edited January 2015

    gotta go, theoeretically problem solved. I spent way more time on this plugin than I wanted to. I'm kind out of free time, I've got other stuff to do now.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

    1. I think I found an example in the 'example' master plugin. Duh.
    2. Before you edited your comment, I went looking for my wallet to make a donation and realized I had lost it somewhere during the 2 hour drive to my parents' house this afternoon. I guess I should toss out another TYAP, with an accompanying FFF#$@$@#$@#$@$!!!
  • Thanks very much for your help. Very much appreciated!!

  • peregrineperegrine MVP
    edited January 2015

    @AaronWebstey said: I went looking for my wallet to make a donation and realized I had lost it

    hope you find your wallet. no fun replacing contents cards, etc.

    look in the helper functions.php within discussions - you get lots of ideas.

    but i always welcome donations to help support my development.

    probably test for Announce field in Discussion

    usually equals 1 or 2 depending on announcement type.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.