本文整理汇总了PHP中GeographPage::assign_by_ref方法的典型用法代码示例。如果您正苦于以下问题:PHP GeographPage::assign_by_ref方法的具体用法?PHP GeographPage::assign_by_ref怎么用?PHP GeographPage::assign_by_ref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeographPage
的用法示例。
在下文中一共展示了GeographPage::assign_by_ref方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flush
flush();
$count++;
$recordSet->MoveNext();
}
$recordSet->Close();
print "<h2>All Done</h2>";
print "Squares done = {$count}<br/>";
print "Tiles deleted = {$tiles}";
flush();
exit;
} elseif (isset($_GET['gridref'])) {
$square = new GridSquare();
$ok = $square->validGridRef($_GET['gridref']);
if ($ok) {
$gridref = $_GET['gridref'];
$smarty->assign_by_ref('gridref', $gridref);
$smarty->assign('showinfo', 1);
//can we find a square?
$sq = $db->GetRow("select * from gridsquare where grid_reference='{$gridref}'");
if (count($sq)) {
$smarty->assign('percent_land', $sq['percent_land']);
}
//update?
if (isset($_GET['save'])) {
$percent = intval($_GET['percent_land']);
if (count($sq)) {
//update existing square
$db->Execute("update gridsquare set percent_land='{$percent}' where gridsquare_id='{$sq['gridsquare_id']}'");
$smarty->assign('status', "Existing gridsquare {$gridref} updated with new land percentage of {$percent} %");
$db->Execute("REPLACE INTO mapfix_log SET user_id = {$USER->user_id}, gridsquare_id = {$sq['gridsquare_id']}, new_percent_land='{$percent}', old_percent_land='{$sq['percent_land']}',created=now(),comment=" . $db->Quote($_GET['comment']));
require_once 'geograph/mapmosaic.class.php';
示例2: GeographPage
* 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 = 0;
//dont cache!
$cacheid = 0;
$template = 'gallery.tpl';
$db = NewADOConnection($GLOBALS['DSN']);
$data = $db->getRow("show table status like 'content'");
//we use content as it should only update when galleries update
//when this table was modified
$mtime = strtotime($data['Update_time']);
//can't use IF_MODIFIED_SINCE for logged in users as has no concept as uniqueness
customCacheControl($mtime, $cacheid, $USER->user_id == 0);
if (!$smarty->is_cached($template, $cacheid)) {
$prev_fetch_mode = $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$list = $db->getAll("\r\n\tselect topic_id,topic_title,topic_poster,topic_poster_name,topic_time,topic_views,posts_count,count(*) as images_count\r\n\tfrom geobb_topics\r\n\tleft join gridimage_post using (topic_id)\r\n\twhere forum_id = {$CONF['forum_gallery']}\r\n\tgroup by topic_id\r\n\torder by topic_last_post_id desc");
foreach ($list as $i => $row) {
$list[$i]['url'] = trim(strtolower(preg_replace('/[^\\w]+/', '_', html_entity_decode(preg_replace('/&#\\d+;?/', '_', $row['topic_title'])))), '_') . '_' . $row['topic_id'];
}
$smarty->assign_by_ref('list', $list);
}
$smarty->display($template, $cacheid);
示例3: NewADOConnection
if (!$smarty->is_cached($template, $cacheid)) {
require_once 'geograph/gridimage.class.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/imagelist.class.php';
$db = NewADOConnection($GLOBALS['DSN']);
if (!$db) {
die('Database connection failed');
}
$column = 'post_time';
$title = "Busiest Day for Forum Posts";
$where = array();
if (!empty($u)) {
$where[] = "poster_id=" . $u;
$smarty->assign('u', $u);
$profile = new GeographUser($u);
$smarty->assign_by_ref('profile', $profile);
$title .= " for " . $profile->realname;
} elseif (isset($_GET['users'])) {
$group_sql = 'poster_id,';
$column_sql = "CONCAT('<a href=\"/profile/',poster_id,'\">',poster_name,'</a>') as User,";
$title .= " by user";
}
if (isset($_GET['threads'])) {
$join_sql .= ' inner join geobb_topics using(topic_id)';
$group_sql .= 'geobb_posts.topic_id,';
$column_sql .= "CONCAT('<a href=\"/discuss/?action=vthread&topic=',geobb_posts.topic_id,'\">',topic_title,'</a>') as Topic,";
$title .= " by topic";
}
if (count($where)) {
$where_sql = " AND " . join(' AND ', $where);
}
示例4: foreach
#$geographs = 0;
$pending = 0;
#$points = 0;
foreach ($topusers as $user_id => $entry) {
if ($lastgeographs == $entry['geographs']) {
$topusers[$user_id]['ordinal'] = '" ';
} else {
$topusers[$user_id]['ordinal'] = smarty_function_ordinal($i);
$lastgeographs = $entry['geographs'];
}
$i++;
#$geographs += $entry['geographs'];
$pending += $entry['pending'];
#$points += $entry['points'];
if (empty($entry['points'])) {
$topusers[$user_id]['points'] = '';
}
}
$geographs = $sum['geographs'];
$points = $sum['points'];
$smarty->assign('geographs', $geographs);
$smarty->assign('pending', $pending);
$smarty->assign('points', $points);
$smarty->assign_by_ref('topusers', $topusers);
$smarty->assign('cutoff_time', time() - 86400 * 7);
$smarty->assign('types', array('points', 'geosquares', 'images', 'depth'));
$smarty->assign('typenames', $MESSAGES['moversboard']['type_names']);
//lets find some recent photos
new RecentImageList($smarty);
}
$smarty->display($template, $cacheid);
示例5: NOW
$errors[$key] = "missing required info";
}
}
if (!count($updates)) {
$smarty->assign('error', "No Changes to Save");
$errors[1] = 1;
}
if ($_REQUEST['id'] == 'new') {
$updates[] = "`user_id` = {$USER->user_id}";
$updates[] = "`created` = NOW()";
$sql = "INSERT INTO geoevent SET " . implode(',', $updates);
} else {
$sql = "UPDATE geoevent SET " . implode(',', $updates) . " WHERE geoevent_id = " . $db->Quote($_REQUEST['id']);
}
if (!count($errors) && count($updates)) {
$db->Execute($sql);
if ($_REQUEST['id'] == 'new') {
$_REQUEST['id'] = $db->Insert_ID();
}
$memcache->name_increment('ep', intval($_REQUEST['id']), 1, true);
$smarty->clear_cache('events.tpl');
header("Location: /events/event.php?id=" . intval($_REQUEST['id']));
exit;
} else {
if ($errors[1] != 1) {
$smarty->assign('error', "Please see messages below...");
}
$smarty->assign_by_ref('errors', $errors);
}
}
$smarty->display($template, $cacheid);
示例6: GeographPage
$smarty = new GeographPage();
$len = isset($_GET['len']) && is_numeric($_GET['len']) ? max(0, min(3, intval($_GET['len']))) : 2;
$words = isset($_GET['words']) && preg_match('/^[\\w ]+$/', $_GET['words']) ? $_GET['words'] : '';
$u = isset($_GET['u']) && is_numeric($_GET['u']) ? intval($_GET['u']) : 0;
//bare minimum for the dynamic section
if ($u) {
if ($u == -1) {
if ($USER->registered) {
$u = $USER->user_id;
} else {
$u = 0;
}
}
if ($u) {
$profile = new GeographUser($u);
$smarty->assign_by_ref('profile', $profile);
$smarty->assign_by_ref('u', $u);
}
}
if (!empty($_GET['t'])) {
$template = 'explore_wordnet_simple.tpl';
$cacheid = "explore|wordnet_simple{$u}." . $len . "." . str_replace(' ', '.', $words);
} else {
$template = 'explore_wordnet.tpl';
$cacheid = "explore|wordnet{$u}." . $len . "." . str_replace(' ', '.', $words);
}
$smarty->caching = 2;
// lifetime is per cache
$smarty->cache_lifetime = 3600 * 24;
//24hr cache
if (!$smarty->is_cached($template, $cacheid)) {
示例7: NewADOConnection
$_GET['days'] = 10;
}
if (!$smarty->is_cached($template, $cacheid)) {
$db = NewADOConnection($GLOBALS['DSN']);
if (empty($db)) {
die('Database connection failed');
}
if ($u) {
$where = "where submitted > date_sub(now(),interval {$_GET['days']} day) and user_id = {$u}";
$having = isset($_GET['full']) ? '' : 'having cnt>5';
$table = 'gridimage';
$smarty->assign('varname', 'catListUser');
$arr = $db->getCol("select imageclass,count(*) as cnt from {$table} {$where} group by imageclass {$having}");
} else {
$where = isset($_GET['full']) ? '' : 'where c>5';
$table = 'category_stat';
$smarty->assign('varname', 'catList');
$arr = $db->getCol("select imageclass,c as cnt from {$table} {$where}");
}
$smarty->assign_by_ref('classes', $arr);
}
if ($u) {
customExpiresHeader(300, false);
} else {
customExpiresHeader(3600 * 3, true);
}
header("Content-type: text/javascript");
customGZipHandlerStart();
//always turn off debugging, it will break the js
$smarty->debugging = false;
$smarty->display($template, $cacheid);
示例8: round
}
$jump = 360 / 16;
$jump2 = 360 / 32;
$q = round($angle / $jump) * $jump;
$s = $q % 90 == 0 ? strtoupper(heading_string($q)) : ucwords(heading_string($q));
$direction = sprintf('%s : %03d deg (%03d > %03d)', str_pad($s, 16, '�'), $q, $q == 0 ? $q + 360 - $jump2 : $q - $jump2, $q + $jump2);
$angle = sprintf('%.1f', $angle);
if (!$dist) {
$line['Direction'] = "<small style=\"color:gray\">Same Location</small>";
$q = '-';
} elseif ($dist >= 1000) {
$line['Direction'] = "<b>{$s}</b> <nobr>[{$angle}]</nobr>";
#"Wide:".$angle."<br>".
$q = floor($q);
} elseif ($promore4 && $submore4) {
$line['Direction'] = "<b>{$s}</b> <nobr>[{$angle}]</nobr>";
#"Detailed:".$angle."<br>".
$q = floor($q);
} else {
$line['Direction'] = "<small style=\"color:gray\">" . ($submore4 ? 'Photographer' : 'Subject') . ' Location Not Accurate Enough</small>';
$q = '-';
}
$line['Result'] = $q;
$line['Manually Specified'] = $image->view_direction > -1 ? $image->view_direction : '-';
$table[] = $line;
}
$smarty->assign_by_ref('table', $table);
$smarty->assign("h2title", 'Listing images with Photographer position specified (and different to Subject)');
$smarty->assign("total", count($table));
}
$smarty->display($template, $cacheid);
示例9: elseif
} elseif (datetimeToTimestamp($smarty->get_template_vars('imagetaken')) > datetimeToTimestamp(date("Y-m-d"))) {
$ok = false;
$error['imagetaken'] = "Time machines are not allowed on Planet Geograph";
}
if (($_POST['imageclass'] == 'Other' || empty($_POST['imageclass'])) && !empty($_POST['imageclassother'])) {
$imageclass = stripslashes($_POST['imageclassother']);
} else {
if ($_POST['imageclass'] != 'Other') {
$imageclass = stripslashes($_POST['imageclass']);
}
}
if (strlen($imageclass) == 0) {
$ok = false;
$error['imageclass'] = "Please choose a geographical feature";
} else {
$smarty->assign_by_ref('imageclass', $imageclass);
}
$title = trim(stripslashes($_POST['title']));
$title = strip_tags($title);
$title2 = trim(stripslashes($_POST['title2']));
$title2 = strip_tags($title2);
if (strlen($title) == 0 && strlen($title2) == 0) {
$ok = false;
$error['title'] = "Please specify an image title";
}
//preserve title and comment
$smarty->assign('title', $title);
$smarty->assign('comment', trim(stripslashes($_POST['comment'])));
$smarty->assign('title2', $title2);
$smarty->assign('comment2', trim(stripslashes($_POST['comment2'])));
$smarty->assign('user_status', stripslashes($_POST['user_status']));
示例10: dieUnderHighLoad
}
//24hr cache
if (isset($_GET['gridref_from']) && preg_match('/^[a-zA-Z]{1,3}\\d{4}$/', $_GET['gridref_from'])) {
$smarty->assign('gridref_from', $_GET['gridref_from']);
$cacheid .= '.' . $_GET['gridref_from'];
}
//regenerate?
if (!$smarty->is_cached($template, $cacheid)) {
dieUnderHighLoad();
if ($map->type_or_user > 0) {
$profile = new GeographUser($map->type_or_user);
$smarty->assign('realname', $profile->realname);
$smarty->assign('user_id', $map->type_or_user);
}
//assign main map to smarty
$smarty->assign_by_ref('map', $map);
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$grid =& $map->getGridArray();
$smarty->assign_by_ref('grid', $grid);
$first = current($grid);
$second = current($first);
$ri = $second['reference_index'];
$letterlength = $CONF['gridpreflen'][$ri];
$smarty->assign('ofe', $letterlength + 1);
$smarty->assign('ofn', $letterlength + 3);
//assign all the other useful stuff
$gr = $map->getGridRef(-1, -1);
$smarty->assign('gridref', $gr);
if ($map->pixels_per_km == 4) {
$starte = substr($gr, $letterlength, 2);
$starte = intval($starte) - 50;
示例11: GeographPage
* 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/gridimage.class.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/token.class.php';
require_once 'geograph/gazetteer.class.php';
init_session();
$smarty = new GeographPage();
$template = 'map_frame.tpl';
$cacheid = '';
$square = new GridSquare();
$token = new Token();
if ($token->parse($_GET['t'])) {
$s = false;
$rastermap = new RasterMap($s);
foreach ($token->data as $key => $value) {
$rastermap->{$key} = $value;
}
$rastermap->inline = true;
$smarty->assign_by_ref('rastermap', $rastermap);
} else {
die("invalid");
}
$smarty->display($template, $cacheid);
示例12: GeographUser
$profile->{$name} = strip_tags(stripslashes($value));
}
}
} else {
$profile = new GeographUser($USER->user_id);
}
$smarty->assign('pagesizes', array(5, 10, 15, 20, 30, 50));
$smarty->assign('delays', array(2, 3, 4, 5, 6, 10, 12));
$smarty->assign('stdsize', $CONF['img_max_size']);
$smarty->assign('sizes', $CONF['img_sizes']);
$smarty->assign('showorig', $CONF['img_size_unlimited']);
$smarty->assign('largeimages', $CONF['img_size_unlimited'] || count($CONF['img_sizes']) != 0);
$smarty->assign('canclearexif', $CONF['exiftooldir'] !== '');
$profile->getStats();
$profile->md5_email = md5(strtolower($profile->email));
$smarty->assign_by_ref('profile', $profile);
}
#elseif (isset($_REQUEST['notifications'])) #FIXME
#{
# //must be logged in to proceed with an edit
# $USER->login();
#
# $template='profile_notifications.tpl';
#
# //save changes?
# if (isset($_POST['savechanges']))
# {
#
# }
# else
# {
示例13: array
}
$column = $date == 'taken' ? 'imagetaken' : 'submitted';
$title1 = $date == 'taken' ? 'Taken' : 'Submitted';
$where = array();
if ($date == 'taken') {
$where[] = "{$column} not like '%-00%'";
}
if (!empty($ri)) {
$where[] = "reference_index=" . $ri;
$smarty->assign('ri', $ri);
}
if (!empty($u)) {
$where[] = "user_id=" . $u;
$smarty->assign('u', $u);
$profile = new GeographUser($u);
$smarty->assign_by_ref('profile', $profile);
$title .= " for " . $profile->realname;
}
if (count($where)) {
$where_sql = " WHERE " . join(' AND ', $where);
}
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$graphs = array();
//=================
if ($date != 'taken') {
$graph = array();
$title = "Breakdown of Images by {$title1} Hour";
$table = $db->GetAll("SELECT \n\t\tHOUR({$column}) AS `title`, \n\t\tcount( * ) AS `value`\n\t\tFROM `gridimage` {$where_sql}\n\t\tGROUP BY HOUR({$column})");
$graph['table'] = $table;
$graph['title'] = $title;
$max = 0;
示例14: GeographPage
*
* 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/searchcriteria.class.php';
require_once 'geograph/searchengine.class.php';
require_once 'geograph/searchenginebuilder.class.php';
init_session();
$smarty = new GeographPage();
$i = !empty($_GET['i']) ? intval($_GET['i']) : '';
$sortorders = array('' => '', 'dist_sqd' => 'Distance', 'gridimage_id' => 'Date Submitted', 'imagetaken' => 'Date Taken', 'imageclass' => 'Image Category', 'realname' => 'Contributor Name', 'grid_reference' => 'Grid Reference', 'title' => 'Image Title', 'x' => 'West->East', 'y' => 'South->North', 'seq_id' => '** Import Order **');
$breakdowns = array('' => '', 'imagetaken' => 'Day Taken', 'imagetaken_month' => 'Month Taken', 'imagetaken_year' => 'Year Taken', 'imagetaken_decade' => 'Decade Taken', 'imageclass' => 'Image Category', 'realname' => 'Contributor Name', 'grid_reference' => 'Grid Reference', 'submitted' => 'Day Submitted', 'submitted_month' => 'Month Submitted', 'submitted_year' => 'Year Submitted');
$displayclasses = array('full' => 'full listing', 'more' => 'full listing + links', 'thumbs' => 'thumbnails only', 'thumbsmore' => 'thumbnails + links', 'gmap' => 'on a map', 'slide' => 'slideshow - fullsize', 'reveal' => 'slideshow - map imagine', 'cooliris' => 'cooliris 3d wall', 'mooflow' => 'cover flow', 'text' => 'text list only', 'spelling' => 'spelling utility');
$smarty->assign_by_ref('displayclasses', $displayclasses);
$smarty->assign('pagesizes', array(5, 10, 15, 20, 30, 50));
$smarty->assign_by_ref('imagestatuses', $imagestatuses);
$smarty->assign_by_ref('sortorders', $sortorders);
$smarty->assign_by_ref('breakdowns', $breakdowns);
$pg = !empty($_GET['page']) ? intval(str_replace('/', '', $_GET['page'])) : 0;
if (empty($pg) || $pg < 1) {
$pg = 1;
}
$engine = new SearchEngine($i);
if ($engine->criteria && $engine->criteria->searchclass == "Special" && ($USER->user_id == $engine->criteria->user_id || $USER->hasPerm('moderator'))) {
//you can pass!
} else {
$smarty->display('no_permission.tpl');
exit;
}
示例15: GeographPage
*
* 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('usermsg');
init_session();
$smarty = new GeographPage();
$template = 'usermsg.tpl';
//gather what we need
$recipient = new GeographUser($_REQUEST['to']);
$from_name = isset($_POST['from_name']) ? stripslashes($_POST['from_name']) : $USER->realname;
$from_email = isset($_POST['from_email']) ? stripslashes($_POST['from_email']) : $USER->email;
$sendcopy = isset($_POST['sendcopy']) ? stripslashes($_POST['sendcopy']) : false;
$smarty->assign_by_ref('recipient', $recipient);
$smarty->assign_by_ref('from_name', $from_name);
$smarty->assign_by_ref('from_email', $from_email);
$smarty->assign_by_ref('sendcopy', $sendcopy);
$db = NewADOConnection($GLOBALS['DSN']);
if (empty($db)) {
die('Database connection failed');
}
$ip = getRemoteIP();
$user_id = "inet_aton('{$ip}')";
$throttlenumber = 5;
if ($USER->hasPerm("ticketmod") || $USER->hasPerm("moderator")) {
$throttlenumber = 30;
}
if (empty($CONF['usermsg_spam_trap'])) {
$throttle = 0;