Closed (fixed)
Project:
userposts
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
20 Mar 2005 at 01:11 UTC
Updated:
5 Jun 2005 at 20:58 UTC
In order to prevent userposts from showing unpublished posts, change line 29 in userposts.module (4.50)
//It looks like this:
$listres = db_query('SELECT n.nid, n.title, n.type FROM {node} n WHERE n.uid=%d AND n.type = \'%s\' ORDER BY n.changed DESC LIMIT %d',$user->uid, $type, variable_get('profile_list_amount', 10));
//Change it to this:
$listres = db_query('SELECT n.nid, n.title, n.status, n.type FROM {node} n WHERE n.uid=%d AND n.type = \'%s\' AND n.status = 1 ORDER BY n.changed DESC LIMIT %d',$user->uid, $type, variable_get('profile_list_amount', 10));
I'm not sure how well this works with other node modules, so perhaps chaning it to n.status != 0 would work. In my installation, theres only 0's and 1's in the status columns, so it doesnt matter.
Comments
Comment #1
Bèr Kessels commentedFixed in CVS. Thank you for the report!
Comment #2
(not verified) commented