Add quick reply/edit
Michelle - September 3, 2008 - 16:10
| Project: | AJAX Comments |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I'd like to have the ajaxy quick reply/edit like vB has. I don't know ajax at all, though. Any one want to work on this?
Michelle

#1
Will revisit this in 2.x.
Michelle
#2
I'm using ajax_comments (http://drupal.org/node/349090), but with advanced_forum "delete" function doesn't works, I created an issue #411016: Can't delete comments when using advanced_forum.module, perhaps You could take a look at this as well?
#3
I don't use that module and it's not something I'll have time to look at any time soon.
Michelle
#4
That's shame, because those both modules together would make a killer forum. I'm gonna try play around this, could You tell perhaps why this could be that reply works, but delete isn't? Ajax comments is using token during delete operation, maybe here's the problem, that it's lost on the way thru advanced_forum?
#5
AF doesn't do anything special on add/edit/delete so I really have no idea.
Michelle
#6
Well I'll be trying do something about this then though I'm nobody's programmer :P
#7
Well, if you get it figured out, feel free to report back here. I'll look at it when I work on 2.x.
Michelle
#8
I found this in ajax_comments read me
2. If you have themed your comments output, make sure that everything is wrapped to ".comment" class
in your "comment.tpl.php"
Comments doesn't works because advanced forums comment template is different and there's no "div class comment".
#9
Ah, well, there you go, then. Sounds like you just need to add that.
Michelle
#10
Hi
Well it's not exactly comment class issue, because I replaced advf-forum-post.tpl.php with Drupal's default comment.tpl.php and comments still can't be deleted, they are only "fading away" but are not actually deleted, to be able to delete comments, I must disable comment theming (commenting lines) in advanced_forum.module, so it must be something in module's code, which collide with ajax_comment delete function.
#11
Hi
I fixed this by commenting this code in advanced_forum.module (function advanced_forum_preprocess_comment, lines 461-512):
<?php
if (arg(1) != 'reply') {
// Because the $links array isn't available here, we recreate it
$node = node_load($variables['comment']->nid);
$links = module_invoke_all('link', 'comment', $variables['comment']);
drupal_alter('link', $links, $node);
unset($links['comment_parent']);
// Iconify common links (optional to avoid translation issues)
_advanced_forum_buttonify_links($links);
// Remake the links with our changes
$variables['links'] = theme('links', $links, array('class' => 'links forum-links'));
$variables['links_array'] = $links;
}
// Since we have to load the node anyway for our links trick, make it avail
$variables['node'] = $node;
?>
and replacing this:
<?php else: ?><?php $classes .= $comment_classes; ?>
<div id="comment-<?php print $comment->cid; ?>" class="forum-post <?php print $classes; ?> clear-block">
<?php endif; ?>
with the code below, in adfv-forum-post.tpl.php (lines 31-34):
<?php else: ?><div class="comment">
<?php endif; ?>
#12
Well, glad you got it working but you're cutting out a large chunk of functionality to do it. Not something I recommend for users in general but great if you're happy with it. :)
Michelle
#13
Well I know it's probably not the best way to do it, but I couldn't make this working in any other way. Perhaps when You'll be working on version 2.x of the module You gonna find some better solution (I'm sure You will ;-).
#14
Hopefully. We'll see when I get that far. :)
Michelle
#15
subscribe. might give this idea some time.
#16
#17
Subscribe...
#18
i'd love to see this too, have had to turn off ajax comments for the forums :-(
#19
This is not likely to get into 2.x unless someone writes a patch or an add-on to nodecomment. While 2.x will still work with normal comments, I, personally, will be using nodecomment and that's what gets my attention.
Michelle
#20
I am going to look into this, at my free hours. I ll post later a few details about how i am going to develop it.
apanag
#21
@apanag: Thanks. :)
Michelle
#22
Michelle,
nodecomment is going to be the default comment system in the advanced_forum2? Or is it going to be a plugin and the user will be able to choose either default drupal comment system or nodecomment?
apanag
#23
It's optional but my focus is on nodecomment. AF will continue to work with comment but not all the features will.
Michelle
#24
I see.
So i think the best solution is to develop a plugin for nodecomment as you suggested on post #19.
apanag
#25
subscribe...
#26
I have noticed that if Ajax Comments are enabled for forum topic, the "delete" button use the link for example:
.../comment/delete/?token=0519dc......
and this does not work becasue the comment ID is not included before ?
if I use the link
.../comment/delete/75?token=0519dc (75 states for comment ID) then the delete function works properly also in conetion with Ajax Comments...
So to solve this issue we will have to include the NID before ?
but how???
#27
Yep, that's the same for me. It has been mentioned in other AF-related thread that this issue wouldn't be solved by Michelle but workaround was found by another user.
#28
Hi,
@#26... the problem is then with AJAX comments module integration. It isn't a problem strictly concerning advanced forum.
In fact, when I disable AJAX comments, all come back to work as desired.