本文整理汇总了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;
}
}
示例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;
}
示例3: getBlock
static function getBlock($sModule, $aParams = array())
{
ob_start();
Phpfox::getBlock($sModule, $aParams);
$sHtml = ob_get_contents();
ob_end_clean();
return $sHtml;
}
示例4: attach
public function attach()
{
Phpfox::isUser(true);
$this->setTitle(Phpfox::getPhrase('link.attach_a_link'));
Phpfox::getBlock('link.attach');
}
示例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;
}
示例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>';
}
示例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);
}
示例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());
}));
}
示例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');
}
}
示例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>');
}
示例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'))));
}
}
}
示例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;
}
}
示例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\'});');
}
示例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');
}
}
示例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());
}));
}