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?

Add info about number of comments and number of views on latest articles module on Material theme

Asked Modified Viewed 1,442 times
B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
asked
Member

Hello there,
I would ask again for help with small customization, I looking for advice how to add info about number of comments and number of views on latest article module, smth like that:

i.ibb.co/3McBKKR/2021-05-16-21-10-03-Strona-g-owna-Elbl-ska-Grupa-Rowerowa-STOP.jpg


but maybe not on green background.

The same icon can be found in latest comments section in footer.

Thanks for help.

Regards.
0 replies

13 posts

R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

Place code somewhere after this L47 line
echo '<i class="fa fa-comments"></i> '.$data['comment_count'];
echo !empty($data['views']) ? '<i class="m-l-5 fa fa-eye"></i> '.$data['views'] : '';
0 replies
B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

I put code under line 48

and it almost works, now i can see:
i.ibb.co/cYMTzk3/2021-05-19-18-28-58-Window.jpg


with missing view number and with this error in error log:

File: HomePage.php
Page: /home.php
Line: 59
Error message: Undefined array key "comment_count"
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

echo isset($data['comment_count']) ? '<i class="fa fa-comments"></i> '.$data['comment_count'] : '';
0 replies
B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

When i put only this

echo isset($data['comment_count']) ? '<i class="fa fa-comments"></i> '.$data['comment_count'] : '';


I dont see anything
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

Delete this echo '<i class="fa fa-comments"></i> '.$data['comment_count'];

And add this echo isset($data['comment_count']) ? '<i class="fa fa-comments"></i> '.$data['comment_count'] : '';
0 replies
B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

Ok, now i insert this code:

echo isset($data['comment_count']) ? '<i class="fa fa-comments"></i> '.$data['comment_count'] : '';
                           echo !empty($data['views']) ? '<i class="m-l-5 fa fa-eye"></i> '.$data['views'] : '';


And what i get:

i.ibb.co/8MXVbQM/2021-05-19-21-18-32-Window.jpg


Stil dont see comment icon.

If im doing smth wrong sorry for that.
Edited by BenL on 19-05-2021 21:20,
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Makesure you have Entypo & FA enabled under Theme settings in Admin.
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

https://github.com/PHPFusion/Archive/...me.php#L46 comment_count is in 9.03.110 so idk why you don't have.
Anyway in 9.10 this will be changed, so wait for this update and then customize home.
0 replies
B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

Many thanks for you support, i will be wait with this customization for 9.10 then if any issue i will back in this topic.
Thanks!
0 replies
— 4 months later —
B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

Its looks that become a true, and now option to see number of views, and comments its now available for Material theme, but counters for comments dont works properly, and show 0 comments for news where i have more then 0
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

B
BenL
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
answered
Member

Hello there, one more thing related with this feature, i notice that icons are mixed.
Please check in att.
BenL attached the following image:
Image not found
0 replies
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

This is in your theme. Just swap icons fa-comments, fa-eye in Material/classes/Templates/HomePage.php
1 reply

Category Forum

Themes Support

Labels

None yet

Statistics

  • Views 0 views
  • Posts 13 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
B
B
BenL 12
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 41 threads in the forums
  • Started this discussions
R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet