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

When I get a partial URL, say without the URL words added by q2a: http://question2answer.org/qa/19513/

and I wanted to get the real URL, I have to check the source code for canonical.

Unfortunately "asked 27 Nov in Q2A Core by eetv (Kai)" → the asked part is not linked.

"answered", "edited", "commented" are all linked, however.

Help :)

 

PS: Who thinks of linking the question title? As blogs are doing it mostly.

Q2A version: 1.5.3
by
I link the question title on my site. I agree it should be done by default.
by
what code snippet are you using? :)
btw, have a great Happy New Year party!
by
Done it by myself, to link the question title change in qa-app-format.php, line 253:
from: $fields['title']='<SPAN CLASS="entry-title">'.$fields['title'].'</SPAN>';
to: $fields['title']='<A HREF="'.$fields['url'].'" CLASS="entry-title">'.$fields['title'].'</A>';

1 Answer

0 votes
by
edited by

To link the "asked " part, e.g. asked Dec 30, 2012 in Q2A Core by echteinfachtv (Kai)

1. open qa-app-format.php

2. go to line 438 which is:

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

3. below add those lines:

  // link question meta "asked"
    if (@$options['whatlink'] && $isquestion)
        $fields['what_url']=qa_path_html(qa_request(), null, null, null, null);

 

Done :)

 

Note: You might want to change CSS class of .qa-q-view-what to set the default color.

by
edited by
Update to get the correct URL and not the request:
if (@$options['whatlink'] && $isquestion)
    //former hack: $fields['what_url']=qa_path_html(qa_request(), null, null, null, null);
    $fields['what_url']=qa_q_path($fields['raw']['postid'], $fields['raw']['title']);
by
Code Block in qa-app-format.php:

if (@$options['whatview'] ) {
    $fields['what']=qa_lang_html($isquestion ? 'main/asked' : ($isanswer ? 'main/answered' : 'main/commented'));
       
    if (@$options['whatlink'] && !$isquestion)
        $fields['what_url']=qa_path_html(qa_request(), array('show' => $postid), null, null, qa_anchor($post['basetype'], $postid));
    // linking the "asked" part
    if (@$options['whatlink'] && $isquestion)
        $fields['what_url']=qa_q_path($fields['raw']['postid'], $fields['raw']['title']);
}
...