Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Optimizing full wordpress comment integration (comment order, auto truncate, double embed)

edited May 2012 in Questions

The background: I am setting up a vanilla discussions page where users can obviously create their own discussions. I am also using the vanilla forums wordpress plugin to integrate comments. I am doing this on a page I have been running for a few months and already has a fair amount of content in the form of blog posts.

(1) When I view an existing blog post for the first time since comment integration was turned on, it creates a new discussion for it on the discussions page. It then shows the same comments within that discussion on both the blog post and the discussion page. This is excellent. However, on the discussion page, replies are displayed with oldest first, and on the blog post replies are displayed with newest first. I would like them both to be oldest first -- is there a way to customize this?

(2) On the discussion page that is automatically generated by viewing a new post, Vanilla displays either the first paragraph or the first 400 characters (whichever is shorter) of the content of the blog post. Is there a way to default to displaying the entire blog post?

(3) On the same page, it displays a thumbnail of my blog's .png header image. This is unnecessary and I would like to remove it. Can I?

(4) On the same page, it says the title (in the format "Blog Post Title << Blog Name") and then below that displays the permalink to the post. I can click on either of these (title or permalink) to see the original page. However, when I do so it embeds inside of itself -- so my wordpress blog page is embedded inside of my vanilla discussions page which is embedded inside my wordpress page. Can I change it so that these links open on a new page and go straight to the permalink without embedding?

(5) On the blog post page, at the bottom, the text field for entering a new comment is located above where the existing comments are displayed. Assuming I can change the display order (as mentioned in my first question), can I change the location to display below the comments?

A HUGE THANK YOU for any help anyone can provide! I've been digging around the .js and .php files trying to figure out what governs this stuff, but I'm a novice when it comes to anything like this and don't think I'll be able to figure it out on my own!

Answers

  • 422422 Developer MVP

    Great questions and welcome. I cannot help, but i am sure someone can.

    422 Real Estate Australia , now open Check it out

    UnderDog
  • peregrineperegrine MVP
    edited May 2012

    5) I'm too tired to help here.

    4) this plugin should solve the embed problem http://wordpress.org/extend/plugins/wp-no-frames/

    worked for me with other issues of custom programs within wordpress and vanilla and the consequential recursive embedding.

    3) number 3 shouldn't be too hard - identify it in firebug or some web tool, and then you can more easily search for it.

    2) I'm too tired to help here.

    1) I'm too tired to help here.

    I put it in reverse order for you :)

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    UnderDog422
  • 4) Solved, thank you!

    3) The issue is that every time I view a blog post for the first time, it creates a discussion for it, and follows some kind of instructions for how to automatically generate the contents of that discussion. So it has header, title, link, preview. I want to remove the header and make the preview the full blog post. Sure I could edit each individual post, but some part of the vanilla forums plugin for wordpress must be instructing vanilla how to generate these discussions and saying "include thumbnail of banner image" ... so while I can identify the elements themselves easily enough, I have no idea what .php file or .js file is actually causing them to be generated...

  • 3) can you provide a link to sample.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

    UnderDog
  • ShadowdareShadowdare π Moderator

    I'm not sure how to change the format of the discussion that gets created, but I know they've changed how it looks in the upcoming Vanilla 2.1. Vanilla 2.1 will also provide options to change how the comments are sorted on the blog.

  • UnderDogUnderDog Moderator

    Welcome futuretalk do you have some plugins enabled on the vanilla portion of your site? For example the 'reverse sort' plugin and the 'Excerpt' plugin?
    The reverse sort plugin of Vanilla sorts your comments newest first, I think that's what you wanted in your section question, right?
    The Excerpt plugin takes pieces of your post and shows it, instead of your entire post :-)

  • Thanks for the responses.

    I can't provide a link because I'm blocking outside IPs while I renovate my site... but that's moot because I think this is mostly solved. I can just manually edit each discussion that is auto generated by a new blog post, and that solves (2) and (3). Peregrine solved (4).

    I will look for a plugin to modify the comment display order as mentioned in (1).

    Still curious if anybody can tell me anything about (5) -- that is changing the order of appearance of comments and the text field where you would type a new comment on blog posts.

  • 422422 Developer MVP

    Perhaps post screenshot of outstanding issues.

    422 Real Estate Australia , now open Check it out

  • The only real issue right now is that on my actual self-hosted vanilla forum, comments display oldest first, which is ideal -- but as the comments are displayed on the bottom of each blog post, they shown in the reverse of that with newest first.

    In other words, the exact same set of comments will appear 1, 2, 3, 4 on the discussions page, and 4, 3, 2, 1 on the corresponding blog post. I would like the blog posts to also display their comments oldest first so both pages appear 1, 2, 3, 4.

  • This is how comments appear on the discussion itself:

    This is perfect.

    This is those exact same comments appear on the corresponding blog post:

    This is in reverse order, and that is not optimal. Additionally I would like the text field to appear below the existing comments if that is possible...

  • 422422 Developer MVP
    edited May 2012

    why is it blurred?

    when you say BLOG ? you mean wordpress blog ? i wasnt aware vanilla did a blog plugin ( as default ) are you using nillablog

    422 Real Estate Australia , now open Check it out

  • It doesn't appear blurred to me, I'm not sure what you mean...

    My site uses wordpress. There is a "blog" page which contains blog posts and there is a "discussions" page which contains a self-hosted, embedded vanilla forum. I am using the vanilla forums plugin for wordpress to override wordpress comments and use Vanilla for comments.

  • 422422 Developer MVP

    Ok its clear now, weird.

    Ok so the PLUGIN is the issue.

    You have it set or its default as date added

    You want newest first. Check the php, it should be very easy to fix. You may need to compare both to see how they function.

    422 Real Estate Australia , now open Check it out

  • Unfortunately I don't know anything about PHP... can you provide any guidance?

    One thing to mentioned, those links for "Votes" and "Date Added" do not work, if I click either of them it redirects the embedded portion of the page to "Page Not Found".

  • If it helps, this is the "comments.php" file from the vanilla forums plugin for wordpress:

    <?php if (!is_preview()) {
    $options = get_option(VF_OPTIONS_NAME);
    $categoryid = vf_get_value('embed-categoryid', $options, '0');
    ?>
    <div id="vanilla-comments"></div>
    <script type="text/javascript">
    var vanilla_forum_url = '<?php echo vf_get_value('url', $options); ?>'; // Required: the full http url & path to your vanilla forum
    var vanilla_identifier = '<?php echo $post->ID; ?>'; // Required: your unique identifier for the content being commented on
    var vanilla_url = '<?php echo get_permalink(); ?>'; // Current page's url
    <?php if ($categoryid > 0) { ?>
    var vanilla_category_id = '<?php echo $categoryid; ?>'; // Embed comments in this category
    <?php } ?>
    <?php 
    if ($sso = vf_get_sso_string()) {
       echo "var vanilla_sso = '$sso';"; // Single-Sign-On string.
    }
    ?>
    (function() {
        var vanilla = document.createElement('script');
        vanilla.type = 'text/javascript';
        var timestamp = new Date().getTime();
        vanilla.src = vanilla_forum_url + '/js/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(vanilla);
    })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="http://vanillaforums.com/?ref_noscript">comments powered by Vanilla.</a></noscript>
    <div class="vanilla-credit"><a class="vanilla-anchor" href="http://vanillaforums.com">Comments by <span class="vanilla-logo">Vanilla</span></a></div>
    <?php }
  • 422422 Developer MVP

    Thats just path issue.

    Php for date added vs newest first is quite simple, im on ipad so cannot help at the mo. X00 or peregrine should be able to help

    422 Real Estate Australia , now open Check it out

  • I shall await help =)

  • Oh, I figured I'd let folks know this as well --

    In terms of (4) where clicking a discussion link to a blog post was causing the website to embed within itself -- when I installed a plugin called wp no frames, it successful forced the link to redirect to the page itself (rather than embed within). However, this had the side effect of embedding the entire vanilla page at the end of each blog post (rather than just the comments on that particular discussion).

    In the end, the easier solution was to just disable that plugin and modify the links to include target="_blank" to force them to open in a new window.

    an2050
  • ShadowdareShadowdare π Moderator
    edited May 2012

    The easiest thing to do is to wait for Vanilla 2.1 which will have a setting to change how the comments are sorted.

  • Mmm... nebulous release date?

  • Also I'm afraid that won't solve it because the issue is not with core Vanilla, it's with the vanilla forums plugin for wordpress... the comments are sorted properly on the actual discussion page.

  • 422422 Developer MVP

    Perhaps look inthe plugin for SORT_BY

    422 Real Estate Australia , now open Check it out

  • ShadowdareShadowdare π Moderator
    edited May 2012

    futuretalk said: Also I'm afraid that won't solve it because the issue is not with core Vanilla, it's with the vanilla forums plugin for wordpress... the comments are sorted properly on the actual discussion page.

    There is probably a way to change it via the code of the WordPress plugin; however, because there is an option to change the sorting of the comments in Vanilla 2.1, then it is actually controlled from the Vanilla side.

Sign In or Register to comment.