Author |
Message |
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Wed Nov 16, 2011 10:50 am Post subject: Problem with parsing of html characters. |
|
|
I am experimenting with the FIND - Forum Integrated News Delivery - Input and I like it, looks like a good and easy way to add topics to my board.
One problem I am seeing is that in the articles appears a read more link with the following
at the end. Those characters arenīt parsed.
What/where can I make a change in the phpBB code that will enable parsing of those?
I tried to enable html and add them to the list of allowed html tags, but this has no effect.
Greetings. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
drathbun Board Member
Joined: 24 Jul 2008
Posts: 729 Location: Texas
|
Posted: Wed Nov 16, 2011 1:14 pm Post subject: Re: Problem with parsing of html characters. |
|
|
HTML encoded tags can be replaced with their equivalent characters using the html_entity_decode() function. I assume that you would need to apply that function to the input stream at some point in the code. _________________ phpBBDoctor Blog |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Wed Nov 16, 2011 2:15 pm Post subject: Re: Problem with parsing of html characters. |
|
|
I'm looking at includes/functions_post.php, because in the MOD file that prepares and inserts the message the function unprepare_message is used. This function is defined in includes/functions_post.php. This file is also called at the beginning of the MOD's functions_insert_post.php.
And this function makes use of Code: | $unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#', '#nbsp;#', '#raquo;#');
$unhtml_specialchars_replace = array('>', '<', '"', '&', ' ', 'ŧ');
|
I added Code: | ', '#nbsp;#', '#raquo;#' | because in the rss code those caracters appear as Code: | &nbsp;&raquo; | .
However, not even when posting a normal message those characters are parsed as I expected after those code changes.
Any suggestion? _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Wed Nov 23, 2011 3:56 am Post subject: Re: Problem with parsing of html characters. |
|
|
(FIND is great, I am using that one for several years now) _________________ Love your data! Back it up! |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Wed Nov 23, 2011 2:50 pm Post subject: Re: Problem with parsing of html characters. |
|
|
Donīt you observe the problem I'm commenting, the non-parsing of those two HTML encoded tags? _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Wed Nov 23, 2011 3:41 pm Post subject: Re: Problem with parsing of html characters. |
|
|
Yes, the same problem with different encoded tags.
Something somewhere avoids them from getting parsed.
Not a big thing, but I'd like to fix this. Problem is I donīt know how/where. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Thu Nov 24, 2011 2:40 am Post subject: Re: Problem with parsing of html characters. |
|
|
I fixed this.
Code: | #
#-----[ OPEN ]------------------------------------------
#
mods/netclectic/includes/functions_insert_post.php
#
#-----[ FIND ]------------------------------------------
#
function insert_post(
$message,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$nbsp_raquo_match = array('#&nbsp;#', '#&raquo;#');
$nbsp_raquo_replace = array(' ', 'ŧ');
function nbsp_raquo_message($message)
{
global $nbsp_raquo_match, $nbsp_raquo_replace;
return preg_replace($nbsp_raquo_match, $nbsp_raquo_replace, $message);
}
#
#-----[ FIND ]------------------------------------------
#
$message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$message = nbsp_raquo_message($message);
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
That's all. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu Nov 24, 2011 3:34 am Post subject: Re: Problem with parsing of html characters. |
|
|
Oooops! We dont seem to use the same mod!
I have this in the ACP:
Quote: | FIND v1.2.0 - Spitt - The Comic Haven |
_________________ Love your data! Back it up! |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Thu Nov 24, 2011 3:37 am Post subject: Re: Problem with parsing of html characters. |
|
|
I'm using FIND version 1.0.3.
Do you have a copy of the MOD you're using?
*EDIT* Found one.
In Version 1.2.0 my modification has to be applied to includes/find_functionsInsertPost.php. (Not tested yet, I will upgrade version later on today and check.)
*RE-EDIT* I can confirm that the modification works as expected on v.1.2.0. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu Nov 24, 2011 4:21 am Post subject: Re: Problem with parsing of html characters. |
|
|
Here we go
Edit:
Uuups, I cant attach ZIP-files ... _________________ Love your data! Back it up! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Thu Nov 24, 2011 4:26 am Post subject: Re: Problem with parsing of html characters. |
|
|
I have inserted your suggested changes in find_functionsInsertPost.php
As I am running this with cron I will report the result after 12 oclock. _________________ Love your data! Back it up! |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Fri Nov 25, 2011 3:59 pm Post subject: Re: Problem with parsing of html characters. |
|
|
Hi Holger,
Did you check the results? _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Sat Nov 26, 2011 6:10 am Post subject: Re: Problem with parsing of html characters. |
|
|
Sorry! Yes, it works very well!
I will have to replace some more characters. _________________ Love your data! Back it up! |
|
Back to top |
|
|
|