Welcome, Guest. Please Login or Register.
April 30, 2024, 06:05:47 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.4.1]Generate RSS feeds from YabbSE « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: [Beta 1.4.1]Generate RSS feeds from YabbSE  (Read 4957 times)
PCorral
Noobie
*
Posts: 17


Get Real!

[Beta 1.4.1]Generate RSS feeds from YabbSE
« on: October 20, 2002, 04:32:13 AM »
Reply with quote

Hi...

I've coded this script to generate RSS feeds from YabbSE boards.

Why? Because i need to moderate a big forum, and its better for me get the news using FeedReader (http://www.feedreader.com) than navigate the forum.

It's very interesting.

I would like to share it because i sure that someone is going to improve it, or maybe add this feature to Yabb.

RSS Feeds are going to be a very important feature from any content management system soon.

See you,
Pablo.


Here is the code. Feel free to ask me anything.
//---------------- cut here and save to createYabbFeeds.php ----------------------

<?php
/* last edit by pcorral 20/10/2002 */
/*****************************************************************************/
/* CreateYabbFeeds.php                                                       */
/*****************************************************************************/
/* Open-Source Project started by Pablo Corral ([email protected])     */
/* Software Version: 0.1                                        */
/* ========================================================================= */
/* Support, News, Updates at:  [email protected]                       */
/* ========================================================================= */
/* Copyright (c) 2002                                           */
/*****************************************************************************/
/* 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.                                          */
/*                                                                           */
/*****************************************************************************/

/* #### How yo use it? #### */

/* Just http://www.yourhost.com/pathtoscript/createYabbFeeds.php?board=<any board id> */

/* ### Configure ### */

$db_host="localhost";
$db_name="your_db_name";
$db_username="your_db_username";
$db_password="your_db_password";

$yabbse_prefix="yabbse";               // this is the Prefix of your table's names on MySql
$site_prefix="PeL - ";                  // this prefix is used to create the Feed Name based on your boards
$cantidad=10;                        // how many messages do you want to get. (Default = 10)

$URL="http://www.yourhost.com/";   // URL to index.php from your YabbSeForum (don't include /index.php)
$descripcion="feed generated by createYabbFeeds.php";


/* ### End Configure ### */


// If not Board is passed as parameter, then sets to default.
if (!isset($board)) { $board=1; } 


$tabla_mensajes=$yabbse_prefix "_messages";
$tabla_topics=$yabbse_prefix "_topics";
$tabla_boards=$yabbse_prefix "_boards";

// open connection to database
$connection mysql_connect($db_host$db_username$db_password) or die ("Imposible conectarse con la base de datos. Contactese con el administrador de BlogRating");

// select database
mysql_select_db($db_name) or die ("Unable to select database!");

//obtenemos el titulo
$query "SELECT name from $tabla_boards where id_board=$board";
$result mysql_query($query) or die ("Error in query: $query. " mysql_error());
$row mysql_fetch_row($result);
$titulo htmlspecialchars($site_prefix $row[0]);


$header="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>

<!-- RSS generation done by Pablo Corral Scripting -->
<rss version=\"0.91\">
\t<channel>
\t\t<title>$titulo</title>
\t\t<link>$URL</link>
\t\t<description>$descripcion</description>
\t\t<lastBuildDate>Tuesday, October 08, 2002 6:37:46 PM</lastBuildDate>
\t\t<language>en-us</language>";

$footer="
\t</channel>
</rss>
";

// execute query
$query = "SELECT a.subject,
          a.body,
        a.posterName,
        a.posterTime,
        b.id_board,
        a.id_msg,
        FROM_UNIXTIME(a.posterTime) as fecha,
        a.id_topic,
        DATE_FORMAT(FROM_UNIXTIME(a.posterTime),\"%Y-%m-%dT%h:%i-03:00\")  
          FROM $tabla_mensajes a,$tabla_topics b
        where a.id_topic=b.id_topic and b.id_board=$board
        order by fecha desc
        limit $cantidad";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

// iterate through rows and print column data
// in the form TITLE - AUTHOR
echo $header;

// string to add reply link

while ($row = mysql_fetch_row($result))
{

      $titulo = htmlspecialchars($row[0]);
      $desc   = htmlspecialchars($row[1]);
      $autor  = htmlspecialchars($row[2]);
      $fecha_formato  = htmlspecialchars($row[8]);
         
       echo "
      <item>
      ";
      echo "\t<title>$titulo - [$autor]</title>
      ";
        echo "\t<link>$URL/index.php?board=$board;action=display;threadid=$row[7]</link>
      ";
      echo "\t<description>$desc</description>
      ";
        echo "\t<dc:date>$fecha_formato</dc:date>
      ";
      echo "</item>      ";
}

echo $footer;

// close database connection
mysql_close($connection);

?>

//----- end of file ------
« Last Edit: October 20, 2002, 07:44:51 PM by Nemesis » Logged
Mach8
Sweetie
Beta Tester
YaBB God
*****
Posts: 1218


ICQ - 339855961
Re:Generate RSS feeds from YabbSE
« Reply #1 on: October 20, 2002, 05:51:51 PM »
Reply with quote

If this works, then wow :)

 Have you tested it yet?
Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:Generate RSS feeds from YabbSE
« Reply #2 on: October 20, 2002, 07:25:24 PM »
Reply with quote

I tried it but am having trouble, I think it is because it is being copied from the message body.  PCorral, send me a copy via e-mail and I will attach it in this thread for you, or just upload it somewhere for us please.
Logged

Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:[Beta 1.4.1]Generate RSS feeds from YabbSE
« Reply #3 on: October 20, 2002, 07:45:33 PM »
Reply with quote

I changed his message see if it works for you now...
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
pege
Full Member
***
Posts: 146


Re:[Beta 1.4.1]Generate RSS feeds from YabbSE
« Reply #4 on: October 20, 2002, 07:47:08 PM »
Reply with quote

Quote from: PCorral on October 20, 2002, 04:32:13 AMHi...

I've coded this script to generate RSS feeds from YabbSE boards.
......

Ok, so now I've installed it.  How do I use it?  How do I add feeds to it?  How do I make it do something when I click the board I installed it to?  Is this supposed to display feeds within boards?  

Thanks

Thanks
Logged
PCorral
Noobie
*
Posts: 17


Get Real!

Re:[Beta 1.4.1]Generate RSS feeds from YabbSE
« Reply #5 on: October 21, 2002, 01:33:43 PM »
Reply with quote

OK. I cannot upload the file right now, but i will do it asap.

How to Use It?
The scripts querys the database and generate a valid RSS 0.91 feed on demand. So, every time you call the script, you will get the latest 10 messages from a specified board.

1) So, open FeedReeder.

2) Click New Feed.

3) Enter :
http://www.yourhost.com/pathtoscript/createYabbFeeds.php?board=4

4) And that's all.

FeedReader wiill call the script every 15 minutes to ge the latest messages from the board 4.

WARNING: You can check the lastest messages from any board, without checking the permission of your yabb member.
Logged
perrera
Jr. Member
**
Posts: 51


I love YaBB SE!

Re:[Beta 1.4.1]Generate RSS feeds from YabbSE
« Reply #6 on: October 21, 2002, 06:09:10 PM »
Reply with quote

Wow, amazing mod...  ;D

Is there are anyway to generate a RSS of the lastest topics posted?
« Last Edit: October 21, 2002, 07:59:49 PM by perrera » Logged
pege
Full Member
***
Posts: 146


Re:[Beta 1.4.1]Generate RSS feeds from YabbSE
« Reply #7 on: October 21, 2002, 08:20:41 PM »
Reply with quote

Quote from: PCorral on October 21, 2002, 01:33:43 PM...1) So, open FeedReeder.

2) Click New Feed.

3) Enter :
http://www.yourhost.com/pathtoscript/createYabbFeeds.php?board=4

4) And that's all.

FeedReader wiill call the script every 15 minutes to ge the latest messages from the board 4.

ok, kewl.  thanks.

Logged
TheJkWhoSaysNi
YaBB God
*****
Posts: 1025


I dont know what to put here, i'll leave it blank.

ICQ - 122821095TheJkWhoSaysNi@evilemail.com WWW
Re:[Beta 1.4.1]Generate RSS feeds from YabbSE
« Reply #8 on: November 21, 2002, 08:59:23 PM »
Reply with quote

I cant get this to work correctly..
Logged

WARNING: THIS POST MAY CONTAIN TRACES OF PEANUT!!!
I'm listening to....
Cerberus
Full Member
***
Posts: 100


Who's a llama?!

WWW
Re:[Beta 1.4.1]Generate Rss feeds from YabbSE
« Reply #9 on: May 21, 2003, 02:06:39 PM »
Reply with quote

Anybody managed to get it working with 1.5.1?
Logged

Best Regards, Cerberus
Check out http://www.pocketpcrussia.com :)
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:[Beta 1.4.1]Generate Rss feeds from YabbSE
« Reply #10 on: May 21, 2003, 09:37:17 PM »
Reply with quote

Quote from: Cerberus on May 21, 2003, 02:06:39 PM
Anybody managed to get it working with 1.5.1?
i think a built in RSS will be included in 1.6.0
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
pixellated
Noobie
*
Posts: 10


Yoicks! and Away!

Re:[Beta 1.4.1]Generate Rss feeds from YabbSE
« Reply #11 on: May 21, 2003, 09:53:38 PM »
Reply with quote

Quote from: Cerberus on May 21, 2003, 02:06:39 PM
Anybody managed to get it working with 1.5.1?

Yes, I did just now. Nothing to it - just make sure your variables are set correctly for your particular install.
Logged
Gus
Jr. Member
**
Posts: 56


www.armymedic.info

WWW
Re:[Beta 1.4.1]Generate Rss feeds from YabbSE
« Reply #12 on: May 22, 2003, 10:43:26 AM »
Reply with quote

Quote from: PCorral on October 21, 2002, 01:33:43 PMHow to Use It?

1) So, open FeedReeder.

2) Click New Feed.

3) Enter :
http://www.yourhost.com/pathtoscript/createYabbFeeds.php?board=4

4) And that's all.


Think I must be missing something here..

Where do I find the "FeedReader"?
I appear to have jumped to point 3)
The script reported that all was well but I see no news feed on my site :/

Any clue as to what I`m doing wrong please?


I was just being lame  :-\

Sussed it now  ;D
« Last Edit: May 23, 2003, 01:57:30 AM by Gus » Logged

bigdon24
Noobie
*
Posts: 16


What?

WWW
Re:[Beta 1.4.1]Generate Rss feeds from YabbSE
« Reply #13 on: May 23, 2003, 02:14:15 PM »
Reply with quote

Okay, so it's working now ...

But now what? Nothing ever shows up in the FeedReader window. If I run the command from my browser, I can see it doing something, but nothing ever happens in FeedReader.

Am I just not getting it, or having one of those weeks?
« Last Edit: May 24, 2003, 07:57:23 PM by bigdon24 » Logged
Thomas
Full Member
***
Posts: 203


WWW
Re:[Beta 1.4.1]Generate Rss feeds from YabbSE
« Reply #14 on: July 30, 2003, 11:43:47 PM »
Reply with quote

Quote from: Spaceman-Spiff on May 21, 2003, 09:37:17 PM
Quote from: Cerberus on May 21, 2003, 02:06:39 PM
Anybody managed to get it working with 1.5.1?
i think a built in RSS will be included in 1.6.0
Are you sure Spaceman-Spiff? If so I'll wait until 1.6

/Thomas
Logged
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.4.1]Generate RSS feeds from YabbSE « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.040 seconds with 20 queries.