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.
Not a member yet? Click here to register.
Forgot Password?

comments error

Asked Modified Viewed 6,369 times
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
asked
Senior Member

incorrectly calculates the number of comments.
First picture nebula 2 bootstrap
(bootstrap not localize Reply)
karrak attached the following file:
capture_b.jpg [No information available / 137 Downloads]
capture_n.jpg [No information available / 121 Downloads]
0 replies

22 posts

K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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 11:55,
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Done.
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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>",
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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++;
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Thanks, done!
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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']);
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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.
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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.
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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.
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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 [No information available / 144 Downloads]
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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.
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Comments sub reply jquery is freaking hard to do.. I failed 6 times.
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

Now well-calculated. :)
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

:G wait for jquery update. I'm almost there.
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Which comment form are you using?
Nebula's one or Default One?

Head over to the File, put in print_p($_POST);
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

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 [No information available / 115 Downloads]
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

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.
0 replies
K
karrak
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question
answered
Senior Member

only installed. (default)
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 22 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,841 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
K
K
karrak 32
Van mi sosem változik..smile
  • Senior Member, joined since
  • Contributed 311 posts on the community forums.
  • Started 94 threads in the forums
  • Started this discussions
  • Answered 1 question

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet