Example #1
0
 protected function _content()
 {
     global $dbtable_prefix;
     global $page_last_modified_time;
     switch ($this->config['mode']) {
         case 'new':
             $query = "SELECT a.`fk_user_id`,UNIX_TIMESTAMP(a.`last_changed`) as `last_changed` FROM `{$dbtable_prefix}user_profiles` a WHERE a.`_photo`<>'' AND a.`del`=0 AND a.`status`=" . STAT_APPROVED . " ORDER BY a.`date_added` DESC";
             break;
         case 'vote':
             $query = "SELECT a.`fk_user_id`,UNIX_TIMESTAMP(b.`last_changed`) as `last_changed` FROM `{$dbtable_prefix}user_stats` a,`{$dbtable_prefix}user_profiles` b WHERE a.`fk_user_id`=b.`fk_user_id` AND a.`stat`='vote_score' AND b.`_photo`<>'' AND b.`status`=" . STAT_APPROVED . " AND b.`del`=0 ORDER BY a.`value` DESC";
             break;
         case 'views':
             $query = "SELECT a.`fk_user_id`,UNIX_TIMESTAMP(b.`last_changed`) as `last_changed` FROM `{$dbtable_prefix}user_stats` a,`{$dbtable_prefix}user_profiles` b WHERE a.`fk_user_id`=b.`fk_user_id` AND a.`stat`='total_views' AND b.`_photo`<>'' AND b.`status`=" . STAT_APPROVED . " AND b.`del`=0 ORDER BY a.`value` DESC";
             break;
         case 'comm':
             $query = "SELECT a.`fk_user_id`,UNIX_TIMESTAMP(b.`last_changed`) as `last_changed` FROM `{$dbtable_prefix}user_stats` a,`{$dbtable_prefix}user_profiles` b WHERE a.`fk_user_id`=b.`fk_user_id` AND a.`stat`='total_comments' AND b.`_photo`<>'' AND b.`status`=" . STAT_APPROVED . " AND b.`del`=0 ORDER BY a.`value` DESC";
             break;
     }
     $query .= " LIMIT 15";
     if (!($res = @mysql_query($query))) {
         trigger_error(mysql_error(), E_USER_ERROR);
     }
     $user_ids = array();
     while ($rsrow = mysql_fetch_assoc($res)) {
         $user_ids[] = $rsrow['fk_user_id'];
         if ($page_last_modified_time < $rsrow['last_changed']) {
             $page_last_modified_time = $rsrow['last_changed'];
         }
     }
     if (!empty($user_ids)) {
         require_once _BASEPATH_ . '/includes/classes/user_cache.class.php';
         $user_cache = new user_cache();
         $loop = $user_cache->get_cache_tpl($user_ids, 'result_user');
         unset($user_cache);
         if (!empty($loop)) {
             $loop[0]['class'] = 'first';
             $loop = array_slice($loop, 0, $this->config['total']);
             $this->tpl->set_file('widget.content', 'widgets/members/display.html');
             $this->tpl->set_loop('loop', $loop);
             $this->tpl->process('widget.content', 'widget.content', TPL_LOOP | TPL_OPTLOOP);
             $this->tpl->drop_loop('loop');
             unset($loop);
         }
     }
 }
Example #2
0
                ++$j;
            }
        } else {
            // not allowed to view this member info
            // maybe we should say something here like "upgrade your membership to view this info"...
            $tpl->set_var('temp', $pcat);
            $temp = $tpl->process('', 'no_access');
            $categs[$j]['content'] = $temp;
            ++$j;
        }
    }
    $categs[count($categs) - 1]['class'] = 'last';
    // get some friends
    $loop_friends = get_network_members($output['uid'], NET_FRIENDS, 4);
    if (!empty($loop_friends)) {
        $loop_friends = $user_cache->get_cache_tpl($loop_friends, 'result_user');
    }
    unset($user_cache);
    // comments
    $loop_comments = create_comments_loop('user', $output['uid'], $output);
    $output['pic_width'] = get_site_option('pic_width', 'core_photo');
    $tplvars['title'] = sprintf($GLOBALS['_lang'][152], $output['user']);
    $tplvars['page_title'] = $output['user'];
} else {
    $topass['message']['type'] = MESSAGE_ERROR;
    $topass['message']['text'] = $GLOBALS['_lang'][7];
    redirect2page('info.php', $topass);
}
$output['lang_273'] = sanitize_and_format($GLOBALS['_lang'][273], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$output['lang_274'] = sanitize_and_format($GLOBALS['_lang'][274], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$output['lang_256'] = sanitize_and_format($GLOBALS['_lang'][256], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
Example #3
0
require _BASEPATH_ . '/skins_site/' . get_my_skin() . '/lang/net.inc.php';
check_login_member('manage_networks');
$tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs');
require _BASEPATH_ . '/includes/classes/user_cache.class.php';
$user_cache = new user_cache(get_my_skin());
$query = "SELECT `net_id`,`network` FROM `{$dbtable_prefix}networks`";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$networks = array();
$i = 0;
while ($rsrow = mysql_fetch_assoc($res)) {
    $rsrow['network'] = sanitize_and_format($rsrow['network'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
    $net_members = get_network_members($_SESSION[_LICENSE_KEY_]['user']['user_id'], $rsrow['net_id'], 4);
    if (!empty($net_members)) {
        $rsrow['members'] = $user_cache->get_cache_tpl($net_members, 'result_user');
    }
    if (!empty($rsrow['members'])) {
        $rsrow['see_all'] = true;
        $networks[] = $rsrow;
    }
}
$output = array();
$output['user_id'] = $_SESSION[_LICENSE_KEY_]['user']['user_id'];
$tpl->set_file('content', 'my_networks.html');
$tpl->set_var('output', $output);
$tpl->set_loop('networks', $networks);
$tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTLOOP | TPL_NOLOOP);
$tpl->drop_loop('networks');
unset($networks);
$tplvars['title'] = $GLOBALS['_lang'][240];