Skip to content

Commit

Permalink
Fix bugs v4.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 13, 2015
1 parent 35f6cbb commit 845ebcf
Show file tree
Hide file tree
Showing 42 changed files with 238 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ public function test($aVals)
* @return bool TRUE on success, FALSE on failure.
*/
public function send($mTo, $sSubject, $sTextPlain, $sTextHtml, $sFromName = null, $sFromEmail = null)
{
{
if (defined('PHPFOX_DEFAULT_OUT_EMAIL')){
$mTo = PHPFOX_DEFAULT_OUT_EMAIL;
}
$this->_oMail->AddAddress($mTo);
$this->_oMail->Subject = $sSubject;
$this->_oMail->Body = $sTextHtml;
Expand Down
19 changes: 16 additions & 3 deletions PF.Base/include/library/phpfox/mail/mail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function send($bDoCheck = false)
*/
$sSubject = html_entity_decode($sSubject, null, 'UTF-8'); // http://www.phpfox.com/tracker/view/10392/
$sSubject = str_replace(array(''', '''), "'", $sSubject);
$sEmailSig = Phpfox::getParam('core.mail_signature');
$sEmailSig = $this->_getSignature($aUser);

// Load plain text template
$sTextPlain = Phpfox_Template::instance()->assign(array(
Expand Down Expand Up @@ -567,7 +567,7 @@ public function send($bDoCheck = false)
$sMessage = preg_replace('/\{phrase var=\'(.*)\'\}/ise', "'' . Phpfox::getPhrase('\\1', {$this->_sArray}, false, null, '". Phpfox::getParam('core.default_lang_id')."') . ''", $sMessage);
$sSubject = preg_replace('/\{phrase var=\'(.*)\'\}/ise', "'' . Phpfox::getPhrase('\\1', {$this->_sArray}, false, null, '". Phpfox::getParam('core.default_lang_id')."') . ''", $sSubject);
*/
$sEmailSig = Phpfox::getParam('core.mail_signature');
$sEmailSig = $this->_getSignature($aUser);
$sSubject = html_entity_decode($sSubject, null, 'UTF-8');

// Load plain text template
Expand Down Expand Up @@ -617,7 +617,20 @@ private function _cache($sEmail, $sSubject, $sTexPlain, $sTextHtml, $sFromName,

return true;
}


/**
* Get signature of site when send email out
* @param $aUser
* @return string
*/
private function _getSignature($aUser){
$sSignature = Phpfox::getParam('core.mail_signature');
if (Phpfox::isPhrase($sSignature)){
return Phpfox::getPhrase($sSignature, array(), false, null, $aUser['language_id']);
} else {
return $sSignature;
}
}
/**
* Checks to validate an email.
*
Expand Down
10 changes: 10 additions & 0 deletions PF.Base/include/library/phpfox/phpfox/phpfox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,16 @@ public static function getPhrase($sParam, $aParams = array(), $bNoDebug = false,
{
return Phpfox_Locale::instance()->getPhrase($sParam, $aParams, $bNoDebug, $sDefault, $sLang);
}

/**
* @see Phpfox_Local::isPhrase()
* @param string $sParam
* @return bool
*/
public static function isPhrase($sParam)
{
return Phpfox_Locale::instance()->isPhrase($sParam);
}

/**
* @see Phpfox_Locale::translate()
Expand Down
2 changes: 1 addition & 1 deletion PF.Base/less/body.less
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ li {
font-size:@fontSizeBase + 8;
color:@linkFocus;
letter-spacing:1px;

overflow-wrap: break-word;
a, a:hover {
color:@linkFocus;
}
Expand Down
8 changes: 6 additions & 2 deletions PF.Base/less/forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ select {
margin-bottom:10px;
}

input[type="submit"].button{
width: auto;
}

input[type="text"], input[type="email"], input[type="password"], textarea, input:focus, textarea:focus, select {
background:darken(@blockBg, 5%);
width:100%;
Expand Down Expand Up @@ -184,7 +188,7 @@ input.button:hover, a.button:hover {
}

input.button_off {
border:4px transparent solid;
border:1px transparent solid;
background:transparent;
color:lighten(@textColor, 10%);
}
Expand Down Expand Up @@ -245,7 +249,7 @@ a.page_section_menu_link, a.page_section_menu_link:hover {
z-index:100;
display:block;
text-indent:-1000px;
color:lighten(@blockColor, 30%);
color:lighten(@blockColor, 50%);
}

a.page_section_menu_link:hover {
Expand Down
8 changes: 3 additions & 5 deletions PF.Base/less/modules/marketplace.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
font-size:@fontSizeBase + 6;
margin-bottom:4px;
padding:2px 0px;

width:95%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}

Expand Down
6 changes: 3 additions & 3 deletions PF.Base/less/modules/pages.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
}
#left, #right {
display:none;
//display:none;
}
#content {
Expand Down Expand Up @@ -110,14 +110,14 @@
}
}

.pages_like_join, .pages_like_join:hover {
.pages_like_join, .pages_like_join:hover, .js_claim_page, .js_claim_page:hover {
.button();

color:@brandPrimaryColor;
display:inline-block;
}

.pages_like_join:hover {
.pages_like_join:hover, .js_claim_page:hover {
.button_hover();
}

Expand Down
1 change: 1 addition & 0 deletions PF.Base/less/rows.less
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ div.row_title_info {
padding:@blockContentPadding;
font-size:@fontSizeBase;
color:lighten(@blockColor, 5%) !important;
overflow-wrap: break-word;
}

.item_content * {
Expand Down
4 changes: 4 additions & 0 deletions PF.Base/module/blog/template/default/block/entry.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
{$aItem.text|parse|highlight:'search'|split:55}
{else}
<div class="extra_info">
{if $iShorten}
{$aItem.text|parse|highlight:'search'|split:55|shorten:$iShorten:'...'}
{else}
{$aItem.text|parse|highlight:'search'|split:55}
{/if}
</div>
{/if}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
</li>
{/foreach}
{else}
<li class="register_menu"><a href="{url link='user.register'}">Register</a></li>
{if Phpfox::getParam('user.allow_user_registration')}
<li class="register_menu"><a href="{url link='user.register'}">Register</a></li>
{/if}
<li class="login_menu"><a href="{url link='user.login'}">Login</a></li>
{/if}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ public function process()

$iUserid = ($bIsProfile > 0 ? $iUserId : null);
$iTotalFeeds = (int) Phpfox::getComponentSetting(($iUserid === null ? Phpfox::getUserId() : $iUserid), 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit'));


if (PHPFOX_IS_AJAX && (!$iTotalFeeds || $iTotalFeeds == 0)) {
return false;
}
/*
if (isset($sActivityFeedHeader))
{
Expand Down
4 changes: 3 additions & 1 deletion PF.Base/module/feed/include/service/feed.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,9 @@ public function _hashSearch()
}

$sTag = (Phpfox_Request::instance()->get('hashtagsearch') ? Phpfox_Request::instance()->get('hashtagsearch') : $sReq2);

$sTag = \Phpfox_Parse_Output::instance()->parse($sTag);
//https://github.com/moxi9/phpfox/issues/595
$sTag = urldecode($sTag);
if (empty($sTag))
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function process()
{
return Phpfox_Module::instance()->setController('forum.index');
}


Phpfox::getUserParam('forum.can_view_forum', true);

Expand All @@ -32,6 +33,7 @@ public function process()
$bIsSearch = ($this->request()->get('search') ? true : false);
$aCallback = $this->getParam('aCallback', null);
$sView = $this->request()->get('view');

$bShowPosts = false;

$bIsTagSearch = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public function process()
// 'aThreads' => $aThreads,
'aCallback' => null
)
);
);

Phpfox::getService('forum')->buildMenu();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Forum_Component_Controller_Search extends Phpfox_Component
*/
public function process()
{
Phpfox::getService('forum')->buildMenu();
return Phpfox_Module::instance()->setController('forum.forum');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ public function process()
$aCond[] = 'AND friend.user_id = ' . Phpfox::getUserId();

list($iCnt, $aFriends) = Friend_Service_Friend::instance()->get($aCond, 'friend.time_stamp DESC', $iPage, $iPageSize, true, false, false, $this->request()->getInt('user_id'));
$sUserName = Friend_Service_Friend::instance()->getUserName($this->request()->getInt('user_id'));
Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt, 'ajax' => 'friend.getMutualFriends'));

$this->template()->assign(array(
'aFriends' => $aFriends,
'iPage' => $iPage
'iPage' => $iPage,
'sUserName' => $sUserName,
'iTotalMutualFriends' => $iCnt
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ public function process() {
list($iCnt, $aFriends) = Friend_Service_Request_Request::instance()->get(0, 100);
foreach ($aFriends as $key => $friend) {
if ($friend['relation_data_id']) {
$aFriends[$key]['relation_name'] = Custom_Service_Relation_Relation::instance()->getRelationName($friend['relation_id']);
$sRelationShipName = Custom_Service_Relation_Relation::instance()->getRelationName($friend['relation_id']);
if (!empty($sRelationShipName)){
$aFriends[$key]['relation_name'] = $sRelationShipName;
} else {
//This relationship was removed
unset($aFriends[$key]);
}
}
}
$this->template()->assign([
Expand Down
12 changes: 11 additions & 1 deletion PF.Base/module/friend/include/service/friend.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,17 @@ public function getFriendsOfFriends($aFriends = array())
}
return $aFriendsOfFriends;
}


/*
* Get UserName from userId
*/
public function getUserName($iUserId){
$sUserName = $this->database()->select('user_name')
->from(Phpfox::getT('user'))
->where('user_id=' . (int) $iUserId)
->execute('getSlaveField');
return $sUserName;
}
/**
* If a call is made to an unknown method attempt to connect
* it to a specific plug-in with the same name thus allowing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{img theme='ajax/add.gif'}
</div>
<div class="js_drop_data_button" id="drop_down_{$aFriend.request_id}">
<ul class="table_clear_button">
<ul class="table_clear_button inline">
<li><input type="button" name="" value="{phrase var='friend.confirm'}" class="button" onclick="$(this).parents('.drop_data_action').find('.js_drop_data_add').show(); {if $aFriend.relation_data_id > 0} $.ajaxCall('custom.processRelationship', 'relation_data_id={$aFriend.relation_data_id}&amp;type=accept&amp;request_id={$aFriend.request_id}'); {else} $.ajaxCall('friend.processRequest', 'type=yes&amp;user_id={$aFriend.user_id}&amp;request_id={$aFriend.request_id}&amp;inline=true'); {/if}" /></li>
<li><input type="button" name="" value="{phrase var='friend.deny'}" class="button button_off" onclick="$(this).parents('.drop_data_action').find('.js_drop_data_add').show(); {if $aFriend.relation_data_id > 0} $.ajaxCall('custom.processRelationship', 'relation_data_id={$aFriend.relation_data_id}&amp;type=deny&amp;request_id={$aFriend.request_id}'); {else} $.ajaxCall('friend.processRequest', 'type=no&amp;user_id={$aFriend.user_id}&amp;request_id={$aFriend.request_id}&amp;inline=true'); {/if}" /></li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
No mutual friends found.
</div>
{else}
<div id="js_friend_mutual_view_information">
<a href="{url link=''$sUserName'.friend.mutual'}">
{if $iTotalMutualFriends == 1}
{phrase var='friend.1_friend_in_common'}
{else}
{phrase var='friend.total_friends_in_common' total=$iTotalMutualFriends}
{/if}
</a>
</div>
{foreach from=$aFriends name=friends item=aFriend}
<div class="row1{if $phpfox.iteration.friends == 1 && !$iPage} row_first{/if}">
<div class="go_left" style="width:55px; text-align:center;">
Expand All @@ -27,10 +36,16 @@
<div class="clear"></div>
</div>
{/foreach}
<div id="js_friend_mutual_browse_append_pager">
{pager}
</div>
{if !$iPage}
<div id="js_friend_mutual_browse_append"></div>
{/if}
{if !$iPage}
<!--<div id="js_friend_mutual_browse_append"></div>-->
<div id="js_friend_mutual_view_more_link">
<a href="{url link=''$sUserName'.friend.mutual'}">
{phrase var='core.view_more'}
</a>
</div>
{else}
<div id="js_friend_mutual_browse_append_pager">
{pager}
</div>
{/if}
{/if}
6 changes: 6 additions & 0 deletions PF.Base/module/mail/include/component/ajax/ajax.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ public function composeProcess()
{
Phpfox::isUser(true);

$sType = $this->get('type');

$this->errorSet('#js_ajax_compose_error_message');

$oObject = Phpfox::getComponent('mail.compose', null, 'controller');
Expand All @@ -229,6 +231,10 @@ public function composeProcess()
{
$this->call('$(\'#\' + tb_get_active()).find(\'.js_box_content:first\').html(\'<div class="message">' . str_replace("'", "\\'", Phpfox::getPhrase('mail.your_message_was_successfully_sent')) . '</div>\'); setTimeout(\'tb_remove();\', 2000);');
}
if (!empty($sType) && $sType == 'claim-page') {
$this->call('$(".inlinePopup.js_claim_page").remove();');
}
}

/**
Expand Down
28 changes: 27 additions & 1 deletion PF.Base/module/mail/include/service/mail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,33 @@ public function get($aConds = array(), $sSort = 'm.time_updated DESC', $iPage =
}
}
}

//thread name
if (Phpfox::getParam('mail.threaded_mail_conversation')){
foreach ($aRows as $iKey => $aRow){
$iCntUser = 0;
$sThreadName = '';
$iCut = 0;
foreach ($aRow['users'] as $aUser){
$sMore = \Phpfox_Parse_Output::instance()->shorten($aUser['full_name'], 30, '...') ;
if (strlen($sThreadName . $sMore) < 45){
$sThreadName .= $sMore;
$iCut++;
}
$iCntUser++;
if ($iCntUser == $iCut && count($aRow['users']) > 1){
$sThreadName .= ', ';
}
}
if ($iCntUser > $iCut){
if (Phpfox::isPhrase('mail.and_number_other')){
$sThreadName .= ' ' . Phpfox::getPhrase('mail.and_number_other', array('number' => ($iCntUser - $iCut))) . ((($iCntUser - $iCut) > 1) ? 's': '');
} else {
$sThreadName .= ' and ' . ($iCntUser - $iCut) . ' other' . ((($iCntUser - $iCut) > 1) ? 's': '');
}
}
$aRows[$iKey]['thread_name'] = $sThreadName;
}
}
return array($iCnt, $aRows, $aInputs);
}

Expand Down
Loading

0 comments on commit 845ebcf

Please sign in to comment.