Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.1k views
in Q2A Core by
For example how to do that tag cloud widget can see only registered members ?

1 Answer

+1 vote
by
if you mean the widget is for logged in user only, you can use the code below.

function output_widget($region, $place, $themeobject, $template, $request, $qa_content){
            if (qa_get_logged_in_handle() == null){
                return;
            }

...
asked Jul 23, 2011 in Q2A Core by Widget for guests only
by
edited by
With this code, widget displays only for guests, how about only users ?
by
Enyone, please ?
by
@Another one, which do you want? The code above should display only for users. But you also asked a Q about displaying for guests only. If you want that you should be able to change == to != in the code above.
by
Thanks, now everything is ok. Tenkana's answers code shows only for guests.
by
`qa_get_logged_in_handle() == null` is true when the user is a guest. But the if clause returns, so the code is saying "if this user is not logged in, return out of the function, otherwise display the things". You should put your output stuff below the if clause, not inside it.
...