Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
611 views
in Q2A Core by
How do I get the id or name of the user who asked the question with PHP
by
+1
In what context?
 * A layer?
 * A module? Which module?
 * Somewhere else?
by
in  qa-theme-layer.php
by

1 Answer

+2 votes
by
selected by
 
Best answer

From a layer (or theme) you can get it in this way:

if ($this->template === 'question' && isset($this->content['q_view']['raw']['userid'])) {
    $userId = $this->content['q_view']['raw']['userid'];
    echo $userId;
}

BTW, I understand you are displaying a question, that's why you said "who asked THE question?"

by
Yes, that's what I wanted,
I want to show ads in some editors' questions
Thank you
...