本文整理汇总了PHP中GeographPage::reassignPostedDate方法的典型用法代码示例。如果您正苦于以下问题:PHP GeographPage::reassignPostedDate方法的具体用法?PHP GeographPage::reassignPostedDate怎么用?PHP GeographPage::reassignPostedDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeographPage
的用法示例。
在下文中一共展示了GeographPage::reassignPostedDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$smarty->assign('error', 'We were unable to process your upload - please try again');
break;
}
} elseif (isset($_POST['savedata'])) {
//Submit Step 3..
if (isset($_POST['goback'])) {
$step = 2;
} else {
//preserve the upload id
if ($uploadmanager->validUploadId($_POST['upload_id'])) {
$smarty->assign('upload_id', $_POST['upload_id']);
$uploadmanager->setUploadId($_POST['upload_id']);
}
$ok = true;
//preserve the meta info
$smarty->reassignPostedDate('imagetaken');
if ($smarty->get_template_vars('imagetaken') == '0000-00-00') {
$ok = false;
$error['imagetaken'] = "Please specify a date for when the photo was taken (even approximate)";
} 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) {
示例2: using
$lockedby = $db->getOne("\r\n\t\t\t\tselect \r\n\t\t\t\t\tm.realname\r\n\t\t\t\tfrom\r\n\t\t\t\t\tarticle_lock as l\r\n\t\t\t\t\tinner join user as m using (user_id)\r\n\t\t\t\twhere\r\n\t\t\t\t\tarticle_id = {$page['article_id']}\r\n\t\t\t\t\tand m.user_id != {$USER->user_id}\r\n\t\t\t\tand lock_obtained > date_sub(NOW(),INTERVAL 1 HOUR)");
if ($lockedby) {
$smarty->assign('lockedby', $lockedby);
$template = 'article_locked.tpl';
$smarty->display($template, $cacheid);
exit;
}
$smarty->assign($page);
$db->Execute("REPLACE INTO article_lock SET user_id = {$USER->user_id}, article_id = {$page['article_id']}");
} else {
$template = 'static_404.tpl';
}
}
if ($template != 'static_404.tpl' && isset($_POST) && isset($_POST['submit'])) {
$errors = array();
$smarty->reassignPostedDate('publish_date');
$_POST['title'] = preg_replace('/[^\\w-\\., ]+/', '', trim($_POST['title']));
if (empty($_POST['url']) && !empty($_POST['title'])) {
$_POST['url'] = $_POST['title'];
}
$_POST['url'] = preg_replace('/ /', '-', trim($_POST['url']));
$_POST['url'] = preg_replace('/[^\\w-]+/', '', $_POST['url']);
if ($_POST['title'] == "New Article") {
$errors['title'] = "Please give a meaningful title";
}
$gs = new GridSquare();
if (!empty($_POST['grid_reference'])) {
if ($gs->setByFullGridRef($_POST['grid_reference'])) {
$_POST['gridsquare_id'] = $gs->gridsquare_id;
} else {
$errors['grid_reference'] = $gs->errormsg;