By Yannis JEAN on Thursday, 03 January 2019
Posted in General
Likes 0
Views 573
Votes 0
Hi,
as you can see in the image, I would like to understand how I can display in header the number of followers of a page + administrator + owner (at least, in the image the '7' and not '5').
I can't find the settings or the customisation for that.
Could you help me ?


Hey there,

May I know is this from a page or a group?

Can you provide us with your site's access and FTP's access so that I can have a better check on it?

May I know did you and what di you add/ edit some PHP code to show the members on the header?
·
Thursday, 03 January 2019 17:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
it's a page.
I just modified the langage files to display "members" and 1 file to modify the icon (/helpers/cover/page.php :

<a href="<?php echo $page->getAppPermalink('followers');?>" class="">
<i class="fa fa-users"></i> <?php echo JText::sprintf(ES::string()->computeNoun('APP_PAGE_COUNT_MEMBRES', $page->getTotalMembers()), $page->getTotalMembers()); ?>
</a>


I edit the first message to add access to my website.
·
Thursday, 03 January 2019 19:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey there,

as you can see in the image, I would like to understand how I can display in header the number of followers of a page + administrator + owner (at least, in the image the '7' and not '5').


You can add the following code to the function page() which is at
JoomlaFolder/administrator/components/com_easysocial/includes/template/helpers/cover.php to show your 'All', 'Members' and 'Admins' on the header:


$counters = array();
$counters['followers'] = $page->getTotalMembers();
$counters['admins'] = $page->getTotalAdmins();
$counters['total'] = $counters['followers'] + $counters['admins'];

and add this following code after '$theme = ES::themes();':

$theme->set('counters', $counters);


Also, add the following code after the part as shown in the screenshot which is at JoomlaFolder/components/com_easysocial/themes/wireframe/helpers/cover/page.php for the rendering part to show your 'All', 'Members' and 'Admins' on the header:

<li>
<a href="javascript:void(0);" class="">
<i class="fa fa-group"></i><?php echo $counters['total'];?>
</a>
</li>

<li>
<a href="javascript:void(0);" class="">
<i class="fa fa-group"></i><?php echo $counters['followers'];?>
</a>
</li>

<li>
<a href="javascript:void(0);" class="">
<i class="fa fa-user"></i><?php echo $counters['admins'];?>
</a>
</li>


Can you have a try and see how it goes?

For your information, when I was trying to access your FTP, it gave me the following error:

Command: PASS **************
Response: 530 Login authentication failed
Error: Critical error: Could not connect to server
·
Friday, 04 January 2019 12:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
thanks a lot. It's work for cover.

In the same time, I want display this number $counters['total'] everywhere it's possible (for the exact members of page ie follower + admin).

So, for example, I try to modify : pages/default/items.list.php


<i class="fa fa-thumbs-o-up"></i> <span data-page-like-count-<?php echo $page->id; ?> ><?php echo $page->getTotalMembers();?></span>
</li>


by this

<li data-es-provide="tooltip" data-original-title="<?php echo JText::sprintf(ES::string()->computeNoun('APP_PAGE_COUNT_MEMBRES', $page->getTotalMembers()), $counters['total']); ?>">
<i class="fa fa-users"></i> <span data-page-like-count-<?php echo $page->id; ?> ><?php echo $counters['total'];?></span>
</li>


But it isnt work.

(I'll try to check the ftp access).
·
Friday, 04 January 2019 18:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Yannis,

You can download my attached file and see how I did for the Page listing page.

I am really sorry but this will be the last time that I would be able to assist you as we normally do not provide customisation support as outlined in http://stackideas.com/support . We need to help others with real issues.

Thanks for understanding.
·
Saturday, 05 January 2019 10:46
·
0 Likes
·
0 Votes
·
0 Comments
·
I understand.
Thanks a lot for the help.

As I wrote on twitter, for my opinion, you're the best team in the J! world. Congratulations for your work.

Have a good time.
·
Saturday, 05 January 2019 20:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Yannis,

Thank you so much for your kind words.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Saturday, 05 January 2019 20:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post