The MU forums have moved to WordPress.org

Reading Cookies, Login/Site Admin Header Link (5 posts)

  1. DaveArtz
    Inactive
    Posted 17 years ago #

    I am trying to create a /wiki/ (and other custom pages, etc.) page off my wordpress blog, but share a common navigation that includes the Login/Site Admin links.

    I want to know whether or not the user is logged in/authenticated to properly show these links, and allow them to log in/ log out from these custom areas.

    What is the best way to approach this? I do not want to end up including all of wordpress's function libraries, but would like a simple way to detect which links to show.

    Is the right question to ask, "how do i figure out what the COOKIEHASH is?"

    Thanks,
    Dave

  2. andrewbillits
    Member
    Posted 17 years ago #

    um... duck, duck, goose! Donncha, you're it!

    -------

    let me see if I understand this. You want to check to see if a user is properly logged into wpmu before showing them the wiki links?

  3. DaveArtz
    Inactive
    Posted 17 years ago #

    Well, I think I got it now, unless there's a better way. I'm trying to architect my header.php so it is includable by other custom pages that I create off my wordpress blog. For example, if I created a wiki, i'd like to share the same header.php that wordpress uses. I run into issues when functions unique to wordpress are called, for example, the wp_register() and wp_loginout() functions.

    I fixed my particular issue by looking at what these functions were doing, and wrote this little script:

    $user_ID = $_COOKIE['wordpressuser_aa5965604ffdadb313959bdf53110d07'];

    if ('' == $user_ID) :
    $link = 'Login';
    else :
    $link = 'Logout';
    endif;

    echo $link;

    This is what I wanted to do, something that I could include on other pages borrowing the header.php file.

    If there's a better way, lemme know...

    *chases andrew around the duck circle*

  4. andrewbillits
    Member
    Posted 17 years ago #

    ah, I see. I posted a thread earlier this week that might help. http://mu.wordpress.org/forums/topic/235

  5. andrewbillits
    Member
    Posted 17 years ago #

    so basically take a look at the code inside of wp-newblog.php and you'll see how to call everything.

About this Topic

  • Started 17 years ago by DaveArtz
  • Latest reply from andrewbillits