当前位置: 首页>>代码示例>>PHP>>正文


PHP Phpfox::getBlock方法代码示例

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


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

示例1: compose

 public function compose()
 {
     Phpfox::isUser(true);
     $aUser = Phpfox::getService('user')->get($this->get('user_id'), true);
     $this->setTitle(Phpfox::getPhrase('interact.interact_with_user', array('fname' => $aUser['full_name'])));
     if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'interact.can_interact')) {
         echo Phpfox::getPhrase('interact.unable_privacy');
         return false;
     }
     if (Phpfox::getParam('interact.interact_friends_only')) {
         if (!Phpfox::getService('friend')->isFriend($aUser['user_id'], Phpfox::getUserId())) {
             echo Phpfox::getPhrase('interact.unable_friend');
             return false;
         }
     }
     if (Phpfox::getUserParam('interact.enable_interactions')) {
         $iAllowed = Phpfox::getUserParam('interact.send_per_hour');
         if ($iAllowed != 0) {
             $iHourSent = Phpfox::getLib('database')->select('COUNT(id)')->from(Phpfox::getT('interactions_main'))->where('is_reply = 0 AND sender_id = ' . Phpfox::getUserId() . ' AND time >= ' . (time() - 3600))->execute('getSlaveField');
             if (!Phpfox::isAdmin() && $iHourSent >= $iAllowed && $this->get('reply') == 0) {
                 echo Phpfox::getPhrase('interact.flood_control', array('allowed' => $iAllowed));
                 return false;
             }
         }
         $iItemId = 0;
         if ($this->get('item_id')) {
             $iItemId = $this->get('item_id');
         }
         Phpfox::getBlock('interact.compose', array('int_id' => $this->get('int_id'), 'user_id' => $this->get('user_id'), 'item_id' => $iItemId, 'is_reply' => $this->get('reply') ? $this->get('reply') : 0));
         echo '<script type="text/javascript">$Core.loadInit();</script>';
     } else {
         echo Phpfox::getPhrase('interact.no_permission');
         return false;
     }
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:35,代码来源:ajax.class.php

示例2: update

 public function update()
 {
     ($sPlugin = Phpfox_Plugin::get('ad.component_ajax_update__start')) ? eval($sPlugin) : false;
     Phpfox::getBlock('ad.display', array('block_id' => $this->get('block_id')));
     $this->html('#js_ad_space_' . $this->get('block_id'), $this->getContent(false));
     ($sPlugin = Phpfox_Plugin::get('ad.component_ajax_update__end')) ? eval($sPlugin) : false;
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:7,代码来源:ajax.class.php

示例3: getBlock

 static function getBlock($sModule, $aParams = array())
 {
     ob_start();
     Phpfox::getBlock($sModule, $aParams);
     $sHtml = ob_get_contents();
     ob_end_clean();
     return $sHtml;
 }
开发者ID:PhpFoxPro,项目名称:Better-Mobile-Module,代码行数:8,代码来源:tools.class.php

示例4: attach

	public function attach()
	{
		Phpfox::isUser(true);
		
		$this->setTitle(Phpfox::getPhrase('link.attach_a_link'));
		
		Phpfox::getBlock('link.attach');		
	}
开发者ID:hoanghd,项目名称:tools,代码行数:8,代码来源:ajax.class.php

示例5: changeLanguage

 public function changeLanguage()
 {
     ($sPlugin = Phpfox_Plugin::get('announcement.component_ajax_changelanguage__start')) ? eval($sPlugin) : false;
     $sLanguage = $this->get('sLanguage');
     $aAnnouncements = Phpfox::getService('announcement')->getAnnouncementsByLanguage($sLanguage);
     Phpfox::getBlock('announcement.manage', array('aAnnouncements' => $aAnnouncements));
     $this->call('$("#js_announcements").hide("slow", function(){$(this).html("' . $this->getContent() . '");});');
     ($sPlugin = Phpfox_Plugin::get('announcement.component_ajax_changelanguage__end')) ? eval($sPlugin) : false;
 }
开发者ID:googlesky,项目名称:snsp.vn,代码行数:9,代码来源:ajax.class.php

示例6: _loadBlocks

 private function _loadBlocks($location)
 {
     echo '<div class="_block" data-location="' . $location . '">';
     $blocks = \Phpfox_Module::instance()->getModuleBlocks($location);
     foreach ($blocks as $block) {
         \Phpfox::getBlock($block);
     }
     echo '</div>';
 }
开发者ID:lev1976g,项目名称:core,代码行数:9,代码来源:Base.php

示例7: browse

 public function browse()
 {
     $this->error(false);
     Phpfox::getBlock('like.browse');
     $sTitle = $this->get('type_id') == 'pages' && $this->get('force_like') == '' ? Phpfox::getPhrase('like.members') : Phpfox::getPhrase('like.people_who_like_this');
     if ($this->get('dislike') == 1) {
         $sTitle = Phpfox::getPhrase('like.people_who_disliked_this');
     }
     $this->setTitle($sTitle);
 }
开发者ID:Lovinity,项目名称:EQM,代码行数:10,代码来源:ajax.class.php

示例8: __construct

    public function __construct()
    {
        $Template = \Phpfox_Template::instance();
        $this->_loader = new View\Loader();
        $dir = $Template->theme()->get()->getPath() . 'html';
        if (is_dir($dir)) {
            $this->_loader->addPath($dir, 'Theme');
        }
        $this->_loader->addPath(PHPFOX_DIR . 'theme/default/html', 'Theme');
        $this->_loader->addPath(PHPFOX_DIR . 'views', 'Base');
        $this->_env = new View\Environment($this->_loader, array('cache' => defined('PHPFOX_IS_TECHIE') && PHPFOX_IS_TECHIE || defined('PHPFOX_NO_TEMPLATE_CACHE') ? false : PHPFOX_DIR_FILE . 'cache/twig/', 'autoescape' => false));
        $this->_env->setBaseTemplateClass('Core\\View\\Base');
        $this->_env->addFunction(new \Twig_SimpleFunction('url', function ($url, $params = []) {
            return \Phpfox_Url::instance()->makeUrl($url, $params);
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('setting', function () {
            return call_user_func_array('setting', func_get_args());
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('user', function () {
            return call_user_func_array('user', func_get_args());
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('phrase', function () {
            return call_user_func_array('phrase', func_get_args());
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('comments', function () {
            \Phpfox::getBlock('feed.comment');
            return '';
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('payment', function ($params) {
            $params = new \Core\Object($params);
            \Phpfox::getBlock('api.gateway.form', ['gateway_data' => ['item_number' => '@App/' . $params->callback . '|' . $params->id, 'currency_code' => 'USD', 'amount' => $params->amount, 'item_name' => $params->name, 'return' => $params->return, 'recurring' => '', 'recurring_cost' => '', 'alternative_cost' => '', 'alternative_recurring_cost' => '']]);
            return '';
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('pager', function () {
            $u = \Phpfox_Url::instance();
            if (!isset($_GET['page'])) {
                $_GET['page'] = 1;
            }
            $_GET['page']++;
            $u->setParam('page', $_GET['page']);
            $url = $u->current();
            $html = '
				<div class="js_pager_view_more_link">
					<a href="' . $url . '" class="next_page">
						<i class="fa fa-spin fa-circle-o-notch"></i>
						<span>View More</span>
					</a>
				</div>
			';
            return $html;
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('_p', function () {
            return call_user_func_array('_p', func_get_args());
        }));
    }
开发者ID:lev1976g,项目名称:core,代码行数:55,代码来源:View.php

示例9: getAll

	public function getAll()
	{
		if (!Phpfox::isUser())
		{
			$this->call('<script type="text/javascript">window.location.href = \'' . Phpfox::getLib('url')->makeUrl('user.login') . '\';</script>');
		}
		else
		{
			Phpfox::getBlock('notification.link');	
		}
	}
开发者ID:hoanghd,项目名称:tools,代码行数:11,代码来源:ajax.class.php

示例10: browse

 public function browse()
 {
     $this->error(false);
     Phpfox::getBlock('like.browse');
     $sTitle = $this->get('type_id') == 'pages' && $this->get('force_like') == '' ? Phpfox::getPhrase('like.members') : 'Followers';
     if ($this->get('dislike') == 1) {
         $sTitle = Phpfox::getPhrase('like.people_who_disliked_this');
     }
     $this->setTitle($sTitle);
     $this->call('<script>$Core.loadInit();</script>');
 }
开发者ID:lev1976g,项目名称:core,代码行数:11,代码来源:ajax.class.php

示例11: inlineUpdate

 public function inlineUpdate()
 {
     if (($iUserId = Tag_Service_Tag::instance()->hasAccess($this->get('sType'), $this->get('item_id'), 'edit_own_tags', 'edit_user_tags')) && Phpfox::getService('tag.process')->update($this->get('sType'), $this->get('item_id'), $iUserId, Phpfox::getLib('parse.format')->isEmpty($this->get('quick_edit_input')) ? null : $this->get('quick_edit_input'))) {
         if (Phpfox::getLib('parse.format')->isEmpty($this->get('quick_edit_input'))) {
             $this->call('$(\'#' . $this->get('id') . '\').parent().remove();');
         } else {
             $aTags = Tag_Service_Tag::instance()->getTagsById($this->get('sType'), $this->get('item_id'));
             Phpfox::getBlock('tag.item', array('bDontCleanTags' => true, 'sType' => $this->get('sType'), 'sTags' => $aTags[$this->get('item_id')], 'iItemId' => $this->get('item_id'), 'iUserId' => $iUserId, 'bIsInline' => true));
             $this->html('#' . $this->get('id'), Phpfox::getLib('parse.output')->clean($this->getContent(false), false), '.highlightFade()');
             $this->html('#' . $this->get('content'), Phpfox::getLib('parse.output')->parse(Phpfox::getLib('parse.input')->clean($this->get('quick_edit_input'))));
         }
     }
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:13,代码来源:ajax.class.php

示例12: edit_status

 public function edit_status()
 {
     Phpfox::isUser(true);
     $iUserId = phpfox::getUserId();
     $iFeedId = $this->get('feed_id');
     $iItemId = $this->get('id');
     $aUserStatus = phpfox::getService('customfeed.user.status')->getById($iItemId);
     if ($aUserStatus && $aUserStatus['user_id'] == $iUserId) {
         Phpfox::getBlock('customfeed.edit_status', array('iFeedId' => $iFeedId, 'iItemId' => $iItemId, 'aUserStatus' => $aUserStatus));
     } else {
         return false;
     }
 }
开发者ID:globalmediasoft,项目名称:phpfox-customfeed,代码行数:13,代码来源:ajax.class.php

示例13: getBlocks

	public function getBlocks()
	{
		Phpfox::isUser(true);
		Phpfox::getUserParam('admincp.has_admin_access', true);
		Phpfox::getBlock('admincp.block.setting');		

		$this->html('#js_setting_block', $this->getContent(false));
		$this->show('#content_editor_text');
		$this->show('#js_editing_block');
		$this->html('#js_editing_block_text', ($this->get('m_connection') == '' ? Phpfox::getPhrase('admincp.site_wide') : $this->get('m_connection')));		
		$this->call('$.scrollTo(0);');		
		$this->call('$Core.loadInit();');
		$this->call('Core_drag.init({table: \'.js_drag_drop\', ajax: \'admincp.blockOrdering\'});');
	}
开发者ID:hoanghd,项目名称:tools,代码行数:14,代码来源:ajax.class.php

示例14: getAll

 public function getAll()
 {
     if (!Phpfox::isUser()) {
         $this->call('<script type="text/javascript">window.location.href = \'' . Phpfox::getLib('url')->makeUrl('user.login') . '\';</script>');
     } else {
         // This function caches into a static so it shouldn't be an extra load
         /*
         $aNotifications = Phpfox::getService('notification')->get();
         if (count($aNotifications) < 1)
         {
         	$this->call('<script type="text/javascript">$("#js_total_new_notifications").hide();</script>');
         }
         */
         Phpfox::getBlock('notification.link');
     }
 }
开发者ID:googlesky,项目名称:snsp.vn,代码行数:16,代码来源:ajax.class.php

示例15: __construct

    public function __construct()
    {
        $this->_loader = new View\Loader();
        $this->_loader->addPath(PHPFOX_DIR . 'theme/default/html', 'Theme');
        $this->_loader->addPath(PHPFOX_DIR . 'views', 'Base');
        /*
        $this->_env = new \Twig_Environment($this->_loader, array(
        	'cache' => false,
        	'autoescape' => false
        ));
        */
        $this->_env = new View\Environment($this->_loader, array('cache' => false, 'autoescape' => false));
        $this->_env->setBaseTemplateClass('Core\\View\\Base');
        $this->_env->addFunction(new \Twig_SimpleFunction('url', function ($url, $params = []) {
            return \Phpfox_Url::instance()->makeUrl($url, $params);
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('phrase', function () {
            return call_user_func_array('phrase', func_get_args());
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('comments', function () {
            \Phpfox::getBlock('feed.comment');
            return '';
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('pager', function () {
            $u = \Phpfox_Url::instance();
            if (!isset($_GET['page'])) {
                $_GET['page'] = 1;
            }
            $_GET['page']++;
            $u->setParam('page', $_GET['page']);
            $url = $u->current();
            $html = '
				<div class="js_pager_view_more_link">
					<a href="' . $url . '" class="next_page">
						<i class="fa fa-spin fa-circle-o-notch"></i>
						<span>View More</span>
					</a>
				</div>
			';
            return $html;
        }));
        $this->_env->addFunction(new \Twig_SimpleFunction('_p', function () {
            return call_user_func_array('_p', func_get_args());
        }));
    }
开发者ID:pH7s,项目名称:phpfox,代码行数:45,代码来源:View.php


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