本文整理汇总了PHP中photo::update方法的典型用法代码示例。如果您正苦于以下问题:PHP photo::update方法的具体用法?PHP photo::update怎么用?PHP photo::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类photo
的用法示例。
在下文中一共展示了photo::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convert
//.........这里部分代码省略.........
break;
case 'Summary':
$module->view = 'showall_summary';
break;
default:
$module->view = 'showall';
break;
}
//check to see if it's already pulled in (circumvent !is_original)
$ploc = $iloc;
$ploc->mod = "news";
if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
$iloc->mod = 'newsmodule';
$linked = true;
break;
}
$iloc->mod = 'newsmodule';
$newsitems = $old_db->selectArrays('newsitem', "location_data='" . serialize($iloc) . "'");
$oldconfig = $old_db->selectObject('newsmodule_config', "location_data='" . serialize($iloc) . "'");
if ($newsitems) {
$files_attached = false;
foreach ($newsitems as $ni) {
unset($ni['id']);
$news = new news($ni);
$loc = expUnserialize($ni['location_data']);
$loc->mod = "news";
$news->location_data = serialize($loc);
$news->title = !empty($ni['title']) ? $ni['title'] : gt('Untitled');
$news->body = !empty($ni['body']) ? $ni['body'] : gt('(empty)');
$news->save();
// default is to create with current time
$news->created_at = $ni['posted'];
$news->edited_at = $ni['edited'];
$news->update();
@$this->msg['migrated'][$iloc->mod]['count']++;
@($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
if (!empty($ni['file_id'])) {
$file = new expFile($ni['file_id']);
$news->attachitem($file, '');
$files_attached = true;
}
}
$newconfig = new expConfig();
if ($files_attached) {
// fudge a config to get attached files to appear
$newconfig->config = 'a:14:{s:9:"feedmaker";s:0:"";s:11:"filedisplay";s:7:"Gallery";s:6:"ffloat";s:4:"Left";s:6:"fwidth";s:3:"120";s:7:"fmargin";s:1:"5";s:7:"piwidth";s:3:"100";s:5:"thumb";s:3:"100";s:7:"spacing";s:2:"10";s:10:"floatthumb";s:8:"No Float";s:6:"tclass";s:0:"";s:5:"limit";s:0:"";s:9:"pagelinks";s:14:"Top and Bottom";s:10:"feed_title";s:0:"";s:9:"feed_desc";s:0:"";}';
}
if ($oldconfig->enable_rss == 1) {
if ($newconfig->config != null) {
$config = expUnserialize($newconfig->config);
}
$config['enable_rss'] = true;
$config['feed_title'] = $oldconfig->feed_title;
$config['feed_desc'] = $oldconfig->feed_desc;
$config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
$config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
$newconfig->config = $config;
$newrss = new expRss();
$newrss->module = $loc->mod;
$newrss->src = $loc->src;
$newrss->enable_rss = $oldconfig->enable_rss;
$newrss->feed_title = $oldconfig->feed_title;
$newrss->feed_desc = $oldconfig->feed_desc;
$newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
$newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
$newrss->save();
示例2: IN
if ($tocatid) {
$db->query("UPDATE {$table} SET catid={$tocatid} WHERE `{$fromtype}` IN ({$fromids})");
dmsg('移动成功', $forward);
} else {
msg('请选择目标分类');
}
} else {
$itemid = $itemid ? implode(',', $itemid) : '';
$menuid = 5;
include tpl($action, $module);
}
break;
case 'update':
is_array($itemid) or msg('请选择' . $MOD['name']);
foreach ($itemid as $v) {
$do->update($v);
}
dmsg('更新成功', $forward);
break;
case 'tohtml':
is_array($itemid) or msg('请选择' . $MOD['name']);
$html_itemids = $itemid;
foreach ($html_itemids as $itemid) {
tohtml('show', $module);
}
dmsg('更新成功', $forward);
break;
case 'delete':
$itemid or msg('请选择' . $MOD['name']);
isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid);
dmsg('删除成功', $forward);
示例3: isset
isset($sid) or $sid = $fid;
if (!isset($tid)) {
$r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status=3 {$sql}");
$tid = $r['tid'] ? $r['tid'] : 0;
}
if ($update) {
require MD_ROOT . '/photo.class.php';
$do = new photo($moduleid);
}
isset($num) or $num = 100;
if ($fid <= $tid) {
$result = $db->query("SELECT itemid FROM {$table} WHERE status=3 AND itemid>={$fid} {$sql} ORDER BY itemid LIMIT 0,{$num} ");
if ($db->affected_rows($result)) {
while ($r = $db->fetch_array($result)) {
$itemid = $r['itemid'];
$update ? $do->update($itemid) : tohtml('show', $module);
}
$itemid += 1;
} else {
$itemid = $fid + $num;
}
} else {
if ($update) {
$all ? msg('', '?moduleid=' . $moduleid . '&file=' . $file . '&action=index&all=1&one=' . $one) : dmsg('更新成功', $this_forward);
} else {
if ($one) {
dheader('?file=html&action=back&mid=' . $moduleid);
}
$all ? msg($MOD['name'] . '生成成功', $this_forward) : dmsg($MOD['name'] . '生成成功', $this_forward);
}
}