本文整理汇总了PHP中Phpfox类的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox类的具体用法?PHP Phpfox怎么用?PHP Phpfox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Phpfox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Controller
*/
public function process()
{
$sCountryChildValue = $this->getParam('country_child_value');
$mCountryChildFilter = $this->getParam('country_child_filter', $this->request()->get('country_child_filter', null));
$sCountryChildType = $this->getParam('country_child_type', null);
$sCountryChildId = null;
if (empty($sCountryChildValue) && Phpfox::isUser() && $mCountryChildFilter === null && !$this->getParam('country_not_user')) {
$sCountryChildValue = Phpfox::getUserBy('country_iso');
}
$iSearchId = 0;
if ($mCountryChildFilter !== null) {
$iSearchId = $this->request()->get('search-id');
if (!empty($iSearchId) && isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country'])) {
$sCountryChildValue = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country'];
}
if (isset($_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country_child_id'])) {
$sCountryChildId = $_SESSION[Phpfox::getParam('core.session_prefix')]['search'][$sCountryChildType][$iSearchId]['country_child_id'];
}
}
/* Last resort, get is a little heavy but controller didnt provide a child country*/
if ($sCountryChildId == null && $this->getParam('country_child_id') == null) {
$aUser = Phpfox::getService('user')->get(Phpfox::getUserId(), true);
$sCountryChildId = $aUser['country_child_id'];
}
$this->template()->assign(array('aCountryChildren' => Phpfox::getService('core.country')->getChildren($sCountryChildValue), 'iCountryChildId' => (int) $this->getParam('country_child_id', $sCountryChildId), 'bForceDiv' => $this->getParam('country_force_div', false), 'mCountryChildFilter' => $mCountryChildFilter));
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:29,代码来源:country-child.class.php
示例2: getValidation
public function getValidation($sStep = null)
{
$aValidation = array();
if ($sStep == 1 || $sStep === null) {
$aValidation['full_name'] = Phpfox::getPhrase('user.provide_your_full_name');
$aValidation['email'] = array('def' => 'email', 'title' => Phpfox::getPhrase('user.provide_a_valid_email_address'));
$aValidation['password'] = array('def' => 'password', 'title' => Phpfox::getPhrase('user.provide_a_valid_password'));
if (Phpfox::getParam('user.new_user_terms_confirmation')) {
$aValidation['agree'] = array('def' => 'checkbox', 'title' => Phpfox::getPhrase('user.check_our_agreement_in_order_to_join_our_site'));
}
if (!Phpfox::getParam('user.profile_use_id') && !Phpfox::getParam('user.disable_username_on_sign_up')) {
$aValidation['user_name'] = array('def' => 'username', 'title' => Phpfox::getPhrase('user.provide_a_valid_user_name', array('min' => Phpfox::getParam('user.min_length_for_username'), 'max' => Phpfox::getParam('user.max_length_for_username'))));
}
}
if ($sStep == 2 || $sStep === null) {
if (Phpfox::getParam('core.registration_enable_dob')) {
$aValidation['month'] = Phpfox::getPhrase('user.select_month_of_birth');
$aValidation['day'] = Phpfox::getPhrase('user.select_day_of_birth');
$aValidation['year'] = Phpfox::getPhrase('user.select_year_of_birth');
}
if (Phpfox::getParam('core.registration_enable_location')) {
$aValidation['country_iso'] = Phpfox::getPhrase('user.select_current_location');
}
if (Phpfox::getParam('core.registration_enable_gender')) {
$aValidation['gender'] = Phpfox::getPhrase('user.select_your_gender');
}
}
if (Phpfox::isModule('captcha') && Phpfox::getParam('user.captcha_on_signup') && $sStep === null) {
$aValidation['image_verification'] = Phpfox::getPhrase('captcha.complete_captcha_challenge');
}
return $aValidation;
}
开发者ID:googlesky,项目名称:snsp.vn,代码行数:32,代码来源:register.class.php
示例3: moderation
/**
* Need this to take over photo moderation
* Enter description here ...
*/
public function moderation()
{
Phpfox::isUser(true);
switch ($this->get('action')) {
case 'approve':
Phpfox::getUserParam('photo.can_approve_photos', true);
foreach ((array) $this->get('item_moderate') as $iId) {
Phpfox::getService('photo.process')->approve($iId);
$this->call('$(\'#js_photo_id_' . $iId . '\').remove();');
}
$sMessage = Phpfox::getPhrase('photo.photo_s_successfully_approved');
$this->alert($sMessage, 'Moderation', 300, 150, true);
break;
case 'delete':
Phpfox::getUserParam('photo.can_delete_other_photos', true);
$item = $this->get('item_moderate')[0];
$bReload = Phpfox::getService('profiles')->getUserAndProfile($item);
if ($bReload) {
$this->call('location.reload();');
}
foreach ((array) $this->get('item_moderate') as $iId) {
Phpfox::getService('photo.process')->delete($iId);
$this->call('$(\'#js_photo_id_' . $iId . '\').remove();');
}
$sMessage = Phpfox::getPhrase('photo.photo_s_successfully_deleted');
break;
}
$this->updateCount();
$this->hide('.moderation_process');
}
开发者ID:Lovinity,项目名称:EQM,代码行数:34,代码来源:ajax.class.php
示例4: __construct
/**
* Based on what CDN module is selected here is where we load the CDN class and initiat the object.
*
* @param array $aParams Array of any special params to pass to the module CDN class
*/
public function __construct($aParams = array())
{
if (!$this->_oObject) {
$sCdn = Phpfox::getParam('core.cdn_service') == '' ? 's3' : Phpfox::getParam('core.cdn_service');
$this->_oObject = Phpfox::getLib('phpfox.cdn.module.' . $sCdn, $aParams);
}
}
开发者ID:Lovinity,项目名称:EQM,代码行数:12,代码来源:cdn.class.php
示例5: getJavascript
public function getJavascript($iPhotoId)
{
$aTags = $this->database()->select('p.user_id AS photo_owner_id, pt.tag_id, pt.user_id AS post_user_id, pt.content, pt.position_x, pt.position_y, pt.width, pt.height, ' . Phpfox::getUserField())->from($this->_sTable, 'pt')->leftJoin(Phpfox::getT('user'), 'u', 'u.user_id = pt.tag_user_id')->join(Phpfox::getT('photo'), 'p', 'p.photo_id = pt.photo_id')->where('pt.photo_id = ' . (int) $iPhotoId)->execute('getSlaveRows');
if (!count($aTags)) {
return false;
}
$sNotes = '[';
foreach ($aTags as $aTag) {
$sNotes .= '{';
$sNotes .= 'note_id: ' . $aTag['tag_id'] . ', ';
$sNotes .= 'x1: ' . $aTag['position_x'] . ', ';
$sNotes .= 'y1: ' . $aTag['position_y'] . ', ';
$sNotes .= 'width: ' . $aTag['width'] . ', ';
$sNotes .= 'height: ' . $aTag['height'] . ', ';
$sRemove = $aTag['post_user_id'] == Phpfox::getUserId() || $aTag['photo_owner_id'] == Phpfox::getUserId() || $aTag['user_id'] == Phpfox::getUserId() ? ' <a href="#" onclick="if (confirm(\\\'' . Phpfox::getPhrase('photo.are_you_sure') . '\\\')) { $(\\\'#noteform\\\').hide(); $(\\\'#js_photo_view_image\\\').imgAreaSelect({ hide: true }); $(this).parent(\\\'span:first\\\').remove();$(\\\'.notep#notep_' . $aTag['tag_id'] . '\\\').remove();$.ajaxCall(\\\'photo.removePhotoTag\\\', \\\'tag_id=' . $aTag['tag_id'] . '\\\'); } return false;"><i class="fa fa-remove"></i></a>' : '';
if (!empty($aTag['user_id'])) {
$sNotes .= 'note: \'<a href="' . Phpfox_Url::instance()->makeUrl($aTag['user_name']) . '" id="js_photo_tag_user_id_' . $aTag['user_id'] . '">' . $aTag['full_name'] . '</a>' . $sRemove . '\'';
} else {
$sNotes .= 'note: \'' . str_replace("'", "\\'", Phpfox::getLib('parse.output')->clean($aTag['content'])) . $sRemove . '\'';
}
$sNotes .= '},';
}
$sNotes = rtrim($sNotes, ',');
$sNotes .= ']';
return $sNotes;
}
开发者ID:Goudarzi-hahram,项目名称:phpfox,代码行数:26,代码来源:tag.class.php
示例6: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
// assign the categories
$this->template()->assign(array('aCategories' => Phpfox::getService('contact.contact')->getCategories()));
// create the captcha check JS
// they need to input some text always
$aValidation = array('text' => Phpfox::getPhrase('contact.fill_in_some_text_for_your_message'), 'category_id' => Phpfox::getPhrase('contact.you_need_to_choose_a_category'), 'subject' => Phpfox::getPhrase('contact.provide_a_subject'), 'full_name' => Phpfox::getPhrase('contact.provide_your_full_name'));
// do they need to complete a captcha challenge?
if (Phpfox::isModule('captcha') && Phpfox::getParam('contact.contact_enable_captcha')) {
$aValidation['image_verification'] = Phpfox::getPhrase('captcha.complete_captcha_challenge');
}
// They always need to input their email address
$aValidation['email'] = array('def' => 'email', 'title' => Phpfox::getPhrase('contact.provide_a_valid_email'));
$oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_contact_form', 'aParams' => $aValidation));
// check if we're getting a request:
if ($aVals = $this->request()->getArray('val')) {
// check the fields are valid
if ($oValid->isValid($aVals)) {
if (Phpfox::getService('contact.contact')->sendContactMessage($aVals)) {
if (!empty($aVals['category_id']) && $aVals['category_id'] == 'phpfox_sales_ticket') {
$this->url()->send('contact', array('sent' => 'true'));
} else {
$this->url()->send('contact', null, Phpfox::getPhrase('contact.your_message_was_successfully_sent'));
}
} else {
$this->template()->assign(array('aContactErrors' => Phpfox_Error::set(Phpfox::getPhrase('error.site_email_not_set'))));
}
}
}
if (Phpfox::isUser()) {
$this->template()->assign(array('sFullName' => Phpfox::getUserBy('full_name'), 'sEmail' => Phpfox::getUserBy('email')));
}
$this->template()->setTitle(Phpfox::getPhrase('contact.contact_us'))->setBreadcrumb(Phpfox::getPhrase('contact.contact_us'))->assign(array('sCreateJs' => $oValid->createJs(), 'sGetJsForm' => $oValid->getJsForm(), 'bIsSent' => $this->request()->get('sent')))->setFullSite();
}
开发者ID:googlesky,项目名称:snsp.vn,代码行数:37,代码来源:index.class.php
示例7: process
/**
* Class process method which is used to execute this component.
*/
public function process()
{
if (substr(decoct(fileperms('./file/achievements/')), 1) != "0777") {
$this->template()->assign(array('bError' => true))->setTitle('Konsort.org Achievements')->setBreadcrumb('Konsort.org Achievements')->setHeader('cache', array('pager.css' => 'style_css'));
} else {
if ($this->request()->get('setHighest', false)) {
if (Phpfox::getService('achievements.process')->setHighest($this->request()->get('id', 0), $this->request()->get('category', 0))) {
$this->url()->send('admincp.achievements.list', null, 'Successfully made the selected acheivement the highest achievement for the category.');
} else {
$this->url()->send('admincp.achievements.list', null, 'There was an error processing your request');
}
} elseif ($this->request()->get('unsetHighest', false)) {
if (Phpfox::getService('achievements.process')->unsetHighest($this->request()->get('id', 0), $this->request()->get('category', 0))) {
$this->url()->send('admincp.achievements.list', null, 'Successfully unmade the selected acheivement the highest achievement for the category.');
} else {
$this->url()->send('admincp.achievements.list', null, 'There was an error processing your request');
}
}
$sLimit = 10;
$iPage = $this->request()->get('page', 0);
if ($iPage > 0) {
$iPage--;
}
list($iCnt, $aAchievements) = Phpfox::getService('achievements')->getList($iPage, $sLimit);
Phpfox::getLib('pager')->set(array('page' => $iPage + 1, 'size' => $sLimit, 'count' => $iCnt));
$this->template()->assign(array('bError' => false, 'iCnt' => $iCnt, 'aAchievements' => $aAchievements))->setTitle('Konsort.org Achievements')->setBreadcrumb('Konsort.org Achievements')->setHeader('cache', array('pager.css' => 'style_css'));
}
}
开发者ID:Lovinity,项目名称:EQM,代码行数:31,代码来源:list.class.php
示例8: getApiSupportedMethods
public function getApiSupportedMethods()
{
$aMethods = array();
$aMethods[] = array('call' => 'getNewCount', 'requires' => array('user_id' => 'user_id'), 'detail' => Phpfox::getPhrase('notification.get_the_total_number_of_unseen_notifications_if_you_do_not_pass_the_user_id_we_will_return_information_about_the_user_that_is_currently_logged_in'), 'type' => 'GET', 'response' => '{"api":{"total":5,"pages":0,"current_page":0},"output":5}');
$aMethods[] = array('call' => 'get', 'requires' => array('user_id' => 'user_id'), 'detail' => Phpfox::getPhrase('notification.get_all_of_the_users_notifications_if_you_do_not_pass_the_user_id_we_will_return_information_about_the_user_that_is_currently_logged_in'), 'type' => 'GET', 'response' => '{"api":{"total":0,"pages":0,"current_page":0},"output":[{"notification_id":"3","link":"http:\\/\\/[DOMAIN_REPLACE]\\/john-doe\\/comment-id_1\\/","message":"Jane Doe commented on your wall","icon":"http:\\/\\/[DOMAIN_REPLACE]\\/module\\/blog\\/static\\/image\\/default\\/default\\/activity.png"}]}');
return array('module' => 'notification', 'module_info' => '', 'methods' => $aMethods);
}
开发者ID:googlesky,项目名称:snsp.vn,代码行数:7,代码来源:callback.class.php
示例9: 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));
}
}
开发者ID:lev1976g,项目名称:core,代码行数:37,代码来源:verify.class.php
示例10: process
/**
* Controller
*/
public function process()
{
$this->url()->send('music');
Phpfox::isUser(true);
if (Phpfox::getParam('music.music_user_group_id') == Phpfox::getUserBy('user_group_id')) {
$this->url()->send('music');
}
$aUser = array('full_name' => Phpfox::getUserBy('full_name'));
$aSettings = Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), Phpfox::getUserId(), Phpfox::getParam('music.music_user_group_id'));
$aParams = array('full_name' => Phpfox::getPhrase('music.provide_a_artist_band_name'), 'agree' => Phpfox::getPhrase('music.tick_the_box_to_agree_to_our_terms_and_privacy_policy'));
foreach ($aSettings as $sKey => $aSetting) {
if ($aSetting['is_required']) {
$aParams['custom_field_' . $aSetting['field_id']] = array('title' => Phpfox::getPhrase('music.provide_a_value_for') . ': ' . Phpfox::getPhrase($aSetting['phrase_var_name']), 'def' => 'required', 'php_id' => 'custom[' . $aSetting['field_id'] . ']');
}
}
$oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aParams));
if ($aVals = $this->request()->getArray('val')) {
if ($oValid->isValid($aVals)) {
if (Music_Service_Process::instance()->convertMember($aVals, $this->request()->getArray('custom'))) {
$this->url()->send('music', null, Phpfox::getPhrase('music.you_have_successfully_converted_your_account'));
}
}
}
$this->template()->setTitle(Phpfox::getPhrase('music.musician_registration'))->setBreadcrumb(Phpfox::getPhrase('music.music'), $this->url()->makeUrl('music'))->setBreadcrumb(Phpfox::getPhrase('music.registration'), null, true)->setFullSite()->assign(array('aForms' => $aUser, 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(), 'aSettings' => $aSettings));
}
开发者ID:lev1976g,项目名称:core,代码行数:28,代码来源:register.class.php
示例11: process
/**
* Controller
*/
public function process()
{
/* This is a good way of leaving out the admins and staff, we could remove the Banned user groups
* but that would require more processing */
$aUserGroups = Phpfox::getService('user.group')->get('user_group_id != 1 AND user_group_id != 4');
$this->template()->assign(array('aUserGroups' => $aUserGroups, 'bShow' => $this->getParam('bShow', false) ? true : false, 'bHideAffected' => $this->getParam('bHideAffected', false) ? true : false));
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:10,代码来源:form.class.php
示例12: process
/**
* Controller
*/
public function process()
{
$this->_setMenuName('admincp.user.cancellations.add');
// is user trying to edit or add an item?
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('user.cancellations.process')->add($aVals)) {
if (isset($aVals['iDeleteId'])) {
$sMessage = Phpfox::getPhrase('user.option_updated_successfully');
} else {
$sMessage = Phpfox::getPhrase('user.option_added_successfully');
}
$this->url()->send('admincp.user.cancellations.manage', null, $sMessage);
}
}
// is user requesting an item for edit?
if ($iId = $this->request()->getInt('id')) {
$aDelete = Phpfox::getService('user.cancellations')->get($iId);
if (empty($aDelete)) {
Phpfox_Error::set(Phpfox::getPhrase('user.item_not_found'));
}
$aDelete = reset($aDelete);
$this->template()->assign(array('aForms' => $aDelete));
}
$this->template()->setTitle(Phpfox::getPhrase('user.add_cancellation_options'))->setBreadcrumb(Phpfox::getPhrase('user.add_cancellation_options'), $this->url()->makeUrl('admincp.user.cancellations.add'), true)->assign(array());
}
开发者ID:lev1976g,项目名称:core,代码行数:28,代码来源:add.class.php
示例13: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
define('PHPFOX_DONT_SAVE_PAGE', true);
if (Phpfox::isUser()) {
$this->url()->send('profile');
}
switch (Phpfox::getParam('user.login_type')) {
case 'user_name':
$aValidation['login'] = Phpfox::getPhrase('user.provide_your_user_name');
break;
case 'email':
$aValidation['login'] = Phpfox::getPhrase('user.provide_your_email');
break;
default:
$aValidation['login'] = Phpfox::getPhrase('user.provide_your_user_name_email');
}
$aValidation['password'] = Phpfox::getPhrase('user.provide_your_password');
$oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_login_form', 'aParams' => $aValidation));
if ($aVals = $this->request()->getArray('val')) {
if ($oValid->isValid($aVals)) {
list($bLogged, $aUser) = Phpfox::getService('user.auth')->login($aVals['login'], $aVals['password'], isset($aVals['remember_me']) ? true : false, Phpfox::getParam('user.login_type'));
if ($bLogged) {
$this->url()->send('');
}
}
}
}
开发者ID:Lovinity,项目名称:EQM,代码行数:30,代码来源:index-visitor-mobile.class.php
示例14: getNotificationAction
/** This function catches all the "actions" (Dislike, and in the future maybe others)
* */
public function getNotificationAction($aNotification)
{
//d($aNotification);die();
// get the type of item that was marked ("blog", "photo"...)
$aAction = $this->database()->select('*')->from(Phpfox::getT('action'))->where('action_id = ' . (int) $aNotification['item_id'])->limit(1)->execute('getSlaveRow');
if (empty($aAction) || !isset($aAction['item_type_id'])) {
return false;
throw new Exception('No type for this action (' . print_r($aAction, true) . ')');
}
// Check if the module is a sub module
if (preg_match('/(?P<module>[a-z]+)[_]?(?P<submodule>[a-z]{0,99})/i', $aAction['item_type_id'], $aMatch) < 1) {
throw new Exception('Malformed item_type');
}
// Call the module and get the title
if (!Phpfox::isModule($aMatch['module'])) {
return false;
}
$aRow = Phpfox::getService($aMatch['module'])->getInfoForAction($aAction);
$sUsers = Phpfox::getService('notification')->getUsers($aNotification);
$sTitle = Phpfox::getLib('parse.output')->shorten($aRow['title'], Phpfox::getParam('notification.total_notification_title_length'), '...');
$sPhrase = '';
if ($aNotification['user_id'] == $aRow['user_id']) {
// {users} disliked {gender} own {item} "{title}"
$sPhrase = Phpfox::getPhrase('like.users_disliked_gender_own_item_title', array('users' => $sUsers, 'gender' => Phpfox::getService('user')->gender($aRow['gender'], 1), 'title' => $sTitle, 'item' => $aAction['item_type_id']));
} elseif ($aRow['user_id'] == Phpfox::getUserId()) {
// {users} liked your blog "{title}"
$sPhrase = Phpfox::getPhrase('like.users_disliked_your_item_title', array('users' => $sUsers, 'title' => $sTitle, 'item' => $aAction['item_type_id']));
} else {
$sPhrase = Phpfox::getPhrase('like.users_disliked_users_item', array('users' => $sUsers, 'row_full_name' => $aRow['full_name'], 'title' => $sTitle, 'item' => $aAction['item_type_id']));
}
return array('link' => $aRow['link'], 'message' => $sPhrase, 'icon' => Phpfox_Template::instance()->getStyle('image', 'activity.png', 'blog'));
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:34,代码来源:callback.class.php
示例15: process
/**
* Controller
*/
public function process()
{
if ($sPlugin = Phpfox_Plugin::get('core.component_controller_index_visitor_start')) {
eval($sPlugin);
}
$image = [];
list($total, $featured) = Photo_Service_Photo::instance()->getFeatured();
if (is_array($featured) && isset($featured[0])) {
$photo = $featured[0];
$url = Phpfox_Image_Helper::instance()->display(['server_id' => $photo['server_id'], 'path' => 'photo.url_photo', 'file' => $photo['destination'], 'suffix' => '_1024', 'return_url' => true]);
$image = ['image' => $url, 'info' => strip_tags($photo['title']) . ' by ' . $photo['full_name']];
}
if (!$image) {
$images = ['create-a-community-for-musicians.jpg' => 'Creating communities for Musicians', 'create-a-community-for-athletes.jpg' => 'Creating communities for Athletes', 'create-a-community-for-photographers.jpg' => 'Creating communities for Photographers', 'create-a-social-network-for-fine-cooking.jpg' => 'Creating communities for Fine Cooking'];
$total = rand(1, count($images));
$image = [];
$cnt = 0;
foreach ($images as $image => $info) {
$cnt++;
$image = ['image' => 'http://bg.m9.io/' . $image, 'info' => $info];
if ($cnt === $total) {
break;
}
}
}
$this->template()->setHeader('cache', array('register.js' => 'module_user', 'country.js' => 'module_core', 'comment.css' => 'style_css'))->setBreadCrumb(Phpfox::getParam('core.site_title'))->setPhrase(array('user.continue'))->assign(array('aSettings' => Phpfox::getService('custom')->getForEdit(array('user_main', 'user_panel', 'profile_panel'), null, null, true), 'image' => $image));
}
开发者ID:noikiy,项目名称:phpfox-dist,代码行数:30,代码来源:index-visitor.class.php
示例16: export
public function export($sProduct, $sModuleId = null)
{
$aCond = array();
$aCond[] = "me.product_id = '" . $this->database()->escape($sProduct) . "'";
if ($sModuleId !== null) {
$aCond[] = "AND me.module_id = '" . $sModuleId . "'";
}
$aRows = $this->database()->select('me.*, m.module_id AS module_name, p.title AS product_name, pm.var_name as parent_var_name')->from($this->_sTable, 'me')->join(Phpfox::getT('module'), 'm', 'm.module_id = me.module_id')->join(Phpfox::getT('product'), 'p', 'p.product_id = me.product_id')->leftjoin(Phpfox::getT('menu'), 'pm', 'pm.menu_id = me.parent_id')->where($aCond)->execute('getRows');
if (!count($aRows)) {
return false;
}
$oXmlBuilder = Phpfox::getLib('xml.builder');
$oXmlBuilder->addGroup('menus');
foreach ($aRows as $aRow) {
if (!empty($aRow['disallow_access'])) {
$aGroups = unserialize($aRow['disallow_access']);
$aRow['disallow_access'] = array();
foreach ($aGroups as $iGroup) {
if (!in_array($iGroup, array(1, 2, 3, 4))) {
continue;
}
$aRow['disallow_access'][] = $iGroup;
}
$aRow['disallow_access'] = serialize($aRow['disallow_access']);
}
$aTag = array('module_id' => $aRow['module_id'], 'parent_var_name' => $aRow['parent_var_name'], 'm_connection' => $aRow['m_connection'], 'var_name' => $aRow['var_name'], 'ordering' => $aRow['ordering'], 'url_value' => $aRow['url_value'], 'version_id' => $aRow['version_id'], 'disallow_access' => $aRow['disallow_access'], 'module' => $aRow['module_name']);
if (!empty($aRow['mobile_icon'])) {
$aTag['mobile_icon'] = $aRow['mobile_icon'];
}
$oXmlBuilder->addTag('menu', '', $aTag);
}
$oXmlBuilder->closeGroup();
return true;
}
开发者ID:googlesky,项目名称:snsp.vn,代码行数:34,代码来源:menu.class.php
示例17: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::getService('user.auth')->logout();
$sHttp = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$this->template()->setFullSite();
$this->template()->setHeader(array('<script src="' . $sHttp . '://connect.facebook.net/en_US/all.js" type="text/javascript"></script>', '<script type="text/javascript">
$Behavior.facebook_init = function()
{
FB.init(
{
appId : \'' . Phpfox::getParam('facebook.facebook_app_id') . '\',
status : true,
cookie : true,
oauth : true,
xfbml : true
});
FB.getLoginStatus(function(response)
{
if (response.authResponse)
{
FB.logout(function(response)
{
window.location.href = \'' . $this->url()->makeUrl('') . '\';
});
}
else
{
window.location.href = \'' . $this->url()->makeUrl('') . '\';
}
});
};
</script>'));
}
开发者ID:googlesky,项目名称:snsp.vn,代码行数:38,代码来源:logout.class.php
示例18: process
public function process()
{
Phpfox::isUser(true);
Phpfox::getUserParam('profiles.is_enabled', true);
if ($sName = $this->request()->get('req3')) {
$aExtraProfile = Phpfox::getService('profiles')->getProfile($sName);
}
if (count($aExtraProfile) == 0) {
return Phpfox::getLib('module')->setController('error.404');
}
if (Phpfox::getUserId() != $aExtraProfile['user_id']) {
Phpfox::getUserParam('profiles.can_edit_others', true);
if (($aUser = Phpfox::getService('user')->getUser($aExtraProfile['user_id'], 'u.user_group_id')) && isset($aUser['user_group_id'])) {
$iUserGroupId = $aUser['user_group_id'];
}
} else {
$iUserGroupId = Phpfox::getUserBy('user_group_id');
}
$bIsEdit = false;
if ($iId = $this->request()->getInt('id', false)) {
$iUserGroupId = $iId;
if ($aVals = $this->request()->getArray('custom') && !empty($aVals)) {
$bIsEdit = true;
if (Phpfox::getService('profiles.process')->updateFields($aExtraProfile['extra_id'], $aExtraProfile['user_id'], $aVals)) {
$this->url()->send('profiles.' . $aExtraProfile['title_url'], null, Phpfox::getPhrase('profiles.successfully_updated_name_profile', array('extra_name' => $aExtraProfile['title'])));
}
}
}
$aCustomFields = Phpfox::getService('profiles')->getFields(array('extra_main', 'extra_panel', 'extra_side'), $aExtraProfile['extra_id'], $iUserGroupId);
$this->template()->setTitle(Phpfox::getPhrase('profiles.edit_extra_profiles'))->setBreadcrumb($aExtraProfile['title']);
$this->template()->setHeader(array('custom.js' => 'module_profiles'))->assign(array('aExtraProfile' => $aExtraProfile, 'aSettings' => $aCustomFields, 'bIsEdit' => $bIsEdit));
}
开发者ID:Lovinity,项目名称:EQM,代码行数:32,代码来源:change.class.php
示例19: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
$sMessage = Phpfox::getPhrase('share.hi_check_this_out_bbcode', array('url' => $this->request()->get('url')));
$sMessage = str_replace("\n", "", $sMessage);
$this->template()->assign(array('sTitle' => $this->request()->get('title'), 'sMessage' => $sMessage));
}
开发者ID:Lovinity,项目名称:EQM,代码行数:10,代码来源:friend.class.php
示例20: get
public function get($iContestId, $iPage = 0, $iLimit = 20)
{
$where = 'cta.contest_id = ' . $iContestId;
$iCnt = $this->database()->select('count(*)')->from($this->_sTable, 'cta')->join(Phpfox::getT('user'), 'u', 'u.user_id = cta.user_id')->where($where)->execute('getSlaveField');
$aRows = $this->database()->select('*')->from($this->_sTable, 'cta')->join(Phpfox::getT('user'), 'u', 'u.user_id = cta.user_id')->where($where)->limit($iPage, $iLimit)->execute('getSlaveRows');
return array($iCnt, $aRows);
}
开发者ID:Lovinity,项目名称:EQM,代码行数:7,代码来源:announcement.class.php
注:本文中的Phpfox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论