News: December 2nd, 2015, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.2! GET IT NOW!!!

Login  |  Register
* * *

Welcome !!!

Welcome, Guest. Please login or register.
Did you miss your activation email?
Please welcome Afer, our newest member.

 
 

TinyPortal on Twitter
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 30, 2017, 08:33:27 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3652
  • Latest: Afer
Stats
  • Total Posts: 180687
  • Total Topics: 20283
  • Online Today: 68
  • Online Ever: 383
  • (January 02, 2015, 05:58:49 AM)
Users Online
Users: 1
Guests: 46
Total: 47

Please read the Posting Guidelines


Recent Posts

Pages: [1] 2 ... 10
1
Thanks, I tried, doing what I think you intended me to do, but it's not displaying.
Perhaps you;d be kind enough to check my code for me?

Code: [Select]
$rss = new DOMDocument();
$rss->load('http://gsx1400owners.org/forum/index.php?action=.xml;board=22.0;type=rss');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$description = $feed[$x]['desc'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
echo '<small><em>Posted on '.$date.'</em></small></p>';
echo '<p>'.$description.'</p>';
}

I get
Quote


Posted on Thursday January 01, 1970


Posted on Thursday January 01, 1970


Posted on Thursday January 01, 1970


Posted on Thursday January 01, 1970


Posted on Thursday January 01, 1970
And that's all - posted dates (all of which as you can see are wrong/some kind of default date) and no actual content.....
2
You could use that rss script I linked to in that other thread to grab and display those, otherwise we could see if there's another solution. perhaps using ssi_boardNews etc.

Just change the site address and the board number in the code below, and add it to that rss script.
Code: [Select]
http://whatevermysitescalled.com/index.php?action=.xml;board=73;type=rss'
3
Support / Recent Topics from a single board to show in a block on frontpage?
« Last post by VladTepes on March 28, 2017, 07:05:07 PM »
Hi,  I would like for recent posts in one of my forum boards (it's titled Announcements" to be shown in a block on the front page  (i.e. Home from the top menu)

So far I have tried a recent topics block, but I can't restrict it to a single board.

I have also tried in frontpage settings near the bottom and selected "Announcements' in the Display forum-posts on frontpage from: section.
I've tried this in combination with the What to display on frontpage: set as "selected topics only" and as "frontpanel" but no joy.

I'd very much appreciate if someone could point me in the right direction with this.  Thanks
4
Support / Re: Making a home page
« Last post by VladTepes on March 28, 2017, 06:58:25 PM »
May I suggest that this thread be retitled to "Article System question" and the first two posts in the thread removed  ( and the first line of my next post referring to wordpress.)

The thread will then be relevant and easier for people with a  similar question to find.

Cheers
5
Support / Re: RSS feed block question
« Last post by lurkalot on March 28, 2017, 02:03:13 PM »
Might have to convert to UTF-8 to stop that from happening.  This will also give you a bit of future proofing, as The new SMF 2.1 is already UTF-8 as standard.

http://wiki.simplemachines.org/smf/UTF-8_Readme

Backup database etc before doing anything.

Actually my testsite was displaying that MotoGP feed same as yours, so I just converted it to UTF-8 all seems fine now.http://cctestsite.info/forums/index.php
6
Support / Re: RSS feed block question
« Last post by VladTepes on March 28, 2017, 07:23:26 AM »
OK well I grabbed said script as follows:

Code: [Select]
$rss = new DOMDocument();
$rss->load('http://www.motogp.com/en/news/rss');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$description = $feed[$x]['desc'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
echo '<small><em>Posted on '.$date.'</em></small></p>';
echo '<p>'.$description.'</p>';
}

but the actual feed has some super-odd characters in it (see attached).
Any ideas on why / a fix for this?

Secondly, how do I mod that script so it grabs images too?

Thanks.
7
Support / Re: RSS feed block question
« Last post by VladTepes on March 28, 2017, 06:07:31 AM »
Quote
The script I mentioned in the other thread added a PHP block seems to work ok. Code, http://bavotasan.com/2010/display-rss-feed-with-php/

Bugger that site is offline at the moment.
8
Support / Re: RSS feed block question
« Last post by VladTepes on March 28, 2017, 06:03:54 AM »
This forum needs a say thanks mod... so... thanks !  :)
9
Support / Re: RSS feed block question
« Last post by lurkalot on March 28, 2017, 12:42:58 AM »
Meanwhile I've looked and found several RSS feed scripts but have no idea how good they are, whether they will work etc.
Does anyone have a particular recommendation?

The script I mentioned in the other thread added a PHP block seems to work ok. Code, http://bavotasan.com/2010/display-rss-feed-with-php/

This is what it looks like atm. http://cctestsite.info/forums/index.php Added a feed from your forum so you can see what it looks like, and the original feed underneath from one of my forums. seems to handle images ok as well.
10
Support / Re: RSS feed block question
« Last post by VladTepes on March 27, 2017, 09:58:25 PM »
Meanwhile I've looked and found several RSS feed scripts but have no idea how good they are, whether they will work etc.
Does anyone have a particular recommendation?
Pages: [1] 2 ... 10