Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Members Module with only avatar

10 years 3 months ago
  • P's Avatar
    Topic Author
  • P
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 4
Licenses:
JomSocial Expired

Dear sirs,
is it possible to show in the module "Community - Members Module" only the members with avatar/picture uploaded?
Thank you.

10 years 3 months ago
Licenses:

Hi P,

its possible. but need customization at jomsocial core functions. and you need re-apply it every upgrade process. because at upgrade process, any core customization will disappear. if you comfortable with this. I will give you the instructions for that.

Regards.
Albert

10 years 3 months ago
  • P's Avatar
    Topic Author
  • P
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 4
Licenses:
JomSocial Expired

Yes please give me the instructions please.
Thank you so much!

10 years 3 months ago
Licenses:

Hi P,

give me time for this

Regards

10 years 3 months ago
Licenses:

Hi P,

first you must backup any files before you make the changes.

for newest members edit /components/com_community/controllers/frontpage.php line 97, changing the code from

$latestMembers = $model->getLatestMember($limit);
to
$latestMembers = $model->getLatestMember($limit, false);

edit /components/com_community/models/user.php around line 174, change the code from
public function getLatestMember($limit = 15) {
    if ($limit == 0)
        return array();
    $limit = ($limit < 0) ? 0 : $limit;

    $config = CFactory::getConfig();
    $db = $this->getDBO();

    $filterquery = '';
    $config = CFactory::getConfig();
    if (!$config->get('privacy_show_admins')) {
        $userModel = CFactory::getModel('User');
        $tmpAdmins = $userModel->getSuperAdmins();

        $admins = array();

        $filterquery .= ' AND ' . $db->quoteName('id') . ' NOT IN(';
        for ($i = 0; $i < count($tmpAdmins); $i++) {
            $admin = $tmpAdmins[$i];
            $filterquery .= $db->Quote($admin->id);
            $filterquery .= $i < count($tmpAdmins) - 1 ? ',' : '';
        }
        $filterquery .= ')';
    }
    $query = 'SELECT * FROM ' . $db->quoteName('#__users') . ' '
            . ' WHERE ' . $db->quoteName('block') . '=' . $db->Quote(0) . ' '
            . $filterquery
            . ' ORDER BY ' . $db->quoteName('registerDate') . ' '
            . ' DESC LIMIT ' . $limit;

    $db->setQuery($query);

    $result = $db->loadObjectList();

    if ($db->getErrorNum()) {
        JError::raiseError(500, $db->stderr());
    }

    $latestMembers = array();

    $uids = array();
    foreach ($result as $m) {
        $uids[] = $m->id;
    }
    CFactory::loadUsers($uids);

    foreach ($result as $row) {
        $latestMembers[] = CFactory::getUser($row->id);
    }
    return $latestMembers;
}
to
public function getLatestMember($limit = 15, $avatar = true) {
    if ($limit == 0)
        return array();
    $limit = ($limit < 0) ? 0 : $limit;

    $config = CFactory::getConfig();
    $db = $this->getDBO();

    $filterquery = '';
    $config = CFactory::getConfig();
    if (!$config->get('privacy_show_admins')) {
        $userModel = CFactory::getModel('User');
        $tmpAdmins = $userModel->getSuperAdmins();

        $admins = array();

        $filterquery .= ' AND ' . $db->quoteName('id') . ' NOT IN(';
        for ($i = 0; $i < count($tmpAdmins); $i++) {
            $admin = $tmpAdmins[$i];
            $filterquery .= $db->Quote($admin->id);
            $filterquery .= $i < count($tmpAdmins) - 1 ? ',' : '';
        }
        $filterquery .= ')';
    }

    $where = '';
    if ($avatar == false) {
        $where = ' AND avatar != "" ';
    }

    $query = 'SELECT ' . $db->quoteName('#__users') . '.* FROM ' . $db->quoteName('#__users') . ' '
            . ' LEFT JOIN ' . $db->quoteName('#__community_users') . ' ON (' . $db->quoteName('#__community_users.userid') . '=' . $db->quoteName('#__users.id') . ') '
            . ' WHERE ' . $db->quoteName('block') . '=' . $db->Quote(0) . $where . ' '
            . $filterquery
            . ' ORDER BY ' . $db->quoteName('registerDate') . ' '
            . ' DESC LIMIT ' . $limit;

    $db->setQuery($query);

    $result = $db->loadObjectList();

    if ($db->getErrorNum()) {
        JError::raiseError(500, $db->stderr());
    }

    $latestMembers = array();

    $uids = array();
    foreach ($result as $m) {
        $uids[] = $m->id;
    }
    CFactory::loadUsers($uids);

    foreach ($result as $row) {
        $latestMembers[] = CFactory::getUser($row->id);
    }
    return $latestMembers;
}

do you need Featured, Active, and Popular also?

the changes will be long, and it will painfull every upgrade process. you need to re-apply again.

Regards

The following user(s) said Thank You: P
10 years 3 months ago
  • P's Avatar
    Topic Author
  • P
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 4
Licenses:
JomSocial Expired

Hi Albetus,
Hi tried but it doesn't change nothing.
I see always all users even the members with joomla default avatar.

10 years 3 months ago
Licenses:

Hi P,

could you please provide me FTP access detail, and administrator access detail (with URL).
I will do it for you.

Regards

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW