I'm trying to implement the following functionality:
When the users import their feeds, I want to modify (if the feed has been already imported) the node containing a feed by registering who has submitted the feed.
So an example:
Suppose user A submits the feed F, the user B submits the feed F, what I need to have is a list associated with the node representing the feed F containing users A and B.
This is the code that I started to write, using a field called field_users. this code is located in the import process, inside the if clause of a feed already imported in the site.
$result = db_query("SELECT nid FROM {feedapi} WHERE url = '%s'", $feed['XMLURL']);
$feed = db_fetch_object($result);
$node = node_load($feed->nid);
array_push($node->field_users, array('uid' => $user-uid));
node_save($node);
$count_already_imported++;
Now my question:
Are you planning to implement this functionality?
Can you imagine a better way to implement this?
Can be any performance problem in doing this?
Thanks a lot for your time.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | usersFeeds.txt | 2.04 KB | cacciaresi |
Comments
Comment #1
aron novakFeedAPI won't contain such a specific feature, but I'm glad that you're planning with FeedAPI :)
What I recommend to you:
create a separate module which does the following:
- implement hook_nodeapi(), use $op = 'submit' clause of switch structure. Get feed url from this: $node->feedapi_url . Get current user from global $user. And store it in whatever table you want. In this case you can store the submission-trying for users per feed.
I hope it helps you to achieve what you want.
To make sure if it's really ok: http://aggregation.novaak.net/documentation/?q=api/FeedAPI/function/_fee... . Notice node_submit() call. Of course it's not opml-import specific, normal feed creation will have an effect too.
Comment #2
cacciaresi commentedI'm working in this http://drupal.org/node/186236, is there any way to contact you online if i want to make you some questions?
I'm having problems asigning the users to the node.
I add to the "blog" contentn type a CCK field of type User Reference, but i'm not being able to asign the users to the field...
My code is the following, is a new module:
Well when i do this, after the submit, the fields contaings an errorvalue! I do not know why this is happening....
Thanks a lot for your time!
Comment #3
alex_b commentedCan be addressed in a separate module. See #1.
Comment #4
alex_b commented