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.

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

edited May 2012 in Vanilla 2.0 - 2.8

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!

«1

Answers

  • 422422 Developer MVP

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

    There was an error rendering this rich post.

  • 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 :)

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

  • 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.

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

  • 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.

    Add Pages to Vanilla with the Basic Pages app

  • 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 :-)

    There was an error rendering this rich 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.

    There was an error rendering this rich post.

  • 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

    There was an error rendering this rich post.

  • 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.

    There was an error rendering this rich post.

  • 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

    There was an error rendering this rich post.

  • 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.

  • ShadowdareShadowdare r_j MVP
    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.

    Add Pages to Vanilla with the Basic Pages app

  • Mmm... nebulous release date?

Sign In or Register to comment.