phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Problem with parsing of html characters.

Goto page 1, 2  Next
 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Wed Nov 16, 2011 2:50 pm 
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
Code:
  and »

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: 666
Location: Texas


flag
PostPosted: Wed Nov 16, 2011 5: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: 621
Location: Spain


flag
PostPosted: Wed Nov 16, 2011 6: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:
&amp;nbsp;&amp;raquo;
.

However, not even when posting a normal message those characters are parsed as I expected after those code changes.

Any suggestion? icon_confused.gif

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Wed Nov 23, 2011 7: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: 621
Location: Spain


flag
PostPosted: Wed Nov 23, 2011 6: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


flag
PostPosted: Wed Nov 23, 2011 7:17 pm 
Post subject: Re: Problem with parsing of html characters.

Hm, I dont think so ...
But I have tweaked the code and also paid someone for correcting the code. Maybe that error was solved that way.
The posts appear here:
http://www.maskinisten.net/viewforum.php?f=108
http://www.maskinisten.net/viewforum.php?f=21

_________________
Love your data! Back it up!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Wed Nov 23, 2011 7:19 pm 
Post subject: Re: Problem with parsing of html characters.

Now I am looking closer to this I can see the error too!
http://www.maskinisten.net/viewtopic.php?t=27647
&rsquo;
&ldquo;

_________________
Love your data! Back it up!
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Wed Nov 23, 2011 7: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: 621
Location: Spain


flag
PostPosted: Thu Nov 24, 2011 6: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('#&amp;nbsp;#', '#&amp;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. icon_biggrin.gif

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Thu Nov 24, 2011 7: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: 621
Location: Spain


flag
PostPosted: Thu Nov 24, 2011 7: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


flag
PostPosted: Thu Nov 24, 2011 8: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


flag
PostPosted: Thu Nov 24, 2011 8: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: 621
Location: Spain


flag
PostPosted: Fri Nov 25, 2011 7:59 pm 
Post subject: Re: Problem with parsing of html characters.

Hi Holger,

Did you check the results? icon_smile.gif

_________________
phpBB2 will never die, I hope!
Back to top
Holger
Board Member



Joined: 19 Jan 2009

Posts: 509
Location: Hanover


flag
PostPosted: Sat Nov 26, 2011 10: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
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 2 All times are GMT
Goto page 1, 2  Next
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0284 seconds using 15 queries. (SQL 0.0018 Parse 0.0010 Other 0.0257)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo