By Abi on Tuesday, 04 August 2015
Posted in General
Replies 8
Likes 0
Views 668
Votes 0
Hello,

I need help with implementing a ranking system because the 'Badges' facility does not help me to do so.

(a) Imagine that my website is based on the British Army ranks and I want my members to progress from Cadets to Field Marshal as their total points increases. Cadet (0-49 points), Lieutenant (50 - 99 points), Captain (100 - 149), Major (150-199), Colonel (200-299), Brigadier (300-399), General (400-699), Field Marshal (700+).

(b) Each member can only be at one of the ranks and will have a display in his profile to show his rank such as :- Cadet.png (0-49 points), Lieutenant.png (50 - 99), Captain.png (100 - 149), Major.png (150-199), Colonel.png (200-299), Brigadier.png (300-399), General.png (400-699), FieldMarshal.png (700+).

(c) Looking at my jpeg, I want the png picture to be displayed in location red OR green BUT if possible in location blue ALSO.

How can I achieve the above, even if I have to hack a 'case' statement or 'if' statement into php files? I know that it will not be supported but this ranking requirement is vital to my website concept.

Thanks in advance.
Hey Abi,

Are you referring to the page at http://demo.stackideas.com/easysocial/profile/darius-scott ? Take a look at the file /components/com_easysocial/themes/wireframe/profile/default.header.php
·
Saturday, 08 August 2015 17:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Abi,

Unfortunately there is no quick setting in order to achieve this. However you can try to manually hack the following file, /components/com_easysocial/themes/wireframe/profile/default.header.php and add the following 'if' code to check the user points.
if ($user->getPoints() < 50) {
// echo your image here for Cadet badge
}


What I give is the basic requirement for you to get the user points. You can further adjust the code according to your need.
·
Tuesday, 04 August 2015 19:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Ezrul,

It is fantastic that there is a possibility !! This requirement is so vital to me.

But because I'm not a coder I need a bit more help. What lines do I add for the other ranks and to display in my desired module position of under the profile picture ?

I accept that what I want to do is not supported and I do it at my own risk. But it will help me to move from Jomsocial + Alphauserpoints.
Abi
·
Tuesday, 04 August 2015 19:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Also, where in the file would I place the entry? I had a look at the file and it is confusing.

Likewise which php file, what code and where do I put it, so that ranking PNGs are displayed in the Easysocial Leader Board?

I really appreciate your help.
Abi
·
Tuesday, 04 August 2015 22:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Abi,

Since you are only going to use 1 badge at a time, I strongly advise you to then ignore the achievements system in EasySocial altogether because the achievements in EasySocial is more like "rewards" where you perform specific actions and be rewarded with a badge.

The solution which Ezrul provided is a workaround that you could perform. This is a code sample, edit the file /components/com_easysocial/themes/wireframe/profile/default.header.php and placed the codes below,


$points = $user->getPoints();

if ($points < 50) {
echo '<img src="/path/to/your/badge1.png" />';
}

if ($points > 50 && $points < 100) {
echo '<img src="/path/to/your/badge2.png" />';
}

if ($points > 100 && $points < 200) {
echo '<img src="/path/to/your/badge3.png" />';
}



Does this make sense to you?
·
Tuesday, 04 August 2015 23:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark. It's working now - thanks to you all.

I will use the excellent badge (reward) system alongside the ranking (e.g a soldier progresses up the ranks and earns many badges on the way).

I just need someone to tell me which file I can modify to place my 'rank' images in the EasySocial Leaderboard.
Abi
·
Wednesday, 05 August 2015 14:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Abi,

Sorry for the delay of this reply as we are pretty occupied with the development of EasySocial 1.4. You may find them in /components/com_easysocial/themes/wireframe/leaderboard/default.php

Cheers!
·
Thursday, 06 August 2015 03:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thanks . /components/com_easysocial/themes/wireframe/leaderboard/default.php is very useful. However the particular place that interests me is, looking at your demo site, where Darius Scott is shown to have 220 points. I want it so that near this 220 points, I put my rank images. Which file do I modify to achieve this?
Abi
·
Saturday, 08 August 2015 17:07
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post