Bloglines mod - Posted (4821 Views)
Retired Support Moderator
MarcelG
Posts: 2625
2625
I'm trying to design a mod that enables a 'bloglines' like facility for registered members. The idea that I'm having is this:
- Create a new table in the db, called FORUM_FEEDS, where the ID, URL and NAME of the RSS feeds are stored. For instance:
Code:
FEED_ID, FEED_URL, FEED_NAME
1 , http://forum.snitz.com/rssfeed.asp , Snitz Forums 2000
2 , http://news.bbc.co.uk/rss/newsonline_world_edition/front_page/rss091.xml , BBC World News
Etc etc. Let's assume that this list is filled with 40+ feeds. Now, I want to enable each member to select a maximum of 10 feeds from that central list, in a page called 'my_feeds_edit.asp'. At first I thought I'd take the Avatar mod as the base for this mod, but I see that the Avatar mod stores the actual avatar_url in the members table, instead of the reference to the avatar_id. Using that route would mean that I'd have to add at least 10 columns to the members table, but that's not what I want to do. Instead, I want to add only 1 field, called MEMBERS.M_FEEDS, where I want to store the FEED_ID's, in this format :
Code:
1,4,5,8,21,34,28,12,14,17

Then, finally, I create a page called my_feeds.asp, where one sees the RSS Feeds displayed in the forum layout. I already have a piece of code to display the feeds.
I think I need to pull the feeds via this query ;
Code:
strSqL = "SELECT M_FEEDS " 
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , " & strTablePrefix & "FEEDS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'"
Now I've got the 'array', let's call it myFeeds
The second query pulls the URL's from the FEEDS table.
Code:
strSql = "SELECT FEED_URL, FEED_NAME "
strSql = strSql & "FROM " & strTablePrefix & "FEEDS "
strSql = strSql & "WHERE " & strTablePrefix & "FEEDS.FEED_ID IN (" & myFeeds & ") "

Perhaps, these two queries above can be put together in one query.. question
After this, I can loop through the feeds, and display them one by one.
So, the general idea is there, but perhaps someone has some other ideas about this, or is willing to work together on this mod. cool<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Support Moderator
Shaggy
Posts: 6780
6780
I'd recommend creating a new table with two fields, one for MEMBER_ID and on for FEED_ID, á la the MODERATOR table and then use a join to select the FEED_IDs from the new table and the details from the FEEDS table.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
mmm...sounds plausible. No interference with the memberstable, no upgrade of the pending members table. Gonna have a look at how the moderator-thingy works.<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Ay, all you'd need would be the MemberID variable.
I'd give you an example of an SQL query but, unfortunately, I don't get on to well with JOINs!
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
I just whirled up this ; (it's all on paper ; nothing live yet)
The DBS:
Code:
Members RSS Feeds Mod for 3.4
[CREATE] FEEDS
FEED_ID
FEED_URL#varchar (255)#NULL#
FEED_NAME#varchar (50)#NULL#
[END] [CREATE] M_FEEDS
MFEED_ID
MEMBER_ID
[END] [INSERT] CONFIG_NEW
(C_VARIABLE,C_VALUE)#('intEnableMFeeds','1')
[END]
The query for getting the FEED_ID's from the table.
Code:
'getting the feeds from the db
strSql = "SELECT FEED_URL, FEED_ID, MEMBER_ID, " & _
" FROM " & strTablePrefix & "MFEEDS" & _
" , " & strMemberTablePrefix & "FEEDS " & _
" WHERE FEED_ID = MFEED_ID AND " & _
" MEMBER_ID = " & getMemberID(strDBNTUserName) & "" & _
" ORDER BY MFEED_ID"
<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
D'oh! Of course; no need for a JOIN, don't know what I was thinking when I sugessted that, but it made perfect sense at the time! tongue Looks good, man smile Only thing I'd suggest (and maybe I'm off here) is switching the prefixes, giving the MFEEDS table the MEMBERS_ prefix and the FEEDS table a prefix of FORUM_

<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
Okay! Switching prefixes! Man, this will be my first mod that will be done totally in theory before using the T&E method wink<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
You might want to check the documentation for dbs files as well, if you want a new table to take the MEMBERS_ prefix, it needs to, I think, contain the word MEMBERS in its name. Can't remember exactly what the criteria is, though.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
Well, I've just checked my DB, and I see that all tables have FORUM_ as prefix...also the MEMBERS table...(FORUM_MEMBERS) ... question<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Sorry for the confusion, meant for you to switch so MFEEDS uses strMemberTablePrefix and FEEDS uses strTablePrefix which are configurable in config.asp. I always forget that little point, whenever I do use prefixes I always use MEMBERS_ for member tables, you're obviously using FORUM_ for both. Still, if you're releasing this as a mod, no harm in making the change.
<edit> Actually, thinking through the logic a bit more, perhaps they should both use strMemberTablePrefix that way, those who do run multiple forums using the same members tables can also share the feeds across forums. </edit>

<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Retired Support Moderator
MarcelG
Posts: 2625
2625
Ah, now I see. Changing it. So, the DBS would be something like this:
Code:
Members RSS Feeds Mod for 3.4
[CREATE] MEMBERS_FEEDS
MEMBERS_FEEDS.FEED_ID
MEMBERS_FEEDS.FEED_URL#varchar(255)#NULL#
MEMBERS_FEEDS.FEED_NAME#varchar(50)#NULL#
[END] [CREATE] MEMBERS_MFEEDS
MEMBERS_MFEEDS.MFEED_ID#int#NULL#0
MEMBERS_MFEEDS.MEMBER_ID##NULL#0
[END]
No need for an ID field in the MFEEDS table.
I've also created a Feed Admin page, based on the Smile Manager Plus Admin page (yep...still a Copy/Paste programmer wink)
So, we've got the DBS file, we've got the query to get the smilies from the table, we've got the admin page for managing the feeds. What else do we need... Let me think.
  • The page where the user selects the feeds
  • The page that renders the selected feeds for that user
  • That's about it ... I guess....<
    You Must enter a message