Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
533 views
in Q2A Core by

As I once noted, asked resp. asked by is not linked in the question list nor in the question view.

I added a hack to at least link it. But gidgreen built in the linking by the request URL which gives not correct URLs.

Now I tried to change the hack to link the real URL (like the canonical one):

if (@$options['whatlink'] && $isquestion)
    //former hack: $fields['what_url']=qa_path_html(qa_request(), null, null, null, null);
    $fields['what_url']=qa_q_request($fields['raw']['postid'], $fields['raw']['title']);

which links the "asked" in the question list correctly!

However, in the question view I get the question-ID in the URL twice?!

e.g. http://www.question2answer.org/qa/20274/20274/why-is-asked-by-actually-not-linked

Can somebody help me finding the reason for that ... or solve the problem?

Thanks.

Q2A version: 1.5.4

1 Answer

0 votes
by
edited by

stupid me... not qa_q_request(...) but qa_q_path(...)

now it works! =)

But well, if URL is not correct, still the answers and comments have the "wrong" URL (the request URL). This is still open. We just need to map the function qa_path_html/qa_path to qa_q_path:

if (@$options['whatlink'] && !$isquestion)
  $fields['what_url']=qa_path_html(qa_request(), array('show' => $postid), null, null, qa_anchor($post['basetype'], $postid));

to something like:

if (@$options['whatlink'] && !$isquestion)
  $fields['what_url']=qa_q_path($fields['raw']['parentid'], $fields['raw']['title']);

but this needs also a check if comment on answer or comment on question when using parentid.... :|

...