Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Ok I have started by

422422 Developer MVP
edited April 2012 in Vanilla 2.0 - 2.8
echo '< span class="LastCommentBy">'.sprintf(T('Started by %1$s'), UserAnchor($First)).'</ span>';

I want to do Most recent reply ALSO

Is it MostRecentBy ?if so do you know the full snippet of code to echo:

Most recent by :UserName

There was an error rendering this rich post.

Best Answer

  • Options
    peregrineperegrine MVP
    edited April 2012 Answer ✓

    /vanilla/views/discussions/helper_functions.php

    $Last

    echo '< span class="LastCommentBy">'.sprintf(T('Most Recent by %1$s'), UserAnchor($Last)).'</ span>';

                if ($Discussion->LastCommentID != '') {
                   echo '<span class="LastCommentBy">'.sprintf(T('Most recent by %1$s'), UserAnchor($Last)).'</span>';
                   echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span>';
                } else {
                   echo '<span class="LastCommentBy">'.sprintf(T('Started by %1$s'), UserAnchor($First)).'</span>';
                   echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->FirstDate);
    

    also

    $First = UserBuilder($Discussion, 'First');
    $Last = UserBuilder($Discussion, 'Last');
    

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

Answers

  • Options
    peregrineperegrine MVP
    edited April 2012 Answer ✓

    /vanilla/views/discussions/helper_functions.php

    $Last

    echo '< span class="LastCommentBy">'.sprintf(T('Most Recent by %1$s'), UserAnchor($Last)).'</ span>';

                if ($Discussion->LastCommentID != '') {
                   echo '<span class="LastCommentBy">'.sprintf(T('Most recent by %1$s'), UserAnchor($Last)).'</span>';
                   echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span>';
                } else {
                   echo '<span class="LastCommentBy">'.sprintf(T('Started by %1$s'), UserAnchor($First)).'</span>';
                   echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->FirstDate);
    

    also

    $First = UserBuilder($Discussion, 'First');
    $Last = UserBuilder($Discussion, 'Last');
    

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

  • Options
    422422 Developer MVP

    I get the first part .. not sure what you mean on 2nd part /..

    There was an error rendering this rich post.

  • Options
    peregrineperegrine MVP
    edited April 2012

    Don't worry about the second part if what you have works. Its how it pulls the string out of the object

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

  • Options
    422422 Developer MVP

    thats just it, it doesnt. One mo will grab the code

    There was an error rendering this rich post.

  • Options
    422422 Developer MVP
    edited April 2012

    Argghh I missed an element

    There was an error rendering this rich post.

Sign In or Register to comment.