//can't use IF_MODIFIED_SINCE for logged in users as has no concept as uniqueness customCacheControl($mtime, $cacheid, $USER->user_id == 0); } else { $template = 'static_404.tpl'; } if (!$smarty->is_cached($template, $cacheid)) { if (count($page)) { $CONF['global_thumb_limit'] *= 2; $CONF['post_thumb_limit'] *= 2; $smarty->assign($page); if (!empty($page['extract'])) { $smarty->assign('meta_description', "User contributed article about, " . $page['extract']); } if (!empty($page['gridsquare_id'])) { $square = new GridSquare(); $square->loadFromId($page['gridsquare_id']); $smarty->assign('grid_reference', $square->grid_reference); require_once 'geograph/conversions.class.php'; $conv = new Conversions(); list($lat, $long) = $conv->gridsquare_to_wgs84($square); $smarty->assign('lat', $lat); $smarty->assign('long', $long); } if (preg_match('/\\bgeograph\\b/i', $page['category_name'])) { $db->Execute("set @last=0"); $users = $db->getAll("select realname,modifier,update_time,if(approved = @last,1,0) as same,@last := approved \r\n\t\t\tfrom article_revisions \r\n\t\t\tleft join user on (article_revisions.modifier = user.user_id)\r\n\t\t\twhere article_id = {$page['article_id']}"); $arr = array(); foreach ($users as $idx => $row) { if ($row['same'] == 1 && $row['modifier'] != $page['user_id'] && !isset($arr[$row['modifier']])) { $arr[$row['modifier']] = "<a href=\"/profile/{$row['modifier']}\">" . htmlentities2($row['realname']) . "</a>"; }
$item = new FeedItem(); $item->title = date('d/m/Y: ', strtotime($recordSet->fields['created'])) . $recordSet->fields['title']; //htmlspecialchars is called on link so dont use & $item->link = "http://{$_SERVER['HTTP_HOST']}/events/event.php?id={$recordSet->fields['geoevent_id']}"; $item->guid = $item->link; $description = $recordSet->fields['description']; if (strlen($description) > 160) { $description = substr($description, 0, 157) . "..."; } $description .= "<br/><br/><a href=\"{$item->link}\">More details of this event</a>"; $item->description = $description; $item->date = strtotime($recordSet->fields['created']); $item->author = $recordSet->fields['realname']; if (($format == 'KML' || $format == 'GeoRSS' || $format == 'GPX') && $recordSet->fields['gridsquare_id']) { $gridsquare = new GridSquare(); $grid_ok = $gridsquare->loadFromId($recordSet->fields['gridsquare_id']); if ($grid_ok) { list($item->lat, $item->long) = $conv->internal_to_wgs84($recordSet->fields['x'], $recordSet->fields['y']); } $rss->addItem($item); } elseif ($format != 'KML') { $rss->addItem($item); } $recordSet->MoveNext(); } header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
/** * get a url that will zoom us out one level from this gridsquare * @access public */ function getGridSquareToken($gridsquare) { if (is_numeric($gridsquare)) { $id = $gridsquare; $gridsquare = new GridSquare(); $gridsquare->loadFromId($id); } $out = new GeographMapMosaic(); //start with same params $out->setScale(40); $out->setMosaicFactor(2); $out->setCentre($gridsquare->x, $gridsquare->y, true); //true to align to 10x10 map return $out->getToken(); }
function loadByNickname($nickname = 0) { if (!empty($nickname)) { $db = $this->_getDB(); $nickname = $db->Quote($nickname); $arr =& $db->GetRow("select * from user where nickname = {$nickname} limit 1"); //todo check seperate table if (count($arr)) { $this->registered = strlen($arr['rights']) > 0; foreach ($arr as $name => $value) { if (!is_numeric($name)) { $this->{$name} = $value; } } // get user homesquare if (isset($this->home_gridsquare)) { $gs = new GridSquare(); $gs->loadFromId($this->home_gridsquare); $this->grid_reference = $gs->grid_reference; } } } }