MyBB Community Forums

Full Version: Usergroup stars - FontAwesome
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Sorry but I offered you a support and tutorial how to apply. If you cannot copy and paste the code mentioned above I cannot help you more. First of all you should try it in MyBB default theme and then try to debug... we cannot help you, no URL, no test account, nothing... without that not possible to help you.
The above mentioned tutorial didn't work for me,that's it.

Take it easy.
Hi!

I've followed the steps you mentioned above and unfortunately it's not working for me either. I'm already using FontAwesome v5.3.1 on my forum. I am testing this on default theme. Maybe have a look at http://www.r-gamers.net . Waiting for your reply.

Thank you!
Hello Eldenroot

Here is my forum info
URL: https://foro.guitarravallenata.com
MyBB version: 1.8.18
Theme: Default
PHP Version 7.1.21
SQL Engine MySQLi 10.1.36
test user: traste/espacio
FA: 4.7.0

I followed all steps given in your first post:
https://community.mybb.com/thread-217129...pid1302474

Yet, it is not working for me. Please let me know if I'm missed a step or something is not right with my forum install.

Thanks,
the reason why some folks may think it does not work is they may be looking at the administrator account and seeing it not display..., perhaps because this needs to be added to the css to make it display.


.star_7:before {
    content: "\f005\f005\f005\f005\f005\f005\f005";
} 

Because here is why: Fyi, by default there are actually 7 stars not 6 and this tutorial is only setup for 6 so not only does the 7th need to be added but each of the original six need to be modified to support 7 stars.

So for me to get it working correctly with FA 4.7  I merely modified the CSS for example as follows:

/** Usergroup star rating - FontAwesome 4.7 **/

.userstar {
    font-family: "FontAwesome";
    font-size: 13px;
    color: #D5CA3C;
    line-height: 13px;
    display: inline-block;
    letter-spacing: 2px;
}

.star_0:before {
    content: "\f006\f006\f006\f006\f006\f006\f006";
}

.star_1:before {
    content: "\f005\f006\f006\f006\f006\f006\f006";
}

.star_2:before {
    content: "\f005\f005\f006\f006\f006\f006\f006";
}

.star_3:before {
    content: "\f005\f005\f005\f006\f006\f006\f006";
}

.star_4:before {
    content: "\f005\f005\f005\f005\f006\f006\f006";
}

.star_5:before {
    content: "\f005\f005\f005\f005\f005\f006\f006";
}

.star_6:before {
    content: "\f005\f005\f005\f005\f005\f005\f006";
} 

.star_7:before {
    content: "\f005\f005\f005\f005\f005\f005\f005";
} 

Note: FA5 version will also need to be updated to  reflect the 7 actual stars as opposed to the existing 6 currently in the fa5 css version.

For example modified css fo Font Awesome 5:



/** Usergroup star rating - FontAwesome 5 **/

.userstar {
   font-family: "Font Awesome 5 Free";
   font-size: 13px;
   color: #D5CA3C;
   line-height: 13px;
   display: inline-block;
   letter-spacing: 2px;
   font-weight: 900;
}

.star_0:before {
   content: "\f005\f005\f005\f005\f005\f005\f005";
   font-weight: 400;
}

.star_1:before {
   content: "\f005";
}

.star_1:after {
   content: "\f005\f005\f005\f005\f005\f005";
   font-weight: 400;
}

.star_2:before {
   content: "\f005\f005";
}

.star_2:after {
   content: "\f005\f005\f005\f005\f005";
   font-weight: 400;
}

.star_3:before {
   content: "\f005\f005\f005";
}

.star_3:after {
   content: "\f005\f005\f005\f005";
   font-weight: 400;
}

.star_4:before {
   content: "\f005\f005\f005\f005";
}

.star_4:after {
   content: "\f005\f005\f005";
   font-weight: 400;
}

.star_5:before {
   content: "\f005\f005\f005\f005\f005";
}

.star_5:after {
   content: "\f005\f005";
   font-weight: 400;
}

.star_6:before {
   content: "\f005\f005\f005\f005\f005\f005";
}

.star_6:after {
   content: "\f005";
   font-weight: 400;
}

.star_7:before {
   content: "\f005\f005\f005\f005\f005\f005\f005";
}



So now let us just for proof of it working with 4.7 or 5 and for this to be successfully setup walk through the steps again with the modified css and adding the fontawesome include:

For Font Awesome 4.7 :

In headerinclude add:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">


For Font Awesome 5:

In headerinclude add:


<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css">



In posbit and postbit_classic find:

{$post['userstars']} 

Replace with:

<span style="text-align: center;" class="userstar star_{$post['stars']}" title="{$post['usertitle']}"></span>

In memberlist_user find:

{$user['userstars']} 


Replace with:

<span style="text-align: center;" class="userstar star_{$user['stars']}" title="{$user['usertitle']}"></span>

In member_ profile find:

{$userstars} 

Replace with:

<span style="text-align: center;" class="userstar star_{$stars}" title="{$usertitle}"></span> 

For Font Awesome 4.7:

Add to global.css:

/** Usergroup star rating - FontAwesome 4.7 **/

.userstar {
    font-family: "FontAwesome";
    font-size: 13px;
    color: #D5CA3C;
    line-height: 13px;
    display: inline-block;
    letter-spacing: 2px;
}

.star_0:before {
    content: "\f006\f006\f006\f006\f006\f006\f006";
}

.star_1:before {
    content: "\f005\f006\f006\f006\f006\f006\f006";
}

.star_2:before {
    content: "\f005\f005\f006\f006\f006\f006\f006";
}

.star_3:before {
    content: "\f005\f005\f005\f006\f006\f006\f006";
}

.star_4:before {
    content: "\f005\f005\f005\f005\f006\f006\f006";
}

.star_5:before {
    content: "\f005\f005\f005\f005\f005\f006\f006";
}

.star_6:before {
    content: "\f005\f005\f005\f005\f005\f005\f006";
} 

.star_7:before {
    content: "\f005\f005\f005\f005\f005\f005\f005";
} 


For Font Awesome 5:


Add to global.css:


/** Usergroup star rating - FontAwesome 5 **/

.userstar {
   font-family: "Font Awesome 5 Free";
   font-size: 13px;
   color: #D5CA3C;
   line-height: 13px;
   display: inline-block;
   letter-spacing: 2px;
   font-weight: 900;
}

.star_0:before {
   content: "\f005\f005\f005\f005\f005\f005\f005";
   font-weight: 400;
}

.star_1:before {
   content: "\f005";
}

.star_1:after {
   content: "\f005\f005\f005\f005\f005\f005";
   font-weight: 400;
}

.star_2:before {
   content: "\f005\f005";
}

.star_2:after {
   content: "\f005\f005\f005\f005\f005";
   font-weight: 400;
}

.star_3:before {
   content: "\f005\f005\f005";
}

.star_3:after {
   content: "\f005\f005\f005\f005";
   font-weight: 400;
}

.star_4:before {
   content: "\f005\f005\f005\f005";
}

.star_4:after {
   content: "\f005\f005\f005";
   font-weight: 400;
}

.star_5:before {
   content: "\f005\f005\f005\f005\f005";
}

.star_5:after {
   content: "\f005\f005";
   font-weight: 400;
}

.star_6:before {
   content: "\f005\f005\f005\f005\f005\f005";
}

.star_6:after {
   content: "\f005";
   font-weight: 400;
}

.star_7:before {
   content: "\f005\f005\f005\f005\f005\f005\f005";
}

Still not working for me. The stars don't show up as it's supposed to do.
I am using FA 5

http://prntscr.com/kyl50v
Hmm, really weird. Can you send me a testing account and your board url to test it? I will have some free time in next two days.

IT seems to be fine on your board...

OK, first of all - you have a JS error on your board.

To everybody who has problems with this tutorial - try it with FA4.7 if the issue persists. If not, you have to use a custom generated FA5 url link - you can take it from there for free:

https://fontawesome.com/how-to-use/on-th...s-with-css
and that's how you look at my forum, I just can not link the font

https://prnt.sc/kyq9i7


http://latinhope.skn1.com/showthread.php?tid=2
(2018-09-25, 11:27 PM)DarkEternity Wrote: [ -> ]and that's how you look at my forum, I just can not link the font

https://prnt.sc/kyq9i7


http://latinhope.skn1.com/showthread.php?tid=2

Have you tried: https://community.mybb.com/thread-217129...pid1315029? I modified slightly for FA 4 .7 and FA 5 and tested both. Both appear to be working fine.
(2018-09-26, 12:39 AM)vintagedaddyo Wrote: [ -> ]
(2018-09-25, 11:27 PM)DarkEternity Wrote: [ -> ]and that's how you look at my forum, I just can not link the font

https://prnt.sc/kyq9i7


http://latinhope.skn1.com/showthread.php?tid=2

Have you tried: https://community.mybb.com/thread-217129...pid1315029? I modified slightly for FA 4 .7 and FA 5 and tested both. Both appear to be working fine.

It was what I did, even though I can not get it to work
Pages: 1 2 3 4 5