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

Just now I noticed that there is no anchor link set when somebody comments on your comment. It gives only the plain URL.

I like the fact that if somebody comments on my question or answer, I get the anchor at the end of the url #1234 to jump directly to the new comment.

How to add this feature?

 

I assume that in qa-event-notify.php starting with about line 89, there is the case for "C" (comment on comment) missing.

Q2A version: 1.5.4
by
Will look into it for 1.6.2.
by
edited by
I found out that comment on answer or question does not give me an anchor either. It is weird that it seems to work with the emails I receive from this q2a forum... but not with my setup.

I think to use $parent might be incorrect for the last two parameters here (around line 106 of qa-event-notify.php):
$sendurl=qa_q_path($question['postid'], $question['title'], true, $parent['basetype'], $parent['postid']);

Still trying to understand it :)

---
Must basetype not be 'C' ?
And shouldn't the postid be the one of the comment not the parent?
by
@gidgreen: Was not changed in 1.6.2.
by
Sorry - must have slipped through - will try again for 1.6.3 :)

1 Answer

0 votes
by
 
Best answer

I solved this finally. I am not using the parents data for $sendurl but the comment's data. Don't know why gidgreen did it differently... In qa-event-notify.php:

change line: $sendurl=qa_q_path($question['postid'], $question['title'], true, $parent['basetype'], $parent['postid']);

to:

$sendurl=qa_q_path($question['postid'], $question['title'], true, 'C', $params['postid']);

Now the anchor is showing up.

This is also the solution for the initial question on top!

by
I've made this modification in Q2A 1.6.3. I had it the other way to link to the whole thread rather than just the latest comment, but think you're right that this makes more sense.
by
Thanks a lot. It makes it easier for all.
...