TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,026
  • Total Topics: 21,333
  • Online today: 899
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 389
  • Total: 389

RSS Feeds Problem (yes another one)

Started by [JB], October 23, 2006, 11:06:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[JB]

Sorry guys and gals,

I have serached the forums over the last few days - I hate asking questions that have been asked a dozen times before but I cant seem to find the solution.

I am trying to get an RSS feed into a block, I have chose the correct RSS block to add to my page, and as far as I am aware the feed is good, I have also tried other feeds that I have seen advertised on this site that senior member have checked and OK`d

Heres the feed code im using: http://www.armed-assault-zone.com/feeds/news.php

is there any chance someone could try it in a block and tell me if it works for them please?

It may be my installation or something as I cant get the banner to change when I use the Logo image URL: option in Theme Options and Preferences section.

Of course by searching here I found the info on how to change it by adding html code. I also sussed out (by searching here) how to change the page title to an image.

The RSS feed prob has me baffled though  :idiot2:

Thanks in advance for any help..

Lesmond

#1
I just tried it, it seems to working ok but its very long, using the Millenium theme btw

Oh and I have to scroll sideways a bit to see it all

I have it in center block and turned it show titles only works fine.

Click on my sig to see it, but it will be gone soon :)

[JB]

Cheers Lesmond, so the feed works OK.

Must be doing something wrong at my end  :tickedoff:

Any ideas anyone?

fb

Quote from: [JB] on October 24, 2006, 12:35:07 AM
Cheers Lesmond, so the feed works OK.

Must be doing something wrong at my end  :tickedoff:

Any ideas anyone?

It also comes up fine for me (tried it in an RSS center-block).

For your banner issue, you may want to try this.

[JB]

#4
Cheers for the feedback.

@fb - I got the banner sorted mate -just couldnt use the function in the admin panel to do it.

I will give the RSS feed a go in a center block, but I can see by lesmond`s site that it should work in a left or right block.

*EDIT*

I tried center as well as left and right block - no joy

there is only one thing for it...  :knuppel2:

..I will have to look at alternate methods or bin the RSS feeds.

Thanks for your help on this ppl  ;)

Nokonium

#5
Do you already have another RSS feed?

My experience is that you can only have one feed from the function in TP, if you want more you will need to copy and rename the function, then add the feed url as the $backend.

In TPortal.php

Find

function get_perm($perm)

Add before (this one is for Major Geeks, adapt it to suit)

// RSS feed from Major Geeks
function RSSMajorG()
{

global $context, $settings, $options, $scripturl, $txt, $modSettings;

Ã,  Ã,  $context['TPortal']['rss'];
$backend =Ã,   'http://www.majorgeeks.com/backend.php?id=120';
$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";
$curl = "";

// Now to the parsing itself. Starts by creating it:

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");

// Open the actual datafile:

$fp = fopen($backend, "r");

// Run through it line by line and parse:
while ($data = fread($fp, 4096))
{
xml_parse($xml_parser, $data, feof($fp)) or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}

// Close the datafile
fclose($fp);

// Free any memmory used
xml_parser_free($xml_parser);
}


This must be unique

RSSMajorG()

So if you want to have multiple RSS feeds available each must have a different name.

This you must change for each feed source

$backend =Ã,   'http://www.majorgeeks.com/backend.php?id=120';

In a PHP block or Article use the following code, changing the function name, in this caseÃ,  RSSMajorG(), to whatever you have called your function.

global $context, $settings, $options, $scripturl, $txt, $modSettings;

Ã,  Ã,  Ã,  Ã,   echo '<div style="padding: 5px;" class="smalltext">';
Ã,  Ã,  Ã,  Ã,   RSSMajorG();
Ã,  Ã,  Ã,  Ã,   echo '</div>';



When TP is updated these will be removed because the file will be overwritten. To replace them, to do this find the function TPparseRSS() in the updated TPortal.php file, copy it as above and add you own function name and $backend to each feed function required.

[JB]

Thanks nokonium, that was quite an explanatory post but unfortunately I dont have any other feeds atm- this is the only one.

Once I do get it working I will probably be looking to add more so your info will be very useful, thanks.

Nokonium

Try it anyway then and see if it works, I have 3 working on my main site.

akulion

u guys should get the flash RSS feed displayer from tufat.com

its only 5 bucks and u get 5 of them and its awesome!

[JB]

Quote from: nokonium on October 24, 2006, 07:13:18 AM

In TPortal.php

Find

function get_perm($perm)


Used find option in Dreamweaver and also did a quick search with the mk1 eyeball - couldnt find that line?

This website is proudly hosted on Crocweb Cloud Website Hosting.