WordPress.org

Ready to get started?Download WordPress

Forums

Where do we define If visitor is a user (3 posts)

  1. drmike
    Member
    Posted 8 years ago #

    Greets:

    One of my clients have asked me to install JPCache on their WordPress 2.0.2 install and I am having a bit of an issue with it and am hoping for some assistance.

    We currently use JpCache on a number of PHPNuke installs over here without any issues. One of the features is the ability to turn it off for signed in users to the site by declairing that if the visitor is signed in, not to cache the pages. You can see this feature here.

    From a look see through the WordPress code, I don't see where the flag within the cookie is set to announce where one is signed in or not. I've traced it back to the wp-include subdirectory but am not looking for the function call that determines it.

    Hopeing for some assistance.

    Thanks,
    -drmike

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    I'm not sure what you mean by 'not looking for the function call' ?

    Would this somewhere not help?

    <?php
    global $user_login, $user_nickname ;
    get_currentuserinfo();
    if ($user_login){
    --your code--
    }
    else {
    --something else--
    }
    ?>

    or have I misunderstood?

  3. drmike
    Member
    Posted 8 years ago #

    Sorry about that. How do we tell is the user is logged in? With PHPNuke, which is where we normally use JPCache, it's with having $user defined.

    For example

    I gather WordPress is using $user_login as an on/ off to determine if a visitor is logged in or not?

    This is the recommended method for JPCache when it comes to PHPNuke as those posting will only be the ones logged in and those are the ones would would be wanting to see the site real time as they would be making changes and posting comments and whatnot.

    Thanks,
    -drmike

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags