Exemple #1
0
/**
 * Return a list of how many users are currently online, rendered as a view.
 *
 * @return string
 */
function get_online_users()
{
    $count = find_active_users(600, 10, 0, true);
    $objects = find_active_users(600, 10);
    if ($objects) {
        return elgg_view_entity_list($objects, array('count' => $count, 'limit' => 10));
    }
}
/**
 * Return a list of how many users are currently online, rendered as a view.
 */
function get_online_users()
{
    $offset = get_input('offset', 0);
    $count = count(find_active_users(600, 9999));
    $objects = find_active_users(600, 10, $offset);
    if ($objects) {
        return elgg_view_entity_list($objects, $count, $offset, 10, false);
    }
}
/**
 * Return a list of how many users are currently online, rendered as a view.
 *
 * @return string
 */
function get_online_users()
{
    $offset = get_input('offset', 0);
    $count = find_active_users(600, 10, $offset, true);
    $objects = find_active_users(600, 10, $offset);
    if ($objects) {
        return elgg_view_entity_list($objects, array('count' => $count, 'offset' => $offset, 'limit' => 10));
    }
}
Exemple #4
0
/**
 * Return a list of how many users are currently online, rendered as a view.
 *
 * @return string
 */
function get_online_users()
{
    $limit = max(0, (int) get_input("limit", 10));
    $offset = max(0, (int) get_input("offset", 0));
    $count = find_active_users(600, $limit, $offset, true);
    $objects = find_active_users(600, $limit, $offset);
    if ($objects) {
        return elgg_view_entity_list($objects, array('count' => $count, 'limit' => $limit, 'offset' => $offset));
    }
    return '';
}
     $content = elgg_list_entities($params);
     break;
 case 'popular':
     $options['base_url'] = $base_url;
     $options['relationship'] = 'friend';
     $options['inverse_relationship'] = false;
     $options['joins'] = array("JOIN " . $dbprefix . "users_entity u ON e.guid=u.guid");
     if (!elgg_is_admin_logged_in()) {
         $options['wheres'] = array("(u.banned = 'no')");
     }
     $content = elgg_list_entities_from_relationship_count($options);
     break;
 case 'online':
 default:
     $offset = get_input('offset', 0);
     $count = find_active_users(array('seconds' => 600, 'limit' => 10, 'offset' => $offset, 'count' => true));
     $objects = gc_find_active_users(600, 10, $offset);
     if ($objects) {
         $content = elgg_view_entity_list($objects, array('count' => $count, 'offset' => $offset, 'base_url' => $base_url, 'limit' => 10));
     }
     break;
 case 'newest':
     $options['base_url'] = $base_url;
     $options['joins'] = array("JOIN " . $dbprefix . "users_entity u ON e.guid=u.guid");
     if (!elgg_is_admin_logged_in()) {
         $options['wheres'] = array("(u.banned = 'no')");
     }
     $content = elgg_list_entities($options);
     break;
 case 'alphabetical':
 case 'all':
Exemple #6
0
<?php

$users_max = elgg_get_plugin_setting("maxIcons", "avatar_wall");
if (!$users_max) {
    $users_max = 300;
}
$onlyWithAvatar = elgg_get_plugin_setting("onlyWithAvatar", "avatar_wall");
if (empty($onlyWithAvatar) || $onlyWithAvatar == "no") {
    $users = find_active_users(array('seconds' => 604800, 'limit' => $users_max));
} else {
    $db_prefix = elgg_get_config('dbprefix');
    $time = time() - 604800;
    $users = elgg_get_entities_from_metadata(array('metadata_names' => 'icontime', 'types' => 'user', 'limit' => $users_max, 'offset' => 0, 'joins' => array("join {$db_prefix}users_entity u on e.guid = u.guid"), 'wheres' => array("u.last_action >= {$time}"), 'order_by' => "u.last_action desc", 'full_view' => false, 'pagination' => false));
}
$wallIconSize = elgg_get_plugin_setting("wallIconSize", "avatar_wall");
if (!$wallIconSize) {
    $wallIconSize = "small";
}
shuffle($users);
?>
<div align='center'>
<?php 
foreach ($users as $user) {
    echo "<a href='" . $user->getURL() . "'><img class='wall_icons' alt='" . $user->name . "' src='" . $user->getIconURL($wallIconSize) . "'><a/>";
}
?>
</div>
Exemple #7
0
// Get entity statistics
$entity_stats = get_entity_statistics();
$selected_entities = $vars["entity"]->selected_entities;
?>
<table class='elgg-table'>
	<?php 
foreach ($entity_stats as $k => $entry) {
    arsort($entry);
    foreach ($entry as $a => $b) {
        $key = $k . "|" . $a;
        if (empty($selected_entities) || in_array($key, $selected_entities)) {
            if ($a == "__base__") {
                $a = elgg_echo("item:{$k}");
                if ($k == "user") {
                    $b .= " (" . count(find_active_users(600, 9999)) . " " . elgg_echo("online") . ")";
                }
            } else {
                if (empty($a)) {
                    $a = elgg_echo("item:{$k}");
                } else {
                    $a = elgg_echo("item:{$k}:{$a}");
                }
                if (empty($a)) {
                    $a = "{$k} {$a}";
                }
            }
            echo "<tr><td>{$a}:</td><td>{$b}</td></tr>";
        }
    }
}
Exemple #8
0
<?php

$count = find_active_users(array(), 10, 0, true);
echo elgg_echo("admin:statistics:label:onlineusers") . ": <strong>{$count}</strong>";
?>
<script type="text/javascript">
	setTimeout(function(){ 
	
		$(".elgg-widget-instance-online_user_count > .elgg-body > .elgg-widget-content").load(elgg.normalize_url("ajax/view/widgets/online_user_count/content"));
	
	}, 60 * 1000);
</script>
<?php

require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
$limit = get_input('count', 16);
$mode = get_input('type', 10);
switch ($mode) {
    case "m_latest":
        //$members = get_entities_from_metadata('icontime', '', 'user', '', 0, 10);
        $members = get_entities("user", "", 0, '', $limit, 0);
        break;
    case "m_views":
        $members = get_entities_by_relationship_count('friend', true, '', '', 0, $limit);
        break;
    case "m_com":
        $members = find_active_users(600, $limit, $offset);
        break;
}
if (isset($members)) {
    //display member avatars
    foreach ($members as $member) {
        echo "<div class=\"index_members\">";
        echo elgg_view("profile/icon", array('entity' => $member, 'size' => 'small'));
        echo "</div>";
    }
}
?>
<div class="clearfloat"/>
Exemple #10
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */
echo '<div class="spotlight clearfloat">';
echo '<div class="spotlight-column">';
echo elgg_view('page/elements/spotlight/module', array('title' => elgg_echo('about:lorea'), 'items' => array('http://lorea.org/' => elgg_echo('about:blog'), 'https://n-1.cc/g/lorea/' => elgg_echo('about:group'), 'https://github.com/lorea/' => elgg_echo('dev:repo'))));
echo '</div><div class="spotlight-column">';
echo elgg_view('page/elements/spotlight/module', array('title' => elgg_echo('help:help'), 'items' => array('https://n-1.cc/faq/' => elgg_echo('help:faq'), 'https://n-1.cc/dokuwiki/9394' => elgg_echo('help:howto'), 'https://n-1.cc/g/help' => elgg_echo('help:group'), 'https://n-1.cc/g/bughunting/' => elgg_echo('dev:bughunting'), 'https://n-1.cc/g/lorea+seeds' => elgg_echo('help:seeds'))));
echo '</div><div class="spotlight-column">';
echo elgg_view('page/elements/spotlight/module', array('title' => elgg_echo('dev:dev'), 'items' => array('https://n-1.cc/g/lorea+code' => elgg_echo('dev:group'), 'https://n-1.cc/g/testers-and-usability/' => elgg_echo('dev:testers'), 'https://n-1.cc/g/documentation/' => elgg_echo('dev:documentation'), 'https://n-1.cc/g/communication' => elgg_echo('dev:communication'), 'https://n-1.cc/g/lorea+babel-fish' => elgg_echo('dev:translation'), 'https://n-1.cc/g/lorea+founds' => elgg_echo('dev:financiation'))));
echo '</div><div class="spotlight-column">';
$members = get_number_users();
$online = find_active_users(600, 0, 0, true);
$groups = elgg_get_entities(array('type' => 'group', 'count' => true, 'limit' => 0));
$assemblies = elgg_get_entities(array('type' => 'object', 'subtypes' => array('assembly'), 'count' => true, 'limit' => 0));
$pages = elgg_get_entities(array('type' => 'object', 'subtypes' => array('page', 'page_top', 'etherpad', 'subpad'), 'count' => true, 'limit' => 0));
$blog = elgg_get_entities(array('type' => 'object', 'subtype' => 'blog', 'count' => true, 'limit' => 0));
$file = elgg_get_entities(array('type' => 'object', 'subtype' => 'file', 'count' => true, 'limit' => 0));
//$agendas     = elgg_get_entities(array('type' => 'object', 'subtype' => 'scheduling', 'count' => true, 'limit' => 0));
$tasks = elgg_get_entities(array('type' => 'object', 'subtype' => 'task', 'count' => true, 'limit' => 0));
$wires = elgg_get_entities(array('type' => 'object', 'subtype' => 'thewire', 'count' => true, 'limit' => 0));
$calendars = elgg_get_entities(array('type' => 'object', 'subtype' => 'event_calendar', 'count' => true, 'limit' => 0));
$ads = elgg_get_entities(array('type' => 'object', 'subtype' => 'market', 'count' => true, 'limit' => 0));
$polls = elgg_get_entities(array('type' => 'object', 'subtype' => 'poll', 'count' => true, 'limit' => 0));
echo elgg_view('page/elements/spotlight/module', array('title' => elgg_echo('stats:stats'), 'items' => array('members/online' => $online . ' ' . elgg_echo('members:label:online'), 'members' => $members . ' ' . elgg_echo('members'), 'wires/all' => $wires . ' ' . elgg_echo('item:object:thewire'), 'groups/all' => $groups . ' ' . elgg_echo('item:group'), 'assemblies/all' => $assemblies . ' ' . elgg_echo('stats:assemblies'), 'tasks/all' => $tasks . ' ' . elgg_echo('stats:tasks'), 'market/all' => $ads . ' ' . elgg_echo('item:object:market'), 'calendars/all' => $calendars . ' ' . elgg_echo('item:object:event_calendar'), 'pages/all' => $pages . ' ' . elgg_echo('item:object:page'), 'blog/all' => $blog . ' ' . elgg_echo('item:object:blog'), 'file/all' => $file . ' ' . elgg_echo('item:object:file'), 'poll/all' => $polls . ' ' . elgg_echo('item:object:poll'))));
echo '</div>';
echo '</div>';
 * with blue border around users' avatars who are friends of logged in user
 *
 * @package users_online
 * @author iionly
 * @copyright iionly 2014
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @website https://github.com/iionly
 * @email iionly@gmx.de
 */
// limit number of users to be displayed
$limit = elgg_get_plugin_setting('user_listing_limit', 'users_online');
if (!$limit) {
    $limit = 20;
}
// active users within the last 5 minutes
$users_online = find_active_users(array('seconds' => 300, 'limit' => $limit));
$visitors = "<div><table border='0' class='usersonline' cellspacing='0' cellpadding='0'><tr>";
$visitors .= "<td class='usersonlinetext'><h3>" . elgg_echo('users_online:online') . "</h3></td>";
if ($users_online) {
    $visitors .= "<td>";
    foreach ($users_online as $user) {
        $spacer_url = elgg_get_simplecache_url("spacer.gif");
        $name = htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8', false);
        $username = $user->username;
        $icon_url = elgg_format_url($user->getIconURL('tiny'));
        $icon = elgg_view('output/img', array('src' => $spacer_url, 'alt' => $name, 'title' => $name, 'class' => '', 'style' => "background: url({$icon_url}) no-repeat;"));
        if ($user->isFriend()) {
            $class = "usersonlinefriendicon";
        } else {
            $class = "usersonlineicon";
        }
Exemple #12
0
<?php

/**
 * Online users widget
 */
$count = find_active_users(600, 10, 0, true);
$objects = find_active_users(600, 10);
if ($objects) {
    echo elgg_view_entity_list($objects, array('count' => $count, 'limit' => 10, 'pagination' => false));
}
Exemple #13
0
<?php

/**
 * Online users widget
 */
$num = (int) $vars['entity']->num_display;
$count = find_active_users(600, $num, 0, true);
$objects = find_active_users(600, $num);
if ($objects) {
    echo elgg_view_entity_list($objects, array('count' => $count, 'limit' => $num));
}
 * iZAP izap profile visitor
 *
 * @license GNU Public License version 3
 * @author iZAP Team "<*****@*****.**>"
 * @link http://www.izap.in/
 *
 * iionly; Version 1.8 and newer
 */
$MaxVistors = $vars['entity']->num_display;
if (!$MaxVistors) {
    $MaxVistors = 5;
}
$VisitorArray = izapVisitorList();
if (!empty($VisitorArray) && count($VisitorArray) > 0) {
    $VisitorArray = array_slice($VisitorArray, 0, $MaxVistors);
    $online = find_active_users(array('seconds' => 600, 'limit' => false));
    if (!empty($online) && count($online) > 0) {
        $onlineUsers = array();
        foreach ($online as $key => $entity) {
            $onlineUsers[] = $entity->guid;
        }
    }
    foreach ($VisitorArray as $VisitorGuid) {
        $VisitorEntity = get_entity($VisitorGuid);
        $icon = elgg_view_entity_icon($VisitorEntity, 'small');
        if (is_array($onlineUsers)) {
            if (in_array($VisitorGuid, $onlineUsers)) {
                $Visitors .= '<div class="izapWrapperOnline">' . $icon . '</div>';
            } else {
                $Visitors .= '<div class="izapWrapper">' . $icon . '</div>';
            }
Exemple #15
0
// Get entity statistics
$entity_stats = get_entity_statistics();
$selected_entities = $vars["entity"]->selected_entities;
if ($entity_stats) {
    ?>
	<table class='elgg-table'>
	<?php 
    foreach ($entity_stats as $k => $entry) {
        arsort($entry);
        foreach ($entry as $a => $b) {
            $key = $k . "|" . $a;
            if (empty($selected_entities) || in_array($key, $selected_entities)) {
                if ($a == "__base__") {
                    $a = elgg_echo("item:{$k}");
                    if ($k == "user") {
                        $b .= " (" . elgg_echo("admin:users:online") . " " . find_active_users(array("seconds" => 600, "count" => true)) . ")";
                    }
                } else {
                    if (empty($a)) {
                        $a = elgg_echo("item:{$k}");
                    } else {
                        $a = elgg_echo("item:{$k}:{$a}");
                    }
                    if (empty($a)) {
                        $a = "{$k} {$a}";
                    }
                }
                echo "<tr><td>{$a}:</td><td>{$b}</td></tr>";
            }
        }
    }
Exemple #16
0
<?php

$options = array("type" => "user", "relationship" => "member_of_site", "relationship_guid" => elgg_get_site_entity()->guid, "inverse_relationship" => true, "count" => true);
$count_users = elgg_get_entities_from_relationship($options);
$count_online = find_active_users(600, $limit, $offset, true);
echo "<div class='center'>";
echo "<div>" . elgg_view_icon("bar-chart-o") . "</div>";
echo "<div>" . $count_users . " " . strtolower(elgg_echo("item:user")) . "</div>";
echo "<div>" . elgg_view_icon("users") . " " . $count_online . " " . elgg_echo("online") . "</div>";
echo "</div>";
Exemple #17
0
 function method_getElggData($params, $error)
 {
     global $CONFIG;
     if (!$this->is_loggedin()) {
         return array("err" => SESSION_ERROR);
     }
     $owner = $_SESSION['user'];
     $request = $params[0];
     // erlaubte Abfragen: friends, contacs, user
     $filter = $params[1];
     $friendselect = $params[2];
     //    $firstRow = $params[3];
     //    $lastRow = $params[3];
     $entry["data"] = array();
     $entry["colnames"] = array();
     $entry["colwidths"] = array();
     if ($request == "demo" && $friendselect == elgg_echo('ElggMan:rb:view:user') && $this->is_admin()) {
         $varColumns = $this->getVarColumnsUser();
     } else {
         $varColumns = $this->getVarColumns();
     }
     $limit = MAXENTRIES;
     switch ($request) {
         case "friends":
             switch ($friendselect) {
                 case elgg_echo('ElggMan:friends'):
                     $users = $owner->getFriends("", MAXENTRIES, $offset = 0);
                     break;
                 case elgg_echo('ElggMan:friends:incoming'):
                     $in_count = get_entities_from_relationship('friendrequest', $owner->guid, true, "", "", 0, "", 0, 0, true);
                     $users = get_entities_from_relationship("friendrequest", $owner->guid, true, "", "", 0, "", $in_count);
                     break;
                 case elgg_echo('ElggMan:friends:outgoing'):
                     $sent_count = get_entities_from_relationship("friendrequest", $owner->guid, false, "user", "", 0, "", 0, 0, true);
                     $users = get_entities_from_relationship("friendrequest", $owner->guid, false, "user", "", 0, "", $sent_count);
             }
             // switch
             break;
         case "contacts":
             $users = $owner->getObjects("PrivateContact", MAXENTRIES, $offset = 0);
             break;
         case "notActivatedUsers":
             access_show_hidden_entities(true);
             $prefix = $CONFIG->dbprefix;
             $sql = "SELECT guid  FROM {$prefix}entities WHERE type = 'user' and enabled <> 'yes'";
             $result = get_data($sql);
             if (is_array($result)) {
                 foreach ($result as $row) {
                     $users[] = westorElggMan_get_entity($row->guid);
                 }
             }
             break;
         case "usersOnline":
             $users = find_active_users(600, MAXENTRIES);
             break;
         case "demo":
             $limit = 2;
             $entry["helpTxt"] = elgg_echo('ElggMan:helpTableColumns');
         default:
             // "users" || "blockedUsers":
             $users = westorElggMan_get_entities($type = "user", $subtype = "", $owner_guid = 0, $order_by = "", $limit);
             break;
     }
     // switch
     if (is_array($users)) {
         foreach ($users as $user) {
             if ($request == "users" && $user->isBanned()) {
                 continue;
             }
             if ($request == "blockedUsers" && !$user->isBanned()) {
                 continue;
             }
             $name = $this->getEntityProperty($user, elgg_echo('ElggMan:displayname'));
             if ($filter) {
                 // Filter angegeben
                 if (stripos($name, $filter) === false) {
                     continue;
                 }
             }
             $line = array($user->getGUID(), false, $this->getEntityProperty($user, 'userIcon'), $name);
             if (is_array($varColumns)) {
                 foreach ($varColumns as $varColumn) {
                     if ($varColumn == elgg_echo('ElggMan_:cMobile')) {
                         $line[] = $this->getEntityProperty($user, 'smsIcon');
                     } else {
                         $line[] = $this->getEntityProperty($user, $varColumn);
                     }
                 }
             }
             $entry["data"][] = $line;
             // f = friend
             // a = admin
             // s = self
             $entry["metadata"][$user->getGUID()] = array('f' => is_object($owner->isFriendsWith($user->guid)), 'a' => westorElggMan_isAdmin($user), 's' => $owner->getGUID() == $user->getGUID(), 'u' => $user->getURL());
         }
     }
     $entry["colnames"] = array('', '', '', elgg_echo("ElggMan:displayname"));
     $entry["colnames"] = array_merge($entry["colnames"], $varColumns);
     if (!$this->is_admin() || $request == "demo" && $friendselect == elgg_echo('ElggMan:rb:view:user')) {
         $entry["colwidths"] = $this->getAllColumnWidths("user");
     } else {
         $entry["colwidths"] = $this->getAllColumnWidths("admin");
     }
     // list the colrenderer to use, null for default
     $entry["colrenderer"] = array(null, 'bool', 'img', null);
     $i = 4;
     if (is_array($varColumns)) {
         foreach ($varColumns as $varColumn) {
             if ($varColumn == elgg_echo('ElggMan_:cMobile')) {
                 $entry["colrenderer"][] = 'img';
                 $entry["colwidths"][$i] = 30;
             } else {
                 $entry["colrenderer"][] = null;
             }
             $i++;
         }
     }
     //    $entry["colwidths"] = array(0, 22, 22, 180);
     //    foreach($varColumns as $varColumn){
     //      if ($varColumn == elgg_echo('ElggMan_:cSince') || $varColumn == elgg_echo('ElggMan_:cLastLogin') || $varColumn == elgg_echo('ElggMan_:cLastAction') ) {
     //        $entry["colwidths"][] = 80;
     //      } else {
     //        $entry["colwidths"][] = 170;
     //      }
     //    }
     return $entry;
 }