 | |  | | | Classifieds How do I...? Wondering how to do something in Classifieds? |
September 1st, 2009, 12:20 PM
|
#1 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2009 Location: Denpasar
Posts: 13
| Description showing html codes ...
i have been testing my site Code: Content visible to verified customers only.
for the last month for error and some tweaking here and there .. until recently, i realised that the 'description' part was showing html codes ..
at first i thought it was the compatibility problem with advanced editor , so i swithc to basic . it still showing html codes , i turned it off , and it still showing html codes ..
pls take a look at the ss : Code: Content visible to verified customers only.
any ideas what went wrong ?
sorry if i posted in the wrong section .
thnx in advace
|
| |
September 1st, 2009, 02:45 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
well you could try altering the showproduct.php file adding the line in bold where noted but I dont see why yours is not rendering as we already call an un_htmlspecialchars line Code: Content visible to verified customers only.
|
| |
September 1st, 2009, 08:49 PM
|
#3 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2009 Location: Denpasar
Posts: 13
|
it still doesn;t work chuck  ...
is the problem inside VB's engine or showproduct.php ? i'm just asking ..
could vb theme affect ppclassifieds ?
desperate mode : (on) |
| |
September 1st, 2009, 08:56 PM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
I am not seeing how what I posted would not work that makes no sense. You can post a valid link to a test ad. Your sure you uploaded the changed file with the change I suggested?
|
| |
September 1st, 2009, 10:38 PM
|
#5 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2009 Location: Denpasar
Posts: 13
|
hmm.. it took the server to refresh quite a while ... yes i have upload the file as you suggested (with the new line added inside) earlier .. strangely the new file 'activated' just now..
i guess there was a problem with my server ..
but it working fine now
thanks alot chuck !
|
| |
September 1st, 2009, 11:00 PM
|
#6 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
Have a good day
|
| |
September 4th, 2009, 05:35 PM
|
#7 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2007
Posts: 18
| Having same issue...
Chuck-
I'm also having this issue with some of the html displaying in the ad description of showcat (see attached screenprint). I just downloaded the latest pp classifieds a few days ago. I tried the fix you gave in this post but no change. The page source (below) looks ok, so I'm not sure why the partial html is displayed instead of the link. Hope you have a great idea to fix this. Code: Content visible to verified customers only.
Sorry, forgot to mention I'm using the advanced wysiwyg editor, but also tried basic with same results
|
| |
September 4th, 2009, 05:42 PM
|
#8 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
Showcat does not and can not show html
Basically the description html tags should be stripped because the actual description is limited if we broke the tags they can result in inproper page generation so tags are stripped
|
| |
September 4th, 2009, 05:46 PM
|
#9 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2007
Posts: 18
|
That makes sense. I'm curious, why not use strip_tags instead of htmlspecialchars so none of the html code is displayed?
Update: Actually, I do see the function you're using in pp-inc but I admit I'm not entirely clear on the results. My understanding is that strip_tags removes the entire tag and the text between the brackets, so the html code would not display in the category listing as it does now, which would be perfect. But doesn't the str_replace kinda prevent that? I'm sure I'm wrong so I'll wait for your explanation. Code: Content visible to verified customers only.
Last edited by atddoug; September 4th, 2009 at 06:33 PM.
|
| |
September 5th, 2009, 09:41 AM
|
#10 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
The function I refer to is not in pp-inc.php and the un_htmlspecialchars function does more than a strip_tags
In showcat.php we do a straight strip_tags before we cut the description down |
| |
September 5th, 2009, 05:11 PM
|
#11 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2007
Posts: 18
|
Hey Chuck, thanks for the reply (and on a saturday?  ).
I discovered something through trial-and-error that works for me, but maybe you can explain why it works, and perhaps why I shouldn't do it.
In this code in showcat.php... Code: Content visible to verified customers only.
I comment-out this statement... Code: Content visible to verified customers only.
And the ad descriptions in the showcat page just show the text without the partial html link code, just the way I wanted. And when you look at individual items in a showproduct page, everything is correct with the description text and any text-links.
So, the result was what I wanted, but am I missing some other potential issue by commenting-out that statement?
Thanks for your assistance. Btw: The latest pp version is awesome! Your hard work is appreciated. |
| |
September 5th, 2009, 05:38 PM
|
#12 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
Well again the code that is there prevents invalid html tags because if you say open some html and dont close it the page can be thrown off.
|
| |
September 6th, 2009, 07:40 PM
|
#13 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2007
Posts: 18
|
"What we have here is a failure to communicate." Just kidding. Now, you'll have to look at my attached images because I've tried pasting the browser output into this post but I can't prevent this forum from altering the code that I need you to see (not even with code or quote tags).
What I'm trying to say is... for some reason the preg_replace_callback isn't working right. With your original pp source (not my changes), what the browser displays in the showcat desc is seen in the first attachment of this reply.
so only the first 8 chars, Code: Content visible to verified customers only.
, are stripped off the front of the tag leaving the remainder of the tag displayed in the browser.
And maybe this is a clue to the problem... the page's source code in the browser is showing the actual "shy" code, as seen in the second attachment.
See what I mean? That's not the expected result, is it? Again, that's using the original showcat.php source code, nothing I've changed.
Now as a workaround for myself, I'm commenting-out the preg_replace_callback and I moved the wordwrap below the strip_tags. So its just showing text in the description and its wrapped correctly.
But please let me know if you see something to correct in the preg_replace_callback statement so I can restore the showcat.php code to its original condition (minus the correction).
Thanks Chuck!
Last edited by atddoug; September 6th, 2009 at 07:50 PM.
|
| |
September 6th, 2009, 08:25 PM
|
#14 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
| |
| |
September 6th, 2009, 08:25 PM
|
#15 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
| |
| |
September 7th, 2009, 05:44 PM
|
#16 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2007
Posts: 18
| Quote: |
I am not seeing any links.
| That's because I have the statement commented as a temporary workaround to prevent the partial link from showing... Quote: |
Now as a workaround for myself, I'm commenting-out the preg_replace_callback and I moved the wordwrap below the strip_tags. So its just showing text in the description and its wrapped correctly.
| Please check the attached pics in my last post - the first one shows the partial link in the browser, the second shows the funky browser source code that shows the "shy" variables. That's using the unaltered showcat.php file that I downloaded last week.
Thanks again for looking into this, Chuck. My workaround is more than satisfactory for the time being.
Have a great labor day!
|
| |
September 7th, 2009, 06:17 PM
|
#17 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
If your workaround works then thats fine for you.
|
| |
September 9th, 2009, 12:57 AM
|
#18 (permalink)
| | Junior Member Verified Customer
Join Date: Jul 2007
Posts: 18
|
Ok, sounds good. Thanks :-)
|
| |
September 9th, 2009, 09:06 AM
|
#19 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 52,680
|
yeah its all in whatever works.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 01:46 AM. | |