1 pepoluan Jul 17, 2008 23:15
3 yabba Jul 22, 2008 20:16
Hi pepolun,
If you can wait until I have a chance to install a demo blog && the ru skin then I'll offer you a work through.
The post you linked to hasn't been updated to reflect the current evo skins way of doing things, but if you check the comments on my blog you can see it works .... unfortunately I have a pretty unique skin, so my code changes won't work in yours
¥
4 sam2kb Jul 22, 2008 21:19
I tried to install nested comments. There is no depth in Comment object
5 yabba Jul 23, 2008 00:15
The plugin creates the depth property ;)
¥
6 sam2kb Jul 23, 2008 00:20
var_export($Comment);
Comment::__set_state(array(
'Item' => NULL,
'item_ID' => '22',
'author_User' => NULL,
'author_ID' => NULL,
'type' => 'comment',
'status' => 'published',
'author' => NULL,
'author_email' => NULL,
'author_url' => '',
'author_IP' => '127.0.0.1',
'date' => '2008-07-22 14:39:51',
'content' => 'thhhhhhhhhhhhhhhhhhhh',
'spam_karma' => NULL,
'allow_msgform' => '0',
'nofollow' => '1',
'ID' => '3',
'dbtablename' => 'T_comments',
'dbprefix' => 'comment_',
'dbIDname' => 'comment_ID',
'datecreated_field' => '',
'datemodified_field' => '',
'creator_field' => '',
'lasteditor_field' => '',
'dbchanges' =>
array (
),
'delete_restrictions' =>
array (
),
'delete_cascades' =>
array (
),
'author_user_ID' => '1',
'rating' => NULL,
'featured' => '0',
))
7 sam2kb Jul 23, 2008 00:34
Here is a quick patch
replace
$Plugins->call_by_code( 'amNestCmnt', array() );
with
$Plugins->call_by_code( 'amNestCmnt', array( 'CommentList' => $CommentList ) );
and in plugin
function SkinTag()
{
global $CommentList, $DB;
to
function SkinTag( & $param )
{
global $CommentList, $DB;
$CommentList = $param['CommentList'];
8 sam2kb Jul 23, 2008 01:12
To pepoluan
You can download modified files from [url=http://ru.b2evo.net/media/download/other/nested_comments.zip]here[/url]
_item_comment.inc.php
_item_feedback.inc.php
9 yabba Jul 23, 2008 01:20
function SkinTag( & $params )
{
global $DB;
$this->CommentList = & $params[ 'CommentList' ];
if( !( $evoComments = $this->CommentList->result_num_rows ) ) return; // there are no comments
// lets set all the parents and depths
for( $z = 0; $z < $evoComments; $z++ )
{
$sql = 'select comment_parent, comment_depth from '.$this->get_sql_table('nesting').' where comment_ID = '.$this->CommentList->Obj[ $z ]->ID;
$fred = $DB->get_results( $sql );
if( empty( $fred[0]->comment_parent ) ) $fred[0]->comment_parent = $this->CommentList->Obj[ $z ]->ID;
if( empty( $fred[0]->comment_depth ) ) $fred[0]->comment_depth = 0;
$this->CommentList->Obj[ $z ]->parent = $fred[0]->comment_parent;
$this->CommentList->Obj[ $z ]->depth = $fred[0]->comment_depth;
}
the plugin sets the depth and parent properties ;)
Your patch is very close to what's in my skin :P
$CommentList = & new CommentList( NULL, implode(',', $type_list), array('published'), $Item->ID, '', 'ASC' );
// Nested comments part 1 of 3
$Plugins->call_by_code( 'amNestCmnt', array( 'CommentList' => & $CommentList ) );
See first "paste" for the skintag change ;)
Guess I need to update the download as well as the instructions :P
¥
*edit*
If you download the version from my credits page ( [url=http://waffleson.co.uk/2007/10/credits]credits[/url] ), then you'll have the code as it is now on my blog
10 sam2kb Jul 23, 2008 01:31
I always forget about this reference thing &
I deleted the plugin from download and fixed _item_feedback.inc.php
11 yabba Jul 23, 2008 01:37
I always forget to update zips :-S
I'll have to remember to post a 2.x.x version of the instructions though ... lots has happened since then
¥
No suggestion?
Gee... I guess Nested Comments is beyond b2evo's capabilities then. Oh well...