(WBRP)
(It’s fixed….see second update below)
I just updated this site to use the latest WP (2.8) and now my “Read More Right Here” plugin doesn’t work quite right. When you click the “Read More” text, the rest of the post successfully downloads and is displayed. However, the next “click” takes you to the post’s single page display instead of just collapsing the new content.
I will hopefully get this sorted out soon. Whenever I do, I’ll update here.
UPDATE:
Unfortunately I haven’t been able to fix this. The problem is caused by the latest version of jQuery (1.3.2), to which WP apparently updated. Actually, it was caused somehow in the changes made in between 1.2.6 and 1.3.
Specifically, the function curCSS is throwing exceptions during the animation of the new content “away” (i.e. hiding).
800 | var computedStyle = defaultView.getComputedStyle( elem, null ); |
The elem parameter being passed to getComputedStyle that causes the exception is a “\n“. With jQuery 1.2.6, I don’t see that element being passed to that function.
I tried some of the other animation techniques, but they I guess they all hit curCSS at some point or another. Even plain old hide causes problems.
So…..sorry. As of right now, the RMRH plugin does not work with WP 2.8. The only solution I can see at the moment is to include the older version of jQuery with the plugin. But I’m not sure yet how that will work out.
UPDATE 2: FIXED
It’s funny how a day away can make a difference. It only took about 10 minutes to get this fixed.
So I knew that jQuery couldn’t have a defect that serious that wasn’t already fixed. The most recent version has been available for more than four months now, and too many people use it for that issue to still be around. I figured the the problem had to be how I was creating the new content that is inserted into the DOM.
My previous method for doing this was:
var newEl = $j("<p> + newContent + </p>");
And the fixed method of the above code is:
var newEl = $j("<p>").html(newContent);
All I can think is that the use of "<p> + newContent + </p>" somehow results in newline characters (/n) being inserted as part of the string. The new method does not use string operators, only the <p> element and its html content are created.
Anyway, it’s fixed. If you use the “Read More Right Here” plugin and have updated to Wordpress 2.8, you need to update the plugin to version 1.0.3.
22 Comments
Hi, this new version doesnt display the embed vĂdeo inside the post here, with the previous version this was fine.
The embed video where?
Just after the tag on the post.
Just after the “more” tag in the post
This happens with embed video.
I will try to post with a different method like video tags to see if it works.
Toward the bottom of the home page of this site is a blog entry titled “La Bomba”. The only content after its “more” section is an embed object. I just tried it again and it still seems to be working fine. Where are you seeing this issue?
ops, sorry, it was not embed, it was a video embed with Viper’s Video Quicktags, and the plugin was out of date… ^^
Its working now. Thank you for your time.
Oh, that’s good to hear. Glad it’s working!
Hey man,
This plugin is awesome. I love it. makes it a lot easier for people to read my posts. However, there are two minor problems. 1. It seems that when you click on the link to see the rest of the post it doesn’t increment the number of times the post has been visited. For example, I am using the WP-PostViews which shows how many times a post have been visited but with your plugin it doesn’t work. Is there anyway to fix this? 2. The second problem is that when I add the ShareThis plugin to the posts your plugin stops working. Why!?
Do you have any solution for these? By the way my email address is mohammad_khazab@yahoo.com.au. Would you reply to my email if you like please?
Once again, great work mate!
by the way, the website I am using this plugin for is http://globalmediapost.com
please have a look. you’ll see that the views is not incremented when you click on the “read full article” link
Sorry the second problem (with sharethis plugin) is fixed. But I am still not sure how to fix the first problem to increment num of views. appreciate your help
I think this is the code to increment the ‘views’ custom tag:
$post_id = intval($post->ID);
if($post_id > 0) {
$post_views = get_post_custom($post_id);
$post_views = intval($post_views['views'][0]);
if(!update_post_meta($post_id, ‘views’, ($post_views+1))) {
add_post_meta($post_id, ‘views’, 1, true);
}
}
I tried putting this code into the function wt_rmrh_oninit() but it didn’t work. What would you suggest?
Mohammad: I’m not sure what’s going on with that, but I don’t think my plugin should have any sort of adverse effect on the use of WP-PostViews. Clicking on the “Read More” link is not going to update any stats related plugin because there’s no way to be able to adequately support all possible stat collecting plugins. That’s sort of a trade off when using it. People either click on it right there on the page and view the rest, or they visit that post’s individual page display. As best as I can tell, WP-PostViews updates that post’s view count when its displayed as an individual post or as part of a WP “page”. So you are losing counts when the user selects the “Read More” link as opposed to clicking on the post title and going to its own page.
If you want to try and add an update to the post view count collected by WP-PostViews, the best I can tell you is you examine the “process_postviews” function of that plugin (starting at line 60 of wp-postviews.php). Notice that the post’s ID value, in my ‘init’ hook (“wt_rmrh_oninit”), is grabbed from a $_POST value, and not from the global “$post->ID”. Also, WP-PostViews does not appear to increment the post count when it’s a logged-in user (see line 74 in “wp-postviews.php”).
Really though, like I mentioned, it’s a trade off. WP-PostViews collects stats when posts are individually visited. Making it easier to view your entire post content “inline” on the front page means that collecting stats for individual views of that post will not happen.
Well WP 2.8.1 breaks RMRH for me… It acts like there’s no plugin at all. Any solutions?
Same here
Ah, shoot. Doesn’t seem to be working for me Will.
It was working fine previously (2.8) – I had it on wampserver. But when I uploaded it online and updated wordpress it stopped working.
Hey Abdul, it looks like the path to the javascript file has somehow been messed-up. The end of the path included in your header looks like this:
plugins/read-more-right-herejs/wt_rmrh.js
It should be:
plugins/read-more-right-here/js/wt_rmrh.js
Same looks to be true for Christoph and AIR. I’m not sure what would be different about these setups compared to mine. Obviously I messed something up with the last update though. As soon as I can I will get it fixed.
Wow
Thank you! Due to your post I’ve found where to make a fix 
file: read-more-right-here.php
change “$loadImageName = ‘ajax-loader.gif’;” to “$loadImageName = ‘/ajax-loader.gif’;”
change “$pluginUrl . “js/wt_rmrh.js”,” to “$pluginUrl . “/js/wt_rmrh.js”,”
I’ve used RMRH on a couple of sites & LOVE it. However, when trying to install it on two new WP sites (v2.8.2) I get this error message:
Fatal error: Call to undefined function: strripos() in /nfs/cust/2/71/10/401172/web/wordpress/wp-content/plugins/read-more-right-here/read-more-right-here.php on line 42
I then have to FTP into the sites, delete the plugin’s folder & then all is fine. Any suggestions or ideas about this?
Uh oh..Looks like strripos is a php5 only function. I guess your server is still using php4? I’m going to need to fix that next chance I get. If you’re up to it, you can comment out the if statement with that function call (~ line 42). It’s only purpose is to keep the RMRH javascript from loading while in the admin area. There are better Wordpress functions I should be using instead (though it seems like I had issues with them when I originally wrote this). Anyway, you can comment that out and it won’t be a big deal.
Sorry James!
Woolie,
I see when using your plugin with Lightbox Plus that after I click READ MORE, the pictures that were loaded dynamically are no longer acting as lightboxes, but as normal pictures. Might you know a way of going about and fixing this? if you dont want to do the leg work to do it just point me in the right direction and I can see what I can find out. Great plugin, I love it
Rob
I think this is the code to increment the ‘views’ custom tag:
$post_id = intval($post->ID);
if($post_id > 0) {
$post_views = get_post_custom($post_id);
$post_views = intval($post_views['views'][0]);
if(!update_post_meta($post_id, ‘views’, ($post_views+1))) {
add_post_meta($post_id, ‘views’, 1, true);
}
}
I tried putting this code into the function wt_rmrh_oninit() but it didn’t work. What would you suggest?
@Bruce
Two things:
1. Make sure the the $post variable is declared global at the top of the wt_rmrh_oninit function:
function wt_rmrh_oninit() { global $post;2. If for whatever reason the above doesn’t work (but it should, I just tried it out), use the following to get the post’s ID:
That the’s value sent by the javascript.