• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vBulletinHook类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中vBulletinHook的典型用法代码示例。如果您正苦于以下问题:PHP vBulletinHook类的具体用法?PHP vBulletinHook怎么用?PHP vBulletinHook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了vBulletinHook类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getLoadQuery

	/**
	 * Fetches the SQL for loading.
	 * $required_query is used to identify which query to build for classes that
	 * have multiple queries for fetching info.
	 *
	 * This can safely be based on $this->required_info as long as a consitent
	 * flag is used for identifying the query.
	 *
	 * @param int $required_query				- The required query
	 * @param bool $force_rebuild				- Whether to rebuild the string
	 *
	 * @return string
	 */
	protected function getLoadQuery($required_query = self::QUERY_BASIC, $force_rebuild = false)
	{
		// Hooks should check the required query before populating the hook vars
		$hook_query_fields = $hook_query_join = $hook_query_where = '';
		($hook = vBulletinHook::fetch_hook($this->query_hook)) ? eval($hook) : false;

		if (self::QUERY_BASIC == $required_query)
		{
			$ids = array_map('intval', $this->itemid);
			return $query = "
				SELECT
					discussion.discussionid as itemid,
					discussion.*,
					firstpost.postuserid,
					firstpost.postusername,
					firstpost.dateline,
					firstpost.state,
					firstpost.title,
					firstpost.pagetext,
					firstpost.ipaddress,
					firstpost.allowsmilie,
					firstpost.reportthreadid " .
					$hook_query_fields . "
				FROM " . TABLE_PREFIX . "discussion AS discussion JOIN " .
					TABLE_PREFIX . "groupmessage AS firstpost ON discussion.firstpostid = firstpost.gmid
					INNER JOIN " .	TABLE_PREFIX . "socialgroup AS socialgroup ON socialgroup.groupid = discussion.groupid " .
				$hook_query_join . "
				WHERE discussion.discussionid IN (" . implode(',', $ids) . ")
				$hook_query_where";
		}

		throw (new vB_Exception_Model('Invalid query id \'' . htmlspecialchars($required_query) .
			'\'specified for social group message collection: ' . htmlspecialchars($query)));
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:47,代码来源:socialgroupdiscussion.php


示例2: prepare_render

 public function prepare_render($user, $results)
 {
     global $show;
     $this->mod_rights['movethread'] = false;
     $this->mod_rights['deletethread'] = false;
     $this->mod_rights['approvethread'] = false;
     $this->mod_rights['openthread'] = false;
     $ids = array();
     foreach ($results as $result) {
         $forumid = $result->get_thread()->get_field('forumid');
         $this->mod_rights['movethread'] = ($this->mod_rights['movethread'] or $user->canModerateForum($forumid, 'canmanagethreads'));
         $this->mod_rights['deletethread'] = ($this->mod_rights['deletethread'] or ($user->canModerateForum($forumid, 'candeleteposts') or $user->canModerateForum($forumid, 'canremoveposts')));
         $this->mod_rights['approvethread'] = ($this->mod_rights['approvethread'] or $user->canModerateForum($forumid, 'canmoderateposts'));
         $this->mod_rights['openthread'] = ($this->mod_rights['openthread'] or $user->canModerateForum($forumid, 'canopenclose'));
         //we need to know if any particular thread allows icons before we render any of them
         $thread = $result->get_thread();
         if ($thread->has_icon()) {
             $show['threadicons'] = true;
         }
         $ids[] = $thread->get_field('threadid');
     }
     //this is used by process_thread_array in functions_forumdisplay.php
     //which is called from vBForum_Search_Result_Thread::render
     global $dotthreads;
     $dotthreads = fetch_dot_threads_array(implode(',', $ids));
     ($hook = vBulletinHook::fetch_hook('search_prepare_render')) ? eval($hook) : false;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:27,代码来源:thread.php


示例3: fetch_validated_list

 public function fetch_validated_list($user, $ids, $gids)
 {
     //null items are never valid
     $retval = array_fill_keys($ids, false);
     ($hook = vBulletinHook::fetch_hook('search_validated_list')) ? eval($hook) : false;
     return $retval;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:7,代码来源:null.php


示例4: getLoadQuery

	/**
	 * Fetches the SQL for loading.
	 * $required_query is used to identify which query to build for classes that
	 * have multiple queries for fetching info.
	 *
	 * This can safely be based on $this->required_info as long as a consitent
	 * flag is used for identifying the query.
	 *
	 * @param int $required_query				- The required query
	 * @param bool $force_rebuild				- Whether to rebuild the string
	 *
	 * @return string
	 */
	protected function getLoadQuery($required_query = self::QUERY_BASIC, $force_rebuild = false)
	{
		// Hooks should check the required query before populating the hook vars
		$hook_query_fields = $hook_query_join = $hook_query_where = '';
		($hook = vBulletinHook::fetch_hook($this->query_hook)) ? eval($hook) : false;

		if (self::QUERY_BASIC == $required_query)
		{
			return $query = "
				SELECT 
					groupmessage.gmid as itemid,
					groupmessage.discussionid,
					groupmessage.postuserid,
					groupmessage.postusername,
					groupmessage.dateline,
					groupmessage.state,
					groupmessage.title,
					groupmessage.pagetext,
					groupmessage.ipaddress,
					groupmessage.allowsmilie,
					groupmessage.reportthreadid " .
					$hook_query_fields . "
				FROM " . TABLE_PREFIX . "groupmessage AS groupmessage " .
					$hook_query_join . "
				WHERE groupmessage.gmid IN (" . implode(',', $this->itemid) . ") 
					$hook_query_where";
		}

		throw (new vB_Exception_Model('Invalid query id \'' . htmlspecialchars($required_query) . 
			'\'specified for social group message collection: ' . htmlspecialchars($query)));
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:44,代码来源:socialgroupmessage.php


示例5: getNavigation

 /**
  * Renders the navigation tabs & links.
  */
 protected function getNavigation()
 {
     global $vbulletin;
     $root = '';
     $root_tab = $roots['vbtab_forum'];
     $tabs = build_navigation_menudata();
     $roots = get_navigation_roots(build_navigation_list());
     $request_tab = intval($_REQUEST['tabid']);
     $script_tab = get_navigation_tab_script();
     $hook_tabid = $tabid = 0;
     ($hook = vBulletinHook::fetch_hook('set_navigation_tab_vbview')) ? eval($hook) : false;
     if ($root) {
         $tabid = $roots[$root];
     }
     /* Tab setting logic, using above choices. Preference order
     		is (low > high) root > script > hookroot > hookid > request */
     $current_tab = $script_tab ? $script_tab : $root_tab;
     $current_tab = $tabid ? $tabid : $current_tab;
     $current_tab = $hook_tabid ? $hook_tabid : $current_tab;
     $current_tab = $request_tab ? $request_tab : $current_tab;
     $tabid = set_navigation_tab($current_tab, $tabs);
     $view = new vB_View('navbar_tabs');
     $view->tabs = $tabs;
     $view->selected = $tabid;
     return $view->render();
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:29,代码来源:navbar.php


示例6: process

 public function process($config)
 {
     global $show;
     $activitybits = '';
     $show['as_blog'] = vB::$vbulletin->products['vbblog'];
     $show['as_cms'] = vB::$vbulletin->products['vbcms'];
     $show['as_socialgroup'] = (vB::$vbulletin->options['socnet'] & vB::$vbulletin->bf_misc_socnet['enable_groups'] and vB::$vbulletin->userinfo['permissions']['socialgrouppermissions'] & vB::$vbulletin->bf_ugp_socialgrouppermissions['canviewgroups']);
     switch ($config['activitystream_sort']) {
         case '1':
             $this->orderby = 'score DESC, dateline DESC';
             $sort = 'popular';
             break;
         default:
             // recent
             $this->getnew = false;
             $this->orderby = 'dateline DESC';
             $sort = 'recent';
     }
     switch ($config['activitystream_filter']) {
         case '1':
             $this->setWhereFilter('type', 'photo');
             break;
         case '2':
             $this->setWhereFilter('section', 'forum');
             break;
         case '3':
             if ($show['as_cms']) {
                 $this->setWhereFilter('section', 'cms');
             }
             break;
         case '4':
             if ($show['as_blog']) {
                 $this->setWhereFilter('section', 'blog');
             }
             break;
         case '5':
             $this->setWhereFilter('section', 'socialgroup');
             break;
         default:
             // all
     }
     switch ($config['activitystream_date']) {
         case '0':
             $this->setWhereFilter('maxdateline', TIMENOW - 24 * 60 * 60);
             break;
         case '1':
             $this->setWhereFilter('maxdateline', TIMENOW - 7 * 24 * 60 * 60);
             break;
         case '2':
             $this->setWhereFilter('maxdateline', TIMENOW - 30 * 24 * 60 * 60);
             break;
         default:
             // 3 - anytime
     }
     ($hook = vBulletinHook::fetch_hook($this->hook_beforefetch)) ? eval($hook) : false;
     $this->setPage(1, $config['activitystream_limit']);
     $result = $this->fetchStream($sort, true);
     $cleaned = array_filter($result['bits']);
     return $cleaned;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:60,代码来源:block.php


示例7: get_similar_threads

 /**
  *	Get similar threads to a given thread title
  *
  * A hack to support similar thread functionality -- this used the search system 
  * previous and, in particular, the fulltext indexes on the thread table that 
  * we are trying to get rid of.  This allows us to move to the new search 
  * tables in the db search implementation and for other search implementations
  * to make use of whatever index they have to produce the results.
  *
  * Ideally this would work with the normal search interface or at least 
  * generalize to all content types, but the problem was noticed at the
  * last moment and some thought needs to be put into a more general implementation
  * (and there is no immediate requirement for one).
  *
  * Specialty search controllers can ignore this, it won't be used.
  *	A default implementation is provided that accesses the override hook.
  * Any custom implementation by a search package should respect the hook override.
  *
  *	@param string $threadtitle -- The title to match
  * @param int $threadid -- If provided this thread will be excluded from
  *   similar matches
  */
 public function get_similar_threads($threadtitle, $threadid = 0)
 {
     $similarthreads = null;
     ($hook = vBulletinHook::fetch_hook('search_similarthreads_fulltext')) ? eval($hook) : false;
     if ($similarthreads !== null) {
         return $similarthreads;
     } else {
         return array();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:32,代码来源:searchcontroller.php


示例8: parse_video_bbcode

function parse_video_bbcode($pagetext)
{
    global $vbulletin;
    ($hook = vBulletinHook::fetch_hook('data_parse_bbcode_video')) ? eval($hook) : false;
    if (stripos($pagetext, '[video]') !== false) {
        require_once DIR . '/includes/class_bbcode_alt.php';
        $parser = new vB_BbCodeParser_Video_PreParse($vbulletin, array());
        $pagetext = $parser->parse($pagetext);
    }
    return $pagetext;
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:11,代码来源:functions_video.php


示例9: build_history_bit

/**
* Builds the history bit for a selected history point
*
* @param	array	Array of information for this histoy point
* @param	object	BB code parser
*
* @return	string	History bit HTML
*/
function build_history_bit($history, &$bbcode)
{
    global $vbulletin, $vbphrase, $show, $stylevar;
    $history['editdate'] = vbdate($vbulletin->options['dateformat'], $history['dateline'], true);
    $history['edittime'] = vbdate($vbulletin->options['timeformat'], $history['dateline']);
    $history['message'] = $bbcode->parse($history['pagetext'], 'pt');
    if ($history['reason'] === '') {
        $history['reason'] = $vbphrase['n_a'];
    }
    ($hook = vBulletinHook::fetch_hook('project_historybit')) ? eval($hook) : false;
    eval('$edit_history = "' . fetch_template('pt_historybit') . '";');
    return $edit_history;
}
开发者ID:holandacz,项目名称:nb4,代码行数:21,代码来源:functions_pt_notehistory.php


示例10: IF

/**
 * Contructs a Post Tree
 *
 * @param	string	The template Name to use
 * @param	integer	The Thread ID
 * @param	integer	The "Root" post for which to work from
 * @param	integer	The current "Depth" within the tree
 *
 * @return	string	The Generated Tree
 *
 */
function &construct_post_tree($templatename, $threadid, $parentid = 0, $depth = 1)
{
    global $vbulletin, $stylevar, $parentassoc, $show, $vbphrase, $threadedmode;
    static $postcache;
    if (!$threadedmode and $vbulletin->userinfo['postorder']) {
        $postorder = 'DESC';
    }
    $depthnext = $depth + 2;
    if (!$postcache) {
        $posts = $vbulletin->db->query_read_slave("\n\t\t\tSELECT post.parentid, post.postid, post.userid, post.pagetext, post.dateline, IF(visible = 2, 1, 0) AS isdeleted,\n\t\t\t\tIF(user.username <> '', user.username, post.username) AS username\n\t\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON user.userid = post.userid\n\t\t\tWHERE post.threadid = {$threadid}\n\t\t\tORDER BY dateline {$postorder}\n\t\t");
        while ($post = $vbulletin->db->fetch_array($posts)) {
            if (!$threadedmode) {
                $post['parentid'] = 0;
            }
            $postcache[$post['parentid']][$post['postid']] = $post;
        }
        ksort($postcache);
    }
    $counter = 0;
    $postbits = '';
    if (is_array($postcache["{$parentid}"])) {
        foreach ($postcache["{$parentid}"] as $post) {
            $parentassoc[$post['postid']] = $post['parentid'];
            if (($depth + 1) % 4 == 0) {
                // alternate colors when switching depths; depth gets incremented by 2 each time
                $post['backcolor'] = '{firstaltcolor}';
                $post['bgclass'] = 'alt1';
            } else {
                $post['backcolor'] = '{secondaltcolor}';
                $post['bgclass'] = 'alt2';
            }
            $post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline'], true);
            $post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);
            // cut page text short if too long
            if (vbstrlen($post['pagetext']) > 100) {
                $spacepos = strpos($post['pagetext'], ' ', 100);
                if ($spacepos != 0) {
                    $post['pagetext'] = substr($post['pagetext'], 0, $spacepos) . '...';
                }
            }
            $post['pagetext'] = nl2br(htmlspecialchars_uni($post['pagetext']));
            ($hook = vBulletinHook::fetch_hook('threadmanage_construct_post_tree')) ? eval($hook) : false;
            eval('$postbits .=  "' . fetch_template($templatename) . '";');
            $ret =& construct_post_tree($templatename, $threadid, $post['postid'], $depthnext);
            $postbits .= $ret;
        }
    }
    return $postbits;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:60,代码来源:functions_threadmanage.php


示例11: fetch_prefix_array

/**
* Fetches an array of prefixes for the specified forum. Returned in format:
* [prefixsetid][] = prefixid
*
* @param	integer	Forum ID to fetch prefixes from
*
* @return	array
*/
function fetch_prefix_array($forumid)
{
    global $vbulletin;
    if (isset($vbulletin->prefixcache)) {
        return is_array($vbulletin->prefixcache["{$forumid}"]) ? $vbulletin->prefixcache["{$forumid}"] : array();
    } else {
        $prefixsets = array();
        $prefix_sql = $vbulletin->db->query_read("\n\t\t\tSELECT prefix.*\n\t\t\tFROM " . TABLE_PREFIX . "forumprefixset AS forumprefixset\n\t\t\tINNER JOIN " . TABLE_PREFIX . "prefixset AS prefixset ON (prefixset.prefixsetid = forumprefixset.prefixsetid)\n\t\t\tINNER JOIN " . TABLE_PREFIX . "prefix AS prefix ON (prefix.prefixsetid = prefixset.prefixsetid)\n\t\t\tWHERE forumprefixset.forumid = " . intval($forumid) . "\n\t\t\tORDER BY prefixset.displayorder, prefix.displayorder\n\t\t");
        while ($prefix = $vbulletin->db->fetch_array($prefix_sql)) {
            $prefixsets["{$prefix['prefixsetid']}"][] = $prefix['prefixid'];
        }
        ($hook = vBulletinHook::fetch_hook('prefix_fetch_array')) ? eval($hook) : false;
        return $prefixsets;
    }
}
开发者ID:holandacz,项目名称:nb4,代码行数:23,代码来源:functions_prefix.php


示例12: prepare

 /**
  * Prepares a Profile Field
  *
  * @param	string	The name of a field to be prepared
  */
 function prepare($field, $info = null)
 {
     if (isset($this->prepared["{$field}"])) {
         return;
     }
     $handled = false;
     ($hook = vBulletinHook::fetch_hook('userprofile_prepare')) ? eval($hook) : false;
     if (!$handled) {
         if (isset($this->prepare_methods["{$field}"])) {
             $method = $this->prepare_methods["{$field}"];
             $this->{$method}($info);
         } else {
             $this->prepared["{$field}"] = $this->userinfo["{$field}"];
         }
     }
 }
开发者ID:holandacz,项目名称:nb4,代码行数:21,代码来源:class_userprofile.php


示例13: step_1

 /**
  * Step #1 - Import Settings XML
  *
  */
 function step_1()
 {
     build_forum_permissions();
     vBulletinHook::build_datastore($this->db);
     build_product_datastore();
     build_activitystream_datastore();
     if (VB_AREA == 'Upgrade') {
         $this->show_message($this->phrase['final']['import_latest_options']);
         require_once DIR . '/includes/adminfunctions_options.php';
         if (!($xml = file_read(DIR . '/install/vbulletin-settings.xml'))) {
             $this->add_error(sprintf($this->phrase['vbphrase']['file_not_found'], 'vbulletin-settings.xml'), self::PHP_TRIGGER_ERROR, true);
             return;
         }
         $this->show_message(sprintf($this->phrase['vbphrase']['importing_file'], 'vbulletin-settings.xml'));
         xml_import_settings($xml);
         $this->show_message($this->phrase['core']['import_done']);
     } else {
         $this->skip_message();
     }
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:24,代码来源:class_upgrade_final.php


示例14: fetch_prefix_array

/**
* Fetches an array of prefixes for the specified forum. Returned in format:
* [prefixsetid][] = prefixid
*
* @param	integer	Forum ID to fetch prefixes from
*
* @return	array
*/
function fetch_prefix_array($forumid)
{
	global $vbulletin;

	if (isset($vbulletin->prefixcache))
	{
		return (is_array($vbulletin->prefixcache["$forumid"]) ? $vbulletin->prefixcache["$forumid"] : array());
	}
	else
	{
		$prefixsets = array();
		$prefix_sql = $vbulletin->db->query_read("
			SELECT prefix.*, prefixpermission.usergroupid AS restriction
			FROM " . TABLE_PREFIX . "forumprefixset AS forumprefixset
			INNER JOIN " . TABLE_PREFIX . "prefixset AS prefixset ON (prefixset.prefixsetid = forumprefixset.prefixsetid)
			INNER JOIN " . TABLE_PREFIX . "prefix AS prefix ON (prefix.prefixsetid = prefixset.prefixsetid)
			LEFT JOIN " . TABLE_PREFIX . "prefixpermission AS prefixpermission ON (prefix.prefixid = prefixpermission.prefixid)
			WHERE forumprefixset.forumid = " . intval($forumid) . "
			ORDER BY prefixset.displayorder, prefix.displayorder
		");
		while ($prefix = $vbulletin->db->fetch_array($prefix_sql))
		{
			if (empty($prefixsets["$prefix[prefixsetid]"]["$prefix[prefixid]"]))
			{
				$prefixsets["$prefix[prefixsetid]"]["$prefix[prefixid]"] = array(
					'prefixid' => $prefix['prefixid'],
					'restrictions' => array()
				);
			}

			if ($prefix['restriction'])
			{
				$prefixsets["$prefix[prefixsetid]"]["$prefix[prefixid]"]['restrictions'][] = $prefix['restriction'];
			}
		}

		($hook = vBulletinHook::fetch_hook('prefix_fetch_array')) ? eval($hook) : false;

		return $prefixsets;
	}
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:49,代码来源:functions_prefix.php


示例15: verify_authentication2

 function verify_authentication2($username)
 {
     global $vbulletin;
     $username = strip_blank_ascii($username, ' ');
     if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'")) {
         if ($vbulletin->GPC[COOKIE_PREFIX . 'userid'] and $vbulletin->GPC[COOKIE_PREFIX . 'userid'] != $vbulletin->userinfo['userid']) {
             // we have a cookie from a user and we're logging in as
             // a different user and we're not going to store a new cookie,
             // so let's unset the old one
             vbsetcookie('userid', '', true, true, true);
             vbsetcookie('password', '', true, true, true);
         }
         vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true);
         vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true);
         $return_value = true;
         ($hook = vBulletinHook::fetch_hook('login_verify_success')) ? eval($hook) : false;
         return $return_value;
     }
     $return_value = false;
     ($hook = vBulletinHook::fetch_hook('login_verify_failure_username')) ? eval($hook) : false;
     return $return_value;
 }
开发者ID:xijbx,项目名称:loginshell,代码行数:22,代码来源:loginshell.php


示例16: fetch_entry_tagbits

/**
* Fetches the tagbits for display in an entry
*
* @param	array	Blog info
*
* @return	string	Tag bits
*/
function fetch_entry_tagbits($bloginfo, &$userinfo)
{
	global $vbulletin, $vbphrase, $show, $template_hook;

	if ($bloginfo['taglist'])
	{
		$tag_array = explode(',', $bloginfo['taglist']);

		$tag_list = array();
		foreach ($tag_array AS $tag)
		{
			$tag = trim($tag);
			if ($tag === '')
			{
				continue;
			}
			$tag_url = urlencode(unhtmlspecialchars($tag));
			$tag = fetch_word_wrapped_string($tag);

			($hook = vBulletinHook::fetch_hook('blog_tag_fetchbit')) ? eval($hook) : false;

			$templater = vB_Template::create('blog_tagbit');
				$templater->register('tag', $tag);
				$templater->register('tag_url', $tag_url);
				$templater->register('userinfo', $userinfo);
				$templater->register('pageinfo', array('tag' => $tag_url));
			$tag_list[] = trim($templater->render());
		}
	}
	else
	{
		$tag_list = array();
	}

	($hook = vBulletinHook::fetch_hook('blog_tag_fetchbit_complete')) ? eval($hook) : false;

	return implode(", ", $tag_list);
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:45,代码来源:blog_functions_tag.php


示例17: post_delete

 /**
  * Additional data to update after a delete call (such as denormalized values in other tables).
  *
  * @param	boolean	Do the query?
  */
 function post_delete($doquery = true)
 {
     $pictures = array();
     $picture_sql = $this->registry->db->query_read("\n\t\t\tSELECT albumpicture.pictureid, picture.idhash, picture.extension\n\t\t\tFROM " . TABLE_PREFIX . "albumpicture AS albumpicture\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "picture AS picture ON (albumpicture.pictureid = picture.pictureid)\n\t\t\tWHERE albumpicture.albumid = " . $this->fetch_field('albumid'));
     while ($picture = $this->registry->db->fetch_array($picture_sql)) {
         $pictures["{$picture['pictureid']}"] = $picture;
     }
     if ($pictures) {
         if ($this->registry->options['album_dataloc'] != 'db') {
             // remove from fs
             foreach ($pictures as $picture) {
                 @unlink(fetch_picture_fs_path($picture));
                 @unlink(fetch_picture_fs_path($picture, true));
             }
         }
         $this->registry->db->query_write("\n\t\t\t\tDELETE FROM " . TABLE_PREFIX . "picture\n\t\t\t\tWHERE pictureid IN (" . implode(',', array_keys($pictures)) . ")\n\t\t\t");
         // delete based on picture id as this means that when a picture is deleted,
         // it's removed from all albums automatically
         $this->registry->db->query_write("\n\t\t\t\tDELETE FROM " . TABLE_PREFIX . "albumpicture\n\t\t\t\tWHERE pictureid IN (" . implode(',', array_keys($pictures)) . ")\n\t\t\t");
         $this->registry->db->query_write("\n\t\t\t\tDELETE FROM " . TABLE_PREFIX . "picturecomment\n\t\t\t\tWHERE pictureid IN (" . implode(',', array_keys($pictures)) . ")\n\t\t\t");
         require_once DIR . '/includes/functions_picturecomment.php';
         build_picture_comment_counters($this->fetch_field('userid'));
         $groups = array();
         $groups_sql = $this->registry->db->query_read("\n\t\t\t\tSELECT DISTINCT socialgroup.*\n\t\t\t\tFROM " . TABLE_PREFIX . "socialgrouppicture AS socialgrouppicture\n\t\t\t\tINNER JOIN " . TABLE_PREFIX . "socialgroup AS socialgroup ON (socialgroup.groupid = socialgrouppicture.groupid)\n\t\t\t\tWHERE socialgrouppicture.pictureid IN (" . implode(',', array_keys($pictures)) . ")\n\t\t\t");
         while ($group = $this->registry->db->fetch_array($groups_sql)) {
             $groups[] = $group;
         }
         $this->registry->db->query_write("\n\t\t\t\tDELETE FROM " . TABLE_PREFIX . "socialgrouppicture\n\t\t\t\tWHERE pictureid IN (" . implode(',', array_keys($pictures)) . ")\n\t\t\t");
         foreach ($groups as $group) {
             $groupdata =& datamanager_init('SocialGroup', $this->registry, ERRTYPE_SILENT);
             $groupdata->set_existing($group);
             $groupdata->rebuild_picturecount();
             $groupdata->save();
         }
     }
     $this->remove_usercss_background_image();
     ($hook = vBulletinHook::fetch_hook('albumdata_delete')) ? eval($hook) : false;
     return true;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:44,代码来源:class_dm_album.php


示例18: __construct

 /**
  * 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
  */
 public function __construct(&$registry, $errtype = ERRTYPE_STANDARD)
 {
     parent::vB_DataManager($registry, $errtype);
     ($hook = vBulletinHook::fetch_hook('stylevardata_start')) ? eval($hook) : false;
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:11,代码来源:class_dm_stylevar.php


示例19: intval

// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "session\n\tWHERE lastactivity < " . intval(TIMENOW - $vbulletin->options['cookietimeout']) . "\n");
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "cpsession\n\tWHERE dateline < " . ($vbulletin->options['timeoutcontrolpanel'] ? intval(TIMENOW - $vbulletin->options['cookietimeout']) : TIMENOW - 3600) . "\n");
require_once DIR . '/vb/search/results.php';
vB_Search_Results::clean();
// expired lost passwords and email confirmations after 4 days
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "useractivation\n\tWHERE dateline < " . (TIMENOW - 345600) . " AND\n\t(type = 1 OR (type = 0 and usergroupid = 2))\n");
// old forum/thread read marking data
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "threadread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "forumread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "groupread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
$vbulletin->db->query_write("\n\tDELETE FROM " . TABLE_PREFIX . "discussionread\n\tWHERE readtime < " . (TIMENOW - $vbulletin->options['markinglimit'] * 86400));
// delete expired thread redirects
$threads = $vbulletin->db->query_read("\n\tSELECT threadid\n\tFROM " . TABLE_PREFIX . "threadredirect\n\tWHERE expires < " . TIMENOW . "\n");
while ($thread = $vbulletin->db->fetch_array($threads)) {
    $thread['open'] = 10;
    $threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
    $threadman->set_existing($thread);
    $threadman->delete(false, true, NULL, false);
    unset($threadman);
}
vB_Cache::instance()->clean();
($hook = vBulletinHook::fetch_hook('cron_script_cleanup_hourly')) ? eval($hook) : false;
log_cron_action('', $nextitem, 1);
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 62098 $
|| ####################################################################
\*======================================================================*/
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:cleanup.php


示例20: count

    $show['albumselect'] = count($albums) == 1 ? false : true;
    $vbulletin->userinfo['cachedcss'] = $usercss->build_css($usercss->fetch_effective());
    $vbulletin->userinfo['cachedcss'] = str_replace('/*sessionurl*/', $vbulletin->session->vars['sessionurl_js'], $vbulletin->userinfo['cachedcss']);
    if ($vbulletin->userinfo['cachedcss']) {
        $userinfo = $vbulletin->userinfo;
        eval('$usercss_string = "' . fetch_template('memberinfo_usercss') . '";');
    } else {
        $usercss_string = '';
    }
    eval('$headinclude .= "' . fetch_template('modifyusercss_headinclude') . '";');
    $navbits[''] = $vbphrase['customize_profile'];
    construct_usercp_nav('customize');
    $templatename = 'modifyusercss';
}
// #############################################################################
// spit out final HTML if we have got this far
if ($templatename != '') {
    // make navbar
    $navbits = construct_navbits($navbits);
    eval('$navbar = "' . fetch_template('navbar') . '";');
    ($hook = vBulletinHook::fetch_hook('profile_complete')) ? eval($hook) : false;
    // shell template
    eval('$HTML = "' . fetch_template($templatename) . '";');
    eval('print_output("' . fetch_template($shelltemplatename) . '");');
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 08:19, Wed Nov 5th 2008
|| # CVS: $RCSfile$ - $Revision: 28139 $
|| ####################################################################
\*======================================================================*/
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:profile.php



注:本文中的vBulletinHook类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vCal类代码示例发布时间:2022-05-23
下一篇:
PHP vB_XML_Parser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap