From 845ebcf390e8ed980c42284dbfa7af6bc742cec8 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 13 Oct 2015 09:53:38 +0700 Subject: [PATCH] Fix bugs v4.0.9 --- .../mail/driver/phpmailer/smtp.class.php | 5 +++- .../library/phpfox/mail/mail.class.php | 19 ++++++++++-- .../library/phpfox/phpfox/phpfox.class.php | 10 +++++++ PF.Base/less/body.less | 2 +- PF.Base/less/forms.less | 8 +++-- PF.Base/less/modules/marketplace.less | 8 ++--- PF.Base/less/modules/pages.less | 6 ++-- PF.Base/less/rows.less | 1 + .../template/default/block/entry.html.php | 4 +++ .../block/template-breadcrumbmenu.html.php | 4 ++- .../include/component/block/display.class.php | 5 +++- .../feed/include/service/feed.class.php | 4 ++- .../component/controller/forum.class.php | 2 ++ .../component/controller/index.class.php | 4 ++- .../component/controller/search.class.php | 1 + .../component/block/mutual-browse.class.php | 6 ++-- .../component/controller/panel.class.php | 8 ++++- .../friend/include/service/friend.class.php | 12 +++++++- .../template/default/block/accept.html.php | 2 +- .../default/block/mutual-browse.html.php | 27 +++++++++++++---- .../include/component/ajax/ajax.class.php | 6 ++++ .../mail/include/service/mail.class.php | 28 +++++++++++++++++- .../default/controller/compose.html.php | 25 ++++++++++++++++ .../default/controller/index.html.php | 13 +++++++-- .../include/component/ajax/ajax.class.php | 4 +++ .../template/default/block/header.html.php | 1 + .../template/default/block/photo.html.php | 7 +++++ .../component/controller/index.class.php | 2 +- PF.Base/module/share/install/phpfox.xml.php | 2 -- .../share/install/version/3.0.0beta1.xml.php | 18 ------------ .../tag/include/service/process.class.php | 3 +- .../include/component/ajax/ajax.class.php | 1 + .../component/block/register.class.php | 2 +- .../template/default/block/tooltip.html.php | 4 +-- PF.Base/static/jscript/main.js | 19 +++++++++--- PF.Base/static/jscript/user_info.js | 29 +++++++------------ .../default/style/default/css/custom.css | 2 +- .../default/style/default/css/common.css | 4 +++ .../default/style/default/css/layout.css | 3 +- .../default/style/default/css/mail.css | 3 +- PF.Src/Core/App/Object.php | 9 ++++++ index.php | 1 + 42 files changed, 238 insertions(+), 86 deletions(-) diff --git a/PF.Base/include/library/phpfox/mail/driver/phpmailer/smtp.class.php b/PF.Base/include/library/phpfox/mail/driver/phpmailer/smtp.class.php index 9688b9d4..7918668c 100644 --- a/PF.Base/include/library/phpfox/mail/driver/phpmailer/smtp.class.php +++ b/PF.Base/include/library/phpfox/mail/driver/phpmailer/smtp.class.php @@ -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; diff --git a/PF.Base/include/library/phpfox/mail/mail.class.php b/PF.Base/include/library/phpfox/mail/mail.class.php index c3cfa081..e0215053 100644 --- a/PF.Base/include/library/phpfox/mail/mail.class.php +++ b/PF.Base/include/library/phpfox/mail/mail.class.php @@ -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( @@ -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 @@ -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. * diff --git a/PF.Base/include/library/phpfox/phpfox/phpfox.class.php b/PF.Base/include/library/phpfox/phpfox/phpfox.class.php index b9338310..d66a5d75 100644 --- a/PF.Base/include/library/phpfox/phpfox/phpfox.class.php +++ b/PF.Base/include/library/phpfox/phpfox/phpfox.class.php @@ -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() diff --git a/PF.Base/less/body.less b/PF.Base/less/body.less index 8d1a0930..a62ffcbe 100644 --- a/PF.Base/less/body.less +++ b/PF.Base/less/body.less @@ -141,7 +141,7 @@ li { font-size:@fontSizeBase + 8; color:@linkFocus; letter-spacing:1px; - + overflow-wrap: break-word; a, a:hover { color:@linkFocus; } diff --git a/PF.Base/less/forms.less b/PF.Base/less/forms.less index ae50415e..17d9da08 100644 --- a/PF.Base/less/forms.less +++ b/PF.Base/less/forms.less @@ -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%; @@ -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%); } @@ -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 { diff --git a/PF.Base/less/modules/marketplace.less b/PF.Base/less/modules/marketplace.less index 17f5434d..f4de690b 100644 --- a/PF.Base/less/modules/marketplace.less +++ b/PF.Base/less/modules/marketplace.less @@ -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; } } diff --git a/PF.Base/less/modules/pages.less b/PF.Base/less/modules/pages.less index 0c2048d3..9e9aa537 100644 --- a/PF.Base/less/modules/pages.less +++ b/PF.Base/less/modules/pages.less @@ -74,7 +74,7 @@ } #left, #right { - display:none; + //display:none; } #content { @@ -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(); } diff --git a/PF.Base/less/rows.less b/PF.Base/less/rows.less index cf2f2a18..0edb4c63 100644 --- a/PF.Base/less/rows.less +++ b/PF.Base/less/rows.less @@ -69,6 +69,7 @@ div.row_title_info { padding:@blockContentPadding; font-size:@fontSizeBase; color:lighten(@blockColor, 5%) !important; + overflow-wrap: break-word; } .item_content * { diff --git a/PF.Base/module/blog/template/default/block/entry.html.php b/PF.Base/module/blog/template/default/block/entry.html.php index 1c47e797..f934d809 100644 --- a/PF.Base/module/blog/template/default/block/entry.html.php +++ b/PF.Base/module/blog/template/default/block/entry.html.php @@ -58,7 +58,11 @@ {$aItem.text|parse|highlight:'search'|split:55} {else}
+ {if $iShorten} + {$aItem.text|parse|highlight:'search'|split:55|shorten:$iShorten:'...'} + {else} {$aItem.text|parse|highlight:'search'|split:55} + {/if}
{/if} diff --git a/PF.Base/module/core/template/default/block/template-breadcrumbmenu.html.php b/PF.Base/module/core/template/default/block/template-breadcrumbmenu.html.php index a1191a39..efa0ccf7 100644 --- a/PF.Base/module/core/template/default/block/template-breadcrumbmenu.html.php +++ b/PF.Base/module/core/template/default/block/template-breadcrumbmenu.html.php @@ -30,7 +30,9 @@ {/foreach} {else} -
  • Register
  • + {if Phpfox::getParam('user.allow_user_registration')} +
  • Register
  • + {/if}
  • Login
  • {/if} diff --git a/PF.Base/module/feed/include/component/block/display.class.php b/PF.Base/module/feed/include/component/block/display.class.php index d71bda11..f88af159 100644 --- a/PF.Base/module/feed/include/component/block/display.class.php +++ b/PF.Base/module/feed/include/component/block/display.class.php @@ -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)) { diff --git a/PF.Base/module/feed/include/service/feed.class.php b/PF.Base/module/feed/include/service/feed.class.php index c5817beb..60fec0c2 100644 --- a/PF.Base/module/feed/include/service/feed.class.php +++ b/PF.Base/module/feed/include/service/feed.class.php @@ -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; diff --git a/PF.Base/module/forum/include/component/controller/forum.class.php b/PF.Base/module/forum/include/component/controller/forum.class.php index 4632fb1a..8eaef352 100644 --- a/PF.Base/module/forum/include/component/controller/forum.class.php +++ b/PF.Base/module/forum/include/component/controller/forum.class.php @@ -24,6 +24,7 @@ public function process() { return Phpfox_Module::instance()->setController('forum.index'); } + Phpfox::getUserParam('forum.can_view_forum', true); @@ -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; diff --git a/PF.Base/module/forum/include/component/controller/index.class.php b/PF.Base/module/forum/include/component/controller/index.class.php index 863f6bcf..fb3ddf45 100644 --- a/PF.Base/module/forum/include/component/controller/index.class.php +++ b/PF.Base/module/forum/include/component/controller/index.class.php @@ -159,7 +159,9 @@ public function process() // 'aThreads' => $aThreads, 'aCallback' => null ) - ); + ); + + Phpfox::getService('forum')->buildMenu(); } /** diff --git a/PF.Base/module/forum/include/component/controller/search.class.php b/PF.Base/module/forum/include/component/controller/search.class.php index eaf60f9f..3f34806c 100644 --- a/PF.Base/module/forum/include/component/controller/search.class.php +++ b/PF.Base/module/forum/include/component/controller/search.class.php @@ -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'); } diff --git a/PF.Base/module/friend/include/component/block/mutual-browse.class.php b/PF.Base/module/friend/include/component/block/mutual-browse.class.php index 19b64a65..a22902c8 100644 --- a/PF.Base/module/friend/include/component/block/mutual-browse.class.php +++ b/PF.Base/module/friend/include/component/block/mutual-browse.class.php @@ -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 ) ); } diff --git a/PF.Base/module/friend/include/component/controller/panel.class.php b/PF.Base/module/friend/include/component/controller/panel.class.php index c89e58bb..90c8a2e1 100644 --- a/PF.Base/module/friend/include/component/controller/panel.class.php +++ b/PF.Base/module/friend/include/component/controller/panel.class.php @@ -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([ diff --git a/PF.Base/module/friend/include/service/friend.class.php b/PF.Base/module/friend/include/service/friend.class.php index 13eb2745..bc8e007d 100644 --- a/PF.Base/module/friend/include/service/friend.class.php +++ b/PF.Base/module/friend/include/service/friend.class.php @@ -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 diff --git a/PF.Base/module/friend/template/default/block/accept.html.php b/PF.Base/module/friend/template/default/block/accept.html.php index f30a6edb..a83b3b15 100644 --- a/PF.Base/module/friend/template/default/block/accept.html.php +++ b/PF.Base/module/friend/template/default/block/accept.html.php @@ -44,7 +44,7 @@ {img theme='ajax/add.gif'} {else} +
    + + {if $iTotalMutualFriends == 1} + {phrase var='friend.1_friend_in_common'} + {else} + {phrase var='friend.total_friends_in_common' total=$iTotalMutualFriends} + {/if} + +
    {foreach from=$aFriends name=friends item=aFriend}
    @@ -27,10 +36,16 @@
    {/foreach} -
    - {pager} -
    -{if !$iPage} -
    -{/if} + {if !$iPage} + + + {else} +
    + {pager} +
    + {/if} {/if} \ No newline at end of file diff --git a/PF.Base/module/mail/include/component/ajax/ajax.class.php b/PF.Base/module/mail/include/component/ajax/ajax.class.php index b171e43d..aec03b97 100644 --- a/PF.Base/module/mail/include/component/ajax/ajax.class.php +++ b/PF.Base/module/mail/include/component/ajax/ajax.class.php @@ -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'); @@ -229,6 +231,10 @@ public function composeProcess() { $this->call('$(\'#\' + tb_get_active()).find(\'.js_box_content:first\').html(\'
    ' . str_replace("'", "\\'", Phpfox::getPhrase('mail.your_message_was_successfully_sent')) . '
    \'); setTimeout(\'tb_remove();\', 2000);'); } + + if (!empty($sType) && $sType == 'claim-page') { + $this->call('$(".inlinePopup.js_claim_page").remove();'); + } } /** diff --git a/PF.Base/module/mail/include/service/mail.class.php b/PF.Base/module/mail/include/service/mail.class.php index 1eb354cd..aa9a8c80 100644 --- a/PF.Base/module/mail/include/service/mail.class.php +++ b/PF.Base/module/mail/include/service/mail.class.php @@ -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); } diff --git a/PF.Base/module/mail/template/default/controller/compose.html.php b/PF.Base/module/mail/template/default/controller/compose.html.php index bc30779c..94fae169 100644 --- a/PF.Base/module/mail/template/default/controller/compose.html.php +++ b/PF.Base/module/mail/template/default/controller/compose.html.php @@ -79,6 +79,23 @@ {if Phpfox::isModule('captcha') && Phpfox::getUserParam('mail.enable_captcha_on_mail')} {module name='captcha.form' sType='mail'} {/if} + +
    + {if !Phpfox::getParam('mail.threaded_mail_conversation')} +
    + +
    + {/if} + {if isset($iPageId)} +
    +
      +
    • +
    • +
    +
    +
    + {/if} +
    @@ -90,6 +107,14 @@ {/if} {literal}