Is there an easier way to display the role on profile?

Dominik L Posted in General Discussion 11 months ago

Hello!

I am curious if there is an easier way to display the role "moderator" on profile.

At the moment I am changing role.php under OssnProfile/plugins/default/profile

to

<?php
/**
 * Open Source Social Network
 *
 * @package   Open Source Social Network (OSSN)
 * @author    OSSN Core Team <[email protected]>
 * @copyright (C) OpenTeknik LLC
 * @license   Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
 * @link https://www.opensource-socialnetwork.org/
 */
 
echo "<div class="user-fullname ossn-profile-role">";
if($params["user"]->isAdmin() && $params["user"]->canModerate()){
    echo "<i class="fa fa-star"></i>".ossn_print("admin"); 
} elseif (!$params["user"]->isAdmin() && $params["user"]->canModerate()) {
    echo "<i class="fa fa-star"></i>".ossn_print("moderator-profile");
}
echo "</div>";

this way, there is the moderator role on profile also

Just curious, if there is an easier way

Replies
Indonesian Arsalan Shah Replied 11 months ago

Easy way is you create your own component and replace this file with your custom file in your component.

An other easier was depends on your skills and the logics.