MyBB Community Forums

Full Version: Replace PM icons with Font Awesome
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ignore step 1 if you are already linking to Font Awesome CSS, although you need to make sure that it's the latest version (4.7.0 at this time) as these icons are new.

Step 1:

In headerinclude add above {$stylesheets}:

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

Step 2:

Add to usercp.css


.x_new_pm:before {font-family:FontAwesome; content: "\f003"; font-size:16px}
.x_old_pm:before {font-family:FontAwesome; content: "\f2b7"; font-size:16px}
.x_fw_pm:before {font-family:FontAwesome; content: "\f2b7"; position:absolute; font-size:16px}
.x_fw_pm:after {font-family:FontAwesome; content: "\f178"; position:relative; top:11px; left:5px; color:#5b94c5; font-size:16px}
.x_re_pm:before {font-family:FontAwesome; content: "\f2b7"; position:absolute; font-size:16px}
.x_re_pm:after {font-family:FontAwesome; content: "\f177"; position:relative; top:11px; right:5px; color:#663096; font-size:16px}
 
Step 3:

In private_messagebit and private_search_messagebit templates:

Find

<img src="{$theme['imgdir']}/{$msgstatus}.png" alt="{$msgalt}" title="{$msgalt}" />

and replace with:

<span class="x_{$msgstatus}" title="{$msgalt}"></span>

Before:

[Image: before.png]

After:

[Image: after.png]
Nice , provide same for postbit buttons and thread create close buttons
Looks AWESOME! Hope to see some more as Donald Duck stated
For the thread buttons:

forumdisplay_newthread

Replace with:

<a href="newthread.php?fid={$fid}" class="button" style="text-decoration:none"><i class="fa fa-file-text" aria-hidden="true" style="color:#008000"></i>&nbsp;&nbsp;{$lang->post_thread}</a>

showthread_newreply

Replace with:

<a href="newreply.php?tid={$tid}" class="button" style="text-decoration:none"><i class="fa fa-comments" aria-hidden="true" style="color:#ffff00"></i>&nbsp;&nbsp;{$lang->new_reply}</a>&nbsp;

showthread_newreply_closed

Replace with:

<a href="newreply.php?tid={$tid}" class="button" style="text-decoration:none"><i class="fa fa-lock" aria-hidden="true" style="color:#ffd700"></i>&nbsp;&nbsp;{$lang->thread_closed}</a>&nbsp;

showthread_newthread

Replace with:

<a href="newthread.php?fid={$fid}" class="button" style="text-decoration:none"><i class="fa fa-comments" aria-hidden="true" style="color:#ffd700"></i>&nbsp;&nbsp;{$lang->post_thread}</a>&nbsp;

[Image: buttons1.png][Image: buttons2.png]

[Image: buttons3.png]
Great stuff, thanks
What about PM tracking and the legend shown below the thread/forum (print, subscribe, etc.) Wink
(2016-11-26, 07:53 AM)Ashley1 Wrote: [ -> ]-- SNIP --

Replace PM icons with Font Awesome - Font Awesome 5

Original tutorial credit to Ashley1 @ https://community.mybb.com/thread-206180.html


Here I have simply updated it for Font  Awesome 5 usage:

Example:

[attachment=41191]

For Font Awesome 5:

In headerinclude add:


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

NOTE: You can skip the header include if you already have the font awesome included in your headerinclude say from other tutorials.

In private_messagebit and private_search_messagebit templates:

Find:

<img src="{$theme['imgdir']}/{$msgstatus}.png" alt="{$msgalt}" title="{$msgalt}" />

and replace with:

<span class="x_{$msgstatus}" title="{$msgalt}"></span>


Add to usercp.css:

/** FA PM Icons **/

.x_new_pm:before {
    font-family: "Font Awesome 5 Free";
    content: "\f0e0";
    font-size: 16px;
}

.x_old_pm:before {
    font-family: "Font Awesome 5 Free";
    content: "\f2b6";
    font-size: 16px;
}

.x_fw_pm:before {
    font-family: "Font Awesome 5 Free";
    content: "\f2b6";
    position: absolute;
    font-size: 16px;
}

.x_fw_pm:after {
    font-family: "Font Awesome 5 Free";
    content: "\f30b";
    position: relative;
    top: 11px;
    left: 5px;
    color: #5b94c5;
    font-size: 16px;
    font-weight: 900;
}

.x_re_pm:before {
    font-family: "Font Awesome 5 Free";
    content: "\f2b6";
    position: absolute;
    font-size: 16px;
}

.x_re_pm:after {
    font-family: "Font Awesome 5 Free";
    content: "\f30a";
    position: relative;
    top: 11px;
    right: 5px;
    color: #663096;
    font-size: 16px;
    font-weight: 900;
}

*Simply updated for FA5 usage while compiling, creating and updating all FA5 related tuts here: https://community.mybb.com/thread-220017...15632.html

Update: This tutorial so far has not touched the icons in pm tracking so we need to account for that like so:

Example:
[attachment=41196]

in private_tracking_unreadmessage:

Find:

<img src="{$theme['imgdir']}/new_pm.png" alt="" />


Replace with:

<span class="x_new_pm"></span>


in private_tracking_readmessage:

Find:

<img src="{$theme['imgdir']}/old_pm.png" alt="" />


Replace with:

<span class="x_old_pm"></span>