Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1k views
in Themes by
If unregistered user post question or answer he is linked to an ip address pages which not looks good, my question how to disable this link..
by
Anyone can give correct solution for this

1 Answer

+2 votes
by
edited by
 
Best answer

Although Q2A allows the user of layers and themes to output HTML, for some reason, the core itself spits HTML. That means regardless of how great a plugin or theme system is, you will, sooner or later, end up parsing HTML. I'm not going to preach about MVC but I just wanted to note that.

This is how to remove the HTML that comes from the core. Make sure the doctype() function in qa-theme.php looks like this:

function doctype() {
    qa_html_theme_base::doctype();
    $anonymous = qa_lang_html('main/anonymous');
    if (isset($this->content['q_view']['who']['data']) && strpos($this->content['q_view']['who']['data'], 'class="qa-ip-link">' . $anonymous . '</a>') !== FALSE) {
        $this->content['q_view']['who']['data'] = $anonymous;
    }
}
 
Now, if you have installed any other plugin tha adds HTML to the 'data' value then this will remove that too. That means you'll have to parse that custom HTML yourself. The above solution parses only the HTML that comes from the Q2A core (at least on the current 1.6.3 version).
by
Regarding your questions:

1. That seems to be a kind of breadcrumb. There are a few plugins around about it. Probably it is worth taking a look at them if they satisfy that need.
2. That is not straight forward and seems to be related to theme customization. Most likely not something anyone would do for free. You can find some service providers here: http://www.question2answer.org/services.php
3. Hmm, not an easy thing to do as it seems it will require modifying the core's behaviour. However, this is not the first time that has been asked here so you can find something about it (I think I've seen that as "private categories" or something like that)

strpos warning? Whoops. I fixed my answer, I was checking for the isset($x) and then not using $x. Add the second parameter to to the isset function as it is in the question. Let me know if you have any issue with that
by
Hi thanks for reply but ip link pages not hiding for login users
by
Your question was: If unregistered user post question or answer he is linked to an ip address pages which not looks good, my question how to disable this link.

I've given you the code to remove the link from the anonymous (unregistered) users. So I don't get what you mean by "for login users" in your previous comment.

You also wanted to "disable the link" but you now are asking to hide the ip link pages. That's also different from your original request.

It will be better if you take a screenshot of the current behaviour, edit the screenshot marking the things you want to change and then create a second image (edited with any graphical image tool) with the behaviour you are expecting.
by
Hi
my question is very simple if user is not registered and post question or answer he also assign a page for his questions/answers just like register users but it didn't look good.
at present only register users can see these links. My question is i want to disable ip link pages from everyone except admin.
...