Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2008-05-31 02:33:31

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

Re: [plugin] [ORPHAN] peg_nested_comments

Hmm, it looks like they’re not nested in the source at all right now. Try this in your comment template:

<txp:zem_prblock><div class="<txp:sed_get_comment_class />">
<txp:comment_anchor />
<h5><span class="comment-no"><txp:comment_permlink> #<txp:sed_comment_number/></txp:comment_permlink></span> &middot;&nbsp;<txp:comment_name link="0" /><txp:sed_if_author_comment_string string=" (Author)" /></h5>
<txp:sed_comment_time class="comment-time" />
<txp:message /><txp:peg_reply_link /><txp:peg_child_comments wraptag="ul"/></div>
</txp:zem_prblock>

Offline

#22 2008-05-31 05:01:39

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

Ok I did that… looks the same… :(



WebKat

Offline

#23 2008-05-31 14:30:02

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] peg_nested_comments

I changed my comment form again because it was unclear what was what how it was before. Here is my new code:

<table width="100%"  border="0" cellspacing="0" >
  <tr bgcolor="#F8EBCD">
  	<td width="40" bgcolor="#F8EBCD"><txp:glx_gravatar size="40" default="http://opalcat.com/images/pixel.gif" rating="PG" class="gravatar" /></td>
    <td bgcolor="#F8EBCD"><txp:comment_anchor /><strong><span class="comment-no"><txp:comment_permlink> #<txp:sed_comment_number/></txp:comment_permlink></span> 
&middot;&nbsp;<txp:comment_name link="0" /><txp:sed_if_author_comment_string string=" (Author)" /></strong><br>
<txp:sed_comment_time class="comment-time" />&nbsp;&nbsp;&nbsp;<txp:peg_reply_link /></td>
  </tr>
  <tr>
    <td colspan="2"><txp:message /><txp:peg_child_comments wraptag="ul"/></td>
  </tr>
</table>


WebKat

Offline

#24 2008-05-31 15:34:01

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

Re: [plugin] [ORPHAN] peg_nested_comments

Try going to admin->preferences and setting ‘present comments as a numbered list’ to ‘yes’. The docs for the sed_comment pack suggest setting it to ‘no’.

Oddly enough the only way I could reproduce this on my own setup (with your templates) was to say ‘no’ on that and not provide a wraptag to the peg_child_comments – it wasn’t doing this on my txp install if I explicitly said wraptag=“ul”. But on yours that admin pref seems to be overriding that.

Offline

#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

#26 2008-05-31 16:06:04

Egypt Urnash
Plugin Author
From: Boston
Registered: 2006-07-23
Posts: 19
Website

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

#28 2010-07-13 20:06:25

emeaguiar
New Member
Registered: 2010-07-13
Posts: 5
Website

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

Board footer

Powered by FluxBB