Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
410 views
in Q2A Core by
I would like to display a prominent and noticeable link to my "rules" page for new users, say, anyone under 200 points.

I've just put the HTML in the 'page_title' function in my advanced theme. Can I access the user data here, or should I do this somewhere else in the code?

1 Answer

+2 votes
by
If you don't mind an extra database query, it's probably simplest just to do it inside your advanced theme function. Something like:

global $qa_login_userid, $qa_db;

if (isset($qa_login_userid)) {
    $userpoints=qa_db_single_select($qa_db, qa_db_user_points_selectspec($qa_login_userid));

    if ($userpoints['points']<200)
        // DO YOUR THING
}
...