Community Page
- fortes.com/ Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- Salut, I would like to know if you have a solution to remove also "tag/" and "page/" from permalinks. Merci !
- Hi Firstly, thanks for the plugin. It (generally) works fine. Just a small issue that I have found. I run this plugin, as well as the flickr plugin (http://tantannoodles.com/toolkit/photo-album/),...
- Hello! I had the same problem like Leo and many others. Just use /%category%/%page%/%postname%/
- I have solved the sub categories problem just enter /%category%/%category%/%postname%/ on the permalinks and it works fine
- I am also getting the above problem, but only on sub categories? Is this something to do with my wordpress setup?
Jump to original thread »
Comments are closed for this post.
Version 0.2 of the plugin has been released. This release makes the plugin compatible with WordPress 1.5.1. There are no new features in this release.
Download
Post Levels Plugin v0.2.1
Update 5/22: Sigh, as mentioned in the comments, single-post view is broken. This is due to an issu ... Continue reading »
Download
Post Levels Plugin v0.2.1
Update 5/22: Sigh, as mentioned in the comments, single-post view is broken. This is due to an issu ... Continue reading »
4 years ago
so, it's only natural to think that empty() will work. however, in php, if $var is equal to 0 (zero), empty($var) will return true.
i propose you change
// Don't bother unless someone is logged in
if (!empty($user_level))
to
// Don't bother unless someone is logged in
if (isset($user_level))
and change is_post_level() function accordingly.
anyway, just thought i'd bring this to your attention. thanks for a quick 1.5.1 fix :)
~crash
4 years ago
I'll change this to an option in the next version.
4 years ago
4 years ago
Make sure you're logged out of the site before you view the RSS feed, as you'll see the private posts if you're logged in (it's all browser-cookie based)
4 years ago
This is my site. http://sims2.tatatee.com/main/
I can set up a test user for you if you need.
4 years ago
4 years ago
I entered post_levels in the password box and not the custom field box. My bad.
Thanks!
4 years ago
4 years ago
4 years ago
You will either have to downgrade to 1.5, or live without the post levels plugin until 1.5.1.1 :(
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
I just opened my site up today again to search engines and almost immediately msnbot has been all over it. I just took a look at my users online page and it showed msn bot at being on the page of one of my level 2 posts.
So basically, I'm thinking - how did the bot get there in the first place if the post isn't viewable to users who aren't logged in? And did it actually see/index anything?
Thanks, valerie (spoken-for.org)
4 years ago
I was always looking for a plugin like this. With WP 1.2 I tried out Viewlevel but wasn't very exhalted with the features it provided. This was also because of the poor WP API.
Now a new major release is out and I saw your new plugin doing much the same as the old abandoned Viewlevel. This day I installed it on my test blog and ran into the same problem as all others did with WP 1.5.1. Anyway I wanted this to work as it was supposed to and so I built a solution where it isn't necessary to touch any WP original code. The good thing to say about it: It works. The bad: I am not sure whether I used variables in this fix I shouldn't have.
So here it is. All code has to be added to your post-levels.php file.
1.) Find the line "add_filter('posts_where', 'postlevel_posts_where');". Insert a new line after it with "add_filter('the_posts', 'postlevel_posts');"
2.) Before the "?>" insert the following code:
function postlevel_posts($where)
{
if (count($where) == 0)
{
//
// this is a workaround for WP 1.5.1 until it is somehow fixed
global $wpdb, $user_ID, $postlevel_key, $user_level;
$posts = $wpdb->get_results($request);
if (count($posts) == 1) {
if ('publish' != $posts[0]->post_status) {
if ( ! (isset($user_ID) && ('' != intval($user_ID))) ) {
// User must be logged in to view unpublished posts.
$posts = array();
} else {
if ('draft' == $posts[0]->post_status) {
// User must have edit permissions on the draft to preview.
if (! user_can_edit_post($user_ID, $posts[0]->ID)) {
$posts = array();
}
} elseif ('private' == $posts[0]->post_status) {
// here lies the problem in the main code, so we changed this here
if (($posts[0]->post_author != $user_ID)
&& !($postlevel_key == $posts[0]->meta_key
&& intval($user_level) >= intval($posts[0]->meta_value))) {
$posts = array();
}
}
}
}
}
//
return $posts;
}
return $where;
}
That's all. Warning: This comes with no warranty. As soon as there is an "official" API, this should be removed because of possible security holes. Anyway: Enjoy!
McShelby (normally just Shelby)
4 years ago
4 years ago
4 years ago
the only problem i found was if i logged-out and manually tried to access a PL-ed post, i got a dirty 404, instead of a nice WP redirect.
4 years ago
since it requires you make a post private wouldn't that keep it out of the viewing pages ?
when you mean a certain userlevel can see it do you mean in the admin only or in the actual blog pages
i'm using WP 1.5.1 and haven't been able to make much use of post_levels
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
Besides that if not flagged "private" your new "published" post wil be announced at the update service (by default http://rpc.pingomatic.com/).
Nevertheless a user can edit another post even if it's flagged private and post_levels plugin is active if his' userlevel is higher than that of the writer. Maybe you can tweak the levels of your users by providing an "edit user" with level 9 and all other user not higher than 8? Just a thought.
3 years ago
3 years ago
---------------------------
--- post-levels.php.txt 2005-05-15 00:43:41.000000000 +0300
+++ post-levels.php 2005-07-28 10:43:05.205061888 +0300
@@ -32,9 +32,8 @@
if (function_exists('add_filter'))
{
global $user_level; get_currentuserinfo();
-
// Don't bother unless someone is logged in
- if (!empty($user_level))
+ if (isset($user_level))
{
add_filter('posts_join', 'postlevel_posts_join');
add_filter('posts_where', 'postlevel_posts_where');
@@ -50,21 +49,21 @@
}
// Whether the current posts is of the given level
- function is_post_level($level = 0)
+ function is_post_level($level = -1)
{
global $postlevel_key;
$val = get_post_custom_values($postlevel_key);
if (!empty($val))
return ($val == $level);
else
- return ($level == 0);
+ return ($level == -1);
}
}
else
{
// Not logged in, use define fast functions that don't use the DB
function is_private() { return false; }
- function is_post_level($level = 0) { return ($level == 0); }
+ function is_post_level($level = -1) { return ($level == -1); }
}
}
}
3 years ago
I want to let folks know about a strange behavior I have encountered with Soren's (and perhaps the original) Post-Levels plugin. The plug-in works great in Internet Explorer (PC & Mac), but for me, Does not work in Firefox (PC & Mac) or Safari (Mac). Am I the only one with this problem?
Thanks again to Filipe, Soren, and any other contributors for this great plug-in.