Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
767 views
in Q2A Core by
retagged by
Hi, I want to show a welcome message for new users in top of side panel for one day. Is it possible?

1 Answer

+2 votes
by
You can use this code to find out if a person is new:

global $qa_login_userid, $qa_db;

if (isset($qa_login_userid)) {
    $user=qa_db_single_select($qa_db, qa_db_user_account_selectspec($qa_login_userid, true));

    if ((time()-$user['created'])<86400)
        // SHOW SPECIAL MESSAGE
}

You can use an advanced HTML theme to put that wherever is appropriate, perhaps as a prefix to the sidebar.
by
Thanks Gidgreen, I will try this and let you know!
by
Hi Gidgreen, I tried your option. It is checking current login users logid created date and displaying message. But my requirement is to display a welcome note to new users, means note will be displayed with user name and link to their page, like that. Could you please help me on this?
by
Where I wrote above 'SHOW SPECIAL MESSAGE', you can output anything you want. Use $handle=qa_get_logged_in_handle($db); to get the handle of the currently logged in user, and then qa_get_one_user_html($handle, false); to get some HTML for the user, which links to their page. See qa-app-users.php for more functions you might find useful.
by
Where do I need to paste this code?
...