Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2008-05-31 15:36:06
- WebKat
- Member
- Registered: 2007-01-16
- Posts: 301
Re: [plugin] [ORPHAN] peg_nested_comments
ok I did that.
—
WebKat
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
Still not working? I’m out of ideas, I’m afraid. Try turning off all your other plugins and see if it’s showing up; there could be some kind of conflict.
Offline
#27 2009-04-01 23:08:15
- Werdn
- New Member
- Registered: 2009-04-01
- Posts: 1
Re: [plugin] [ORPHAN] peg_nested_comments
I have made some modifications, so this plugin generates valid code, i remove print $js
:
// Main script
// Why you not make it at first time?
function peg_main_script($atts) {
return "<script type=\"text/javascript\">
<!--
function peg_selectComment(discussid) {
//var mySelect = document.forms[2].peg_replyto;
var mySelect = document.getElementById('peg_replyto');
mySelect.value = discussid;
}
// -->
</script>";
}
Very strange, so this code not be created.
Also:
function peg_reply_link($atts) {
// our current comment
global $thiscomment;
// if passed a label, print it, otherwise, the default is 'Reply'
$reply_value = (isset($atts['label'])) ? $atts['label'] : 'Reply';
$href = "#peg_replyto";
$onclick = "peg_selectComment('".$thiscomment['discussid']."')";
$out = "<a class=\"peg_replyto\" href=\"$href\" onclick=\"$onclick;\"> $reply_value </a>";
return $out;
}
Sorry for my bad english :-)
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
Sorry for posting in such an old thread, but I was having the same issue as OpalCat, no matter what, the nested comments wouldn’t work, but I found a solution to my problem.
After a while struggling with the code I noticed that my database displayed just 000000 on the recently created peg_child table
, it turns out that when I installed textpattern I used a prefix for the database (didn’t know it already uses one) and that isn’t contemplated on the plugin so the correct discussid
wasn’t being saved in the database.
My solution was to add the prefix to the line 143, this function:
function peg_saveCommentLinks($event, $step='') {
$reply_to = ps('peg_replyto');
echo $reply_to;
if ($reply_to != 'Article' && $reply_to != '') {
$nextID = 'lpad("'.peg_getNextAutoID('txp_discuss').'",6,"0")';
$rs = safe_update('txp_discuss','peg_children = if (peg_children = "", '.$nextID.', concat_ws(",",peg_children,'.$nextID.'))','discussid='.$reply_to);
}
So it looks like this:
function peg_saveCommentLinks($event, $step='') {
$reply_to = ps('peg_replyto');
echo $reply_to;
if ($reply_to != 'Article' && $reply_to != '') {
$nextID = 'lpad("'.peg_getNextAutoID('prefix_txp_discuss').'",6,"0")';
$rs = safe_update('txp_discuss','peg_children = if (peg_children = "", '.$nextID.', concat_ws(",",peg_children,'.$nextID.'))','discussid='.$reply_to);
}
Note that I added _prefix__ and now it works like charm, of course old replies didn’t work but that can be fixed from the database, anyway, thanks for the plugin and maybe this can help some other with the same problem.
Offline
#29 2011-08-14 00:30:34
- WebKat
- Member
- Registered: 2007-01-16
- Posts: 301
Re: [plugin] [ORPHAN] peg_nested_comments
Sorry for posting to such an old reply on such an old thread, but emeaguiar, I didn’t use a prefix other than what it automatically uses… do you know if anything you did will help me? Mine still isn’t nested after all these years.
—
WebKat
Offline
#30 2012-03-30 00:48:24
- WebKat
- Member
- Registered: 2007-01-16
- Posts: 301
Re: [plugin] [ORPHAN] peg_nested_comments
Still not nested… oh so many years later… and also I noticed that my “reply” links, which are just anchor links to the comments form, weren’t working. Turns out that instead of <a name="anchorname"></a>
it’s changed to <a id="anchorname"></a>
… when did this happen? Does this mean all of my anchor links from ages past are going to stop working?
—
WebKat
Offline
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
etc wrote #268587:
If someone still uses this plugin , here is a working (nested and minimally sanitized) version.
I like it, thanks.
Maybe you could complete the third point of the plugin help by suggesting the add of <txp:if_comments></txp:if_comments>
around <txp:peg_reply_to />
to show this field only if it’s indeed possible to reply to a comment.
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
Thanks, I actually use this condition on my site. :) Will modify the help in the next version.
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
etc wrote #294753:
Thanks, I actually use this condition on my site. :) Will modify the help in the next version.
As the #peg_replyto_backlink
and #peg_replyto_new
links are displayed on replying only, wouldn’t it be good to make the whole <txp:peg_reply_to />
field work that way to avoid any misundertanding about this inactive field in the comment form when the user is not replying?
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
You are probably right, but I’m bad at UX and prefer to leave it with users. It’s only Javascript in this part, if you suggest a tweak that makes it work more nicely, I will gladly incorporate it.
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
etc wrote #294784:
You are probably right, but I’m bad at UX and prefer to leave it with users. It’s only Javascript in this part, if you suggest a tweak that makes it work more nicely, I will gladly incorporate it.
Ok, i’ll give it a try.
Offline