hi
After I update my tiny portal an article intro display code instead of display text. This issue of displaying code only happen when I using article intro in the front page when using with forum index. Article intros will display properly if in the front page I choose display articles only (without front page). Previously article intro display properly even I used it with forum index in the front page
I attache the print-screen of the problems. Could anyone help?
Thanks
Could be language issue.
I see that the rest of the entire forum uses another language, while TP still uses the english for the articles
Also when you create the article, what kind of article are you placing that code in, and do you have the editor activated ?
Hi
Previously Vietnamese language work just fine. Article itselft still work fine now - only article intro doesn't work. To put the article up I use add article in article management.
you can see my website at http://www.4dkt.com/SMF/
As you see on the website. Article itself display properly but if I use article intro the code display instead of text
Thanks
AUVN
I'm having the same problem with my articles intro text. No html is processed. Must be a block not properly closed on my front page? Auvn you still around to let us know how you fixed this?
Hi catchpen
I still don't know how to resolve the problem yet.
Usually, the first time you put the intro up, it works. But as long as you start to edit it, intro text displays in code format instead of html
Thanks for the quick reply.
Yeah I moved blocks around to front page and made an article block after that it was messed up like yours. I back tracked and did it again and now the html is working again. :idiot2:
I have the same problem as described above with the intro text. I do know that if an article is submitted and then authorized the intro text works fine but if the article is edited or changed in anyway the htlm in the intro text stops being processed and starts being displayed. I does not matter what theme you are using or editor you have selected or No editor it always happens.
If I try to add an article as an administrator the intro text does not work at all it only displays the html it never tries to process the html. I have set the system to no editor, FCKeditor, and WhizzWig and it does not work in any of them.
Below is a shot of what happens before and after an edit and resave of an article..
If anyone has any Ideas Please let me know.
Are you changing things from HTML to PHP in the article type when editing them?
No I am only working with the HTML editor I don't change it to php.
Also try to copy and paste the article on a new blank article. I've had other problems with the article manager and just redoing it solved the problem. I used the Fck editor though.
I Use Fckeditor also and if I cut and copy into a new article it works if I re summit and approve it. If I add or create a new article as a administrator it gives me the error. If I change or edit an article that was submitted it stops processing the HTML.
Thanks for the help
I don’t know if this will help in solving the problem but here is a snippet of the code created before and after an edit and resave of an article. I hope this helps someone who knows coding better than me.
Quote
BEFORE RESAVE
<<div class="tborder" style="margin-bottom: 2px;">
<div class="windowbg" style="padding:4px; " id="block65">
<div style="_height: 1%; overflow: hidden; padding: 4px;"><span class="smalltext">Author: sandman (http://www.islandtackle.com/smf/index.php?action=profile;u=21)</span>
<span class="smalltext">
December 14, 2007, 07:18:45 PM</span>
<span class="smalltext">Views: 29 </span>
<span class="smalltext">Rating: 10 (1 rates) </span>
<div style="overflow: hidden; _height: 1%; margin-top: 1ex;">
<div style="line-height: 1.3em;"><blockquote dir="ltr" style="MARGIN-RIGHT: 0px"><font face="Comic Sans MS" size="3">
<h3 align="center"><font face="Comic Sans MS" color="#ff6600" size="6">Nkorho Pan Africa</font></h3>
<a target="_blank" href="http://www.africam.com/"></a><font face="Comic Sans MS" size="3"><a target="_blank" href="http://www.africam.com/">Nkorho Pan Live WebCam</a> </font>is ranked as one of the top African wildlife sites on the web. Nkorho Pan is a natural water hole in the prestigious Sabi Sands Private Game Reserve, in South Africa. It is a 24 hours a day web cam that is remotely controled by a real person who zooms in on wildlife and put ....</font>
<div class="smalltext" style="margin-top: 1ex; font-weight: bold;">Read more... (http://www.islandtackle.com/smf/index.php?page=43)</div>
</div>
</div>
</div></div></div>
AFTER RESAVE
<div class="tborder" style="margin-bottom: 2px;">
<div class="titlebg" style="padding: 4px; font-weight: bold;"><img border="0" style="margin-right: 4px;" align="right" src="http://www.islandtackle.com/smf/Themes/TP_Christmas_Time/images/tp-edit.gif" alt="" /> (http://www.islandtackle.com/smf/index.php?action=tpadmin;blockeditf=81;sesc=a0c64c92b1bfa98b3e932c1c89eee83d)Nkoho Test edit
</div>
<div class="windowbg" style="padding:4px; " id="block81">
<div style="_height: 1%; overflow: hidden; padding: 4px;"><span class="smalltext">Author:
sandman (http://www.islandtackle.com/smf/index.php?action=profile;u=21)</span>
<span class="smalltext">
December 05, 2006, 01:52:00 PM</span>
<span class="smalltext">Views: 1479 </span>
<span class="smalltext">Comments: 0 </span>
<span class="smalltext">Rating: 9 (5 rates) </span>
<div style="overflow: hidden; _height: 1%; margin-top: 1ex;">
<div style="line-height: 1.3em;"><blockquote dir="ltr" style="MARGIN-RIGHT: 0px"><font face="Comic Sans MS" size="3">
<h3 align="center"><font face="Comic Sans MS" color="#ff6600" size="6">Nkorho Pan Africa</font></h3>
<a target="_blank" href="http://www.africam.com/"></a><font face="Comic Sans MS" size="3"><a target="_blank" href="http://www.africam.com/">Nkorho Pan Live WebCam</a> </font>is ranked as one of the top African wildlife sites on the web. Nkorho Pan is a natural water hole in the prestigious Sabi Sands Private Game Reserve, in South Africa. It is a 24 hours a day web cam that is remotely controled by a real person who zooms in on wildlife and put ....</font> </blockquote>
<div class="smalltext" style="margin-top: 1ex; font-weight: bold;">Read more... (http://www.islandtackle.com/smf/index.php?page=28)</div>
</div>
</div>
</div></div></div>
Hope this helps..
I'm using smf v1.1.4 with tp v0.98 on a fresh install (not upgrade).
In all three editors WhizzyWig, FCK editor, and no [WYSIWYG] intro text is transformed from html formatting to "&[whatever];" whenever the article is saved.
Going to the database and fixing the formatting back to proper html allows the article to display properly; however, if you just open it up in any of the editors and edit it or not, but save it; then all html formatting is again stripped and "&[whatever];" is done again.
This same happens in the body only when not using WhizzyWig or FCK editors.
My assumption is that it is one of two causes: (1) php ini setting, or (2) a programmatic problem in the save process. My money is on (2) since the problem seems to exist in the saving of the intro field and not the body.
I also have other issue with some of the html the editors generate, but that's another issue. I'm gonna do some experimentation and look at the code, then post a follow up.
--follow up--
Here is what I found in TPortalAdmin.php starting at line 939:
elseif(substr($what,0,15)=='tp_article_body'){
$val=substr($what,15);
// convert < and > but only in html types
if(isset($_POST['tp_article_useintro'.$val]) && $_POST['tp_article_useintro'.$val]!='-1')
$newval=htmlspecialchars($value);
else
$newval=$value;
if(is_numeric($val) && $val>0)
db_query("UPDATE {$tp_prefix}articles SET body='$newval' WHERE id=$val", __FILE__, __LINE__);
You will not that htmlspecialchars will only be applied to the body when use intro is set.
Whereas starting at line 998:
elseif(substr($what,0,16)=='tp_article_intro'){
$val=substr($what,16);
$newval=$value;
db_query("UPDATE {$tp_prefix}articles SET intro='$newval' WHERE id=$val", __FILE__, __LINE__);
$go=3;
htmlspecialcharacters is always applied to the intro.
This is embedded in a giant loop starting at line 666 and ending at line 1237 where each $_POST variable is assigned to $what if:
if(isset($_REQUEST['send']) || isset($_REQUEST[$txt['tp-send']]) || isset($_REQUEST['tp_preview']) || isset($_REQUEST['TPadmin_blocks'])){
is true. Our submit [save] button on the edit form is 'send' therefore it is applied EVERYTIME we save the article.
I understand that you should never ever echo something back to the browser that can be harmful. But this is pure paranoia and defeats the whole purpose of the editor.
By changing line line 943 to read $newval=$value; and line 1000 to $newval=$value; it seems to have fixed the problem.
I'm not sure what the security ramifications might be, but since only admins can post articles, at this time it's a non-issue.
Sorry for the long delay but thanks for he help this did the trick... Not sure about the security ramifications but like you said only admins can post articles so there shouldn't be a problem..
Thanks again for the help.