 |
|
Author |
Message |
sophocles
Joined: 07 Jul 2010
Posts: 2
|
Posted:
Wed Jul 07, 2010 10:04 pm |
  |
My database includes some html styling for other uses, but needs to be stripped for the iTunes summary. I'm also using the same data for the description tag, which can, I believe include html.
Can anyone give me an idea how I might do this, or point me to where I should look in the code?
I'm thinking maybe I need one more if statement here:
$field = str_replace("~~~", "", str_replace("~~~", "", $match[0]));
that would check for that field especially and strip html from it.
Problem with that though, is that it seems it would strip it for both times I use it, not just the iTunes summary.
Thanks for any help |
|
|
 |
 |
sophocles
Joined: 07 Jul 2010
Posts: 2
|
Posted:
Thu Jul 08, 2010 10:14 pm |
  |
Just in case anyone else should be working on it, thought I'd let you know.
If anyone's interested, this is what I did:
In the ItemTemplate.xml I added an extra ~ to the front and back of the <itunes:summary> so that there are 4 instead of 3.
Then in the sql2rss.php script, I added an extra preg_match for that:
Code: |
while (preg_match("/~~~~[0-9a-zA-Z_]*~~~~/", $text, $match) !== FALSE) {
if (count($match) == 0) break;
if ($match[0] == "") break;
$field = str_replace("~~~~", "", str_replace("~~~~", "", $match[0]));
if (isset($data[$field])) {
$text = str_replace($match[0], sql2rss_encodeForXML(strip_tags($data[$field])), $text);
} else {
$text = str_replace($match[0], "", $text);
}
}
|
So this is just like what's there except it searches for the 4 ~ instead of 3, and includes a strip_tags at the appropriate place.
Of course, this needs to be added before the preg_match for 3~
Maybe not the most elegant, but it seems to work.
Thanks |
|
|
 |
 |
|
| |