本文整理汇总了PHP中vB_DataManager类的典型用法代码示例。如果您正苦于以下问题:PHP vB_DataManager类的具体用法?PHP vB_DataManager怎么用?PHP vB_DataManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了vB_DataManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vB_DataManager_Blog_Category
/**
* Constructor - checks that the registry object has been passed correctly.
*
* @param vB_Registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
* @param integer One of the ERRTYPE_x constants
*/
function vB_DataManager_Blog_Category(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
($hook = vBulletinHook::fetch_hook('blog_categorydata_start')) ? eval($hook) : false;
}
示例2: vB_DataManager_SocialGroup
/**
* Constructor - checks that the registry object has been passed correctly.
*
* @param vB_Registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
* @param integer One of the ERRTYPE_x constants
*/
function vB_DataManager_SocialGroup(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
($hook = vBulletinHook::fetch_hook('socgroupdata_start')) ? eval($hook) : false;
}
示例3: vB_DataManager_Album
/**
* Constructor - checks that the registry object has been passed correctly.
*
* @param vB_Registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
* @param integer One of the ERRTYPE_x constants
*/
function vB_DataManager_Album(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
($hook = vBulletinHook::fetch_hook('albumdata_start')) ? eval($hook) : false;
}
示例4: vB_DataManager_Cms_Layout
/**
* Constructor - checks that the registry object has been passed correctly.
*
* @param vB_Registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
* @param integer One of the ERRTYPE_x constants
*/
function vB_DataManager_Cms_Layout(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
($hook = vBulletinHook::fetch_hook('cms_layout_start')) ? eval($hook) : false;
}
示例5: vB_DataManager_Pt_IssueType
/**
* Constructor - checks that the registry object has been passed correctly.
*
* @param vB_Registry Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
* @param integer One of the ERRTYPE_x constants
*/
function vB_DataManager_Pt_IssueType(&$registry, $errtype = ERRTYPE_STANDARD)
{
parent::vB_DataManager($registry, $errtype);
($hook = vBulletinHook::fetch_hook('pt_issuetypedata_start')) ? eval($hook) : false;
}
示例6: delete
function delete()
{
if ($this->fetch_field('type') == 'category') {
$this->registry->db->query("delete from " . TABLE_PREFIX . "{$this->table} where type='template' and userid=" . $this->fetch_field('userid') . " and parentid=" . $this->fetch_field('pid'));
}
parent::delete();
}
示例7:
/**
* Sets a bit in a bitfield
*
* @param string Name of the database bitfield (options, permissions etc.)
* @param string Name of the bit within the bitfield (canview, canpost etc.)
* @param boolean Whether the bit should be set or not
*
* @return boolean
*/
function set_bitfield($fieldname, $bitname, $onoff)
{
// there are 2 permissions in the the admin permission bitfield that don't actually
// belong in this table...
if ($fieldname == 'adminpermissions' and ($bitname == 'ismoderator' or $bitname == 'cancontrolpanel')) {
return false;
}
return parent::set_bitfield($fieldname, $bitname, $onoff);
}
示例8: 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);
}
示例9: eval
/**
* Additional data to update after a delete call (such as denormalized values in other tables).
*
* @access protected
*
* @param boolean $doquery Do the query?
*/
function post_delete($doquery = true)
{
require_once(DIR . '/includes/functions_socialgroup.php');
fetch_socialgroup_newest_groups(true, false, !$this->registry->options['sg_enablesocialgroupicons']);
($hook = vBulletinHook::fetch_hook('socgroupicondata_delete')) ? eval($hook) : false;
return parent::post_delete($doquery);
}
示例10: eval
function post_delete($doquery = true)
{
($hook = vBulletinHook::fetch_hook('userpicdata_delete')) ? eval($hook) : false;
return parent::post_delete($doquery);
}
示例11: save
/**
* Overridding parent function to add search index updates
*
* @param boolean Do the query?
* @param mixed Whether to run the query now; see db_update() for more info
* @param bool Whether to return the number of affected rows.
* @param bool Perform REPLACE INTO instead of INSERT
8 @param bool Perfrom INSERT IGNORE instead of INSERT
*
* @return mixed If this was an INSERT query, the INSERT ID is returned
*/
function save($doquery = true, $delayed = false, $affected_rows = false, $replace = false, $ignore = false)
{
// Call and get the new id
$result = parent::save($doquery, $delayed, $affected_rows, $replace, $ignore);
require_once DIR . '/vb/search/indexcontroller/queue.php' ;
// Search index maintenance
vb_Search_Indexcontroller_Queue::indexQueue('vBForum', 'Forum', 'index',
$this->fetch_field('forumid'));
return $result;
}
示例12: post_save_once
public function post_save_once($doquery = true)
{
parent::post_save_once($doquery);
require_once DIR . '/includes/adminfunctions_template.php';
//print_rebuild_style(-1, '', 0, 1, 1, 0, false);
build_style(-1, '', array('docss' => 0, 'dostylevars' => 1, 'doreplacements' => 0, 'doposteditor' => 0), '-1,1', '', false, false);
}
示例13: save
/**
* Saves the data from the object into the specified database tables
*
* We change the default for $replace to true, and then call the parent.
*/
function save($doquery = true, $delayed = false, $affected_rows = false, $replace = true, $ignore = false)
{
// We default $replace to true, and then call the parent.
return parent::save($doquery, $delayed, $affected_rows, $replace, $ignore);
}
示例14: foreach
/**
* Any code to run after deleting
*
* @param Boolean Do the query?
*/
function post_delete($doquery = true)
{
foreach ($this->lists['content'] as $contenttypeid => $list) {
if (!($attach =& vB_Attachment_Dm_Library::fetch_library($this->registry, $contenttypeid))) {
return false;
}
$attach->post_delete($this);
unset($attach);
}
// Update the refcount in the filedata table
if (!empty($this->lists['filedataids'])) {
$this->registry->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "filedata AS fd\n\t\t\t\tSET fd.refcount = (\n\t\t\t\t\tSELECT COUNT(*)\n\t\t\t\t\tFROM " . TABLE_PREFIX . "attachment AS a\n\t\t\t\t\tWHERE fd.filedataid = a.filedataid\n\t\t\t\t)\n\t\t\t\tWHERE fd.filedataid IN (" . implode(", ", array_keys($this->lists['filedataids'])) . ")\n\t\t\t");
}
// Below here only applies to attachments in pictures/groups but I forsee all attachments gaining the ability to have comments
if ($this->info['type'] == 'filedata') {
if (!empty($this->lists['filedataids'])) {
$this->registry->db->query_write("\n\t\t\t\t\tDELETE FROM " . TABLE_PREFIX . "picturecomment\n\t\t\t\t\tWHERE filedataid IN (" . implode(", ", array_keys($this->lists['filedataids'])) . ")\n\t\t\t\t");
}
} else {
if (!empty($this->lists['picturecomments'])) {
foreach ($this->lists['picturecomments'] as $sql) {
if (!($results = $this->registry->db->query_first("\n\t\t\t\t\tSELECT a.attachmentid\n\t\t\t\t\tFROM " . TABLE_PREFIX . "attachment AS a\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t{$sql}\n\t\t\t\t"))) {
$this->registry->db->query_write("\n\t\t\t\t\t\tDELETE FROM " . TABLE_PREFIX . "picturecomment\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t{$sql}\n\t\t\t\t\t");
}
}
}
}
require_once DIR . '/includes/functions_picturecomment.php';
foreach (array_keys($this->lists['userids']) as $userid) {
build_picture_comment_counters($userid);
}
return parent::post_delete($doquery);
}
示例15: intval
/**
* Verifies the page text is valid and sets it up for saving.
*
* @param string Page text
*
* @param bool Whether the text is valid
*/
function verify_pagetext(&$pagetext)
{
if (empty($this->info['skip_charcount']))
{
if (!$this->fetch_field('type'))
{
trigger_error('vB_Datamanager_Blog_Custom_Block(): \'type\' must be set.', E_USER_ERROR);
}
if ($this->fetch_field('type'))
{
$maxchars = $this->registry->options['vbblog_blockmaxchars'];
}
else
{
$maxchars = $this->registry->options['vbblog_pagemaxchars'];
}
if ($maxchars != 0 AND ($postlength = vbstrlen($pagetext)) > $maxchars)
{
$this->error('toolong', $postlength, $maxchars);
return false;
}
$this->registry->options['postminchars'] = intval($this->registry->options['postminchars']);
if ($this->registry->options['postminchars'] <= 0)
{
$this->registry->options['postminchars'] = 1;
}
if (vbstrlen(strip_bbcode($pagetext, $this->registry->options['ignorequotechars'])) < $this->registry->options['postminchars'])
{
$this->error('tooshort', $this->registry->options['postminchars']);
return false;
}
}
return parent::verify_pagetext($pagetext, false);
}