Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   HomePage Excerpt Error in Comment Link Text (http://forum.bytesforall.com/showthread.php?t=13941)

RolandK Apr 27, 2011 07:58 AM

HomePage Excerpt Error in Comment Link Text
 
2 Attachment(s)
I have version 3.5.3. My blog has many post titles that refer to coupon amounts and savings. I've noticed the homepage excerpts for some titles generate an error in the comment link/text. See attached image 'comments-link' which shows this
"/1 Dole Salads Coupon!">5 comments "
instead of
"5 comments"

Seems to happen when the title contains special characters like colon and dollar sign with a number:
e.g. COUPONS: Rare $1/1 Dole Salads Coupon!

Had a similar error on a post called COUPONS: $1/1 Horizon Dairy Product + More!

Is this a known error? What can be done until the software is fixed? Thanks

lmilesw Apr 27, 2011 11:01 AM

This post might help you. Be sure and do the rename of the original file just in case so you can go back if it doesn't work. I mentions it is for Atahualpa 3.4.6 but the files may be the same but all the more reason to no overwrite the original file.

RolandK Apr 28, 2011 06:11 AM

Thanks lmilesw, but I'm reluctant to try since that thread from Mar 2009 also says
"This fix will be included in version 3.5.4 which should be out shortly "

Any other ideas that are more specific to the comments line on homepage?

juggledad Apr 28, 2011 06:22 AM

what is the url?
I just put that title in a post on 353 and have no problem. Edit the post and what is in the 'Atahualpa Post Options' section of the post page?

RolandK Apr 28, 2011 10:13 AM

url is http://couponproblog.com
the title problem does not show on individual page view, but only on homepage excerpt or if search results return that post (e.g. look at this search page to see it: http://couponproblog.com/?s=dole+salads

The page options are:
Footer homepage:
<image(comment-gray.gif)> %comments('Leave a comment', 'One comment', '% comments', 'Comments are closed')% &nbsp; <image(folder-gray.gif)> %categories-linked(', ')% %tags-linked('&nbsp; <image(tag-gray.gif)> ', ', ', ' &nbsp; ')% %edit(' | ', 'Edit', '')%
__________________________________________________ ____

lmilesw Apr 28, 2011 10:21 AM

What happens if you use a dash instead of a slash?

juggledad Apr 28, 2011 11:21 AM

Ok, I've reproduced it, let me take a look...

juggledad Apr 28, 2011 02:14 PM

This is caused by the '$1' it's being treated as a variable in an area of the code. if you change it to '$ 1' there will be no problem. I've sent a note to Flynn about a possible fix, but it could take a number of days before he has time to look at it.

RolandK Apr 28, 2011 03:03 PM

Thanks so much for replicating and finding the problem so quickly!
I'd appreciate if you notify me when he has looked at it so I can circumvent until the fix gets in the next release. As you can imagine, the reader sees the difference

COUPONS: Rare $ 1/1 Dole Salads Coupon!

since we read the dollar sign without spaces.

Would $1.00/1 work any better as a circumvention?

juggledad Apr 28, 2011 03:57 PM

Nope, it's the dollar sign next to the number one '$1' so '$1.00' would still cause the issue. May even be a problem if you used $0.99 or $2.00

RolandK May 5, 2011 05:10 PM

Hello Juggledad,
The problem is a bit more urgent now that it causes my posts to completely disappear. I had decided to live with the incorrect text around the 'leave a comment' link on homepage rather than add space in the title. But today I published such a title, lost posts immediately (on viewing). Put the post in draft mode and the other published posts reappeared. My posts had been vanishing a bit lately and I had to have support repair the database, but this time I see the $ connection in this mishap more clearly!

can you expedite this for me? thanks for your help.

juggledad May 5, 2011 05:18 PM

I'm still waiting for a response from the developer

tizmeashley Jan 16, 2012 11:50 AM

Is there an update on this issue? I am experiencing the same problem.

Thanks!

lmilesw Jan 16, 2012 01:21 PM

I believe this was handled in a patch or a later version of Atahualpa. Which version are you using?

tizmeashley Jan 17, 2012 10:28 AM

I'm using WordPress 3.3.

juggledad Jan 17, 2012 11:24 AM

He means what version of Atahualpa are you using - the current version is 3.7.3

tizmeashley Jan 17, 2012 02:08 PM

oh, ha! Silly me :) sorry about that -- I'm using Atahualpa 3.6.4, so it's possible updating will correct my problem?

lmilesw Jan 17, 2012 02:15 PM

Updating or adding patches. Be sure and do a manual update "just in case".

There are instructions for manually updating in the new versions and updating forum.

RolandK May 10, 2012 04:12 PM

1 Attachment(s)
Hi,
I'm back but regarding a different blog. It's a year since we discussed this problem and I have the latest version 3.7.6 downloaded directly (not an update of earlier version). The problem happens only on the home or category pages since that's where the post info puts the link to the 'leave a comment' using the title (the actual slug does not have the $ sign!). Now it seems to repeat the category and tags and then messes up the link: (see attachment) the title is
$1.50/1 Clorox 2 Product Coupon + Target & Dollar General Deals while the slug is
http://dealdetectingdiva.com/2012/05...al-deals.html/


Here's an example on the tag page: http://dealdetectingdiva.com/tag/cleaning/

Use of $1 is common on couponing sites, so this error is very frustrating and causes folks to change themes... "$ 1" is not how people write or read numbers... Please advise as soon as possible.

juggledad May 10, 2012 06:29 PM

I'm sorry this fell thru the cracks :o. I've just sent another email to Flynn and will nag him till we have a solution. Feel free to nag me too.

I'm also going to look at the code though it has to do with a 'preg_replace' statement and they make my head hurt.

sudipto May 11, 2012 02:30 PM

Add the below code to functions.php
===============================

PHP Code:

function suppress_dollar_in_title($title$id) {
    
$title=str_replace('$'"&#-36;"$title);
    return 
$title;
}
add_filter('the_title''suppress_dollar_in_title'12); 


==========================================
the code simple filters the post title and replaces the $ sign with HTML code of $ sign
&#-36; --- please note remove the dash (-) in the above code.. since its an HTML code its getting converted into dollar

juggledad May 11, 2012 02:47 PM

sudipto - nice try, but it doesn't work. This has to do with this line of code
HTML Code:

                        $postinfo = preg_replace("/(.*)%comments\((.*?)\)%(.*)/i", "\${1}" .
                $comment_link. "\${3}", $postinfo);

and preg_xxxxx's hurt my head :p

p.s. I tried adding
HTML Code:

                        $postinfo=str_replace('$', "$", $postinfo);
just before thise lines and no change.

RolandK May 11, 2012 03:27 PM

Well it seems to do the trick as a 'work-around' until the theme code is changed. See the page I gave before as badly formatted: http://dealdetectingdiva.com/tag/cleaning/

looks fine after Sudipto's php code...

sudipto May 11, 2012 03:44 PM

Quote:

Originally Posted by juggledad (Post 84990)
sudipto - nice try, but it doesn't work. This has to do with this line of code
HTML Code:

                        $postinfo = preg_replace("/(.*)%comments\((.*?)\)%(.*)/i", "\${1}" .
                $comment_link. "\${3}", $postinfo);

and preg_xxxxx's hurt my head :p

p.s. I tried adding
HTML Code:

                        $postinfo=str_replace('$', "$", $postinfo);
just before thise lines and no change.

The dollar sign is creating problem then just replacing it will the HTML of $ is the best alternative. The function that I added works.

juggledad May 11, 2012 03:47 PM

Ahh much better with the ascii values in it. I'll pass this on. Thanks sudipto


All times are GMT -6. The time now is 06:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.