Skip to main content

Apostrophe showing as 39;

More
12 years 2 months ago - 12 years 2 months ago #57 by Infinite
I got all of my feeds apostrophe (') showing as 39;.

I don't know if I need to make a callback function or edit the encoding, I tried with encoding but either i didn't do it right or it did not work.

And how do i add more functions to mycb_cb callbacks?

example:

mycb_cb
generic_cb(&item) {

if function (some code) {
title='';
}
if function (some code) {
title='';
}

}
can i do this?

Thank you for this amazing component.
Last edit: 12 years 2 months ago by Infinite.

Please Log in to join the conversation.

More
12 years 2 months ago #62 by redactie
There are some feeds that notoriously use the wrong encoding. The 39s is one example.

I use code like below to solve this:
Code:
$item['menu_1']=str_replace("39s","'",$item['menu_1']);

Please Log in to join the conversation.

More
12 years 2 months ago - 12 years 2 months ago #63 by redactie
You can add as many code and filters in a callback as you like

Code:
function yourcallback_cb(&$item) { generic_cb($item); if ( condition ) { $item['title']=''; return; } if ( condition2 ) { $item['title']=''; return; } }

or cascade functions
Code:
function yourcallback_cb(&$item) { generic_cb($item); #naming convention ( kind off) #functions ending on _cb will call the generic_cb ( or call another _cb function ) #function without will never call _cb function #this avoids that generic_cb is called twice in the chain another_callback($item); more_callback($item); } function another_callback(&$item){ #do stuff } function more_callback(&$item){ #do stuff }

there is a complete example on www.affiliatefeeds.nl/en/47-datafeeds/3098-callbacks.html
Last edit: 12 years 2 months ago by redactie.

Please Log in to join the conversation.

Time to create page: 0.354 seconds