Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.5k views
in Q2A Core by

Hi, 

i just try this open source on my computer. i'm novice. I would like to hide the user/nickname for all user. If someone can help me, i will appreciate. Thank you 

Version 1.6.2

1 Answer

+2 votes
by
edited by

Place below code into your theme file. Below code will hide from everywhere

function post_meta_who($post, $class){}

If you want to display on question (view) page than use below code

function post_meta_who($post, $class)
{
    if($this->template == 'question')
        qa_html_theme_base::post_meta_who($post, $class);
}

I have posted code on Gist here https://gist.github.com/q2amarket/8356498

<<<------- Version 1.01 ------->>>

I have modified code as per your need. Now the meta who will be visible on the moderation section to Moderator and higher level users and question view page. It will be hidden rest of the areas.

Get code from Gist: https://gist.github.com/q2amarket/8405467 ( you will find detailed description there)

Or just copy and paste below


	

function post_meta_who($post, $class)
{ 
    $type = $post['raw']['type'];
    $level  = qa_get_logged_in_level();
    $type_array = array('Q_QUEUED', 'A_QUEUED', 'C_QUEUED');
 
    if($this->template == 'question' || (in_array($type, $type_array) && $level >= QA_USER_LEVEL_MODERATOR))
        qa_html_theme_base::post_meta_who($post, $class);
}

 

by
Many Thanks, this is what i need.
by
Glad to know...just select the answer so other can consider for the same.
by
Thank's Jatin.Soni.

I have just one more question please ?

If i want to hide the user/nickname on front page and all pages, this code work perfect. i can not see anymore the user/nickname.

now i get another little problem,
 
if someone ask a question, is also hide. So it's possible to show the user/nickname only when the people ask a question because a add a option in administration to moderate a question, than we i need to approve, i don't know who ask a question.

Thank
by
I believe that is possible. Let me see what I can do.
by
Find my updated answer with Version 1.01
by
Thank you so much for you help Jatin, work well with the version 1.6.2
by
Glad to help you. :)
by
edited by
Hi Jatin,

I find a small error on the Pixel_n_Grain_Dark_V_D1.1Theme on the line 31 when i add a message in the wall. I think because the user/nickname is hide.


Notice: Undefined index: type in /home/x-xxxxxxxxx/public_html/qa-theme/claude/qa-theme.php on line 31

This is a line 31 :     $type = $post['raw']['type'];
by
Thanks for reporting issue .... Let me see...
by
Hi jatin,

i find another issue:

without register or login, you can see all information from the user.

EX: http://www.example.com/?qa=user/"name for user"

than you get an access.

I don't know really if it's an issue, but i would like just protect the user information if you are not register. I think is a good idea.

Thank you
by
That is different than this hack/issue
...