本文整理汇总了PHP中vB_DataManager::post_save_each方法的典型用法代码示例。如果您正苦于以下问题:PHP vB_DataManager::post_save_each方法的具体用法?PHP vB_DataManager::post_save_each怎么用?PHP vB_DataManager::post_save_each使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vB_DataManager
的用法示例。
在下文中一共展示了vB_DataManager::post_save_each方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eval
function post_save_each($doquery = true)
{
($hook = vBulletinHook::fetch_hook('userpicdata_postsave')) ? eval($hook) : false;
return parent::post_save_each($doquery);
}
示例2: intval
/**
* Code to run after saving
*
* @param boolean Do the query?
*
* @return boolean Whether this code executed correctly
*
*/
function post_save_each($doquery = true)
{
$pictureid = intval($this->fetch_field('pictureid'));
if (!$this->condition and !empty($this->info['albums'])) {
$dateline = !$this->info['dateline'] ? TIMENOW : $this->info['dateline'];
$albuminsert = array();
$albumids = array();
foreach ($this->info['albums'] as $album) {
$albumids[] = intval($album['albumid']);
$albuminsert[] = "(" . intval($album['albumid']) . ", {$pictureid}, {$dateline})";
}
$this->registry->db->query_write("\n\t\t\t\tREPLACE INTO " . TABLE_PREFIX . "albumpicture\n\t\t\t\t\t(albumid, pictureid, dateline)\n\t\t\t\tVALUES " . implode(', ', $albuminsert));
if ($this->info['auto_count_update']) {
$this->registry->db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "album SET\n\t\t\t\t\t\t" . ($this->fetch_field('state') == 'visible' ? "visible = visible + 1, lastpicturedate = IF({$dateline} > lastpicturedate, {$dateline}, lastpicturedate)" : "moderation = moderation + 1") . "\n\t\t\t\t\tWHERE albumid IN (" . implode(',', $albumids) . ")\n\t\t\t\t");
}
}
($hook = vBulletinHook::fetch_hook('picturedata_postsave')) ? eval($hook) : false;
return parent::post_save_each($doquery);
}
示例3:
/**
* Additional data to update after a save call (such as denormalized values in other tables).
* In batch updates, is executed for each record updated.
*
* @param boolean Do the query?
*/
function post_save_each($doquery = true)
{
if ($contenttypeid = intval($this->fetch_field('contenttypeid'))) {
require_once DIR . '/packages/vbattach/attach.php';
if (!($attach =& vB_Attachment_Dm_Library::fetch_library($this->registry, $contenttypeid))) {
return false;
}
$attach->post_save_each($this);
}
return parent::post_save_each($doquery);
}
示例4: IF
/**
* Additional data to update after a save call (such as denormalized values in other tables).
* In batch updates, is executed for each record updated.
*
* @param boolean Do the query?
*/
function post_save_each($doquery = true)
{
if (!empty($this->info['update_existing'])) {
// we're updating an existing attachment that has already been counted
// in the thread/post.attach fields. We need to decrement those fields
// because they will be incremented on save.
$this->registry->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "post SET\n\t\t\t\t\tattach = IF(attach > 0, attach - 1, 0)\n\t\t\t\tWHERE postid = " . intval($this->info['update_existing']));
$this->registry->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "post AS post, " . TABLE_PREFIX . "thread AS thread SET\n\t\t\t\t\tthread.attach = IF(thread.attach > 0, thread.attach - 1, 0)\n\t\t\t\tWHERE thread.threadid = post.threadid\n\t\t\t\t\tAND post.postid = " . intval($this->info['update_existing']));
}
($hook = vBulletinHook::fetch_hook('attachdata_postsave')) ? eval($hook) : false;
return parent::post_save_each($doquery);
}
示例5: intval
/**
* Additional data to update after a save call (such as denormalized values in other tables).
* In batch updates, is executed for each record updated.
*
* @param boolean Do the query?
*/
function post_save_each($doquery = true)
{
// attachment counts
if ($this->fetch_field('visible') and empty($this->existing['visible'])) {
// new attachment or making one invisible
$this->registry->db->query_write("\r\n\t\t\t\tUPDATE " . TABLE_PREFIX . "pt_issue SET\r\n\t\t\t\t\tattachcount = attachcount + 1\r\n\t\t\t\tWHERE issueid = " . intval($this->fetch_field('issueid')));
} else {
if (!$this->fetch_field('visible') and !empty($this->existing['visible'])) {
// hiding visible attachment
$this->registry->db->query_write("\r\n\t\t\t\tUPDATE " . TABLE_PREFIX . "pt_issue SET\r\n\t\t\t\t\tattachcount = IF(attachcount > 0, attachcount - 1, 0)\r\n\t\t\t\tWHERE issueid = " . intval($this->fetch_field('issueid')));
}
}
if (!$this->condition and $this->fetch_field('visible')) {
// insert issue change
$change =& datamanager_init('Pt_IssueChange', $this->registry, ERRTYPE_STANDARD);
$change->set_info('roll_post_time_limit', 0);
// disable folding for attachment uploads
$change->set('issueid', $this->fetch_field('issueid'));
$change->set('userid', $this->registry->userinfo['userid']);
$change->set('field', 'attachment_uploaded');
$change->set('newvalue', $this->fetch_field('filename'));
$change->set('oldvalue', '');
$change->save();
}
($hook = vBulletinHook::fetch_hook('ptattachdata_postsave')) ? eval($hook) : false;
return parent::post_save_each($doquery);
}
示例6:
function post_save_each($doquery = true)
{
return parent::post_save_each($doquery);
}