Upgrade for D6
matt_paz - December 3, 2007 - 18:22
| Project: | Usernode |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
I tried to sift through older feature requests and it didn't look like this would be a duplicate.
Any chance of pursuing an upgrade for D6?

#1
Title should have said D6
#2
Absolutely. Here's the start (.info and .install).
#3
Starts porting some of .module. Maybe it's just me, but I haven't been able to get drupal_execute() to to save a new node so it'll fire the usernode_insert() hook. Need a break from it, but wanted to leave my work for someone else to continue with.
#4
you'll need to include manually node.pages.inc from the node module.
#5
Subscribing. I've done a little work myself trying to get this to just work on a dev site of mine, so if I run into anything I can give back, I'll post it here.
#6
So, what's the advantage to using drupal_execute(); over a direct node_save();? The drupal_execute(); is going to be doing form validation on the node object which, if invalid, causes no node to be created and breaks the module (as implemented in D5).
I also ask because I too haven't been able to figure out how to get the drupal_execute(); to work correctly.
#7
I have made a port from scratch myself. This is how the drupal_execute part is done, it's documented in the api how to create nodes using drupal_execute.
I'll post a patch later if I have some time.
<?php
/*
* Saves a usernode by using drupal_execute.
* This allows modules like auto_nodetitle to work and makes sure all hooks are invoked properly
*/
function usernode_save_node($node) {
$form_state = array();
$form_state['values'] = $node;
$form_state['values']['op'] = t('Save');
// workaround to disable drupal message "Your usernode has been created"
$messages = drupal_get_messages();
module_load_include('inc', 'node', 'node.pages');
drupal_execute(USERNODE_CONTENT_TYPE .'_node_form', $form_state, (object)$node);
// write back the old messages
$_SESSION['messages'] = $messages;
}
?>
#8
Subscribing, Interested in D6 version. Greetings, Martijn
#9
Hi all!
I have made a full path to lastest stable usernode version which is 1.4. Patch to usernode.info and usernode.install is almost that same as above (but compatible with usernode 5.x-1.4).
It works!
Enjoy!
#10
#9 not work fine!
Create a usernode anonymous first :(
#11
subscribing
#12
subscribing
#13
subscribing
#14
any progress here with a full release. The reason I would like usernode is purely to be able to use CCK fields and only show certain fields to users with certain roles.
is there another way, I used usernode with drupal 5.
thanks
R
#15
@richard.e.morton:
Usernode really doesn't have anything to do with that - it's whole purpose in life was to provide a way to list users in Views AFAIK, which is built into Views in 6.
Check out CCK 6.x-2. It ships with the Content Permissions module which sets field-level permissions for CCK fields.
#16
if Usernode is no longer needed, then how do we implement node profile which is content profile in D6? Node profiles hung off of usernode.
#17
Just read content profile docs - you don't need usernode any more.