Support » Fixing WordPress » Protected Category

  • LS,
    I want to run a “protected category” on my blog, which I will use on a seperate page (not index.php) and which should only be displayed to registered (and logged-in) users.
    Idea behind it is that I could use it as a (personal) diary for my friends (that are registered and logged-in) without displaying it to everyone on the www.
    Easy enough I thought, should be possible combining excisting code…
    1. I made a page “pindex.pxp”, included $cat=X before the includes (and $cat=-X in the original index.php). So far so good, the posts from cat X only display on pindex.php, and not on index.php
    1b. Did the same for b2rdf, b2rss and b2rss2 to prevent the posts from showing up in my XML feeds, works like a charm 😉
    2. I included the “if ($user_level < x)” tag before the “start_b2()” tag. The page now dies when not logged in (or proper level), so that’s great. Problem is, everyone is not logged in or proper level. Including me…
    3. As I guessed the page wasn’t reading the session properly or something I required the b2header.php file in the pindex.php. Now the page just crashed on load while displaying:
    Fatal error: Failed opening required ‘../wp-config.php’ (include_path=’/usr/lib/php4/:/usr/share/pear/:.’) in /home/customers/xxx/wp-admin/b2header.php on line 3
    I tried adaping the links to wp-config.php, but everytime I corrected one, anotherone displayed a simulair error, of course always referring to a different file.
    4. I read through this forums looking for some explanation on how this “if ($user_level < x)” tag works, and how or where to implement it if someone wants. No luck. Loads of nice tips on how to only allow registerd user to comment etc, but those hacks looked a bit extensive. Still believe it should be possible combining existing code, and quite easily as well. Just don’t see how right now as I don’t know how the present user-level verification system works…
    5. Could someone help me with this?
    (would be a nice add-on for the docs as well in my opinion)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Would this solution be useful is more than one category is to remain hidden or for registered users only?

    Excuse my ignorance on the finer workings of the code, but is it possible to include that protected category on the main page’s list of category for registered users only? I really really want a better protected system for my blog, but I don’t really want to have a seperate page for it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Protected Category’ is closed to new replies.