Show Last Post Extension by FlarumAlshain

Image_3


Image_1


Image_2

With this extension;

  • About the last answers given in your forum.
  • If there was no answer to the question, please in the question descriptions.
  • If BBCODE related content was shared in the last answer, please do it without any problems. (Image, ul, etc.)

Installation

composer require flarumalshain/showlastpost

Updating

composer require flarumalshain/showlastpost

If You are using FlarumTR Design add Custom CSS :

.DiscussionListItem-info .item-lastpost img{
  max-width: 100% !important;
  height:300px !important
}

.DiscussionListItem-info .item-lastpost {color: #696969 !important; font-size: 14px !important;}
.PostStream-item:not(:last-child) {
    border-bottom: none;
}

@media (min-width: 767px) {
.DiscussionListItem-info .item-lastpost {
    margin-left: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d7dfea;
    margin-bottom: 15px;
margin-right: -40px !important;
}}

@media (max-width: 767px) {
.DiscussionListItem-info .item-lastpost{
    margin-right: -30px !important;
    white-space: normal !important;
    font-size: 14px !important;
    margin-left: -40px !important;
    line-height: 1.5em !important;
    margin-bottom: 25px !important;
    color: #3a3a3a !important;
    display: block !important;
    border-bottom: 1px solid #d7dfea;
    padding-bottom: 5px;
}

Links

GitHub
Packagist

    • [deleted]

    Alshain Thanks for this extension!

    Question:

    Could you share the likes thing? That shows how much likes the whole post has?
    That would be really cool.

    Kind Regards

      8 days later
      10 days later
      • [deleted]

      • Edited

      @Alshain I think I have found a bug. On my forum, only the first three posts load, then I receive an error in the console as below

      string.js:11 Uncaught TypeError: Cannot read property 'substring' of undefined
          at i (string.js:11)
          at e.<anonymous> (ShowLastPost.js:23)
          at e.t.<computed> [as infoItems] (extend.js:27)
          at e.n.view (DiscussionListItem.js:114)
          at e.t.<computed> [as view] (extend.js:25)
          at e.render (Component.js:102)
          at Object.o [as view] (Component.js:189)
          at P (mithril.js:806)
          at mithril.js:822
          at M (mithril.js:847)

      Any thoughts ?

      EDIT - in addition, this hides posts that have no comments. This is an issue as new threads from my RSS feeds will not show :-(

      I'm also using @clarkwinkelmann Premium WordPress Integration if this helps.

      The GitHub is missing the javascript source code, so I can't take a look (js/src is not under version control).

      A likely error related to substring() and posts could be that this extension is trying to read posts that have a post type that's not comment. Some of these, including the kilowhat-wordpress-summary post type contain JSON so calling substring on it would fail.

        • [deleted]

        clarkwinkelmann Some of these, including the kilowhat-wordpress-summary post type contain JSON so calling substring on it would fail.

        Can we fix this please ?

          [deleted] I would be happy to investigate whether this is linked to my extension (and submit a PR if needed), but I'd need to access the full source code.

          In the meantime I've released an update that fixes summaries. Maybe it'll also fix this. The update will be up soon, check the Wordpress extension discussion.

            Alshain as Clark mentioned above, it appears that your Github repository doesn't include the js source files for easy code parsing, contributing or recompiling. It only includes the dist files that are precompiled by webpack.

            [deleted] uh... do you already have 1.2.2 of the Wordpress extension ? Flagrow.io still hasn't updated and still shows 1.2.1 as the latest.

              • [deleted]

              • Edited

              clarkwinkelmann Yes. Updated via composer 🙂

              Flarum core 0.1.0-beta.11.1
              PHP version: 7.2.24-0ubuntu0.18.04.3
              Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, sodium, session, standard, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, i360, iconv, igbinary, imagick, imap, json, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache
              +---------------------------------+----------------+--------+
              | Flarum Extensions               |                |        |
              +---------------------------------+----------------+--------+
              | ID                              | Version        | Commit |
              +---------------------------------+----------------+--------+
              | flarum-bbcode                   | v0.1.0-beta.8  |        |
              | flarum-emoji                    | v0.1.0-beta.10 |        |
              | flarum-flags                    | v0.1.0-beta.10 |        |
              | flarum-lock                     | v0.1.0-beta.9  |        |
              | flarum-mentions                 | v0.1.0-beta.10 |        |
              | flarum-sticky                   | v0.1.0-beta.9  |        |
              | flarum-subscriptions            | v0.1.0-beta.9  |        |
              | flarum-suspend                  | v0.1.0-beta.10 |        |
              | flarum-tags                     | v0.1.0-beta.11 |        |
              | fof-byobu                       | 0.4.1          |        |
              | fof-follow-tags                 | 0.3.4          |        |
              | fof-share-social                | 0.1.2          |        |
              | fof-polls                       | 0.1.1          |        |
              | fof-merge-discussions           | 0.3.3          |        |
              | fof-ignore-users                | 0.1.5          |        |
              | fof-split                       | 0.4.3          |        |
              | fof-user-bio                    | 0.1.3          |        |
              | fof-user-directory              | 0.3.3          |        |
              | amaurycarrade-syndication       | v0.3.1         |        |
              | fof-links                       | 0.2.1          |        |
              | v17development-seo              | 1.1            |        |
              | fof-gamification                | 0.1.6          |        |
              | fof-pages                       | 0.2.7          |        |
              | fof-drafts                      | 0.1.4          |        |
              | fof-socialprofile               | 0.1.1          |        |
              | flarum-approval                 | v0.1.0-beta.8  |        |
              | fof-spamblock                   | 0.2.1          |        |
              | fof-linguist                    | 0.4.1          |        |
              | flagrow-impersonate             | 0.3.0          |        |
              | fof-disposable-emails           | 0.1.0          |        |
              | flarum-embed                    | v0.1.0-beta.10 |        |
              | fof-pretty-mail                 | 0.1.6          |        |
              | fof-best-answer                 | 0.1.6          |        |
              | franzl-open-links-in-new-tab    | v0.1.0         |        |
              | fof-reactions                   | 0.2.1          |        |
              | fof-prevent-necrobumping        | 0.2.0          |        |
              | fof-subscribed                  | 0.2.3          |        |
              | flagrow-sitemap                 | 0.2.0          |        |
              **| kilowhat-wordpress              | 1.2.2          |        |**
              | michaelbelgium-discussion-views | v3.1.0         |        |
              | reflar-cookie-consent           | 0.2.0          |        |
              | fof-upload                      | 0.8.0          |        |
              | fof-nightmode                   | 0.4.0          |        |
              | flarum-lang-english             | v0.1.0-beta.11 |        |
              | flarum-markdown                 | v0.1.0-beta.10 |        |
              | fof-formatting                  | 0.1.4          |        |
              | michaelbelgium-profile-views    | v2.1.6         |        |
              | flarum-pusher                   | v0.1.0-beta.9  |        |
              | noriods-auto-more               | 0.3.0          |        |
              | the-turk-diff                   | 0.1.0-beta.4   |        |
              | jordanjay29-summaries           | 0.3.1          |        |
              | extiverse-bazaar                | 0.4.1          |        |
              | flarum-statistics               | v0.1.0-beta.9  |        |
              | flarumalshain-showlastpost      | 1.1            |        |
              +---------------------------------+----------------+--------+
              Base URL: https://forum.phenomlab.com
              Installation path: /var/www/vhosts/phenomlab.com/forum.phenomlab.com
              Debug mode: off

              Like the message on the first subject; Do not show bold text in bold or show next to what is written in the bottom line, if you can do it with css codes, can you assign css codes?

              there is something. If there is no comment on the subject, it shows the text of the subject 2 times. It should not show extra when there is no comment on the subject. It would be nice to write as the last comment in the picture.

              2 months later

              what about videos?
              if last post has a video, there is a big gap between posts, i mean video doesn't appear but gap.

              also, if there is a image that has a long height, post has a same height as well.

              Can we add max height to the last answer part?
              how do we solve that?

              i solve this problem via css:

              .DiscussionListItem-info .item-lastpost {
              max-height: 100px;
              overflow: hidden;
              }

                • [deleted]

                sanwhere This might work better. It only targets the span

                .DiscussionListItem-info .item-lastpost span {
                    padding-bottom: 0px !important;
                }

                  Great work on the Extension.

                  1) The CSS seems to break the https://flarumtr.com/d/1198-flarumtr-mobil-tema CSS, which enables FlarumTR to display on mobile. It makes it as if the FlarumTR Mobil Tema didn't exist at all. Is there a fix to make this work on mobile?

                  2) is there any way to make an option to always display the first post instead? I understand the Summaries extension does this, but it does not show images like your fork does.

                  3) Embeded videos like youtube videos seem to render the appropriate-sized box, but don't actually display the video.

                  Thanks for your contribution!

                  [deleted]
                  you advice didn't work for me. there is no span en of that path. there is a "p" and under it, there is <img>.

                  11 days later