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

Need help with all.php

422422 MVP

Working on our version of penny arcade theme.

I have this at the moment in all.php

'.sprintf(Plural(number_format($Category->CountAllComments), '%s', '%s'), $Category->CountComments).'';
                     if ($Category->LastCommentID != '' && $Category->LastDiscussionTitle != '') {
                        $CatList .= ''.sprintf(
                              T('%1$s  %2$s'),
                              Anchor(SliceString($Category->LastDiscussionTitle, 40), '/discussion/'.$Category->LastDiscussionID.'/'.Gdn_Format::Url($Category->LastDiscussionTitle)),
                              UserAnchor($LastComment)
                           ).''
                           .' '.Gdn_Format::Date($Category->DateLastComment).''
                           .''.UserPhoto($LastComment).''
                            .''.UserAnchor($LastComment).'';

My issue is : All works good but ..

'.sprintf(
                              T('%1$s  %2$s'),
                              Anchor(SliceString($Category->LastDiscussionTitle, 40), '/discussion/'.$Category->LastDiscussionID.'/'.Gdn_Format::Url($Category->LastDiscussionTitle)),
                              UserAnchor($LastComment)

                           ).''

I need to split this up so I have Userpost and username separate, at moment they are joined at the hip.

I tried:

'.sprintf(
                              T('%1$s  %2$s'),
                              Anchor(SliceString($Category->LastDiscussionTitle, 40), '/discussion/'.$Category->LastDiscussionID.'/'.Gdn_Format::Url($Category->LastDiscussionTitle))).''



But that now doesnt display the discussiontitle , i am trying to segregate the major post functions ... to:

  1. discusion count
  2. commentcount
  3. lastdiscussiontitle ( and change to last post title )
  4. lastcommentdate
  5. repliedby ( showing userphoto )
  6. lastpostauthor

Any help appreciated

There was an error rendering this rich post.

Answers

  • Some of the changes you're talking about, I've done before with js after the fact. It's kinda brittle, I know... but not everything in Vanilla is as atomic as everyone would like (yet).

    There was an error rendering this rich post.

  • I have split everything, its deffo simple php. My son is back over weekend will get him to fix.

    There was an error rendering this rich post.

  • Ok so what I need to find, is the hook for the latest post ? is that LatestPostComment ? or LatestPostTitle ?

    Basically I want to echo on forum index, the latest thread title. I can use the LastDiscussionTitle .. i will try LatestDiscussionTitle see if that updates the latest added.

    Would be great to see a list of hooks used and vars

    There was an error rendering this rich post.

  • Ok I have fixed my first issue. Thats all good now, was a separation of spans. Thats sorted.

    Now I would like to instantiate fetching latest thread title, without having to have that thread get a reply. As LastDiscusionTitle is only echoed if it has received a reply...

    There was an error rendering this rich post.

  • sahotataransahotataran ✭✭✭
    edited December 2011

    You can use eventi Plugin for getting what events are triggered where

    There was an error rendering this rich post.

  • Cheers taran, will give it a go..is it a dev plugin to help ?

    There was an error rendering this rich post.

  • Yup yup. List all events and where they are triggered :d

    There was an error rendering this rich post.

Sign In or Register to comment.