FeedForAll Forum Index ?
?Home?????FAQ????? Search ?????Register ?????Profile? ????Log in
?Example: 4 - Get the image embedded in the description View next topic
View previous topic
Post new topicReply to topic
Author Message
randeh



Joined: 16 Sep 2015
Posts: 8
Location: Florida

PostPosted: Wed Sep 16, 2015 12:21 pm Reply with quoteBack to top

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 '
';
echo '';
?>
~~~EndItemsRecord~~~
$theImage~~~ItemPubShortDate~~~ ~~~ItemPubShortTime~~~
';
echo '~~~ItemTitle~~~
';
echo $newDescription.'



[/code][/url]
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2694

PostPosted: Wed Sep 16, 2015 3:26 pm Reply with quoteBack to top

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
View user's profile
randeh



Joined: 16 Sep 2015
Posts: 8
Location: Florida

PostPosted: Wed Sep 16, 2015 4:26 pm Reply with quoteBack to top
';[/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

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.'
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2694

PostPosted: Thu Sep 17, 2015 10:03 am Reply with quoteBack to top

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
View user's profile
randeh



Joined: 16 Sep 2015
Posts: 8
Location: Florida

PostPosted: Thu Sep 17, 2015 10:32 am Reply with quoteBack to top

No that did not work. I even tried removing the double quotes from yesterday's change. The image is still within the description tag.

Here is the first item from the source, I see the [code]top-rated_industrial_industrial_B00XI3OLW4 http://www.amazon.com/Citric-Acid-Anti-caking-Satisfaction-Guarantee/dp/B00XI3OLW4/ref=pd_zg_rss_tr_indust_industrial_1 Thu, 17 Sep 2015 15:19:27 GMT Citric AcidCitric Acid - 1lb - Made in USA - 100% Pure for Food Use - Organic Certified and No Anti-caking Agents. 90 Day Satisfaction Guarantee.
Halechem
4.9 out of 5 stars(437)

Buy new: $11.99 $8.97

(Visit the Top Rated in Industrial & Scientific list for authoritative information on this product's current rank.)]]>
[/code]

Thank you for your help.

Randy
View user's profile
Tech Support



Joined: 27 Aug 2004
Posts: 2694

PostPosted: Fri Sep 18, 2015 5:28 am Reply with quoteBack to top

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
View user's profile
randeh



Joined: 16 Sep 2015
Posts: 8
Location: Florida

PostPosted: Fri Sep 18, 2015 11:38 am Reply with quoteBack to top

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

Thank you,

Randy
View user's profile
Display posts from previous:?? ? ?
Post new topicReply to topic


?Jump to:? ?



View next topic
View previous topic


Powered by phpBB ? 2001, 2002 phpBB Group :: FI Theme