Author |
Message |
randeh
Joined: 16 Sep 2015
Posts: 8
Location: Florida
|
Posted: Wed Sep 16, 2015 12:21 pm |

|
I am trying to use Example: 4 - Get the image embedded in the description from the rss2html-pro-examples.txt file. It does not seem to be finding my image in the description. The only thing it is doing is placing "$theImage" to the left of the image. Here is the url to the site I am testing the pro version with different feeds. [url]http://productreviews.mobi/rss/outputimage2.php[/url]
The only thing that look odd to me was this line although I know very little php. $theImage = ' ';
Can you please point me in the right direction.
Thank you,
Randy
[code]
~~~FeedTitle~~~
~~~FeedTitle~~~
~~~FeedDescription~~~
~~~BeginItemsRecord~~~
// Set initial values for our variables
$theImage = ' ';
// To ensure proper display with borders
$newDescription = '~~~ItemDescription~~~';
$match = Array();
// Use regular expressions to find ![]()
if (preg_match('/ ]*>/', $newDescription, $match) !== FALSE) {
// Make sure it truely was a match
if ((count($match) != 0) && ($match[0] != '')) {
// Save the image
$theImage = $match[0];
// Remove the image from the description
$newDescription = str_replace($match[0], '', $newDescription);
}
}
echo '$theImage | ~~~ItemPubShortDate~~~ ~~~ItemPubShortTime~~~ ';
echo '~~~ItemTitle~~~ ';
echo $newDescription.' | ';
echo '
| ';
?>
~~~EndItemsRecord~~~
[/code][/url]
|
|
|
 |
 |
Tech Support
Joined: 27 Aug 2004
Posts: 2694
|
Posted: Wed Sep 16, 2015 3:26 pm |

|
Try replacing the single quotes in the following line with double quotes.
Change
Code: |
echo ' | $theImage | ~~~ItemPubShortDate~~~ ~~~ItemPubShortTime~~~ '; |
to
Code: |
echo " | $theImage | ~~~ItemPubShortDate~~~ ~~~ItemPubShortTime~~~ "; |
|
_________________
Create RSS Feeds
Audio Recording and Editing
|
|
 |
 |
randeh
Joined: 16 Sep 2015
Posts: 8
Location: Florida
|
Posted: Wed Sep 16, 2015 4:26 pm |

|
That takes care of removing the $theimage tag although the code is not giving me a separate image from the description.
I removed the [code]echo $newDescription.' | ';[/code] line and the image went away; of coarse along with the description.
I want to be able to have the image separate so that I can place it above my Item Title. It seems that the image is not being pulled from the description.
Is this variable correct [code]$theImage = ' ';[/code]
Thank you for your help I appreciate it very much.
Kind regards,
Randy
|
|
 |
 |
Tech Support
Joined: 27 Aug 2004
Posts: 2694
|
Posted: Thu Sep 17, 2015 10:03 am |

|
That is odd.
Try changing
Code: |
if (preg_match('/ ]*>/', $newDescription, $match) !== FALSE) { |
to
Code: |
if (preg_match('/ ]*>/', $newDescription, $match) == 1) { |
|
_________________
Create RSS Feeds
Audio Recording and Editing
|
|
 |
 |
randeh
Joined: 16 Sep 2015
Posts: 8
Location: Florida
|
Posted: Thu Sep 17, 2015 10:32 am |

|
|
 |
 |
Tech Support
Joined: 27 Aug 2004
Posts: 2694
|
Posted: Fri Sep 18, 2015 5:28 am |

|
I want to try to reproduce your problem here.
If all the rss2html stuff is in its own folder, can you zip up that folder and send it to ? If not in its own folder, just zip up all the rss2html files and send them along.
Thanks
|
_________________
Create RSS Feeds
Audio Recording and Editing
|
|
 |
 |
randeh
Joined: 16 Sep 2015
Posts: 8
Location: Florida
|
Posted: Fri Sep 18, 2015 11:38 am |

|
Just to follow up and make sure you received my email with attached files. Sent today at 10:13 am EST.
Thank you,
Randy
|
|
|
 |
 |
|