本文整理匯總了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;