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.

Version which displays videos and images

clethrillclethrill ✭✭
edited December 2011 in Vanilla 2.0 - 2.8

I have a modded version of this which displays videos and images. So basically everything appears exactly as it does in the discussion.


  • edited January 2012


    I'd like to try it. Could you post a link where we could download it?

  • DiscussionExcerpt3

    Note, no option to disable for announcements.

  • Hi clethrill, I tried your plugin and it's exactly what I was looking for! The only problem: it breaks down the mobile version of Vanilla, as you can see there:

    It also has problems with videos embed in mobile site:

    Is there a way to make the plugin don't work in mobile version, or to fix this?

    Thanks! :)

  • Oh dear, but sorry I have never worked with the mobile version before, and am unfamiliar with the inner workings of it all.

  • Wow this is so great that it works with images now!

    The displayed images don't seem to resize properly and are much larger, overflowing the blog. Any ideas?

  • You can simply go to your theme and add some css. I am not sure how your theme works exactly or how the plugin works exactly (been ages since I have done anything on here [which saddens me])

    CSS that I think might work

    div.Message > img {
       width: 90%;
       margin: 0 auto;

    I say think as I can't get my localhost running at this moment but I want to answer you as quickly as possible.

  • Thanks for the quick message back, I'm using Vanlix theme from themes section. Not really sure how to fix it. Could you take a look when you get a chance?

  • clethrillclethrill ✭✭
    edited March 2012

    I have not downloaded the vanlix theme because I am currently over my internet quota and my speed has been reduced considerably. However I have added a small css to the plugin which should hopefully fix this problem. I will upload the new plugin tomorrow when I have fast internet back.

  • My hero!

    Another thing this plugin could use is a "... Continue Reading" link at the end when text is truncated. Otherwise they have to click the heading and with images that can be a long way from the bottom.

  • If you would fix those two things for me, I would happily donate to you. This is the last thing stopping me from upgrading my site!

  • I will add it in, I was quite busy today as well as tomorrow, but I will definitely work on it for you

  • I did that quicker than I thought DiscussionExcerpt3

  • Continue Reading is Great!
    Videos now work and look great!

    Images don't appear anymore, maybe because of the next problem?
    It seems to have defaulted back to the 15 word excerpt with no way to change it.

  • Ok I played with it a bit, it will show images for newly created discussions, not discussions that are imported (which my whole forum is right now). The last version worked with everything but was the wrong size. This new version only displays images/videos for newly created discussions.

    It's so close I can taste it! Thanks for all your help!

  • Oh and somehow enabling this new version moves the formatting all around on the admin dashboard. (Puts left column on right side with formatting all weird.)

  • clethrillclethrill ✭✭
    edited March 2012

    Mmm... could I get you to disable the plugin, delete it, go to /conf/config.php and delete any configuration to do with the plugin (should be something like $Configuration[DiscussionExcerpt2']['Number_of_words'] = ###; )
    (I believe there might be two clashing configuration in there that caused the wrong number of words displayed)

    Then download this and install it.

    I was having the same issues with the theme I was using, I switched back to default theme and everything was fine, I think it was the name of my style sheet that through everything out for some reason, I downloaded vanlix and have got the plugin and theme working fine together.

    On the topic of the importing. The plugin works by make the excerpt displayed go through the same formatting process that usually happens when you post a discussion. So there must be something with the importation of it that skips this formatting step.

    EDIT: I found a bug hang on while I iron it out
    EDIT: Got the little bugger

    If there is anything else I am glad to assist

  • 422422 Developer MVP

    Pmsl @ got the little bugger


    There was an error rendering this rich post.

  • This stuff imported from V1 has caused problems since the beginning and I've never been able to upgrade because of them. With your new updated plugin it displays no images at all on these imported discussions. :((

    This imported content is displayed differently than newly created V2 discussions.

  • After some fiddling I have it working with my imported content using your original plugin at the top. How easy would it be to add the "Continue Reading" to the original version.

  • Just fiddle around with the newer and older versions.

    in the new version lines 51-53

    $Body = substr($Body, 0, $end);
    $Last = strrpos($Body, " ");
    $NewBody = substr($Body, 0, $Last);

    remove any truncated words off the end.

    line 62

    echo " ...";

    add the ellipsis

    lines 67-77

        <?php if($end < $Length) { ?>
            < li>
                < a href="<?php echo Gdn::Request()->Url(ConcatSep("/", "discussion", $Discussion->DiscussionID, Gdn_Format::Url($Discussion->Name)))?>"class="More"><?php echo T("Continue Reading");?>
            < /li>
        <?php } else { ?>
            < li>
                < a href="<?php echo Gdn::Request()->Url(ConcatSep("/", "discussion", $Discussion->DiscussionID, Gdn_Format::Url($Discussion->Name)))?>"class="More"><?php echo "View rest of ".T("Discussion");?>
            </ li>
        <?php } ?>

    Deal with the continue reading section

Sign In or Register to comment.