Pages:
1
2 |
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
RSS Feed Hack
Hi
Does anyone know of a RSS feed hack? One that allows feeds to be posted on the forum and if possible also provides the forums rss feed links/page etc.
Cheers
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Thank You
I keep getting error on line 43 in my browser which is this
----
Parse error: syntax error, unexpected T_STRING in /home/name/public_html/forum/rss-file-name.php on line 43
----
Which is this below
---
Code: | echo "<?xml version=\"2.0\"?>\n"; |
---
I've tried changing it to a number of various versions off the top of my head but nothing works, Tried removing it but also no go.
Any idea on what should go there?
Cheers
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
Change it back to 1
I reckon the issue is elsewhere, especially if you have altered the code.
If you've made the changes I recommended, upload it here and I'll see if I can see anything obvious.
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Quote: Originally posted by lottos  | Change it back to 1
I reckon the issue is elsewhere, especially if you have altered the code.
If you've made the changes I recommended, upload it here and I'll see if I can see anything obvious.
|
Doesn't matter what I try nothing changes the error message.
Here's the file.
Am I just supposed to add a RSS link into one of the posts for this to work?
Attachment: ozy_rss.php (5kB) This file has been downloaded 692 times
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
Replace
$query1 = mysql_query("SELECT lastpost, fid, tid, WHERE fid IN[1,3] threads ORDER BY lastpost DESC"  ;
with
$query1 = mysql_query("SELECT lastpost, fid, tid, WHERE fid IN(1,3) threads ORDER BY lastpost DESC"  ;
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Quote: Originally posted by lottos  | Replace
$query1 = mysql_query("SELECT lastpost, fid, tid, WHERE fid IN[1,3] threads ORDER BY lastpost DESC" ;
with
$query1 = mysql_query("SELECT lastpost, fid, tid, WHERE fid IN(1,3) threads ORDER BY lastpost DESC" ; |
I already tried that before and just changed it back to (). No Difference.
Maybe it is me testing it wrong. How should I be testing this?
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
You need to get the code correct before it will run.
You have one too many closing } somewhere - when you removed some of the code you missed removing it.
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
A newer one, which is the one used on this very forum (preview either via the link along the header to the right of the search, or via http://forums.xmbforum2.com/feed.xml.php ):
Code: |
<?php
/**
* eXtreme Message Board
* XMB 1.9.11
*
* RSS Feed Add-On
* Version 0.1 BETA by Robert Chapin (miqrogroove)
* http://www.miqrogroove.com/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**/
define('X_SCRIPT', 'feed.xml.php');
// Configurable, edit as you like!
define('MAX_RSS_ITEMS', 10);
require 'header.php';
$fid = getInt('fid');
$fids = loadFIDs();
if ($fid > 0) {
if (!in_array($fid, $fids)) {
header('HTTP/1.0 404 Not Found');
error('404 Not Found');
} else {
$fids = array($fid);
$forum = getForum($fid);
$link = "{$full_url}forumdisplay.php?fid=$fid";
$title = rss_cdata(fnameOut($forum['name']));
$desc = rss_cdata(html_entity_decode($forum['description']));
}
} else {
$link = $full_url;
$title = $SETTINGS['bbname'];
$desc = $lang['alttodayposts'];
}
if (count($fids) == 0) {
header('HTTP/1.0 403 Forbidden');
error('The forums have not been configured for guest access yet.');
}
$fids = implode(',', $fids);
$query = $db->query(
"SELECT t.*, MIN(p.dateline) AS firstpost
FROM ".X_PREFIX."threads AS t
LEFT JOIN ".X_PREFIX."posts AS p USING (tid)
WHERE t.fid IN ($fids) AND t.closed NOT LIKE 'moved%'
GROUP BY t.tid
ORDER BY tid DESC
LIMIT ".MAX_RSS_ITEMS
);
if ($row = $db->fetch_array($query)) {
$lastpost = explode('|', $row['lastpost']);
$build = '<lastBuildDate>'.date('r', $lastpost[0]).'</lastBuildDate>';
$db->data_seek($query, 0);
} else {
$build = '';
}
echo "<?xml version='1.0' encoding='{$lang['charset']}' ?>\n";
?>
<rss version="2.0">
<channel>
<title><?php echo $title; ?></title>
<link><?php echo $link; ?></link>
<description><?php echo $desc; ?></description>
<language><?php echo $lang['iso639']; ?></language>
<generator><?php echo $versionlong; ?></generator>
<?php echo "$build\n"; ?>
<?php
while ($thread = $db->fetch_array($query)) {
?>
<item>
<title><?php echo rawHTMLsubject(stripslashes($thread['subject'])); ?></title>
<link><?php echo "{$full_url}viewthread.php?tid={$thread['tid']}"; ?></link>
<guid><?php echo "{$full_url}viewthread.php?tid={$thread['tid']}"; ?></guid>
<pubDate><?php echo date('r', $thread['firstpost']); ?></pubDate>
</item>
<?php
} // wend
?>
</channel>
</rss>
<?php
//loadFIDs returns an array of forum and subforum IDs accessible by Guests.
function loadFIDs() {
$forums = permittedForums(forumCache(), 'thread', 'array', TRUE, 'Guest');
$fids = array();
foreach($forums as $forum) {
if ($forum['type'] != 'group') {
$fids[] = $forum['fid'];
}
}
return $fids;
}
function rss_cdata($input) {
return "<![CDATA[$input]]>";
}
?>
|
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Thank You But I am still getting an error message
------------------
Internet Explorer cannot display this feed
This feed contains code errors.
Go back to the previous page.
More information
Invalid at the top level of the document.
Line: 71 Character: 7
</rss>
----------------
But looking at the file line 71 has this on it
Code: | $db->data_seek($query, 0); |
and </rss> is on line 99 with nothing as character 7 as there only 6 characters in this.
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Quote: Originally posted by lottos  | You need to get the code correct before it will run.
You have one too many closing } somewhere - when you removed some of the code you missed removing it. |
That wouldn't surprise me as php although I am trying it has never been my strong suit.
You know I'll tell ya something, I'm a fully Qualified PastryChef, chef, baker, account, and done Law for 10yrs, a 4x4 fanatic, I relocate
houses (that's a whole house), I've created and managed multi million dollar businesses, been around Australia 3 times just to name a few
(the point is I am no idiot) BUT I just for some reason can't get my head around this PHP stuff. HTML is fine but php just has me beat at the
moment.
But I am working at it everyday as I'm semi-retired now and have the time.
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
Everyone has to learn somehow!
Not sure why that newer script is erroring. I assume you've made no changes to it? Have you tried with another browser like FireFox?
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Quote: Originally posted by lottos  | Everyone has to learn somehow!
Not sure why that newer script is erroring. I assume you've made no changes to it? Have you tried with another browser like FireFox?
|
Correct no changes made.
Just tried in Firefox and it does work.
I mostly IE-10 in win8
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Now is it possible to get feeds displayed say on a topic board.
I remember years ago when I was using smf I had a rss hack that when I placed a RSS link in the description panel it displayed feeds say 10 new feeds
everyday into that board each in there own posts under that rss feed heading.
Brings new content to the forum automatically on a daily bases or weekly depending on the admin settings.
Nothing like that is there?
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Quote: Originally posted by lottos  | Everyone has to learn somehow!
Not sure why that newer script is erroring. I assume you've made no changes to it? Have you tried with another browser like FireFox?
|
I have fixed the IE issue by removing these lines at the bottom
----------------------
Largest list of competitions online!
View user's profile Visit user's homepage View All Posts By User U2U Member
---------------------
It now works in IE
Cheers
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
Quote: Originally posted by Phil1ooo  | Quote: Originally posted by lottos  | Everyone has to learn somehow!
Not sure why that newer script is erroring. I assume you've made no changes to it? Have you tried with another browser like FireFox?
|
I have fixed the IE issue by removing these lines at the bottom
----------------------
Largest list of competitions online!
View user's profile Visit user's homepage View All Posts By User U2U Member
---------------------
It now works in IE
Cheers |
That made me smile.... you copied more than what was in the code box!
I'm curious as to why you would want the RSS feed on your own website? Doesn't 'Todays Posts' already provide the most up to date
topics?
In any case, you need to convert the RSS back - there are plenty of examples on the web for this, one example see post 7 on this site:
https://forums.digitalpoint.com/threads/how-to-display-rss-f...
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Not sure how it got there then but anyway it's fixed now.
As for wanting the rss feed, I originally didn't want it for my own website but wanted to be able to display other rss feeds ON my website in
certain posts.
For forums with little content rss feeds put in content automatically.
I'll look into what you provided.
Thanks heaps for all your help on this.
Cheers
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
|
|
lottos
Administrator       
Posts: 486
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
Looks great!
I see:
posted on 11-5-2013 at 04:37 PM
Latest news From XMB Forums
XMB Forum
Today's Posts
[New] Theme preview thumbnail is "error.png"
php programmer looking for love
xmb seo
New Icon Image for each forum id Suggestion
[New] Members List
[New] Need to know where a line of code is!
[New] Move text BELOW header in seperate tables.
RSS Feed Hack
xmb future
[New] Trying to upgrade. Need xmb 1.8 first. Help?
|
|
Phil1ooo
Member  
Posts: 85
Registered: 4-24-2013
Member Is Offline
|
|
Thank You
Like I said this should update with new/updated content every hour.
I hope that part works. (cross fingers) LOL
When I know it's working I can offer this to users so they can generate their own feed links from any website and install the code to access
feeds.
|
|
Pages:
1
2 |