本文整理汇总了PHP中GeographPage类的典型用法代码示例。如果您正苦于以下问题:PHP GeographPage类的具体用法?PHP GeographPage怎么用?PHP GeographPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GeographPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processEvent
function processEvent(&$event)
{
$db =& $this->_getDB();
//very easy -trash any mappings to this topic
$post_id = $event['event_param'];
$post = $db->GetRow("select topic_id,post_time from geobb_posts where post_id='{$post_id}'");
if ($post) {
//update timestamp of last post
$db->Execute("update gridsquare_topic set last_post='{$post['post_time']}' where topic_id = '{$post['topic_id']}'");
//delete any smarty caches for this square
$gridsquare_id = $db->getOne("select gridsquare_id from gridsquare_topic where topic_id = {$post['topic_id']}");
if ($gridsquare_id) {
$images = $db->getCol("select gridimage_id from gridimage where gridsquare_id = {$gridsquare_id}");
$smarty = new GeographPage();
foreach ($images as $gridimage_id) {
//clear any caches involving this photo
$ab = floor($gridimage_id / 10000);
$smarty->clear_cache(null, "img{$ab}|{$gridimage_id}");
}
}
}
//return true to signal completed processing
//return false to have another attempt later
return true;
}
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:25,代码来源:UpdateDiscussionCrossReferencesWithUpdatedTopic.class.php
示例2: processEvent
function processEvent(&$event)
{
//perform actions
$topic_id = $event['event_param'];
$db =& $this->_getDB();
require 'conf/' . $_SERVER['HTTP_HOST'] . '.conf.php';
$topic = $db->GetRow("select topic_title,forum_id,topic_time from geobb_topics where topic_id='{$topic_id}' and forum_id = {$CONF['forum_gridsquare']}");
//get title of topic
$title = strtoupper(trim($topic['topic_title']));
//see if title matches a grid reference
$gridsquare = new GridSquare();
if ($gridsquare->setGridRef($title)) {
$gridsquare_id = $gridsquare->gridsquare_id;
//set up mapping
if ($gridsquare_id > 0) {
$this->processor->trace("Mapping {$gridsquare_id} to topic {$topic_id} ({$title})");
$db->Execute("replace into gridsquare_topic(gridsquare_id,topic_id,forum_id,last_post) " . "values ({$gridsquare_id}, {$topic_id}, {$topic['forum_id']}, '{$topic['topic_time']}')");
//delete any smarty caches for this square
$images = $db->getCol("select gridimage_id from gridimage where gridsquare_id = {$gridsquare_id}");
$smarty = new GeographPage();
foreach ($images as $gridimage_id) {
//clear any caches involving this photo
$ab = floor($gridimage_id / 10000);
$smarty->clear_cache(null, "img{$ab}|{$gridimage_id}");
}
}
}
//return true to signal completed processing
//return false to have another attempt later
return true;
}
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:UpdateDiscussionCrossReferencesWithNewTopic.class.php
示例3: processEvent
function processEvent(&$event)
{
$db =& $this->_getDB();
list($gridimage_id, $updatemaps) = explode(',', $event['event_param']);
$smarty = new GeographPage();
$ab = floor($gridimage_id / 10000);
$smarty->clear_cache(null, "img{$ab}|{$gridimage_id}");
//return true to signal completed processing
//return false to have another attempt later
return true;
}
示例4: processEvent
function processEvent(&$event)
{
$db =& $this->_getDB();
$topic_id = $event['event_param'];
//delete any smarty caches for this square
$gridsquare_id = $db->getOne("select gridsquare_id from gridsquare_topic where topic_id = {$topic_id}");
if ($gridsquare_id) {
$images = $db->getCol("select gridimage_id from gridimage where gridsquare_id = {$gridsquare_id}");
$smarty = new GeographPage();
foreach ($images as $gridimage_id) {
//clear any caches involving this photo
$ab = floor($gridimage_id / 10000);
$smarty->clear_cache(null, "img{$ab}|{$gridimage_id}");
}
// -trash any mappings to this topic
$db->Execute("delete from gridsquare_topic where topic_id = {$topic_id}");
}
//return true to signal completed processing
//return false to have another attempt later
return true;
}
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:21,代码来源:UpdateDiscussionCrossReferencesWithDeletedTopic.class.php
示例5: init_session
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
init_session();
$smarty = new GeographPage();
if (empty($_GET['page']) || preg_match('/[^\\w\\.\\,-]/', $_GET['page'])) {
$smarty->display('static_404.tpl');
exit;
}
$isadmin = $USER->hasPerm('moderator') ? 1 : 0;
$template = 'article_article.tpl';
$cacheid = 'articles|' . $_GET['page'];
$cacheid .= '|' . $USER->hasPerm('moderator') ? 1 : 0;
$cacheid .= '-' . (isset($_SESSION['article_urls']) && in_array($_GET['page'], $_SESSION['article_urls']) ? 1 : 0);
if (isset($_SESSION[$_GET['page']])) {
$cacheid .= '-' . $_SESSION[$_GET['page']];
}
if (!empty($_GET['epoch']) && preg_match('/^[\\w]+$/', $_GET['epoch'])) {
$cacheid .= "--" . $_GET['epoch'];
} else {
示例6: GeographPage
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
$smarty = new GeographPage();
$db = NewADOConnection($GLOBALS['DSN']);
if (empty($_REQUEST['key']) || preg_match("/[^\\w\\.]/", $_REQUEST['key'])) {
die("ERROR: no api key");
}
$sql = "SELECT * FROM `apikeys` WHERE `apikey` = " . $db->Quote($_REQUEST['key']) . " AND (`ip` = INET_ATON('{$_SERVER['REMOTE_ADDR']}') OR `ip` = 0) AND `enabled` = 'Y'";
$profile = $db->GetRow($sql);
if (empty($profile['apikey'])) {
die("ERROR: invalid api key. please contact us");
}
if (empty($_REQUEST['to'])) {
if (!empty($_REQUEST['image'])) {
//initialise message
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/gridimage.class.php';
$image = new GridImage();
示例7: init_session
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
init_session();
$smarty = new GeographPage();
$u = isset($_GET['u']) && is_numeric($_GET['u']) ? intval($_GET['u']) : 0;
$w = isset($_GET['w']) && is_numeric($_GET['w']) ? intval($_GET['w']) : 1;
$template = 'hectadmap.tpl';
$cacheid = "{$u}.{$w}";
if ($smarty->caching) {
$smarty->caching = 2;
// lifetime is per cache
$smarty->cache_lifetime = 3600 * 24;
//24hour cache
}
$maximages = 100;
//percentage AND number of images in a hectad
function smarty_modifier_colerize($input)
{
global $maximages;
示例8: init_session
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
init_session();
$USER->mustHavePerm("admin");
$smarty = new GeographPage();
$db = NewADOConnection($GLOBALS['DSN']);
$smarty->display('_std_begin.tpl');
flush();
if (isset($_GET['getExtendedStats'])) {
$a = $memcache->getExtendedStats();
$a = array_reverse($a);
print "<h2>Overview Memcache Statistics</h2>";
print "<table border=1 cellspacing=0>";
if (isset($_GET['r'])) {
print "<tr>";
print "<th>server</th>";
foreach ($a as $name => $row) {
print "<th>{$name}</th>";
}
print "</tr>";
示例9: init_session
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
require_once 'geograph/wordnet.inc.php';
init_session();
$USER->mustHavePerm("admin");
$smarty = new GeographPage();
$db = NewADOConnection($GLOBALS['DSN']);
//this takes a long time, so we output a header first of all
$smarty->display('_std_begin.tpl');
echo "<h3> ReBuilding Wordnet...</h3>";
flush();
set_time_limit(3600 * 24);
$tim = time();
$recordSet =& $db->Execute("select gridimage_id,title,title2 from gridimage where moderation_status != 'rejected'");
$db->Execute("truncate wordnet1");
$db->Execute("truncate wordnet2");
$db->Execute("truncate wordnet3");
$db->Execute("LOCK TABLES wordnet1 WRITE,wordnet2 WRITE,wordnet3 WRITE");
$db->Execute("ALTER TABLE wordnet1 DISABLE KEYS");
$db->Execute("ALTER TABLE wordnet2 DISABLE KEYS");
$db->Execute("ALTER TABLE wordnet3 DISABLE KEYS");
示例10: include_messages
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
include_messages('moversboard');
init_session();
$type = isset($_GET['type']) && preg_match('/^\\w+$/', $_GET['type']) ? $_GET['type'] : 'images';
$smarty = new GeographPage();
$template = 'statistics_moversboard.tpl';
$cacheid = $type;
if (!$smarty->is_cached($template, $cacheid)) {
/////////////
// in the following code 'geographs' is used a column for legacy reasons, but dont always represent actual geographs....
require_once 'geograph/gridimage.class.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/imagelist.class.php';
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$db = NewADOConnection($GLOBALS['DSN']);
if (!$db) {
die('Database connection failed');
}
$sql_qtable = array('squares' => array('column' => ''), 'geosquares' => array('column' => ''), 'geographs' => array('column' => "sum(i.moderation_status='geograph')"), 'additional' => array('column' => "sum(i.moderation_status='geograph' and ftf = 0)"), 'supps' => array('column' => "sum(i.moderation_status='accepted')"), 'images' => array('orderby' => ",points desc", 'column' => "sum(i.ftf=1 and i.moderation_status='geograph') as points, sum(i.moderation_status in ('geograph','accepted'))"), 'test_points' => array('column' => "sum((i.moderation_status = 'geograph') + ftf + 1)", 'table' => " gridimage_search i "), 'depth' => array('column' => "count(*)/count(distinct grid_reference)", 'table' => " gridimage_search i ", 'isfloat' => true), 'myriads' => array('column' => "count(distinct substring(grid_reference,1,length(grid_reference)-4))", 'table' => " gridimage_search i "), 'hectads' => array('column' => "count(distinct concat(substring(grid_reference,1,length(grid_reference)-3),substring(grid_reference,length(grid_reference)-1,1)) )", 'table' => " gridimage_search i "), 'days' => array('column' => "count(distinct imagetaken)", 'table' => " gridimage_search i "), 'antispread' => array('column' => "count(*)/count(distinct concat(substring(grid_reference,1,length(grid_reference)-3),substring(grid_reference,length(grid_reference)-1,1)) )", 'table' => " gridimage_search i ", 'isfloat' => true), 'spread' => array('column' => "count(distinct concat(substring(grid_reference,1,length(grid_reference)-3),substring(grid_reference,length(grid_reference)-1,1)) )/count(*)", 'table' => " gridimage_search i ", 'isfloat' => true), 'classes' => array('column' => "count(distinct imageclass)", 'table' => " gridimage_search i "), 'clen' => array('column' => "avg(length(comment))", 'table' => " gridimage_search i ", 'isfloat' => true), 'tlen' => array('column' => "avg(length(title))", 'table' => " gridimage_search i ", 'isfloat' => true), 'category_depth' => array('column' => "count(*)/count(distinct imageclass)", 'table' => " gridimage_search i ", 'isfloat' => true), 'centi' => array('column' => "COUNT(DISTINCT nateastings div 100, natnorthings div 100)", 'where' => "and i.moderation_status='geograph' and nateastings div 1000 > 0"), 'points' => array('column' => "sum(i.ftf=1 and i.moderation_status='geograph')"));
if (!isset($sql_qtable[$type])) {
示例11: include_messages
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
include_messages('ecard');
init_session();
$smarty = new GeographPage();
$template = 'ecard.tpl';
//you must be logged in to send e-cards
$USER->mustHavePerm("basic");
//gather what we need
$from_name = isset($_POST['from_name']) ? stripslashes($_POST['from_name']) : $USER->realname;
$from_email = isset($_POST['from_email']) ? stripslashes($_POST['from_email']) : $USER->email;
$to_name = isset($_POST['to_name']) ? stripslashes($_POST['to_name']) : '';
$to_email = isset($_POST['to_email']) ? stripslashes($_POST['to_email']) : '';
$smarty->assign_by_ref('from_name', $from_name);
$smarty->assign_by_ref('from_email', $from_email);
$smarty->assign_by_ref('to_name', $to_name);
$smarty->assign_by_ref('to_email', $to_email);
$db = NewADOConnection($GLOBALS['DSN']);
if (empty($db)) {
die('Database connection failed');
示例12: header
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
if (isset($_SERVER['REDIRECT_SCRIPT_URL']) && preg_match('/120_(ie|ff).gif$/', $_SERVER['REDIRECT_SCRIPT_URL'])) {
//you can just go away - Gmaps seem to lookup these urls via GGeoXML for somereason...
header('Content-Length: 0');
exit;
}
require_once 'geograph/global.inc.php';
init_session();
//get page from request
$page = isset($_GET['page']) ? $_GET['page'] : '404';
//do we trust it? like hell we do! alphanumerics only please!
if (!preg_match('/^[a-z0-9_]+$/', $page)) {
$page = '404';
}
//next, we want to be sure you can only view pages intended for static viewing
$template = 'static_' . $page . '.tpl';
//lets be sure it exists...
$smarty = new GeographPage();
if (!$smarty->templateExists($template)) {
$template = 'static_404.tpl';
}
$smarty->display($template);
示例13: init_session
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
init_session();
$smarty = new GeographPage();
$smarty->caching = 2;
// lifetime is per cache
$smarty->cache_lifetime = 3600 * 24;
//24hr cache
if (isset($_GET['output']) && $_GET['output'] == 'csv') {
$template = 'statistics_table_csv.tpl';
# let the browser know what's coming
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . basename($_SERVER['SCRIPT_NAME'], '.php') . ".csv\"");
} else {
$template = 'statistics_table.tpl';
}
$ri = isset($_GET['ri']) && is_numeric($_GET['ri']) ? intval($_GET['ri']) : 0;
$u = isset($_GET['u']) && is_numeric($_GET['u']) ? intval($_GET['u']) : 0;
$date = isset($_GET['date']) && preg_match('/^\\d{4}(-\\d{2}|)(-\\d{2}|)$/', $_GET['date']) ? $_GET['date'] : '2005-12';
示例14: init_session
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
init_session();
$smarty = new GeographPage();
if (empty($_GET['url']) || preg_match('/[^\\w]/', $_GET['url'])) {
$smarty->display('static_404.tpl');
exit;
}
$pg = empty($_GET['page']) ? 1 : intval($_GET['page']);
$pgsize = 10;
$template = 'gallery_gallery.tpl';
preg_match('/_(\\d+)$/', $_GET['url'], $m);
$topic_id = intval($m[1]);
$cacheid = "{$topic_id}.{$pg}";
$db = NewADOConnection($GLOBALS['DSN']);
$page = $db->getRow("\r\nselect t.topic_id,topic_title,topic_poster,topic_poster_name,topic_time,post_time,posts_count\r\n\tfrom geobb_topics t\r\n\tinner join geobb_posts on (post_id = topic_last_post_id)\r\n\twhere t.topic_id = {$topic_id} and t.forum_id = {$CONF['forum_gallery']}");
if (count($page)) {
//when this page was modified
$mtime = strtotime($page['post_time']);
示例15: init_session
* GeoGraph geographic photo archive project
* This file copyright (C) 2005 Barry Hunter (geo@barryhunter.co.uk)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
require_once 'geograph/global.inc.php';
init_session();
$smarty = new GeographPage();
$template = 'admin_team.tpl';
$cacheid = '';
if (!$smarty->is_cached($template, $cacheid)) {
$db = NewADOConnection($GLOBALS['DSN']);
if (!$db) {
die('Database connection failed');
}
$team = $db->GetAssoc("\r\n\tselect \r\n\t\tuser.user_id,user.realname,user.nickname,user.rights,role\r\n\tfrom user\r\n\twhere length(rights) > 0 AND (rights LIKE '%admin%' OR rights LIKE '%moderator%' OR role != '')\r\n\tgroup by user.user_id\r\n\torder by user.user_id");
$smarty->assign_by_ref('team', $team);
}
$smarty->display($template, $cacheid);