Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Navigation

comments error

Last updated on 4 years ago
karrakkarrak
Posted 4 years ago
incorrectly calculates the number of comments.
First picture nebula 2 bootstrap
(bootstrap not localize Reply)
karrak attached the following file:
capture_b.jpg [103.24kB / 101 Downloads]
capture_n.jpg [72.27kB / 86 Downloads]
karrakkarrak
Posted 4 years ago
if comment sorting = descending, it is not well count
if comment sorting = Ascending, it is good

themes/templates/render_function.php
insert line 45
$locale = fusion_get_locale('', LOCALE.LOCALESET."comments.php"wink;

rewrite
$comments_html .= "<a href='".$data['reply_link']."' class='btn btn-sm btn-default comments-reply'>Reply</a>";
this
$comments_html .= "<a href='".$data['reply_link']."' class='btn btn-sm btn-default comments-reply'>".$locale['c112']."</a>";
Edited by karrak on 03-09-2016 10:55, 4 years ago
ChanChan
Posted 4 years ago
Done.
karrakkarrak
Posted 4 years ago
one of the comments
/nebula/templates/Comment.php
80 line.
"<a href='href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>".$data['comment_datestamp']."</a>",

this
"<a href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>".$data['comment_datestamp']."</a>",
karrakkarrak
Posted 4 years ago
classes/PHPFusion/comments.php
sort by do not have a piece of number
341 line
$this->settings['comments_sorting'] == "ASC" ? $i++ : $i--;
this
$this->settings['comments_sorting'] == $i++;
ChanChan
Posted 4 years ago
Thanks, done!
karrakkarrak
Posted 4 years ago
sorry but not good :(
classes/PHPFusion/Comments.php
219 line

           ORDER BY comment_datestamp ".$this->settings['comments_sorting'].", comment_cat DESC";

            $query = dbquery($comment_query);

            if (dbrows($query) > 0) :

                $i = ($this->settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start']);


This
            ORDER BY comment_datestamp ".$this->settings['comments_sorting'].", comment_cat DESC
            LIMIT ".$_GET['c_start'].",".$cpp;

            $query = dbquery($comment_query);

            if (dbrows($query) > 0) :

                $i = 0;
                ($this->settings['comments_sorting'] == "ASC" ? $_GET['c_start'] + 1 : $c_rows - $_GET['c_start']);

And
352 line
$this->c_arr['c_info']['comments_count'] = format_word(number_format($i - 1, 0), $this->locale['fmt_comment']);
this
$this->c_arr['c_info']['comments_count'] = format_word(number_format($i , 0), $this->locale['fmt_comment']);
ChanChan
Posted 4 years ago
I dont think can put in a limit in the query. The limit must be on the array itself.

If there are 100 comments on that page, we sort the array into chunks and display it by page. The data must be full. That's the disadvantage of hierarchy.

If don't believe me, you can try your code with SQL limit, then have this structure test data

Main Comment
--- reply
--- reply
------ sub reply
----- - sub reply
------ sub sub sub reply
------ sub sub sub reply
---reply
---reply
--- Main Comment
---- Main Comment

Now, put limit to 3 in your settings admin, all sub reply will be missing.

Page 2 no parent, sub will not show.
ChanChan
Posted 4 years ago
Also:
$this->c_arr['c_info']['comments_count'] = format_word(number_format($i , 0), $this->locale['fmt_comment']);

Shows 5 comments, while I have only 4. My code is correct.
karrakkarrak
Posted 4 years ago
not correct.
1. comment
1.1 comment
1.2 comment
2 comment
3 comment
4 comment
5 comment

admin-> Miscellaneous -> Comments Sorting = Ascending
admin-> Miscellaneous -> Comments per page = 4

pege 1/2
7 comment

1.1
1.2
2
3
4

page 2/2
11 comment

1
1.1
1.2
2
3
4

if it's good............

admin-> Miscellaneous -> Comments per page = 4
admin-> Miscellaneous -> Comments Sorting = Descending

page 2/2
9 comment

5
4
3
2

page 1/2
11 comment

5
4
3
2

It shows this.
ChanChan
Posted 4 years ago
With Pagenav, the solution is going to take a massive impact on performance.
We would have to query each comment whether has child or not. 100 comments, 100 queries.

I will try to change to load more. CPP is only going to control first few items as an alternative model worse case scenario.

www.php-fusion.co.uk/infusions/forum/attachments/comments_per_page.jpg
Chan attached the following file:
comments_per_page.jpg [47.89kB / 114 Downloads]
ChanChan
Posted 4 years ago
https://github.com/PHPFusion/PHPFusion/commit/b24d29f0e770edfb10fa50676d32148b7d96e985

I reindex the base array and split them into pages following c_start.

$comments_per_page = 3;

[0] (all array that has comment_cat = 0)
--- [0] -- c_start = 0 (3 comment arrays)
--- [3] -- c_start = 3 (3 comment arrays)
--- [6] -- c_start = 6 (3 comment arrays)

Now, $array[0][0] is page c_start =0 with 3 comments array, and we find child of each comment. If exist, it will show. [b]These do not count as comments_per_page[b]

If they count we got 2 problem, parent not found how to render... it will look very wierd. Replying to ghost.

First page
html view: page 1
{avatar} { Message: Wow this is good }
--------------{avatar} {Message: There is something funny here.}
------------- {avatar} {Message: Something is even funnier with the shape of the block! }

html view: page 2
----------------------------------{avatar} {message: hahahaha}
{avatar} {message: who is A talking to?}

1. That is bad design.
2. sub sub sub sub reply will be in a mess.

So, comments per page only paginate base on items that is only comment_cat = 0

Also, comments will not show current page comment count.. it is also wierd to keep counting how many comments there are in this page, because we are talking about "Comments of the NEWS". That news has 8 comments, so it will stick to 8.

Now, I will progress with the Jquery. In order to do this, I need a static container for Jquery to push content to. It will generate on Model Level. You cannot customize it. I need that ID so HTML can be append.
ChanChan
Posted 4 years ago
Comments sub reply jquery is freaking hard to do.. I failed 6 times.
karrakkarrak
Posted 4 years ago
Now well-calculated. :)
ChanChan
Posted 4 years ago
:G wait for jquery update. I'm almost there.
karrakkarrak
Posted 4 years ago
Im error log..
new install.

C:\xampp\htdocs\fusionm\includes\classes\PHPFusion\Feedback\Comments.ajax.php
/fusionm/includes/classes/PHPFusion/Feedback/Comments.ajax.php?c_action=edit&comment_id=2
Undefined index: comment_item_type
Sor: 24
45 mp
Run-time bejegyzések
C:\xampp\htdocs\fusionm\includes\classes\PHPFusion\Feedback\Comments.ajax.php
/fusionm/includes/classes/PHPFusion/Feedback/Comments.ajax.php?c_action=edit&comment_id=2
Undefined index: comment_db
Sor: 25
45 mp
Run-time bejegyzések
C:\xampp\htdocs\fusionm\includes\classes\PHPFusion\Feedback\Comments.ajax.php
/fusionm/includes/classes/PHPFusion/Feedback/Comments.ajax.php?c_action=edit&comment_id=2
Undefined index: comment_col
Sor: 26
45 mp
Run-time bejegyzések
C:\xampp\htdocs\fusionm\includes\classes\PHPFusion\Feedback\Comments.ajax.php
/fusionm/includes/classes/PHPFusion/Feedback/Comments.ajax.php?c_action=edit&comment_id=2
Undefined index: comment_item_id
Sor: 27
45 mp
Run-time bejegyzések
C:\xampp\htdocs\fusionm\includes\classes\PHPFusion\Feedback\Comments.ajax.php
/fusionm/includes/classes/PHPFusion/Feedback/Comments.ajax.php?c_action=edit&comment_id=2
Undefined index: clink
Sor: 28
45 mp
ChanChan
Posted 4 years ago
Which comment form are you using?
Nebula's one or Default One?

Head over to the File, put in print_p($_POST);
karrakkarrak
Posted 4 years ago
1 comment does not add NEW Comment

2. Yes
3. not
4. yes stb..
but the entered text disappears
print_p($_POST); = empty
bootstrap, nebula

Reply = ok.
Edit error report.
karrak attached the following file:
capture_001_06092016_130508.jpg [43.06kB / 80 Downloads]
ChanChan
Posted 4 years ago
I checked console log, Turn off all BBcode if you have activated any other than smileys,bold, italic, url, image, (default ones). Check console log.

The BBcodes were not made for SEO compatible. Path is wrong.
karrakkarrak
Posted 4 years ago
only installed. (default)
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
You cannot set up a bounty in this discussion thread.
Moderator: Support Team
Users who participated in discussion: Chan, karrak,