- Posts: 2
- Thank you received: 0
Apostrophe showing as 39;
12 years 2 months ago - 12 years 2 months ago #57
by Infinite
Apostrophe showing as 39; was created 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.
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.
12 years 2 months ago #62
by redactie
Replied by redactie on topic Re: Apostrophe showing as 39;
There are some feeds that notoriously use the wrong encoding. The 39s is one example.
I use code like below to solve this:
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.
12 years 2 months ago - 12 years 2 months ago #63
by redactie
Replied by redactie on topic Re: More functions in your callbacks
You can add as many code and filters in a callback as you like
or cascade functions
there is a complete example on www.affiliatefeeds.nl/en/47-datafeeds/3098-callbacks.html
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