本文整理汇总了PHP中Phpfox::getTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getTime方法的具体用法?PHP Phpfox::getTime怎么用?PHP Phpfox::getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::getTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Adds a new job to send the newsletter, first there is no cron jobs/tabs so this function's return
* directs the flow of the script (refresh) to process the batches.
* Sets the errors using Phpfox_Error::set
* @param <type> $aVals
* @return Int Next round to process | false on error.
*/
public function add($aVals, $iUser)
{
// Check validations using the new method
$aForm = array('subject' => array('message' => Phpfox::getPhrase('newsletter.add_a_subject'), 'type' => 'string:required'), 'total' => array('message' => Phpfox::getPhrase('newsletter.how_many_users_to_contact_per_round'), 'type' => 'int:required'), 'text' => array('message' => Phpfox::getPhrase('newsletter.you_need_to_write_a_message_to_send'), 'type' => 'string:required'));
$aVals['type_id'] = 2;
// Internal newsletters are deprecated since 3.3.0 beta 1
$this->validator()->process($aForm, $aVals);
if (!Phpfox_Error::isPassed()) {
return false;
}
// Phpfox::getService('ban')->checkAutomaticBan($aVals['subject'] . ' ' . $aVals['text'] . ' ' . $aVals['txtPlain']);
$iActive = $this->database()->select('COUNT(newsletter_id)')->from($this->_sTable)->where('state = 1')->execute('getSlaveField');
// insert the values in the database
$aInsert = array('subject' => $this->preParse()->clean($aVals['subject']), 'round' => 0, 'state' => $iActive > 0 ? 0 : 1, 'age_from' => (int) $aVals['age_from'], 'age_to' => (int) $aVals['age_to'], 'type_id' => (int) $aVals['type_id'], 'country_iso' => $this->preParse()->clean($aVals['country_iso']), 'gender' => (int) $aVals['gender'], 'user_group_id' => '', 'total' => (int) $aVals['total'], 'user_id' => (int) $iUser, 'time_stamp' => Phpfox::getTime(), 'archive' => isset($aVals['archive']) ? (int) $aVals['archive'] : 2, 'privacy' => isset($aVals['privacy']) ? (int) $aVals['privacy'] : 2);
if (isset($aVals['is_user_group']) && $aVals['is_user_group'] == 2) {
$aGroups = array();
$aUserGroups = Phpfox::getService('user.group')->get();
if (isset($aVals['user_group'])) {
foreach ($aUserGroups as $aUserGroup) {
if (in_array($aUserGroup['user_group_id'], $aVals['user_group'])) {
$aGroups[] = $aUserGroup['user_group_id'];
}
}
}
$aInsert['user_group_id'] = count($aGroups) ? serialize($aGroups) : null;
}
// ** when we implement the cron job this is the place to set the state differently
$iId = $this->database()->insert($this->_sTable, $aInsert);
$this->database()->insert(Phpfox::getT('newsletter_text'), array('newsletter_id' => $iId, 'text_plain' => $this->preParse()->clean($aVals['txtPlain']), 'text_html' => $aVals['text']));
// store that we are processing a job
$aInsert['newsletter_id'] = $iId;
$aInsert['round'] = 0;
return $aInsert;
}
示例2: process
/**
* Controller
*/
public function process()
{
if (!$this->getParam('bIsValidImage')) {
return false;
}
$aUser = $this->getParam('aUser');
$aPhoto = $this->getParam('aPhoto');
$bIsInPhoto = $this->getParam('is_in_photo');
if ($aPhoto === null) {
return false;
}
$sCategories = '';
if (isset($aPhoto['categories']) && is_array($aPhoto['categories'])) {
foreach ($aPhoto['categories'] as $aCategory) {
$sCategories .= $aCategory[0] . ',';
}
$sCategories = rtrim($sCategories, ',');
}
$aInfo = array(Phpfox::getPhrase('photo.added') => '<span itemprop="dateCreated">' . Phpfox::getTime(Phpfox::getParam('photo.photo_image_details_time_stamp'), $aPhoto['time_stamp']) . '</span>', Phpfox::getPhrase('photo.category') => $sCategories, Phpfox::getPhrase('photo.file_size') => Phpfox_File::instance()->filesize($aPhoto['file_size']), Phpfox::getPhrase('photo.resolution') => $aPhoto['width'] . '×' . $aPhoto['height'], Phpfox::getPhrase('photo.comments') => $aPhoto['total_comment'], Phpfox::getPhrase('photo.views') => '<span itemprop="interactionCount">' . $aPhoto['total_view'] . '</span>', Phpfox::getPhrase('photo.rating') => round($aPhoto['total_rating']), Phpfox::getPhrase('photo.battle_wins') => round($aPhoto['total_battle']), Phpfox::getPhrase('photo.downloads') => $aPhoto['total_download']);
if ($bIsInPhoto) {
unset($aInfo[Phpfox::getPhrase('photo.added')]);
}
foreach ($aInfo as $sKey => $mValue) {
if (empty($mValue)) {
unset($aInfo[$sKey]);
}
}
$this->template()->assign(array('sHeader' => Phpfox::getPhrase('photo.image_details'), 'aPhotoDetails' => $aInfo, 'bIsInPhoto' => $bIsInPhoto, 'sUrlPath' => preg_match("/\\{file\\/pic\\/(.*)\\/(.*)\\.jpg\\}/i", $aPhoto['destination'], $aMatches) ? Phpfox::getParam('core.path') . str_replace(array('{', '}'), '', $aMatches[0]) : ($aPhoto['server_id'] && Phpfox::getParam('core.allow_cdn') ? Phpfox::getLib('cdn')->getUrl(Phpfox::getParam('photo.url_photo') . sprintf($aPhoto['destination'], '_500'), $aPhoto['server_id']) : Phpfox::getParam('photo.url_photo') . sprintf($aPhoto['destination'], '_500'))));
// return 'block';
}
示例3: process
public function process()
{
(($sPlugin = Phpfox_Plugin::get('announcement.component_block_index__start')) ? eval($sPlugin) : false);
$aAnnouncement = Phpfox::getService('announcement')->getLatest(null, true, Phpfox::getTime());
if ($aAnnouncement === false)
{
return false;
}
$aAnnouncement = reset($aAnnouncement);
if (isset($aAnnouncement['is_seen']) && $aAnnouncement['is_seen'] == true) return false;
if (Phpfox::getLib('phpfox.locale')->isPhrase($aAnnouncement['intro_var']))
{
$aAnnouncement['intro_var'] = Phpfox::getPhrase($aAnnouncement['intro_var']);
}
else
{
$aAnnouncement['intro_var'] = '';
}
$this->template()->assign(array(
'aAnnouncement' => $aAnnouncement
)
);
(($sPlugin = Phpfox_Plugin::get('announcement.component_block_index__end')) ? eval($sPlugin) : false);
}
示例4: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
// If the user is not a member don't display this block
if (!Phpfox::isUser())
{
return false;
}
$sUserProfileImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true)), array(
'path' => 'core.url_user',
'file' => Phpfox::getUserBy('user_image'),
'suffix' => '_50_square',
'max_width' => 50,
'max_height' => 50
)
)
);
// Assign template vars
$this->template()->assign(array(
'sUserProfileImage' => $sUserProfileImage,
'sUserProfileUrl' => $this->url()->makeUrl('profile', Phpfox::getUserBy('user_name')), // Create the users profile URL
'sCurrentUserName' => Phpfox::getLib('parse.output')->shorten(Phpfox::getLib('parse.output')->clean(Phpfox::getUserBy('full_name')), 50, '...'), // Get the users display name
'sCurrentTimeStamp' => Phpfox::getTime(Phpfox::getParam('core.global_welcome_time_stamp'), PHPFOX_TIME), // Get the current time stamp
'iTotalActivityPoints' => (int) Phpfox::getUserBy('activity_points'),
'iTotalProfileViews' => (int) Phpfox::getUserBy('total_view')
)
);
}
示例5: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$aUser = PHPFOX_IS_AJAX ? Phpfox::getService('user')->get($this->request()->getInt('profile_user_id'), true) : $this->getParam('aUser');
$aBirthDay = Phpfox::getService('user')->getAgeArray(PHPFOX_IS_AJAX ? $aUser['birthday'] : $aUser['birthday_time_stamp']);
if (empty($aUser['birthday'])) {
return false;
}
$this->template()->assign(array('aUser' => $aUser, 'sBirthDisplay' => Phpfox::getTime(Phpfox::getParam('user.user_dob_month_day'), mktime(0, 0, 0, $aBirthDay['month'], $aBirthDay['day'], $aBirthDay['year']), false)));
}
示例6: getNew
public function getNew()
{
($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_getnew__start')) ? eval($sPlugin) : false;
return $this->database()->select('b.blog_id, b.time_stamp, b.title, bt.text_parsed, ' . Phpfox::getUserField())->from($this->_sTable, 'b')->join(Phpfox::getT('user'), 'u', 'u.user_id = b.user_id')->join(Phpfox::getT('blog_text'), 'bt', 'bt.blog_id = b.blog_id')->where('b.is_approved = 1 AND b.privacy = 0 AND b.post_status = 1')->limit((int) Phpfox::getParam('stnewblogs.how_many_nblogs'))->order('b.time_stamp DESC')->execute('getSlaveRows');
foreach ($aRows as $iKey => $aRow) {
$aRows[$iKey]['posted_on'] = Phpfox::getPhrase('blog.posted_on_post_time_by_user_link', array('post_time' => Phpfox::getTime(Phpfox::getParam('blog.blog_time_stamp'), $aRow['time_stamp']), 'user' => $aRow));
}
($sPlugin = Phpfox_Plugin::get('blog.component_service_blog_getnew__end')) ? eval($sPlugin) : false;
return $aRows;
}
示例7: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$aVideo = $this->getParam('aVideo');
$sGroup = $this->getParam('sGroup', '');
$aItems = array(Phpfox::getPhrase('video.added') => Phpfox::getTime(Phpfox::getParam('video.video_time_stamp'), $aVideo['time_stamp']));
if (Phpfox::isModule('comment')) {
$aItems[Phpfox::getPhrase('video.comments')] = $aVideo['total_comment'];
}
$this->template()->assign(array('aVideoDetails' => $aItems, 'sGroup' => $sGroup));
}
示例8: addSponsor
/**
* Creates a record of the purchase into phpfox_ad_sponsor and returns the ID
* to be used as an invoice with the payment gateway.
*
* @example if admin is adding, aVals looks like: array('module' => 'music', 'section' => 'album', 'item_id' => $this->get('album_id'))
* @param array $aVals
* @return int
*/
public function addSponsor($aVals)
{
// check required fields
$aForms = array('name' => array('message' => Phpfox::getPhrase('ad.provide_a_campaign_name'), 'type' => array('string:required')), 'total_view' => array('message' => Phpfox::getPhrase('ad.impressions_cant_be_less_than_a_thousand'), 'type' => 'int:required'));
$sParam = $aVals['module'] . '.can_sponsor_';
$sParam .= isset($aVals['section']) && !empty($aVals['section']) ? $aVals['section'] : $aVals['module'];
if (Phpfox::getUserParam($sParam)) {
$iCpm = $aVals['total_view'] = $aVals['age_to'] = $aVals['age_from'] = $aVals['gender'] = 0;
$aVals['is_active'] = 1;
// $aVals['is_custom'] = 3;
$iIsCustom = 3;
$aVals['country_iso_custom'] = '';
$aVals['name'] = '{phrase var=\'ad.default_campaign_name\'}';
$aVals['cpm'] = 0;
} else {
// done here for extra safety
$aPrices = unserialize(Phpfox::getUserParam($aVals['module'] . '.' . $aVals['module'] . (isset($aVals['section']) ? '_' . $aVals['section'] : '') . '_sponsor_price'));
if (!isset($aPrices[Phpfox::getService('core.currency')->getDefault()])) {
return Phpfox_Error::display('The default currency has no price');
}
$iCpm = $aPrices[Phpfox::getService('core.currency')->getDefault()];
}
$this->validator()->process($aForms, $aVals);
if (!Phpfox_Error::isPassed()) {
return false;
}
$iAutoPublish = 0;
if (isset($aVals['section']) && !empty($aVals['section'])) {
$iAutoPublish = Phpfox::getUserParam($aVals['module'] . '.auto_publish_sponsored_' . $aVals['section']);
} else {
$iAutoPublish = Phpfox::getUserParam($aVals['module'] . '.auto_publish_sponsored_item');
}
if (empty($iAutoPublish)) {
$iAutoPublish = '0';
}
// if its an admin sponsoring something we dont need all the checks:
$aInsertSponsor = array('module_id' => $aVals['module'] . (isset($aVals['section']) && !empty($aVals['section']) ? '-' . $aVals['section'] : ''), 'item_id' => $aVals['item_id'], 'user_id' => Phpfox::getUserId(), 'country_iso' => $aVals['country_iso_custom'], 'gender' => empty($aVals['gender']) ? 0 : (int) $aVals['gender'], 'age_from' => empty($aVals['age_from']) ? 0 : (int) $aVals['age_from'], 'age_to' => empty($aVals['age_from']) ? 0 : (int) $aVals['age_to'], 'campaign_name' => $aVals['name'], 'impressions' => $aVals['total_view'], 'cpm' => $iCpm, 'start_date' => Phpfox::getUserParam($sParam) ? PHPFOX_TIME : Phpfox::getLib('date')->mktime($aVals['start_hour'], $aVals['start_minute'], 0, $aVals['start_month'], $aVals['start_day'], $aVals['start_year']), 'auto_publish' => $iAutoPublish, 'is_custom' => isset($iIsCustom) ? $iIsCustom : '1');
if (isset($aVals['is_active'])) {
$aInsertSponsor['is_active'] = $aVals['is_active'];
}
$iInsert = $this->database()->insert(Phpfox::getT('ad_sponsor'), $aInsertSponsor);
if (Phpfox::getUserParam($sParam)) {
return $iInsert;
}
/**
* @param `phpfox_ad_invoice`.`status`:
* 1 => Submitted but not paid or approved.
* 2 => Paid but not approved,
* 3 => Approved and should be displayed
*/
$aInsertInvoice = array('ad_id' => $iInsert, 'price' => round($iCpm * $aVals['total_view'] / 1000 * 100) / 100, 'currency_id' => Phpfox::getService('core.currency')->getDefault(), 'status' => null, 'user_id' => Phpfox::getUserId(), 'is_sponsor' => 1, 'time_stamp' => Phpfox::getTime());
$iInsertInvoice = $this->database()->insert(Phpfox::getT('ad_invoice'), $aInsertInvoice);
return $iInsertInvoice;
}
示例9: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$sCurrentTimeZone = Phpfox::getTimeZone() == '0' ? '' : ' ' . (substr(Phpfox::getTimeZone(), 0, 1) == '-' ? Phpfox::getTimeZone() : '+' . Phpfox::getTimeZone());
if (substr(Phpfox::getTimeZone(), 0, 1) == 'z' && PHPFOX_USE_DATE_TIME) {
$aTimeZones = Phpfox::getService('core')->getTimeZones();
if (isset($aTimeZones[Phpfox::getTimeZone()])) {
$oDTZ = new DateTime('now', new DateTimeZone($aTimeZones[Phpfox::getTimeZone()]));
$sCurrentTimeZone = $oDTZ->getOffset() / 3600;
}
}
$this->template()->assign(array('sCurrentSiteTime' => Phpfox::getTime(Phpfox::getParam('forum.global_forum_timezone'), PHPFOX_TIME), 'sCurrentTimeZone' => $sCurrentTimeZone));
}
示例10: getTimeLineYears
public function getTimeLineYears($iUserId, $iLastTimeStamp)
{
static $aCachedYears = array();
if (isset($aCachedYears[$iUserId])) {
return $aCachedYears[$iUserId];
}
$aNewYears = array();
$sCacheId = $this->cache()->set(array('timeline', $iUserId));
if (!($aNewYears = $this->cache()->get($sCacheId))) {
$aYears = range(date('Y', PHPFOX_TIME), date('Y', $iLastTimeStamp));
foreach ($aYears as $iYear) {
$iStartYear = mktime(0, 0, 0, 1, 1, $iYear);
$iEndYear = mktime(0, 0, 0, 12, 31, $iYear);
$iCnt = $this->database()->select('COUNT(*)')->from(Phpfox::getT('feed'))->forceIndex('time_stamp')->where('user_id = ' . (int) $iUserId . ' AND feed_reference = 0 AND time_stamp > \'' . $iStartYear . '\' AND time_stamp <= \'' . $iEndYear . '\'')->execute('getSlaveField');
if ($iCnt) {
$aNewYears[] = $iYear;
}
}
$this->cache()->save($sCacheId, $aNewYears);
}
if (!is_array($aNewYears)) {
$aNewYears = array();
}
$iBirthYear = date('Y', $iLastTimeStamp);
$sDobCacheId = $this->cache()->set(array('udob', $iUserId));
if (!($iDOB = $this->cache()->get($sDobCacheId))) {
$iDOB = $this->database()->select('dob_setting')->from(Phpfox::getT('user_field'))->where('user_id = ' . (int) $iUserId)->execute('getSlaveField');
$this->cache()->save($sDobCacheId, $iDOB);
}
if ($iDOB == 0) {
$sPermission = Phpfox::getParam('user.default_privacy_brithdate');
$bShowBirthYear = $sPermission == 'full_birthday' || $sPermission == 'show_age';
}
if (!in_array($iBirthYear, $aNewYears) && ($iDOB == 2 || $iDOB == 4 || $iDOB == 0 && isset($bShowBirthYear) && $bShowBirthYear)) {
$aNewYears[] = $iBirthYear;
}
$aYears = array();
foreach ($aNewYears as $iYear) {
$aMonths = array();
foreach (range(1, 12) as $iMonth) {
if ($iYear == date('Y', PHPFOX_TIME) && $iMonth > date('n', PHPFOX_TIME)) {
} elseif ($iYear == date('Y', $iLastTimeStamp) && $iMonth > date('n', $iLastTimeStamp)) {
} else {
$aMonths[] = array('id' => $iMonth, 'phrase' => Phpfox::getTime('F', mktime(0, 0, 0, $iMonth, 1, $iYear), false));
}
}
$aMonths = array_reverse($aMonths);
$aYears[] = array('year' => $iYear, 'months' => $aMonths);
}
$aCachedYears[$iUserId] = $aYears;
return $aYears;
}
示例11: get
/**
* get database in block
* @return array
*/
public function get()
{
$sType = Phpfox::getParam('themesupporter.block_event_type');
$sCacheId = $this->cache()->set('brodev_themesupporter_event_' . $sType);
if (!($aRecords = $this->cache()->get($sCacheId, 300))) {
$iTimeDisplay = Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d'), Phpfox::getTime('Y'));
$sWhere = 'e.view_id = 0 AND e.privacy = 0 AND e.item_id = 0 ';
switch ($sType) {
case 'Today':
$sWhere .= " AND e.start_time > " . Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d'), Phpfox::getTime('Y')) . " AND e.start_time < " . Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d') + 1, Phpfox::getTime('Y'));
$this->database()->order('e.time_stamp');
break;
case 'Week':
$iFirstDay = @date("w", @mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d'), Phpfox::getTime('Y')));
$iLastDay = 7 - $iFirstDay;
$sWhere .= " AND e.start_time > " . Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d') - $iFirstDay, Phpfox::getTime('Y')) . " AND e.start_time < " . Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), Phpfox::getTime('d') + $iLastDay, Phpfox::getTime('Y'));
$this->database()->order('e.time_stamp');
break;
case 'Month':
$sWhere .= " AND e.start_time > " . Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m'), 1, Phpfox::getTime('Y')) . " AND e.start_time < " . Phpfox::getLib('date')->mktime(0, 0, 0, Phpfox::getTime('m') + 1, 1, Phpfox::getTime('Y'));
$this->database()->order('e.time_stamp');
break;
case 'All':
$this->database()->order('e.time_stamp');
$sWhere .= " AND e.start_time >= " . $iTimeDisplay;
break;
case 'Most':
$sWhere .= " AND e.start_time >= " . $iTimeDisplay;
$aMostEventId = $this->database()->select('event_id')->from(Phpfox::getT('event_invite'))->group('event_id')->order('count(event_id) desc')->limit(Phpfox::getParam('themesupporter.block_event_number'))->execute('getRows');
$aEventIds[] = 0;
foreach ($aMostEventId as $aMostEvent) {
$aEventIds[] = $aMostEvent['event_id'];
}
$sWhere .= " AND e.event_id IN (" . implode(", ", $aEventIds) . ")";
}
$iLimit = Phpfox::getParam('themesupporter.block_event_number');
$aRecords = $this->database()->select('e.*, u.user_name as user_name, u.full_name as full_name, u.user_image as user_image, et.description_parsed as description')->from($this->_sTable, 'e')->leftJoin(Phpfox::getT('user'), 'u', 'e.user_id = u.user_id')->leftJoin(Phpfox::getT('event_text'), 'et', 'e.event_id = et.event_id')->where($sWhere)->limit($iLimit)->execute('getRows');
if (empty($aRecords)) {
return false;
}
foreach ($aRecords as $iKey => $aVal) {
$aRecords[$iKey]['attending'] = $this->countInvite($aVal['event_id']);
$aRecords[$iKey]['url'] = Phpfox::getLib('url')->permalink('event', $aVal['event_id'], $aVal['title']);
$aRecords[$iKey]['start_time_phrase'] = Phpfox::getTime(Phpfox::getParam('event.event_browse_time_stamp'), $aVal['start_time']);
$aRecords[$iKey]['start_time_phrase_stamp'] = Phpfox::getTime('g:sa', $aVal['start_time']);
$aRecords[$iKey]['aFeed'] = array('feed_display' => 'mini', 'comment_type_id' => 'event', 'privacy' => $aVal['privacy'], 'comment_privacy' => $aVal['privacy_comment'], 'like_type_id' => 'event', 'feed_is_liked' => isset($aVal['is_liked']) ? $aVal['is_liked'] : false, 'feed_is_friend' => isset($aVal['is_friend']) ? $aVal['is_friend'] : false, 'item_id' => $aVal['event_id'], 'user_id' => $aVal['user_id'], 'total_comment' => $aVal['total_comment'], 'feed_total_like' => $aVal['total_like'], 'total_like' => $aVal['total_like'], 'feed_link' => Phpfox::getLib('url')->permalink('event', $aVal['event_id'], $aVal['title']), 'feed_title' => $aVal['title']);
}
$this->cache()->save($sCacheId, $aRecords);
}
return $aRecords;
}
示例12: execute
public function execute()
{
$this->_iCnt = $this->database()->select('COUNT(*)')->from($this->_sTable, 'p')->leftjoin(Phpfox::getT('ko_profiles_field_values'), 'pfv', 'pfv.extra_id = p.extra_id')->where($this->_aConditions)->execute('getSlaveField');
if ($this->_iCnt) {
$aListings = $this->database()->select('p.*, pfv.*,p.extra_id AS extra_id, ' . Phpfox::getUserField('u', 'extra_'))->from($this->_sTable, 'p')->join(Phpfox::getT('user'), 'u', 'u.user_id = p.user_id')->leftJoin(Phpfox::getT('ko_profiles_field_values'), 'pfv', 'pfv.extra_id = p.extra_id')->where($this->_aConditions)->order($this->_sOrder)->limit($this->_iPage, $this->_iPageSize, $this->_iCnt)->execute('getSlaveRows');
//echo '<pre>'; print_r($aListings); echo '</pre>'; exit;
foreach ($aListings as $aListing) {
$aListing['user_name_link'] = '<a href="' . Phpfox::getLib('url')->makeUrl($aListing['extra_user_name']) . '">' . Phpfox::getLib('parse.output')->clean($aListing['extra_full_name']) . '</a>';
$aListing['time_stamp_phrase'] = Phpfox::getTime(Phpfox::getParam('profiles.profiles_browse_time_stamp'), $aListing['time_stamp']);
$aListing['url'] = Phpfox::getLib('url')->makeUrl('profiles', $aListing['title_url']);
$this->_aListings[] = $aListing;
}
}
}
示例13: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if ($this->template()->getThemeFolder() == 'nebula' || $this->template()->getParentThemeFolder() == 'nebula') {
return false;
}
// If the user is not a member don't display this block
if (!Phpfox::isUser()) {
return false;
}
$sUserProfileImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true)), array('path' => 'core.url_user', 'file' => Phpfox::getUserBy('user_image'), 'suffix' => '_50_square', 'max_width' => 50, 'max_height' => 50)));
$aGroup = Phpfox::getService('user.group')->getGroup(Phpfox::getUserBy('user_group_id'));
// Assign template vars
$this->template()->assign(array('sUserProfileImage' => $sUserProfileImage, 'sUserProfileUrl' => $this->url()->makeUrl('profile', Phpfox::getUserBy('user_name')), 'sCurrentUserName' => Phpfox::getLib('parse.output')->shorten(Phpfox::getLib('parse.output')->clean(Phpfox::getUserBy('full_name')), Phpfox::getParam('user.max_length_for_username'), '...'), 'sCurrentTimeStamp' => Phpfox::getTime(Phpfox::getParam('core.global_welcome_time_stamp'), PHPFOX_TIME), 'iTotalActivityPoints' => (int) Phpfox::getUserBy('activity_points'), 'iTotalProfileViews' => (int) Phpfox::getUserBy('total_view'), 'sUserGroupFullName' => Phpfox::getLib('locale')->convert($aGroup['title'])));
}
示例14: getPost
public function getPost($iId)
{
($sPlugin = Phpfox_Plugin::get('forum.service_post_getpost')) ? eval($sPlugin) : false;
if (Phpfox::isModule('like')) {
$this->database()->select('l.like_id AS is_liked, ')->leftJoin(Phpfox::getT('like'), 'l', 'l.type_id = \'forum_post\' AND l.item_id = fp.post_id AND l.user_id = ' . Phpfox::getUserId());
}
$aPost = $this->database()->select('fp.*, ' . (Phpfox::getParam('core.allow_html') ? 'fpt.text_parsed' : 'fpt.text') . ' AS text, ' . Phpfox::getUserField() . ', u.joined, u.country_iso, uf.signature, uf.total_post, ft.forum_id, ft.group_id, ft.user_id AS thread_user_id, ft.title AS thread_title')->from(Phpfox::getT('forum_post'), 'fp')->join(Phpfox::getT('forum_thread'), 'ft', 'ft.thread_id = fp.thread_id')->join(Phpfox::getT('forum_post_text'), 'fpt', 'fpt.post_id = fp.post_id')->join(Phpfox::getT('user'), 'u', 'u.user_id = fp.user_id')->join(Phpfox::getT('user_field'), 'uf', 'uf.user_id = fp.user_id')->where('fp.post_id = ' . $iId)->execute('getRow');
$aPost['aFeed'] = array('privacy' => 0, 'comment_privacy' => 0, 'like_type_id' => 'forum_post', 'feed_is_liked' => $aPost['is_liked'] ? true : false, 'item_id' => $aPost['post_id'], 'user_id' => $aPost['user_id'], 'total_like' => $aPost['total_like'], 'feed_link' => Phpfox::permalink('forum.thread', $aPost['thread_id'], $aPost['thread_title']) . 'view_' . $aPost['post_id'] . '/', 'feed_title' => $aPost['thread_title'], 'feed_display' => 'mini', 'feed_total_like' => $aPost['total_like'], 'report_module' => 'forum_post', 'report_phrase' => Phpfox::getPhrase('forum.report_this_post'), 'time_stamp' => $aPost['time_stamp']);
if ($aPost['total_attachment']) {
list($iAttachmentCnt, $aPost['attachments']) = Phpfox::getService('attachment')->get('attachment.item_id = ' . $aPost['post_id'] . ' AND attachment.view_id = 0 AND attachment.category_id = \'forum\' AND attachment.is_inline = 0', 'attachment.attachment_id DESC', '', '', false);
}
$aPost['last_update_on'] = Phpfox::getPhrase('forum.last_update_on_time_stamp_by_update_user', array('time_stamp' => Phpfox::getTime(Phpfox::getParam('forum.forum_time_stamp'), $aPost['update_time']), 'update_user' => $aPost['update_user']));
return $aPost;
}
示例15: _build
private function _build($aPhoto)
{
$sJs = '';
foreach ($aPhoto as $sKey => $sValue) {
if ($sKey == 'destination') {
$sValue = Phpfox::getLib('image.helper')->display(array('server_id' => $aPhoto['server_id'], 'path' => 'photo.url_photo', 'file' => $aPhoto['destination'], 'suffix' => '_500', 'max_width' => 400, 'max_height' => 400));
} elseif ($sKey == 'full_name') {
$sValue = '<a href="' . Phpfox::getLib('url')->makeUrl($aPhoto['user_name']) . '">' . $aPhoto['full_name'] . '</a>';
} elseif ($sKey == 'time_stamp') {
$sValue = Phpfox::getTime(Phpfox::getParam('photo.photo_image_details_time_stamp'), $aPhoto['time_stamp']);
}
$sJs .= $sKey . ': \'' . str_replace("'", "\\'", $sValue) . '\',';
}
$sJs = rtrim($sJs, ',');
return $sJs;
}