Esempio n. 1
0
            // 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]);
$output['return2me'] = 'profile.php';
if (!empty($_SERVER['QUERY_STRING'])) {
    $output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
Esempio n. 2
0
            $output = array_merge($output, $temp);
            if ($output['date_posted'] > $page_last_modified_time) {
                $page_last_modified_time = $output['date_posted'];
            }
            $output['date_posted'] = strftime($_SESSION[_LICENSE_KEY_]['user']['prefs']['datetime_format'], $output['date_posted'] + $_SESSION[_LICENSE_KEY_]['user']['prefs']['time_offset']);
            if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $output['fk_user_id'] == $_SESSION[_LICENSE_KEY_]['user']['user_id']) {
                $output['post_owner'] = true;
            }
            if (isset($_list_of_online_members[$output['fk_user_id']])) {
                $output['is_online'] = 'member_online';
                $output['user_online_status'] = $GLOBALS['_lang'][102];
            } else {
                $output['user_online_status'] = $GLOBALS['_lang'][103];
            }
            // comments
            $loop_comments = create_comments_loop('blog', $output['post_id'], $output);
        } else {
            $topass['message']['type'] = MESSAGE_ERROR;
            $topass['message']['text'] = $GLOBALS['_lang'][2];
            redirect2page('info.php', $topass);
        }
        unset($blog_posts_cache);
    } else {
        $topass['message']['type'] = MESSAGE_ERROR;
        $topass['message']['text'] = $GLOBALS['_lang'][2];
        redirect2page('info.php', $topass);
    }
} else {
    $topass['message']['type'] = MESSAGE_ERROR;
    $topass['message']['text'] = $GLOBALS['_lang'][2];
    redirect2page('info.php', $topass);
Esempio n. 3
0
 $output['caption'] = sanitize_and_format($output['caption'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
 if (!empty($output['allow_rating'])) {
     if ($output['stat_votes'] > 0) {
         $output['rate_num'] = number_format($output['stat_votes_total'] / $output['stat_votes'], 1);
     } else {
         $output['rate_num'] = 0;
     }
     $output['rate_percent'] = (int) ($output['rate_num'] * 100 / 5);
 } else {
     unset($output['allow_rating']);
 }
 if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $output['fk_user_id'] == $_SESSION[_LICENSE_KEY_]['user']['user_id']) {
     $output['photo_owner'] = true;
 }
 // comments
 $loop_comments = create_comments_loop('photo', $output['photo_id'], $output);
 // prev/next stuff
 $query = "SELECT max(`photo_id`) FROM `{$dbtable_prefix}user_photos` WHERE `photo_id`<{$photo_id} AND `fk_user_id`=" . $output['fk_user_id'];
 if (empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) || $output['fk_user_id'] != $_SESSION[_LICENSE_KEY_]['user']['user_id'] && !$is_friend) {
     $query .= " AND `is_private`=0";
 }
 if (!($res = @mysql_query($query))) {
     trigger_error(mysql_error(), E_USER_ERROR);
 }
 if (mysql_num_rows($res)) {
     $output['previous'] = mysql_result($res, 0, 0);
 }
 $query = "SELECT min(`photo_id`) FROM `{$dbtable_prefix}user_photos` WHERE `photo_id`>{$photo_id} AND `fk_user_id`=" . $output['fk_user_id'];
 if (empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) || $output['fk_user_id'] != $_SESSION[_LICENSE_KEY_]['user']['user_id'] && !$is_friend) {
     $query .= " AND `is_private`=0";
 }
Esempio n. 4
0
$i = 0;
foreach ($_pcats as $pcat_id => $pcat) {
    $fields = array();
    for ($j = 0; isset($pcat['fields'][$j]); ++$j) {
        if ($_pfields[$pcat['fields'][$j]]->config['visible']) {
            $fields[] = array('field' => $_pfields[$pcat['fields'][$j]]->display(), 'label' => $_pfields[$pcat['fields'][$j]]->config['label'], 'dbfield' => $_pfields[$pcat['fields'][$j]]->config['dbfield']);
        }
    }
    $categs[$i]['pcat_name'] = $pcat['pcat_name'];
    $categs[$i]['pcat_id'] = $pcat_id;
    $categs[$i]['fields'] = $fields;
    ++$i;
}
$output['pic_width'] = get_site_option('pic_width', 'core_photo');
// comments
$loop_comments = create_comments_loop('user', $_SESSION[_LICENSE_KEY_]['user']['user_id'], $output);
$output['lang_256'] = sanitize_and_format($GLOBALS['_lang'][256], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]);
$output['return2me'] = 'my_profile.php';
if (!empty($_SERVER['QUERY_STRING'])) {
    $output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
$tpl->set_file('content', 'my_profile.html');
$tpl->set_loop('user_photos', $user_photos);
$tpl->set_loop('categs', $categs);
$tpl->set_loop('loop_comments', $loop_comments);
$tpl->set_var('output', $output);
$tpl->set_var('tplvars', $tplvars);
$tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTLOOP | TPL_OPTIONAL);
$tpl->drop_loop('categs');
unset($categs);