Wordpress viewlevel private entries problem
:: Monday, January 30th, 2006 @ 8:10:44 am
:: Tags: Computers
Hey, guys. Private entries haven’t been showing up for the majority of registered users. I think I’ve fixed it. If you have an account, you should probably get into the habit of staying logged in. My install of Wordpress doesn’t (yet) put in private entry placeholders (which means that you won’t get notifications if you’re using RSS, either), but I’ll hack the plug-in at some point.
Also, the Wordpress database upgrade does something strange to users. It maps the old viewlevels to the new user roles, but imported viewlevel 0 users (Subscribers, in the new system) don’t get a proper viewlevel if old plug-ins ask for it.
For example, the plug-in I use at the moment still checks for users by viewlevel. All of my imported “Subscriber” users were not able to see my private posts, which are set to be accessible for users with viewlevel 0 or greater. I found that if I used the admin interface to change a user to a Contributor role and then back to Subscriber role, they could suddenly see viewlevel 0 posts.
So there is definitely a state change between imported users and newly created/edited users, even though the admin tool’s front end doesn’t show any difference. Unfortunately, I can’t access the database from my location at the moment, so I can’t dig deeper.
If you don’t care about any of this and just want a solution (assuming you’re one of the 3 people out there who still have to upgrade from b2, and have hacked your own viewlevel-based privacy hack into your install…), you can just set all of your users to Contributors and then back to Subscribers.
I eagerly await the resolution to this so I can copy what you end up doing, precisely.
While you’re at it, can you figure out a way to tie user accounts to registered-user-viewable member profiles? Thanks so much…
Chester - i don’t see any easy way to view member profiles. If I had time, I would totally write a little hack or something. Have you tried posting in the Wordpress forums to see if anyone has something like that?
As for the private post thing, I’ll do it as soon as I can and will send you the plug-in. :)
Naw, didn’t query the forums about that. Did ask a question regarding avatars, which was related, but don’t know of any way to do the profiles thing. Would be nice. I think I might end up just going back to writing profiles for everyone. Just need to figure out how to “hide” all the profile Pages (which would be linked off of an unhidden index Page).
Still…user-modifiable and viewable profiles with avatars is what I’d really like.
Assuming viewlevel security applies to Wordpress pages, it should be easy to limit profile viewing to registered members.
Also, it doesn’t look like it would be hard to add code to pull out profile information from Wordpress. It just has to be done. :)
I have modified versions of the feed templates that detect for privacy, but I think it’s wrong way to go about things. It turns out that the viewlevel plugin already takes the privacy stuff into account — even in the feeds, so the proper thing to do is to modify the plugin to dump out private post placeholders instead of pretending the posts just aren’t there (when people without access try hit the feeds and content).
The reason I was able to see the rss feeds when I hit my own feeds via the browser was that I was already are logged in.
BUT — the comments rss was happily serving out comments on private posts. So at least my modified templates weren’t for nothing. ;)