예제 #1
0
            $next = $pg + 1;
            $rss->nextURL = "http://{$_SERVER['HTTP_HOST']}/feed/results/" . $_GET['i'] . ($next > 1 ? "/{$next}" : '') . "." . strtolower($format);
        }
        $rss->icon = "http://{$CONF['STATIC_HOST']}/templates/basic/img/logo.gif";
    }
    $images->images =& $images->results;
    /**
     * A user specific feed
     */
} elseif (isset($_GET['u']) && is_numeric($_GET['u'])) {
    $profile = new GeographUser($_GET['u']);
    $rss->description = 'Latest Images by ' . $profile->realname;
    $rss->syndicationURL = "http://{$_SERVER['HTTP_HOST']}/profile/" . intval($_GET['u']) . "/feed/recent." . strtolower($format);
    //lets find some recent photos
    $images = new ImageList();
    $images->getImagesByUser($_GET['u'], array('accepted', 'geograph'), 'gridimage_id desc', 15, false);
    /**
     * general feed of all images
     */
} else {
    $rss->description = 'Latest Images';
    $rss->syndicationURL = "http://{$_SERVER['HTTP_HOST']}/feed/recent." . strtolower($format);
    //lets find some recent photos
    $images = new ImageList(array('accepted', 'geograph'), 'gridimage_id desc', 15);
}
$cnt = count($images->images);
$geoformat = $format == 'KML' || $format == 'GeoRSS' || $format == 'GeoPhotoRSS' || $format == 'GPX' || $format == 'MEDIA';
$photoformat = $format == 'KML' || $format == 'GeoPhotoRSS' || $format == 'BASE' || $format == 'MEDIA';
//create some feed items
for ($i = 0; $i < $cnt; $i++) {
    $item = new FeedItem();
예제 #2
0
             $profile->tickets = 0;
         }
     }
     $smarty->assign_by_ref('profile', $profile);
     $images = new ImageList();
     if ($uid == $USER->user_id || $USER->hasPerm('moderator')) {
         if (isset($_GET['reject']) && empty($_GET['reject'])) {
             $statuses = array('pending', 'accepted', 'geograph');
         } else {
             $statuses = '';
             //all
         }
     } else {
         $statuses = array('accepted', 'geograph');
     }
     $images->getImagesByUser($uid, $statuses, 'gridimage_id desc', $limit, true);
     $images->assignSmarty($smarty, 'userimages');
     if (count($images->images) == $limit) {
         $smarty->assign('limit', $limit);
     }
     if (count($images->images)) {
         $overview = new GeographMapMosaic('overview');
         $overview->type_or_user = $uid;
         $overview->assignToSmarty($smarty, 'overview');
     }
     $profile->md5_email = md5(strtolower($profile->email));
 } else {
     $profile = new GeographUser();
     $profile->user_id = $uid;
     if ($uid == $USER->user_id) {
         if (empty($_SESSION['last_ticket_time']) || $USER->last_ticket_time > $_SESSION['last_ticket_time']) {
예제 #3
0
 function handleUserTimeline()
 {
     $uid = intval($this->params[0]);
     $_GET['key'] = $this->params[1];
     $profile = new GeographUser($uid);
     if ($profile->realname) {
         header("Content-Type:text/xml");
         echo "<data>\n";
         $images = new ImageList();
         $images->getImagesByUser($uid, array('accepted', 'geograph'), 'RAND()', 200);
         foreach ($images->images as $i => $image) {
             if (!preg_match('/00(-|$)/', $image->imagetaken)) {
                 $bits = explode('-', $image->imagetaken);
                 $date = mktime(0, 0, 0, $bits[1], $bits[2], $bits[0]);
                 printf("\t<event start=\"%s\" title=\"%s\">%s &lt;b&gt;%s&lt;/b&gt;&lt;br/&gt; %s</event>\n", date('M d Y 00:00:00', $date) . ' GMT', htmlentities2($image->title), htmlentities("<a href=\"/photo/{$image->gridimage_id}\">" . $image->getThumbnail(120, 120) . "</a>"), $image->grid_reference, htmlentities2(GeographLinks($image->comment)));
             }
         }
         echo "</data>\n";
     } else {
         $this->error("Invalid User id {$uid}");
     }
 }