本文整理汇总了PHP中Phpfox::isMobile方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::isMobile方法的具体用法?PHP Phpfox::isMobile怎么用?PHP Phpfox::isMobile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::isMobile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Class process method which is used to execute this component.
*/
public function process()
{
$this->template()->setTitle(Phpfox::getPhrase('user.email_verification'))->setBreadcrumb(Phpfox::getPhrase('user.email_verification'))->assign(array('iVerifyUserId' => Phpfox::getLib('session')->get('cache_user_id')));
$sHash = $this->request()->get('link', '');
if ($sHash == '') {
} elseif (Phpfox::getService('user.verify.process')->verify($sHash)) {
if ($sPlugin = Phpfox_Plugin::get('user.component_verify_process_redirection')) {
eval($sPlugin);
}
$sRedirect = Phpfox::getParam('user.redirect_after_signup');
if (!empty($sRedirect)) {
Phpfox::getLib('session')->set('redirect', str_replace('.', '/', $sRedirect));
}
if (Phpfox::isMobile()) {
$this->url()->send('mobile.user.login', null, Phpfox::getPhrase('user.your_email_has_been_verified_please_log_in_with_the_information_you_provided_during_sign_up'));
}
// send to the log in and say everything is ok
Phpfox::getLib('session')->set('verified_do_redirect', '1');
$this->url()->send('user.login', null, Phpfox::getPhrase('user.your_email_has_been_verified_please_log_in_with_the_information_you_provided_during_sign_up'));
} else {
//send to the log in and say there was an error
Phpfox_Error::set(Phpfox::getPhrase('user.invalid_verification_link'));
$iTime = Phpfox::getParam('user.verify_email_timeout');
if ($iTime < 60) {
$sTime = Phpfox::getPhrase('user.time_minutes', array('time' => $iTime));
} elseif ($iTime < 60 * 60 * 24) {
$sTime = $iTime == 60 ? Phpfox::getPhrase('user.time_hour', array('time' => round($iTime / 60))) : Phpfox::getPhrase('user.time_hours', array('time' => round($iTime / 60)));
} else {
$sTime = Phpfox::getPhrase('user.time_days', array('time' => $sTime));
}
Phpfox::getService('user.verify.process')->sendMail(Phpfox::getLib('session')->get('cache_user_id'));
$this->template()->assign(array('sTime' => $sTime));
}
}
示例2: check
public function check($sActualTitle, $sReq = 'req3')
{
return;
if (PHPFOX_IS_AJAX) {
return;
}
$sTitle = urldecode(Phpfox_Request::instance()->get($sReq));
if (empty($sTitle)) {
$aParts = explode('/', trim(Phpfox_Request::instance()->get(PHPFOX_GET_METHOD), '/'));
$iCnt = 0;
foreach ($aParts as $sPart) {
if (Phpfox::isMobile() && $sPart == 'mobile') {
continue;
}
$iCnt++;
if ((int) str_replace('req', '', $sReq) == $iCnt) {
$sTitle = $sPart;
break;
}
}
}
$sActualTitle = Phpfox_Url::instance()->cleanTitle($sActualTitle);
if (empty($sActualTitle)) {
return;
}
if ($sTitle != $sActualTitle) {
$sPath = '';
$aRequests = (array) Phpfox_Request::instance()->getRequests();
if (defined('PHPFOX_IS_AJAX_PAGE') && PHPFOX_IS_AJAX_PAGE) {
$aSubRequests = explode('/', trim(Phpfox_Request::instance()->get(PHPFOX_GET_METHOD), '/'));
$aRequests = array();
foreach ($aSubRequests as $iKey => $sSubRequest) {
$sCurrentCnt = 'req' . ($iKey + 1);
$aRequests[$sCurrentCnt] = $sSubRequest;
}
}
if (empty($sTitle)) {
$aRequests[$sReq] = $sActualTitle;
}
foreach ($aRequests as $sKey => $sValue) {
if ($sKey == PHPFOX_GET_METHOD) {
continue;
}
if ($sKey == $sReq) {
$sValue = $sActualTitle;
}
$sPath .= $sValue . '.';
}
$sPath = rtrim($sPath, '.');
if (!empty($sActualTitle)) {
Phpfox_Url::instance()->send($sPath, array(), null, 301);
}
}
}
示例3: process
/**
* Controller
*/
public function process()
{
Phpfox::getUserParam('feed.can_view_feed', true);
$sFeedDisplay = 'feed.display';
($sPlugin = Phpfox_Plugin::get('feed.component_controller_index_feeddisplay')) ? eval($sPlugin) : false;
/* Load the picup files if needed*/
if (Phpfox::isMobile() && (($sBrowser = Phpfox_Request::instance()->getBrowser()) && strpos($sBrowser, 'Safari') !== false)) {
$sMethod = 'simple';
$this->template()->setHeader(array('<script type="text/javascript">
var flash_user_id = ' . Phpfox::getUserId() . ';
var sHash = "' . Phpfox::getService('core')->getHashForUpload() . '";</script>', 'mobile.js' => 'module_photo'))->assign(array('bRawFileInput' => true));
}
$this->template()->setEditor()->setHeader('cache', array('feed.js' => 'module_feed', 'comment.css' => 'style_css', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'))->assign(array('sFeedDisplay' => $sFeedDisplay));
}
示例4: canEndingSoonContest
public function canEndingSoonContest($iContestId)
{
$aContest = Phpfox::getService('contest.contest')->getContestForCheckingPermission($iContestId);
if (!$aContest) {
return false;
}
if (!in_array($aContest['contest_status'], array(Phpfox::getService('contest.constant')->getContestStatusIdByStatusName('on_going')))) {
return false;
}
if ((Phpfox::getUserParam('contest.can_ending_soon_contest') || $aContest['module_id'] == 'pages' && Phpfox::getService('pages')->isAdmin($aContest['item_id'])) && !Phpfox::isMobile()) {
return true;
} else {
return false;
}
return true;
}
示例5: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (Phpfox::isMobile()) {
return false;
}
$mAttachmentShare = $this->getParam('attachment_share', null);
if ($mAttachmentShare === null) {
return false;
}
if (!is_array($mAttachmentShare)) {
$mAttachmentShare = array('type' => $mAttachmentShare);
}
if (!isset($mAttachmentShare['inline'])) {
$mAttachmentShare['inline'] = false;
}
$this->template()->assign(array('aAttachmentShare' => $mAttachmentShare));
}
示例6: filterAd
public function filterAd($aAds)
{
if (!is_array($aAds)) {
return $aAds;
}
$aAdId = Phpfox::getParam('bettermobile.mobile_ad_id');
if (!empty($aAdId)) {
foreach ($aAds as $iKey => $aAd) {
if (Phpfox::isMobile()) {
if (!in_array($aAd['ad_id'], $aAdId)) {
unset($aAds[$iKey]);
}
} else {
if (in_array($aAd['ad_id'], $aAdId)) {
unset($aAds[$iKey]);
}
}
}
}
return $aAds;
}
示例7: timeline
public function timeline()
{
if (Phpfox::isMobile()) {
return false;
}
if (defined('PAGE_TIME_LINE') && PAGE_TIME_LINE) {
return true;
}
$iUserId = Phpfox_Request::instance()->get('profile_user_id');
if ((defined('PHPFOX_IS_USER_PROFILE') || !empty($iUserId)) && Phpfox::isModule('feed') && Phpfox::getParam('feed.force_timeline')) {
return true;
}
if (PHPFOX_IS_AJAX && (Phpfox_Request::instance()->get('action') == 'upload_photo_via_share' && Phpfox_Request::instance()->get('callback_module') == 'pages' && Phpfox::getService('pages')->timelineEnabled(Phpfox_Request::instance()->get('callback_item_id')))) {
return true;
}
if (Phpfox::isModule('feed') && !Phpfox::getParam('feed.force_timeline')) {
if (Phpfox::getParam('feed.timeline_optional') && PHPFOX_IS_AJAX && Phpfox_Request::instance()->get('profile_user_id') > 0) {
$aUser = Phpfox::getService('user')->getUserObject(Phpfox_Request::instance()->get('profile_user_id'));
if (isset($aUser->use_timeline) && $aUser->use_timeline) {
return true;
}
}
if (!PHPFOX_IS_AJAX && Phpfox::getParam('feed.timeline_optional') && defined('PHPFOX_CURRENT_TIMELINE_PROFILE')) {
$aUser = Phpfox::getService('user')->getUserObject(PHPFOX_CURRENT_TIMELINE_PROFILE);
if (isset($aUser->use_timeline) && $aUser->use_timeline) {
return true;
}
}
$aCore = Phpfox_Request::instance()->get('core');
if (PHPFOX_IS_AJAX && Phpfox::getParam('feed.timeline_optional') && isset($aCore['profile_user_id']) && $aCore['profile_user_id'] > 0) {
Phpfox::getService('user')->get($aCore['profile_user_id']);
$aUser = Phpfox::getService('user')->getUserObject($aCore['profile_user_id']);
if (isset($aUser->use_timeline) && $aUser->use_timeline) {
return true;
}
}
return false;
}
return defined('PHPFOX_IS_USER_PROFILE') ? true : false;
}
示例8: process
public function process()
{
Phpfox::getLib('setting')->setParam(array('profile.url_image' => Phpfox::getParam('core.url_pic') . 'subprofiles/'));
$oServiceProfilesBrowse = Phpfox::getService('profiles.browse');
$oDatabase = Phpfox::getLib('database');
$oParseInput = Phpfox::getLib('parse.input');
$iPage = $this->request()->get('page');
$iPageSize = 25;
$iTimeDisplay = Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d'), Phpfox::getTime('Y'));
$aPages = Phpfox::isMobile() ? array(10) : array(21, 31, 41, 51);
$aDisplays = array();
foreach ($aPages as $iPageCnt) {
$aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
}
//get the additional browse filters
$aBrowseFilters = Phpfox::getService('profiles.browse')->getBrowseFilter();
$aFilters = array('display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '21'), 'sort' => array('type' => 'select', 'options' => array('time_stamp' => Phpfox::getPhrase('profiles.date_added'), 'title' => Phpfox::getPhrase('profiles.name')), 'default' => 'time_stamp', 'alias' => 'p'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'), 'keyword' => array('type' => 'input:text', 'size' => 15, 'search' => 'AND p.title LIKE \'%[VALUE]%\''));
//add the additional admin enabled browse field filters to $aFilters
if (!empty($aBrowseFilters)) {
foreach ($aBrowseFilters as $aBrowseFilter) {
$aBrowseFilter[$aBrowseFilter['field_name']] = array('type' => 'input:text', 'size' => 15, 'search' => 'AND pfv.cf_' . $aBrowseFilter['field_name'] . ' LIKE \'%[VALUE]%\'');
$aFilters[$aBrowseFilter['field_name']] = $aBrowseFilter[$aBrowseFilter['field_name']];
}
}
$oFilter = Phpfox::getLib('search')->set(array('type' => 'browse', 'filters' => $aFilters, 'search' => 'keyword', 'custom_search' => true));
$oServiceProfilesBrowse->condition($oFilter->getConditions())->order($oFilter->getSort())->page($iPage)->size($oFilter->getDisplay())->execute();
Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => $oFilter->getDisplay(), 'count' => $oFilter->getSearchTotal($oServiceProfilesBrowse->getCount())));
//This is for adding the snippet fields that have been enabled by the Admin
$oProfileFields = Phpfox::getService('profiles.browse')->getBrowseDisplay();
$this->template()->setTitle(Phpfox::getPhrase('profiles.extra_profiles'))->setBreadcrumb(Phpfox::getPhrase('profiles.extra_profiles'))->setHeader('cache', array('pager.css' => 'style_css'))->assign(array('aProfiles' => $oProfileFields, 'aBrowseFilters' => $aBrowseFilters));
if ($sPlugin = Phpfox_Plugin::get('profiles.component_controller_browse_end')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
}
示例9: run
//.........这里部分代码省略.........
echo $Service->js()->get();
}
} else {
echo @file_get_contents($sPath);
}
exit;
}
($sPlugin = Phpfox_Plugin::get('run_start')) ? eval($sPlugin) : false;
// Load module blocks
$oModule->loadBlocks();
if (!Phpfox::getParam('core.branding')) {
$oTpl->setHeader(array('<meta name="author" content="PHPfox" />'));
}
if (strtolower(Phpfox_Request::instance()->get('req1')) == Phpfox::getParam('admincp.admin_cp')) {
self::$_bIsAdminCp = true;
}
$View = $oModule->setController();
if ($View instanceof Core\View) {
} else {
if (!self::$_bIsAdminCp) {
$View = new Core\View();
}
}
if (!PHPFOX_IS_AJAX_PAGE) {
$oTpl->setImage(array('ajax_small' => 'ajax/small.gif', 'ajax_large' => 'ajax/large.gif', 'loading_animation' => 'misc/loading_animation.gif', 'close' => 'misc/close.gif', 'move' => 'misc/move.png', 'calendar' => 'jquery/calendar.gif'));
$oTpl->setHeader(array('<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />', '<meta http-equiv="Content-Type" content="text/html; charset=' . $aLocale['charset'] . '" />', '<meta http-equiv="cache-control" content="no-cache" />', '<meta http-equiv="expires" content="-1" />', '<meta http-equiv="pragma" content="no-cache" />', '<link rel="shortcut icon" type="image/x-icon" href="' . Phpfox::getParam('core.path') . 'favicon.ico?v=' . $oTpl->getStaticVersion() . '" />'))->setMeta('keywords', Phpfox_Locale::instance()->convert(Phpfox::getParam('core.keywords')))->setMeta('robots', 'index,follow');
$oTpl->setHeader('cache', Phpfox::getMasterFiles());
if (Phpfox::isModule('friend')) {
$oTpl->setPhrase(array('friend.show_more_results_for_search_term'));
}
if (PHPFOX_DEBUG) {
$oTpl->setHeader('cache', array('debug.css' => 'style_css'));
}
if (!Phpfox::isMobile() && Phpfox::isUser() && Phpfox::getParam('user.enable_user_tooltip')) {
$oTpl->setHeader('cache', array('user_info.js' => 'static_script'));
}
if (Phpfox::isModule('captcha') && Phpfox::getParam('captcha.recaptcha')) {
// http://www.phpfox.com/tracker/view/14456/
$sUrl = (Phpfox::getParam('core.force_https_secure_pages') ? 'https' : 'http') . "://www.google.com/recaptcha/api/js/recaptcha_ajax.js";
$oTpl->setHeader('<script type="text/javascript" src="' . $sUrl . '"></script>');
}
}
if ($sPlugin = Phpfox_Plugin::get('get_controller')) {
eval($sPlugin);
}
$oTpl->assign(['aGlobalUser' => Phpfox::isUser() ? Phpfox::getUserBy(null) : array()]);
$oModule->getController();
Phpfox::getService('admincp.seo')->setHeaders();
if (!defined('PHPFOX_DONT_SAVE_PAGE')) {
Phpfox::getLib('session')->set('redirect', Phpfox_Url::instance()->getFullUrl(true));
}
if (!defined('PHPFOX_NO_CSRF')) {
Phpfox::getService('log.session')->verifyToken();
}
($sPlugin = Phpfox_Plugin::get('run')) ? eval($sPlugin) : false;
if (!self::isAdminPanel()) {
if (!Phpfox::isMobile() && !PHPFOX_IS_AJAX_PAGE && Phpfox::isModule('rss') && !defined('PHPFOX_IS_USER_PROFILE')) {
$aFeeds = Phpfox::getService('rss')->getLinks();
if (is_array($aFeeds) && count($aFeeds)) {
foreach ($aFeeds as $sLink => $sPhrase) {
$oTpl->setHeader('<link rel="alternate" type="application/rss+xml" title="' . $sPhrase . '" href="' . $sLink . '" />');
}
}
}
$aPageLastLogin = Phpfox::isModule('pages') && Phpfox::getUserBy('profile_page_id') ? Phpfox::getService('pages')->getLastLogin() : false;
$oTpl->assign(array('aMainMenus' => $oTpl->getMenu('main'), 'aSubMenus' => $oTpl->getMenu(), 'bIsUsersProfilePage' => defined('PHPFOX_IS_USER_PROFILE') ? true : false, 'sGlobalUserFullName' => Phpfox::isUser() ? Phpfox::getUserBy('full_name') : null, 'sFullControllerName' => str_replace(array('.', '/'), '_', Phpfox_Module::instance()->getFullControllerName()), 'iGlobalProfilePageId' => Phpfox::getUserBy('profile_page_id'), 'aGlobalProfilePageLogin' => $aPageLastLogin));
示例10: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
// $aUser = (PHPFOX_IS_AJAX ? Phpfox::getService('user')->get(Phpfox::getUserId(), true) : $this->getParam('aUser'));
$aUser = $this->getParam('aUser');
/*
if (PHPFOX_IS_AJAX)
{
$aUser['gender_name'] = Phpfox::getService('user')->gender($aUser['gender']);
$aUser['birthday_time_stamp'] = $aUser['birthday'];
$aUser['birthday'] = Phpfox::getService('user')->age($aUser['birthday']);
$aUser['location'] = Phpfox::getService('core.country')->getCountry($aUser['country_iso']);
$this->template()->assign('aUser', $aUser);
}
*/
if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.basic_info')) {
return false;
}
$aUser['bRelationshipHeader'] = true;
$sRelationship = Phpfox::getService('custom')->getRelationshipPhrase($aUser);
$aUserDetails = array();
if (!empty($aUser['gender'])) {
$aUserDetails[Phpfox::getPhrase('profile.gender')] = '<a href="' . $this->url()->makeUrl('user.browse', array('gender' => $aUser['gender'])) . '">' . $aUser['gender_name'] . '</a>';
}
$aUserDetails = array_merge($aUserDetails, $aUser['birthdate_display']);
$sExtraLocation = '';
if (!empty($aUser['city_location'])) {
$sExtraLocation .= '<div class="p_2"><a href="' . $this->url()->makeUrl('user.browse', array('location' => $aUser['country_iso'], 'state' => $aUser['country_child_id'], 'city-name' => $aUser['city_location'])) . '">' . Phpfox::getLib('parse.output')->clean($aUser['city_location']) . '</a> »</div>';
}
if ($aUser['country_child_id'] > 0) {
$sExtraLocation .= '<div class="p_2"><a href="' . $this->url()->makeUrl('user.browse', array('location' => $aUser['country_iso'], 'state' => $aUser['country_child_id'])) . '">' . Phpfox::getService('core.country')->getChild($aUser['country_child_id']) . '</a> »</div>';
}
if (!empty($aUser['country_iso'])) {
$aUserDetails[Phpfox::getPhrase('profile.location')] = $sExtraLocation . '<a href="' . $this->url()->makeUrl('user.browse', array('location' => $aUser['country_iso'])) . '">' . Phpfox::getPhraseT($aUser['location'], 'country') . '</a>';
}
if ((int) $aUser['last_login'] > 0 && (!$aUser['is_invisible'] || Phpfox::getUserParam('user.can_view_if_a_user_is_invisible') && $aUser['is_invisible'])) {
$aUserDetails[Phpfox::getPhrase('profile.last_login')] = Phpfox::getLib('date')->convertTime($aUser['last_login'], 'core.profile_time_stamps');
}
if ((int) $aUser['joined'] > 0) {
$aUserDetails[Phpfox::getPhrase('profile.member_since')] = Phpfox::getLib('date')->convertTime($aUser['joined'], 'core.profile_time_stamps');
}
if (Phpfox::getUserGroupParam($aUser['user_group_id'], 'profile.display_membership_info')) {
$aUserDetails[Phpfox::getPhrase('profile.membership')] = (empty($aUser['icon_ext']) ? '' : '<img src="' . Phpfox::getParam('core.url_icon') . $aUser['icon_ext'] . '" class="v_middle" alt="' . Phpfox::getLib('locale')->convert($aUser['title']) . '" title="' . Phpfox::getLib('locale')->convert($aUser['title']) . '" /> ') . $aUser['prefix'] . Phpfox::getLib('locale')->convert($aUser['title']) . $aUser['suffix'];
}
$aUserDetails[Phpfox::getPhrase('profile.profile_views')] = $aUser['total_view'];
if (Phpfox::isModule('rss') && Phpfox::getParam('rss.display_rss_count_on_profile') && Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'rss.display_on_profile')) {
$aUserDetails[Phpfox::getPhrase('profile.rss_subscribers')] = $aUser['rss_count'];
}
$sEditLink = '';
if ($aUser['user_id'] == Phpfox::getUserId()) {
$sEditLink = '<div class="js_edit_header_bar">';
$sEditLink .= '<span id="js_user_basic_info" style="display:none;"><img src="' . $this->template()->getStyle('image', 'ajax/small.gif') . '" alt="" class="v_middle" /></span>';
$sEditLink .= '<a href="' . Phpfox::getLib('url')->makeUrl('user.profile') . '" id="js_user_basic_edit_link">';
$sEditLink .= '<img src="' . $this->template()->getStyle('image', 'misc/page_white_edit.png') . '" alt="" class="v_middle" />';
$sEditLink .= '</a>';
$sEditLink .= '</div>';
}
// Get the Smoker and Drinker details
$aUserPanel = Phpfox::getService('custom')->getUserPanelForUser($aUser['user_id']);
foreach ($aUserPanel as $sName => $aField) {
//$aUserDetails[Phpfox::getPhrase($aField['phrase_var_name'])] = Phpfox::getPhrase($aField['phrase_chosen']);
}
$this->template()->assign(array('aUserDetails' => $aUserDetails, 'sBlockJsId' => 'profile_basic_info', 'sRelationship' => $sRelationship));
$this->setParam('aRatingCallback', array('type' => 'user', 'total_rating' => Phpfox::getPhrase('profile.total_rating_ratings', array('total_rating' => $aUser['total_rating'])), 'default_rating' => $aUser['total_score'], 'item_id' => $aUser['user_id'], 'stars' => range(1, 10)));
($sPlugin = Phpfox_Plugin::get('profile.component_block_info')) ? eval($sPlugin) : false;
if (!Phpfox::isMobile()) {
$this->template()->assign(array('sHeader' => $sEditLink . Phpfox::getPhrase('profile.basic_info'), 'sEditLink' => $sEditLink));
return 'block';
}
}
示例11: checkFeedShareLink
public function checkFeedShareLink()
{
if (Phpfox::isMobile()) {
return false;
}
if (defined('PHPFOX_IS_PAGES_VIEW') && !Phpfox::getService('pages')->hasPerm(null, 'video.share_videos')) {
return false;
}
if (!Phpfox::getParam('video.allow_video_uploading') || !Phpfox::getUserParam('video.can_upload_videos')) {
return false;
}
}
示例12: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::getUserParam('organization.can_view_browse_organization', true);
$mId = $this->request()->getInt('req2');
if (!($aOrganization = Phpfox::getService('organization')->getForView($mId))) {
return Phpfox_Error::display(Phpfox::getPhrase('organization.the_organization_you_are_looking_for_cannot_be_found'));
}
if ($this->request()->get('req3') != '') {
$this->template()->assign(array('bRefreshPhoto' => true));
}
if (Phpfox::getUserParam('organization.can_moderate_organization') || $aOrganization['is_admin']) {
} else {
if ($aOrganization['view_id'] != '0') {
return Phpfox_Error::display(Phpfox::getPhrase('organization.the_organization_you_are_looking_for_cannot_be_found'));
}
}
if ($aOrganization['view_id'] == '2') {
return Phpfox_Error::display(Phpfox::getPhrase('organization.the_organization_you_are_looking_for_cannot_be_found'));
}
if (Phpfox::isMobile()) {
$aPageMenus = Phpfox::getService('organization')->getMenu($aOrganization);
$aFilterMenu = array();
foreach ($aPageMenus as $aPageMenu) {
$aFilterMenu[$aPageMenu['phrase']] = $aPageMenu['url'];
}
$this->template()->buildSectionMenu('organization', $aFilterMenu);
}
if (Phpfox::getUserBy('profile_organization_id') <= 0 && Phpfox::isModule('privacy')) {
Phpfox::getService('privacy')->check('organization', $aOrganization['organization_id'], $aOrganization['user_id'], $aOrganization['privacy'], isset($aOrganization['is_friend']) ? $aOrganization['is_friend'] : 0);
}
$bCanViewPage = true;
// http://www.phpfox.com/tracker/view/15190/
$sCurrentModule = Phpfox::getLib('url')->reverseRewrite($this->request()->get($this->request()->get('req1') == 'organization' ? 'req3' : 'req2'));
Phpfox::getService('organization')->buildWidgets($aOrganization['organization_id']);
if ($aOrganization['designer_style_id']) {
$this->template()->setStyle(array('style_id' => $aOrganization['designer_style_id'], 'style_folder_name' => $aOrganization['designer_style_folder'], 'theme_folder_name' => $aOrganization['designer_theme_folder'], 'theme_parent_id' => $aOrganization['theme_parent_id'], 'total_column' => $aOrganization['total_column'], 'l_width' => $aOrganization['l_width'], 'c_width' => $aOrganization['c_width'], 'r_width' => $aOrganization['r_width']));
}
($sPlugin = Phpfox_Plugin::get('organization.component_controller_view_build')) ? eval($sPlugin) : false;
$this->setParam('aParentModule', array('module_id' => 'organization', 'item_id' => $aOrganization['organization_id'], 'url' => Phpfox::getService('organization')->getUrl($aOrganization['organization_id'], $aOrganization['title'], $aOrganization['vanity_url'])));
if (isset($aOrganization['is_admin']) && $aOrganization['is_admin']) {
define('PHPFOX_IS_ORGANIZATION_ADMIN', true);
}
$sModule = $sCurrentModule;
// http://www.phpfox.com/tracker/view/15190/
if (empty($sModule) && !empty($aOrganization['landing_organization'])) {
$sModule = $aOrganization['landing_organization'];
$sCurrentModule = $aOrganization['landing_organization'];
}
($sPlugin = Phpfox_Plugin::get('organization.component_controller_view_assign')) ? eval($sPlugin) : false;
if (isset($aOrganization['use_timeline']) && $aOrganization['use_timeline']) {
$aPageMenus = Phpfox::getService('organization')->getMenu($aOrganization);
if (!defined('ORGANIZATION_TIME_LINE')) {
define('ORGANIZATION_TIME_LINE', true);
}
$aOrganization['user_name'] = $aOrganization['title'];
$this->template()->setFullSite()->assign(array('aUser' => $aOrganization, 'aProfileLinks' => $aPageMenus))->setHeader(array('<script type="text/javascript">oParams["keepContent4"] = false;</script>'));
}
$this->setParam('aOrganization', $aOrganization);
$this->template()->assign(array('aOrganization' => $aOrganization, 'sCurrentModule' => $sCurrentModule, 'bCanViewOrganization' => $bCanViewPage, 'iViewCommentId' => $this->request()->getInt('comment-id'), 'bHasPermToViewOrganizationFeed' => Phpfox::getService('organization')->hasPerm($aOrganization['organization_id'], 'organization.view_browse_updates')))->setHeader('cache', array('profile.css' => 'style_css', 'pages.css' => 'style_css', 'organization.js' => 'module_organization', 'player/flowplayer/flowplayer.js' => 'static_script'));
if (Phpfox::isMobile()) {
$this->template()->setBreadcrumb($aOrganization['title'], Phpfox::getService('organization')->getUrl($aOrganization['organization_id'], $aOrganization['title'], $aOrganization['vanity_url']), true);
}
$this->setParam('aCallbackShoutbox', array('module' => 'organization', 'item' => $aOrganization['organization_id']));
if ($bCanViewPage && $sModule != 'photo' && $sModule && Phpfox::isModule($sModule) && Phpfox::hasCallback($sModule, 'getOrganizationSubMenu') && !$this->request()->getInt('comment-id')) {
if (Phpfox::hasCallback($sModule, 'canViewOrganizationSection') && !Phpfox::callback($sModule . '.canViewOrganizationSection', $aOrganization['organization_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('organization.unable_to_view_this_section_due_to_privacy_settings'));
}
$this->template()->assign('bIsOrganizationViewSection', true);
$this->setParam('bIsOrganizationViewSection', true);
$this->setParam('sCurrentOrganizationModule', $sModule);
Phpfox::getComponent($sModule . '.index', array('bNoTemplate' => true), 'controller');
} elseif ($bCanViewPage && $sModule != 'photo' && $sModule && Phpfox::getService('organization')->isWidget($sModule) && !$this->request()->getInt('comment-id')) {
define('PHPFOX_IS_ORGANIZATION_WIDGET', true);
$this->template()->assign(array('aWidget' => Phpfox::getService('organization')->getWidget($sModule)));
} else {
$sSubController = $this->request()->get('req3');
if ($sSubController == 'info') {
return Phpfox::getComponent('organization.info', array('bNoTemplate' => true), 'controller');
} else {
if ($sSubController == 'volunteer') {
return Phpfox::getComponent('organization.volunteer', array('bNoTemplate' => true), 'controller');
} else {
if ($sSubController == 'photo') {
return Phpfox::getComponent('organization.photo', array('bNoTemplate' => true), 'controller');
}
}
}
$bCanPostComment = true;
if ($sCurrentModule == 'pending') {
$this->template()->assign('aPendingUsers', Phpfox::getService('organization')->getPendingUsers($aOrganization['organization_id']));
$this->setParam('global_moderation', array('name' => 'organization', 'ajax' => 'organization.moderation', 'menu' => array(array('phrase' => Phpfox::getPhrase('organization.delete'), 'action' => 'delete'), array('phrase' => Phpfox::getPhrase('organization.approve'), 'action' => 'approve'))));
}
if (Phpfox::getService('organization')->isAdmin($aOrganization)) {
define('PHPFOX_FEED_CAN_DELETE', true);
}
if (Phpfox::getUserId()) {
$bIsBlocked = Phpfox::getService('user.block')->isBlocked($aOrganization['user_id'], Phpfox::getUserId());
//.........这里部分代码省略.........
示例13: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
Phpfox::getUserParam('video.can_upload_videos', true);
if (Phpfox::getParam('video.convert_servers_enable')) {
$this->template()->assign('sCustomVideoHash', Phpfox::getService('video')->addCustomHash());
}
if (defined('PHPFOX_IS_HOSTED_SCRIPT')) {
if (Phpfox::getService('video')->getOnCloudLimit()) {
return Phpfox_Error::display('Monthly video limit reached.');
}
}
if ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_1')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
$sModule = $this->request()->get('module', false);
$iItem = $this->request()->getInt('item', false);
$aCallback = false;
if ($sModule !== false && $iItem !== false && Phpfox::hasCallback($sModule, 'getVideoDetails')) {
if ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_2')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
if ($aCallback = Phpfox::callback($sModule . '.getVideoDetails', array('item_id' => $iItem))) {
$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);
$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);
if ($sModule == 'pages' && !Phpfox::getService('pages')->hasPerm($iItem, 'video.share_videos')) {
$sPhrase = Phpfox::getPhrase('video.unable_to_view_this_item_due_to_privacy_settings');
if ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase')) {
eval($sPlugin);
}
return Phpfox_Error::display($sPhrase);
} else {
$sPhrase = '';
if ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase_2')) {
eval($sPlugin);
}
if (!empty($sPhrase)) {
return Phpfox_Error::display($sPhrase);
}
}
}
}
if ($aVals = $this->request()->get('val')) {
if ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_3')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
if (($iFlood = Phpfox::getUserParam('video.flood_control_videos')) !== 0) {
$aFlood = array('action' => 'last_post', 'params' => array('field' => 'time_stamp', 'table' => Phpfox::getT('video'), 'condition' => 'user_id = ' . Phpfox::getUserId(), 'time_stamp' => $iFlood * 60));
// actually check if flooding
if (Phpfox::getLib('spam')->check($aFlood)) {
Phpfox_Error::set(Phpfox::getPhrase('video.you_are_sharing_a_video_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());
}
}
if (Phpfox_Error::isPassed()) {
if ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_4')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
if (Phpfox::getService('video.grab')->get($aVals['url'])) {
if ($iId = Phpfox::getService('video.process')->addShareVideo($aVals)) {
$aVideo = Phpfox::getService('video')->getForEdit($iId);
if (Phpfox::getService('video.grab')->hasImage()) {
if (isset($aVals['module']) && isset($aVals['item']) && Phpfox::hasCallback($aVals['module'], 'uploadVideo')) {
$aCallback = Phpfox::callback($aVals['module'] . '.uploadVideo', $aVals['item']);
if ($aCallback !== false) {
$this->url()->send($aCallback['url_home'], array('video', $sTitle), Phpfox::getPhrase('video.video_successfully_added'));
}
}
$this->url()->permalink('video', $aVideo['video_id'], $aVideo['title'], true, Phpfox::getPhrase('video.video_successfully_added'));
} else {
$this->url()->send('video.edit.photo', array('id' => $aVideo['video_id']), Phpfox::getPhrase('video.video_successfull_added_however_you_will_have_to_manually_upload_a_photo_for_it'));
}
}
}
}
$sModule = isset($aVals['module']) ? $aVals['module'] : false;
$iItem = isset($aVals['item']) ? $aVals['item'] : false;
}
$sMethod = Phpfox::getParam('video.video_enable_mass_uploader') && $this->request()->get('method', '') != 'simple' ? 'massuploader' : 'simple';
$sMethodUrl = str_replace(array('method_simple/', 'method_massuploader/'), '', $this->url()->getFullUrl()) . 'method_' . ($sMethod == 'simple' ? 'massuploader' : 'simple') . '/';
if (Phpfox::isMobile()) {
$sMethod = 'simple';
}
if (Phpfox::getParam('video.convert_servers_enable')) {
$aVideoServers = Phpfox::getParam('video.convert_servers');
$sCustomServerUrl = $aVideoServers[rand(0, count($aVideoServers) - 1)];
//.........这里部分代码省略.........
示例14: checkFeedShareLink
public function checkFeedShareLink()
{
if (Phpfox::isMobile()) {
return false;
}
if (!Phpfox::getUserParam('music.can_upload_music_public')) {
return false;
}
}
示例15: getHeader
/**
* Gets any data we plan to place within the HTML tags <head></head>.
* This method also groups the data to give the template a nice clean look.
*
* @return string|array $sData Returns the HTML data to be placed within <head></head>
*/
public function getHeader($bReturnArray = false)
{
if (Phpfox::isAdminPanel()) {
$this->setHeader(array('custom.css' => 'style_css'));
}
if ($this->delayedHeaders) {
foreach ($this->delayedHeaders as $header) {
$this->setHeader('cache', $header);
}
}
// $this->setHeader('<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">');
Core\Event::trigger('lib_phpfox_template_getheader', $this);
foreach ((new Core\App())->all() as $App) {
if ($App->head && is_array($App->head)) {
foreach ($App->head as $head) {
$this->setHeader($head);
}
}
if ($App->settings) {
$Setting = new Core\Setting();
foreach ($App->settings as $key => $setting) {
if (isset($setting->js_variable)) {
$this->setHeader('<script>var ' . $key . ' = "' . $Setting->get($key) . '";</script>');
}
}
}
}
$aArrayData = array();
$sData = '';
$sJs = '';
$iVersion = $this->getStaticVersion();
$oUrl = Phpfox_Url::instance();
$aUrl = $oUrl->getParams();
if (!defined('PHPFOX_DESIGN_DND')) {
define('PHPFOX_DESIGN_DND', false);
}
if (!PHPFOX_IS_AJAX_PAGE) {
($sPlugin = Phpfox_Plugin::get('template_getheader')) ? eval($sPlugin) : false;
$sJs .= "\t\t\tvar oCore = {'core.is_admincp': " . (Phpfox::isAdminPanel() ? 'true' : 'false') . ", 'core.section_module': '" . Phpfox_Module::instance()->getModuleName() . "', 'profile.is_user_profile': " . (defined('PHPFOX_IS_USER_PROFILE') && PHPFOX_IS_USER_PROFILE ? 'true' : 'false') . ", 'log.security_token': '" . Phpfox::getService('log.session')->getToken() . "', 'core.url_rewrite': '" . Phpfox::getParam('core.url_rewrite') . "', 'core.country_iso': '" . (Phpfox::isUser() ? Phpfox::getUserBy('country_iso') : '') . "', 'core.can_move_on_a_y_and_x_axis' : " . (!defined('PHPFOX_INSTALLER') && Phpfox::getParam('core.can_move_on_a_y_and_x_axis') ? 'true' : 'false') . ", 'core.default_currency': '" . (defined('PHPFOX_INSTALLER') ? 'USD' : Phpfox::getService('core.currency')->getDefault()) . "', 'core.enabled_edit_area': " . (Phpfox::getParam('core.enabled_edit_area') ? 'true' : 'false') . ", 'core.disable_hash_bang_support': " . (Phpfox::getParam('core.disable_hash_bang_support') ? 'true' : 'false') . ", 'core.site_wide_ajax_browsing': " . (!defined('PHPFOX_IN_DESIGN_MODE') && Phpfox::getParam('core.site_wide_ajax_browsing') && !Phpfox::isAdminPanel() && Phpfox::isUser() ? 'true' : 'false') . ", 'profile.user_id': " . (defined('PHPFOX_IS_USER_PROFILE') && PHPFOX_IS_USER_PROFILE ? Profile_Service_Profile::instance()->getProfileUserId() : 0) . "};\n";
// You are filtering out the controllers which should not load 'content' ajaxly, finding a way for pages.view/1/info and like that
$sProgressCssFile = $this->getStyle('css', 'progress.css');
$sStylePath = str_replace(Phpfox::getParam('core.path'), '', str_replace('progress.css', '', $sProgressCssFile));
$aJsVars = array('sJsHome' => Phpfox::getParam('core.path'), 'sJsHostname' => $_SERVER['HTTP_HOST'], 'sSiteName' => Phpfox::getParam('core.site_title'), 'sJsStatic' => $oUrl->getDomain() . PHPFOX_STATIC, 'sJsStaticImage' => Phpfox::getParam('core.url_static_image'), 'sImagePath' => $this->getStyle('image'), 'sStylePath' => $this->getStyle('css'), 'sVersion' => Phpfox::getId(), 'sJsAjax' => $oUrl->getDomain() . PHPFOX_STATIC . 'ajax.php', 'sStaticVersion' => $iVersion, 'sGetMethod' => PHPFOX_GET_METHOD, 'sDateFormat' => defined('PHPFOX_INSTALLER') ? '' : Phpfox::getParam('core.date_field_order'), 'sEgiftStyle' => $this->getStyle('css', 'display.css', 'egift'), 'sGlobalTokenName' => Phpfox::getTokenName(), 'sController' => Phpfox_Module::instance()->getFullControllerName(), 'bJsIsMobile' => Phpfox::isMobile() ? true : false, 'sProgressCssFile' => $sProgressCssFile, 'sHostedVersionId' => defined('PHPFOX_IS_HOSTED_VERSION') ? PHPFOX_IS_HOSTED_VERSION : '');
if (!defined('PHPFOX_INSTALLER')) {
$aJsVars['bWysiwyg'] = Phpfox::getParam('core.wysiwyg') != 'default' && Phpfox::getParam('core.allow_html') ? true : false;
$aJsVars['sEditor'] = Phpfox::getParam('core.wysiwyg');
$aJsVars['sJsCookiePath'] = Phpfox::getParam('core.cookie_path');
$aJsVars['sJsCookieDomain'] = Phpfox::getParam('core.cookie_domain');
$aJsVars['sJsCookiePrefix'] = Phpfox::getParam('core.session_prefix');
$aJsVars['bPhotoTheaterMode'] = Phpfox::isModule('photo') ? Phpfox::getParam('photo.view_photos_in_theater_mode') : false;
$aJsVars['bUseHTML5Video'] = false;
// ((Phpfox::isModule('video') && Phpfox::getParam('video.upload_for_html5')) ? true : false);
if (Phpfox::isAdmin()) {
$aJsVars['sAdminCPLocation'] = Phpfox::getParam('admincp.admin_cp');
} else {
$aJsVars['sAdminCPLocation'] = '';
}
if (Phpfox::isModule('notification')) {
$aJsVars['notification.notify_ajax_refresh'] = Phpfox::getParam('notification.notify_ajax_refresh');
}
$sLocalDatepicker = PHPFOX_STATIC . 'jscript/jquery/locale/jquery.ui.datepicker-' . strtolower(Phpfox_Locale::instance()->getLangId()) . '.js';
if (file_exists($sLocalDatepicker)) {
$sFile = str_replace(PHPFOX_STATIC . 'jscript/', '', $sLocalDatepicker);
$this->setHeader(array($sFile => 'static_script'));
}
/* Only in a few cases will we want to add the visitor's IP */
if (Phpfox::getParam('core.google_api_key') != '' && Phpfox::getParam('core.ip_infodb_api_key')) {
// $aJsVars['sIP'] = Phpfox_Request::instance()->getIp();
}
$aJsVars['bEnableMicroblogSite'] = Phpfox::isModule('microblog') ? Phpfox::getParam('microblog.enable_microblog_site') : false;
}
($sPlugin = Phpfox_Plugin::get('template_getheader_setting')) ? eval($sPlugin) : false;
if (Phpfox::isModule('input') && false) {
$this->setHeader('cache', array('browse.css' => 'style_css'));
}
$sJs .= "\t\t\tvar oParams = {";
$iCnt = 0;
foreach ($aJsVars as $sVar => $sValue) {
$iCnt++;
if ($iCnt != 1) {
$sJs .= ",";
}
if (is_bool($sValue)) {
$sJs .= "'{$sVar}': " . ($sValue ? 'true' : 'false');
} elseif (is_numeric($sValue)) {
$sJs .= "'{$sVar}': " . $sValue;
} else {
$sJs .= "'{$sVar}': '" . str_replace("'", "\\'", $sValue) . "'";
}
}
$sJs .= "};\n";
if (!defined('PHPFOX_INSTALLER')) {
$aLocaleVars = array('core.are_you_sure', 'core.yes', 'core.no', 'core.save', 'core.cancel', 'core.go_advanced', 'core.processing', 'emoticon.emoticons', 'attachment.attach_files', 'core.close', 'core.language_packages', 'core.move_this_block', 'core.uploading', 'language.loading', 'core.saving', 'core.loading_text_editor', 'core.quote', 'core.loading');
if (Phpfox::isModule('im') && Phpfox::getParam('im.enable_im_in_footer_bar')) {
//.........这里部分代码省略.........