Beispiel #1
0
     $page_title = _('mejores notas') . ' | ' . _('menéame');
     $min_date = date("Y-m-d H:00:00", time() - 86400);
     //  about 24 hours
     $where = "post_date > '{$min_date}'";
     $order_by = "ORDER BY post_karma desc";
     $limit = "LIMIT {$offset},{$page_size}";
     $rows = $db->get_var("SELECT count(*) FROM posts where post_date > '{$min_date}'");
     break;
 case '_geo':
     $tab_option = 3;
     $page_title = _('nótame') . ' geo | ' . _('menéame');
     require_once mnminclude . 'geo.php';
     if ($current_user->user_id > 0 && ($latlng = geo_latlng('user', $current_user->user_id))) {
         geo_init('onLoad', $latlng, 5);
     } else {
         geo_init('onLoad', false, 2);
     }
     break;
 case '':
 case '_all':
     $tab_option = 1;
     //$sql = "SELECT SQL_CACHE post_id FROM posts ORDER BY post_id desc limit $offset,$page_size";
     $where = "post_id > 0";
     $order_by = "ORDER BY post_id desc";
     $limit = "LIMIT {$offset},{$page_size}";
     //$rows = $db->get_var("SELECT count(*) FROM posts");
     $rows = Post::count();
     $min_date = date("Y-m-d 00:00:00", time() - 86400 * 10);
     //$rows = $db->get_var("SELECT SQL_CACHE count(*) FROM posts where post_date > '$min_date'");
     $rss_option = "sneakme_rss2.php";
     break;
Beispiel #2
0
// 100 if the user is the current one
if ($globals['external_user_ads'] && !empty($user->adcode)) {
    $globals['user_adcode'] = $user->adcode;
    $globals['user_adchannel'] = $user->adchannel;
    if ($current_user->user_id == $user->id || $current_user->admin) {
        $globals['do_user_ad'] = 100;
    } else {
        $globals['do_user_ad'] = $user->karma * 2;
    }
}
// Load Google GEO
if (!$user->disabled() && $view == 'profile' && $globals['google_maps_api'] && (($globals['latlng'] = $user->get_latlng()) || $current_user->user_id == $user->id)) {
    if ($current_user->user_id == $user->id) {
        geo_init('geo_coder_editor_load', $globals['latlng'], 7, 'user');
    } else {
        geo_init('geo_coder_load', $globals['latlng'], 7, 'user');
    }
    $globals['do_geo'] = true;
}
// Check if it should be index AND if they are valids options, otherwise call do_error()
switch ($view) {
    case 'history':
    case 'shaken':
    case 'friends_shaken':
    case 'friends':
    case 'friends_new':
    case 'friend_of':
    case 'ignored':
    case 'favorites':
        $globals['noindex'] = true;
        break;
Beispiel #3
0
    }
    $current_page = (int) $last_arg;
    array_pop($url_args);
}
switch ($url_args[1]) {
    case '':
        $tab_option = 1;
        $order_field = 'comment_order';
        // Geo check
        if ($globals['google_maps_api']) {
            $link->geo = true;
            $link->latlng = $link->get_latlng();
            if ($link->latlng) {
                geo_init('geo_coder_load', $link->latlng, 5, $link->status);
            } elseif ($link->is_map_editable()) {
                geo_init(null, null);
            }
        }
        if ($globals['comments_page_size'] && $link->comments > $globals['comments_page_size'] * $globals['comments_page_threshold']) {
            if (!$current_page) {
                $current_page = ceil($link->comments / $globals['comments_page_size']);
            }
            $offset = ($current_page - 1) * $globals['comments_page_size'];
            $limit = "LIMIT {$offset}," . $globals['comments_page_size'];
        }
        break;
    case 'best-comments':
        $tab_option = 2;
        if ($globals['comments_page_size'] > 0) {
            $limit = 'LIMIT ' . $globals['comments_page_size'];
        }
Beispiel #4
0
<?php

// The source code packaged with this file is Free Software, Copyright (C) 2007 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'geo.php';
geo_init('onLoad', false, 3);
do_header(_('geovisión'));
do_tabs('main', _('geovisión'), true);
/*** SIDEBAR ****/
echo '<div id="sidebar">';
do_banner_right();
do_vertical_tags();
echo '</div>' . "\n";
/*** END SIDEBAR ***/
echo '<div id="newswrap"><!-- geovision.php -->' . "\n";
echo '<div class="topheading"><h2>actividad de los usuarios geolocalizados</h2></div>';
echo '<div id="map" style="width: 95%; height: 500px;margin:0 0 0 20px"></div></div>';
?>

<script type="text/javascript">
//<![CDATA[
var timestamp = 0;
var period = 10000;
var persistency = 300000;
var counter=0;