PDA

View Full Version : RDF-Feed from your Forums


Dontom
27 Jan 2003, 06:56
Just change db-details and drop this file into your forums directory - it will output a RDF-file with the last x posts on your forums...

As '&' in URLs is not allowed in RDF put this rewrite rule into the directory you put this script.

RewriteEngine on
RewriteRule ^tl([0-9]+)\.html$ showthread.php?s=&goto=lastpost&threadid=$1[L]

it will send the user to the lastpost of the thread.

Demo:
you need a rdf- parser to view it . Knews under KDE or Netscape > 6, PHP-Nuke, Post-Nuke...
http://www.mtb-news.de/forum/rdf.php

Areku
27 Jan 2003, 09:58
Excuse me, but what's a RDF file?

Dontom
27 Jan 2003, 10:22
http://www.w3.org/RDF/
http://www.xml.com/pub/a/2001/01/24/rdf.html
Resource Description Framework (RDF)

Smirks
27 Jan 2003, 15:44
This shows posts from all forums. Is there any way to restrict it to public forums only? I have a few private forums who's posts I don't want to be displayed in the RDF.

Dontom
27 Jan 2003, 15:50
i excluded forum # 13 - you can also change the query to

AND forum.forumid <> 13 AND forum.forumid <> 93 etc to exclude 13, 93 and so on...
tom

VeoMorphine
27 Jan 2003, 17:42
how about a file that can also parse RDF be included here so you can show rdf's on any other page.

Dontom
27 Jan 2003, 19:13
there already exist lots of scripts to to this...
http://www.hotscripts.com/search/?bool=AND&query=rdf&category=PHP
Some of the larger packeges (postnuke/phpnuke) already have it built in

Tom

pogo
27 Jan 2003, 21:59
I used an other approach to exclude private forums.
See it here: Latest Threads in RSS Feed (need help) (http://www.vbulletin.org/forum/showthread.php?postid=330473#post330473)

Minots
28 Jan 2003, 00:22
In June 2002 I´ve done this kind of hack/addOn for vbPortal-User.
It works great since 6 month! :D

Request @ vBulletin Germany.com (http://www.vbulletin-germany.com/forum/showthread.php?s=&threadid=2380)
Public Release @ vbPortal.com (http://www.vbportal.com/forums/showthread.php?threadid=5181)

Short time later, Bierhasser (http://www.vbulletin.org/forum/member.php?s=&action=getinfo&userid=6574) (from KOKSA-Community (http://koksaboard.com)) and my person
have done the first version for "vBulletin-without-vbPortal".

Demos:
http://www.d0x.de offers latest news from http://www.minots.de
(PHPNuke <--> vbPortal)
http://www.minots.de offers latest news from http://www.koksaboard.com
(vbPortal <--> vBulletin)

In the attachment of this post you can find 2 files.
backend.php (for vbPortal)
vBbackend.php (for vBulletin)

Install:
Just open the one you need and edit the few configuration-strings. After that, save & upload it to your www-root-folder. ;)

Greetings,

Dontom
28 Jan 2003, 04:59
Minots,
Fein - ich hatte nach was passendem gesucht aber nix gefunden...

Nice - i searched for something like this but didn't find it - i made it myself...
Tom

Minots
28 Jan 2003, 05:58
@ Dontom
Ich finde es klasse, dass Du Dir auch die Mühe gemacht hast,
etwas derartiges zu coden. Darum sehe mein Posting bitte
nicht als Konkurenz-Angebot, sondern vielmehr als
eine weitere mögliche Lösung, die Dir frei zur Verfügung steht. :)

Liebe Grüße,

djr
28 Jan 2003, 09:25
It probably adds another query, but how can I also add the forum title to it? Do I also need an extra LEFT JOIN on forum USING(forumid)? Can someone point me in the right direction?

Thanks!
- djr

pogo
28 Jan 2003, 09:44
Originally posted by djr
It probably adds another query, but how can I also add the forum title to it? Do I also need an extra LEFT JOIN on forum USING(forumid)? Can someone point me in the right direction?

Thanks!
- djr

It is already in there!

...votetotal, forum.title AS forumname FROM thread...

You can use it as $rows[forumname].

djr
28 Jan 2003, 09:52
Sorry, wasn't clear :( I use your version, because it's easier to work with. But you use a LEFT JOIN on forumpermission instead of forum.

- djr

pogo
28 Jan 2003, 10:41
Then you should have asked in the other thread. ;)

$threads=$DB_site->query("SELECT threadid,thread.title AS title,thread.lastpost,thread.replycount,postusername,thread.forumid,forum.title AS forumtitle
FROM thread
LEFT JOIN forumpermission USING(forumid)
LEFT JOIN forum ON forum.forumid = thread.forumid
WHERE forumpermission.forumid IS NULL
ORDER BY lastpost DESC LIMIT ".$showthreadnumber);

djr
28 Jan 2003, 11:07
You should also release yours as hack. Nothing against Dontom's one, but I feel a 'lil insecure when I have to include my db-details in a seperate php-file. I'd rather use a version which uses global.php.

Again, sorry for posting in the wrong thread and muchos thanks for the update query. Works like a charm!

- djr

Sketch
28 Jan 2003, 18:29
Originally posted by Areku
Excuse me, but what's a RDF file?

:rolleyes:

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%22RDF+file%22

roxics
01 Feb 2003, 20:39
Three questions.

1. How does RDF differ from RSS? I'm foggy on these XML filetypes. Or are they pretty much the same thing.

2. Is there a way to get it to just take news from one forum rather then all of them?

3. Why does this hack seem so much simpler then the vbsyndicate hack available?

Here's what I'm looking to do. I have my forums located at one URL and my main site at another. I want to get news from one forum onto the main page of my site. I figured RSS/RDF might be the best (only) way. It would also be a bonus if others could get that news on their site.

If I understand this hack correctly that is what this does right?

Dontom
01 Feb 2003, 21:06
Originally posted by roxics
Three questions.

1. How does RDF differ from RSS? I'm foggy on these XML filetypes. Or are they pretty much the same thing.
### ahem - no idea ;) very foggy here, too

2. Is there a way to get it to just take news from one forum rather then all of them?
### sure, just change the select -statement to below and change 999 to the forum you want to use

SELECT thread.title AS threadtitle, threadid, dateline, postusername, postuserid, thread.replycount, thread.lastposter, views, thread.forumid AS threadforumid, thread.lastpost AS lastpost, votenum, votetotal, forum.title AS forumname FROM thread LEFT JOIN forum ON forum.forumid = thread.forumid WHERE thread.visible = 1 AND thread.open AND forum.forumid = 999 ORDER BY LASTPOST DESC LIMIT 15


3. Why does this hack seem so much simpler then the vbsyndicate hack available?

### vbsyndicate generates afaik a javascript output, which is written periodically to you server

Here's what I'm looking to do. I have my forums located at one URL and my main site at another. I want to get news from one forum onto the main page of my site. I figured RSS/RDF might be the best (only) way. It would also be a bonus if others could get that news on their site.

### this hack should do this perfectly

If I understand this hack correctly that is what this does right?

roxics
02 Feb 2003, 00:31
Ok the feed works. My only problem is that if you look at the feed on another site it shows up. But when you click on the headline it takes you to a 404 error on my site.

Here is the feed on another site (ve news up top) (http://www.alienprophecy.com/postnuke/)

Here is my board (http://ve.roxics.com/board)

The forum it's drawing from is called Announcements & Classifieds

roxics
02 Feb 2003, 00:36
Also it's only showing 5 headlines. Shouldn't it be showing 15?

Dontom
02 Feb 2003, 05:56
like above:
As '&' in URLs is not allowed in RDF put this rewrite rule into .htaccess in the directory you put this script.

RewriteEngine on
RewriteRule ^tl([0-9]+)\.html$ showthread.php?s=&goto=lastpost&threadid=$1[L]

roxics
02 Feb 2003, 17:02
Excellent. Great addition! Thank you. :D

But I do have a few more questions.

1. Is there any way to send the entire first post instead of just the post title? That way you can have the entire first post on another site and just have the title link it back to the original thread? Or does rdf not do that?

2. How do you get it to go to the first post rather then the last?

3. Any possiblity of doing multiple rdf streams. One for each forum selected. Maybe /rdf1.php, /rdf2.php, and so on?

Dontom
05 Feb 2003, 06:45
Originally posted by roxics
Excellent. Great addition! Thank you. :D

But I do have a few more questions.

1. Is there any way to send the entire first post instead of just the post title? That way you can have the entire first post on another site and just have the title link it back to the original thread? Or does rdf not do that?

## i guess this would wor too, but all vb-stuff wouldnt work without more work (Links, images etc)

2. How do you get it to go to the first post rather then the last?
##change the part you have in you .htaccess and leave out the &goto=lastpost

3. Any possiblity of doing multiple rdf streams. One for each forum selected. Maybe /rdf1.php, /rdf2.php, and so on?
sure - upload multiple instances of rdf and just change the queried forumid. or assign the forumid with a variable in the url (e.g. rdf.php?forumid=1)

roxics
18 May 2003, 17:38
As far as number 1 goes. Is that possible to get done? Having the entire post sent with a link back to the post on the forum itself?

I know Livejournal has RSS feeds that send the entire first 25 entires out. But they only do it for their paid users.

The reason this would be so great is so that you can update the news on the front page of your site easily. It would basically allow you to turn any new forum on your board into a new weblog.

I'm interested in it personally because my board is at one URL and my site is at another. So getting news froma news forum on my site to the main page of my site and thus far been impossible.

Not only that but I host several production forums on my board itself for other people. I know they'd be thrilled to have a new option to easily update the from page news of their site from within with forum.

It doesn't matter if any of the smilies show up or anything. Just so long as all the test and the proper formatting show up.

I know it's been a while but just wondered if this was possible and it your were willing to add a little more to the code for this?

thanks

Thomas P
07 Jan 2004, 19:51
vBackend.php (for vBulletin)

I got an error :


Die XML-Seite kann nicht angezeigt werden
Die XML-Eingabe kann nicht angezeigt werden, wenn Stylesheet XSL verwendet wird. Beheben Sie den Fehler und klicken Sie dann auf Aktualisieren, oder wiederholen Sie den Vorgang später.


--------------------------------------------------------------------------------

Ein Semikolon wurde erwartet. Fehler beim Bearbeiten der Ressource 'http://www.mcseboard.de/mback.php'. Zeile 18, Position 89

<link>http://www.mcseboard.de/showthread.php?threadid=3379</link>
----------------------------------------------------------------------------------------^




What's going wrong here?

thx,
-Tom

Minots
08 Jan 2004, 19:49
@Thomas P
Hmm, momentan kann ich Dir zwar nicht genau sagen woran das liegt, aber
sag mir bitte, ob Du folgende Seite problemlos sehen kannst:
http://www.minots.de/backend2.php
Sollte dem so sein, dann werde ich die neue Version meiner backend.php
auf http://d0x.de zum Download anbieten. ;)

P.S.:
Nettes Board, was Du betreibst. :)
Wie wäre es mit einer kleinen "Vorstellung" im Forum http://www.minots.de/forumdisplay.php?forumid=10 ?

Thomas P
09 Jan 2004, 16:47
Aber gerne, wird gleich gemacht :)

Ja, oberes backend.php sehe ich ... (aber ich nutze ja vbackend.php (?))

Ja, bitte zum downloaden freigeben :)

Danke Dir!!

Minots
09 Jan 2004, 18:50
OK, habe es der Kategorie "Sonstiges" hinzugefügt. :)
http://www.d0x.de/downloads.php?cat=11

Minots
11 Jan 2004, 13:37
Aber gerne, wird gleich gemacht :)

Ja, oberes backend.php sehe ich ... (aber ich nutze ja vbackend.php (?))

Ja, bitte zum downloaden freigeben :)

Danke Dir!!

@Thomas P
Funktioniert es jetzt bei Dir?

Thomas P
15 Jan 2004, 18:11
Leider nein :(

Schicke Dir eine pm.