Author |
Topic |
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 04:51:51
|
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:
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 :
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 ;
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.
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..
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. < |
portfolio - linkshrinker - oxle - twitter |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 05:06:51
|
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.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 05:30:30
|
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.< |
portfolio - linkshrinker - oxle - twitter |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 05:36:26
|
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.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 07:46:09
|
I just whirled up this ; (it's all on paper ; nothing live yet) The DBS:
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.
'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" < |
portfolio - linkshrinker - oxle - twitter |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 07:56:37
|
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! Looks good, man 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.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 08:06:45
|
Okay! Switching prefixes! Man, this will be my first mod that will be done totally in theory before using the T&E method < |
portfolio - linkshrinker - oxle - twitter |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 08:15:22
|
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.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 08:19:38
|
Well, I've just checked my DB, and I see that all tables have FORUM_ as prefix...also the MEMBERS table...(FORUM_MEMBERS) ... < |
portfolio - linkshrinker - oxle - twitter |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 08:27:13
|
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.” |
Edited by - Shaggy on 12 July 2005 08:28:43 |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 08:33:13
|
Ah, now I see. Changing it. So, the DBS would be something like this:
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 ) 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....< |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 12 July 2005 08:39:48 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 09:09:17
|
Just checked the DBS documentation and there's no mention of how to give a table the strMemberTablePrefix prefix. Double checked admin_mod_dbsetup.asp and a table name needs to have MEMBER in it to take that prefix.
< |
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.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 09:28:03
|
Thanks. So, the above mentioned DBS is correct ? Or should I leave out the tablename in the field name ?
BTW ; things are progressing quickly at this side ; I've already created the complete displaypage, plus the function to display the feed. I'm working on the my_feeds_config.asp file now, and I've decided to go for an 'unlimited feeds per member' method, based on the method used for specifying the Allowed Members list in post.asp. (So, two columns, the first with the available feeds, and the second with the selected feeds, with an ADD/REMOVE button in the middle).< |
portfolio - linkshrinker - oxle - twitter |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 09:34:36
|
Yeah, the dbs will work as you have it. Although, I've never seen a DBS with the table names in the field names. Not sure whether it would work or not so probabl best to leave them out to be safe.
< |
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.” |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 12 July 2005 : 10:09:00
|
Okay...I'm a bit lost now. I'm working on the page where the user selects the feeds to display, but I'm a bit stuck there. I think I've got the page which enables the member to select the feeds, but I cannot figure out how post_info.asp actually updates the db. So, for reference: my_feeds_config.asp = the equivalent of post.asp my_feeds_update.asp = the equivalent of post_info.asp
Here's the total progress up until now; http://www.oxle.nl/uploaded/18/Member_feeds.zip
Feel free to have a look at the code, and feel even more free to help Oh, the code is somewhat non-standard, as it uses some oxle-css code. The final mod will be base-compatible, so no worries there.< |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 12 July 2005 10:10:58 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 12 July 2005 : 10:21:42
|
As you submit the form (i.e., using the onclick event of your submit button), you will need to select all the options in the select combo with the members selected feeds in. As you already have selectbox.js in your page you can do this using the selectAllOptions() function, passing the name of the select combo through the arguments. See line 1311 of a clean post.asp for a demo.
Then have a look at the newForumMembers, updateForumMembers, newForumModerators and updateForumModerators subs at the end of post_info.asp to see how Snitz updates the ALLOWED_MEMBERS and MODERATORS tables.
< |
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.” |
|
|
Topic |
|