Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 1241
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

RSS Images

Started by Aw06, February 06, 2009, 03:17:15 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Aw06

How can i snip out or rezize any image that gets pulled in an RSS feed... ??

[SiNaN]

Snip out? You mean remove?
And slowly, you come to realize... It's all as it should be...

Aw06

Quote from: Blue Dream on February 06, 2009, 03:22:45 AM
Snip out? You mean remove?

well by snip i mean ... remove the image but leaves a link to the image ...

eg.


<image snipped>

Reason i want this .. some times it pulls in a really larggeee image .. and messes up the layout of the site

Nathaniel

You should be able to do this with the PHP preg_replace() function and a decent regular expression. Not sure if you know much about those though.

Would you like me to try and write one?
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Killer-B

I now have the REVERSE problem -

On my main RSS Feed (Portal Page) my 1st post under the old portal would show the RSS TEXT as well as a thumbnail image that came with the feed - now it's Text Only?

Also, the Block Size for RSS - it has gotten smaller and now use "sidebars" - anyway to go back and adjust the block size to show more feeds? and get my photos back (I see there's a new icon set too)


Otherwise - looks nice   www.f-1chat.com

[SiNaN]

2.2 still has the Custom PHP block, so you can still use the old block codes in a PHP Block.

global $rss_data, $rss_current, $rss_counter;

$parameters[0] = 'http://www.formula1.com/rss/news/latest.rss';

if (empty($parameters[0]))
return;
else
$feed = $parameters[0];

$rss_data = array();
$rss_current = "";
$rss_counter = 0;
$rss_main = '';

$xml_parser = xml_parser_create();

xml_set_element_handler($xml_parser, "sp_startElement", "sp_endElement");

xml_set_character_data_handler($xml_parser, "sp_characterData");

if (!($fp = @fopen($feed, "r")))
return;

while ($data = fread($fp, 4096))
{
if (!xml_parse($xml_parser, $data, feof($fp)))
{
$xmlerr = (sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)), 
xml_get_current_line_number($xml_parser)));

break;
}
}

fclose($fp);

xml_parser_free($xml_parser);

if (!empty($xmlerr))
{
echo $xmlerr;

return;
}

if (empty($rss_data))
return;

if (!empty($rss_data['IMAGE']))
echo '<a href="', $rss_data['LINK'], '" target="_blank"><img src="', $rss_data['IMAGE']['URL'], '" align="middle" alt="', $rss_data['IMAGE']['TITLE'], '" /></a>', $rss_data['TITLE'], '<br /><br />';
else
echo $rss_data['TITLE'], '<br />';

echo '<em>', $rss_data['DESCRIPTION'], '</em><br />';

if (isset($rss_data['ITEMS']))
{
if (count($rss_data['ITEMS']) > 0)
{
for($i = 0; $i < count($rss_data['ITEMS']); $i++)
{
echo '<span style="font-weight: bold;"><a href="', $rss_data['ITEMS'][$i]['LINK'], '" target="_blank">', $rss_data['ITEMS'][$i]['TITLE'], '</a></span><br />';
echo html_entity_decode($rss_data['ITEMS'][$i]['DESCRIPTION']) . '<br />';
if ($i != count($rss_data['ITEMS']) - 1)
echo '<hr />';
}
}
else
return;
}
And slowly, you come to realize... It's all as it should be...

Killer-B

Thanks for the response SiNan...

I'm using a HTML block - and not very good with PHP -

But the "code" you posted above, is that php code to be used in a php box instead of a HTML block? (sorry for stupid Q - I just want to be clear)...

I will try it... and hope it brings back my RSS pix - that was a great feature!

Thanks for the help!

KB

Killer-B

WORKED PERFECT!! Yeah!!!!!  8)

Thank you!!!

www.f-1chat.com

Nathaniel

Aw06,
Did Sinan's code solve this issue for you as well?
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Aw06

Quote from: LHVWB on April 03, 2009, 08:32:34 PM
Aw06,
Did Sinan's code solve this issue for you as well?

i no longer use rss blocks

Eliana Tamerin

Topic marked solved, then.
Ms. Eliana TamerinIt should be painfully obvious by now that I don't respond to support PMs. Don't send me PMs for support. They will be ignored and deleted, post on the Support Boards to get support.