Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-03-02 13:13:09

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Help with putting <txp:body> into a PHP function

Dear community
Due to how I had set up my txp_hak_tinymce plugin, all my <body> and <excerpt> were saved into the Database like this:

Tambi&#233;n integr&#243; otros proyectos como Revoluci&#243;n de los Ni&#241;os y El arte va a la Escuela.

Thanks to this reply, I’ve been able to solve the way the <body> and <excerpt> are saved in the database from now.

However, in order to avoid to re save all my articles again (I have almost 500), I need to display these fields into an XML file without those strange characters. I mean:

También integró otros proyectos como Revolución de los Niños y El arte va a la Escuela.

A friend programmer helped me with this funcion that works

echo stripslashes( html_entity_decode('Tambi&#233;n integr&#243; otros proyectos como Revoluci&#243;n de los Ni&#241;os y El arte va a la Escuela.', ENT_QUOTES, 'UTF-8') );

The problem I face is that I don’t know how to replace that text by TXP tag as <txp:body> or <txp:excerpt> since this code works inside <txp:php> tags.

I thought something like this but it didn’t work:

<txp:php>
echo stripslashes( html_entity_decode('</txp:php><txp:body/><txp:php>', ENT_QUOTES, 'UTF-8') );
</txp:php>

Could anyone give any clue how to replace that sample string by <txp:body> or <txp:excerpt> ?
I’ll be very grateful.
Regards

Offline

#2 2016-03-02 13:26:03

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Help with putting <txp:body> into a PHP function

Hi Fernando,

may I point you to this gaekwad’s post in the SQL sticky topic instead? And don’t miss his last line ;)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2016-03-02 13:40:43

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Re: Help with putting <txp:body> into a PHP function

Hi Uli. Thanks for reply.
I’d prefer not touch the database. Besides, I would have to replace more than one characters.

I was thinking the etc_query or smd_query might help me but I am not sure how to use it for this purpose. :P

In summary, I just need to display the <txp:body> and <txp:excerpt> into an XML file but without those strange characters.

Last edited by gfdesign (2016-03-02 13:41:15)

Offline

Board footer

Powered by FluxBB