sheppardzwc
01-11-2011, 09:21 PM
Hi all, ran into a bit of a problem here,
Trying to insert some information I'm getting from IMDb into a post but whenever it has certain characters like an apostrophe it converts it into it's entity counterpart? (') Any idea how to prevent this.. is there a variable I need to pass into the datamanager? Tried html_entity_decode when I set the pagetext in the DM but it doesn't have the "entities" yet so it isn't decoding anything...
Thanks.
(here's a snippet of what's going on)
<?php
foreach ($movie->cast() as $cast) {
$num++;
if ($num <= $castnum) {
$actors = array_merge((!is_array($actors)) ? array() : $actors, array(
$cast['name'] => array(
'role' => $cast['role'],
'photo' => $cast['thumb']
)));
}
}
foreach ($actors as $actor => $other) {
$castformatted .= $actor . ' as ' . $other['role'] . "\r\n";
}
$info = str_replace('{id}', $id, $vbulletin->options['auto_imdb_infoformat']);
$info = str_replace('{title}', $title, $info);
$info = str_replace('{year}', $year, $info);
$info = str_replace('{cast}', $castformatted, $info);
$info = str_replace('{genre}', $genre, $info);
$info = str_replace('{photo}', $photo, $info);
$dm = datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dm->set_existing(fetch_postinfo($newpost['postid']));
$dm->set('pagetext', $newpost['message'] . "\r\n\r\n" . html_entity_decode($info));
?>
Trying to insert some information I'm getting from IMDb into a post but whenever it has certain characters like an apostrophe it converts it into it's entity counterpart? (') Any idea how to prevent this.. is there a variable I need to pass into the datamanager? Tried html_entity_decode when I set the pagetext in the DM but it doesn't have the "entities" yet so it isn't decoding anything...
Thanks.
(here's a snippet of what's going on)
<?php
foreach ($movie->cast() as $cast) {
$num++;
if ($num <= $castnum) {
$actors = array_merge((!is_array($actors)) ? array() : $actors, array(
$cast['name'] => array(
'role' => $cast['role'],
'photo' => $cast['thumb']
)));
}
}
foreach ($actors as $actor => $other) {
$castformatted .= $actor . ' as ' . $other['role'] . "\r\n";
}
$info = str_replace('{id}', $id, $vbulletin->options['auto_imdb_infoformat']);
$info = str_replace('{title}', $title, $info);
$info = str_replace('{year}', $year, $info);
$info = str_replace('{cast}', $castformatted, $info);
$info = str_replace('{genre}', $genre, $info);
$info = str_replace('{photo}', $photo, $info);
$dm = datamanager_init('Post', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$dm->set_existing(fetch_postinfo($newpost['postid']));
$dm->set('pagetext', $newpost['message'] . "\r\n\r\n" . html_entity_decode($info));
?>