Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 4 лет назад
Родитель
Сommit
72a737b67f
99 измененных файлов с 337 добавлено и 213 удалено
  1. 3 1
      inc/classes/BxDolCmts.php
  2. 5 0
      inc/classes/BxDolContentInfo.php
  3. 1 1
      inc/classes/BxDolFormQuery.php
  4. 118 9
      inc/classes/BxDolPage.php
  5. 1 1
      inc/classes/BxDolStorageLocal.php
  6. 1 1
      inc/classes/BxDolTemplate.php
  7. 2 2
      inc/profiles.inc.php
  8. 15 3
      inc/utils.inc.php
  9. 2 2
      modules/base/connect/classes/BxBaseModConnectModule.php
  10. 2 5
      modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php
  11. 1 1
      modules/base/general/classes/BxBaseModGeneralGridAdministration.php
  12. 6 6
      modules/base/general/classes/BxBaseModGeneralModule.php
  13. 2 2
      modules/base/general/classes/BxBaseModGeneralSearchResult.php
  14. 1 1
      modules/base/general/classes/BxBaseModGeneralTemplate.php
  15. 2 2
      modules/base/groups/classes/BxBaseModGroupsAlertsResponse.php
  16. 2 2
      modules/base/groups/classes/BxBaseModGroupsMenuSnippetMeta.php
  17. 1 1
      modules/base/groups/classes/BxBaseModGroupsModule.php
  18. 1 1
      modules/base/groups/classes/BxBaseModGroupsPageEntry.php
  19. 1 1
      modules/base/payment/classes/BxBaseModPaymentConfig.php
  20. 1 1
      modules/base/profile/classes/BxBaseModProfileAlertsResponse.php
  21. 6 6
      modules/base/profile/classes/BxBaseModProfileFormEntry.php
  22. 5 5
      modules/base/profile/classes/BxBaseModProfileModule.php
  23. 1 1
      modules/base/profile/classes/BxBaseModProfilePageEntry.php
  24. 4 4
      modules/base/profile/classes/BxBaseModProfileTemplate.php
  25. 2 2
      modules/base/text/classes/BxBaseModTextGridAdministration.php
  26. 1 1
      modules/base/text/classes/BxBaseModTextPageEntry.php
  27. 1 1
      modules/base/text/classes/BxBaseModTextTemplate.php
  28. 3 3
      modules/boonex/acl/classes/BxAclModule.php
  29. 1 1
      modules/boonex/ads/classes/BxAdsFormEntry.php
  30. 1 1
      modules/boonex/ads/classes/BxAdsGridOffersAll.php
  31. 1 1
      modules/boonex/ads/classes/BxAdsMenuSnippetMeta.php
  32. 22 22
      modules/boonex/ads/classes/BxAdsModule.php
  33. 5 5
      modules/boonex/ads/classes/BxAdsTemplate.php
  34. 1 1
      modules/boonex/albums/classes/BxAlbumsContentInfoMedia.php
  35. 4 4
      modules/boonex/albums/classes/BxAlbumsModule.php
  36. 1 1
      modules/boonex/albums/classes/BxAlbumsPageMedia.php
  37. 1 1
      modules/boonex/albums/classes/BxAlbumsSearchResultMedia.php
  38. 3 3
      modules/boonex/albums/classes/BxAlbumsTemplate.php
  39. 2 2
      modules/boonex/antispam/classes/BxAntispamModule.php
  40. 3 3
      modules/boonex/antispam/classes/BxAntispamStudioPage.php
  41. 1 1
      modules/boonex/api/classes/BxApiModule.php
  42. 2 2
      modules/boonex/artificer/classes/BxArtificerModule.php
  43. 3 3
      modules/boonex/artificer/data/template/system/scripts/BxTemplPageHome.php
  44. 1 1
      modules/boonex/attendant/classes/BxAttendantModule.php
  45. 1 1
      modules/boonex/channels/classes/BxCnlModule.php
  46. 1 1
      modules/boonex/classes/classes/BxClssModule.php
  47. 1 1
      modules/boonex/contact/classes/BxContactModule.php
  48. 1 1
      modules/boonex/convos/classes/BxCnvFormsEntryHelper.php
  49. 2 2
      modules/boonex/convos/classes/BxCnvGrid.php
  50. 5 5
      modules/boonex/convos/classes/BxCnvTemplate.php
  51. 2 2
      modules/boonex/credits/classes/BxCreditsConfig.php
  52. 3 3
      modules/boonex/credits/classes/BxCreditsModule.php
  53. 1 1
      modules/boonex/developer/classes/BxDevBuilderPage.php
  54. 4 4
      modules/boonex/donations/classes/BxDonationsModule.php
  55. 1 1
      modules/boonex/events/classes/BxEventsDb.php
  56. 1 1
      modules/boonex/events/classes/BxEventsModule.php
  57. 1 1
      modules/boonex/forum/classes/BxForumGrid.php
  58. 1 1
      modules/boonex/forum/classes/BxForumTemplate.php
  59. 1 1
      modules/boonex/help_tours/classes/BxHelpToursGridItems.php
  60. 1 1
      modules/boonex/help_tours/classes/BxHelpToursGridTours.php
  61. 2 2
      modules/boonex/invites/classes/BxInvGridInvites.php
  62. 1 1
      modules/boonex/invites/classes/BxInvModule.php
  63. 1 1
      modules/boonex/invites/classes/BxInvStudioPage.php
  64. 5 5
      modules/boonex/invites/classes/BxInvTemplate.php
  65. 1 1
      modules/boonex/market/classes/BxMarketGridLicensesAdministration.php
  66. 5 5
      modules/boonex/market/classes/BxMarketModule.php
  67. 1 1
      modules/boonex/market/classes/BxMarketTemplate.php
  68. 3 3
      modules/boonex/massmailer/classes/BxMassMailerGridCampaigns.php
  69. 1 1
      modules/boonex/massmailer/classes/BxMassMailerTemplate.php
  70. 1 1
      modules/boonex/notifications/classes/BxNtfsConfig.php
  71. 1 1
      modules/boonex/notifications/classes/BxNtfsModule.php
  72. 1 1
      modules/boonex/payment/classes/BxPaymentDetails.php
  73. 1 1
      modules/boonex/quoteofday/classes/BxQuoteOfDayStudioPage.php
  74. 1 1
      modules/boonex/reviews/classes/BxReviewsTemplate.php
  75. 1 1
      modules/boonex/shopify/classes/BxShopifyModule.php
  76. 1 1
      modules/boonex/snipcart/classes/BxSnipcartConfig.php
  77. 1 1
      modules/boonex/snipcart/classes/BxSnipcartModule.php
  78. 1 1
      modules/boonex/stream/classes/BxStrmGridRecordings.php
  79. 1 1
      modules/boonex/stream/classes/BxStrmModule.php
  80. 1 1
      modules/boonex/stream/classes/BxStrmTemplate.php
  81. 1 1
      modules/boonex/tasks/classes/BxTasksDb.php
  82. 1 1
      modules/boonex/tasks/classes/BxTasksModule.php
  83. 6 7
      modules/boonex/timeline/classes/BxTimelineConfig.php
  84. 1 1
      modules/boonex/timeline/classes/BxTimelineModule.php
  85. 1 1
      modules/boonex/timeline/classes/BxTimelineTemplate.php
  86. 1 1
      studio/template/scripts/BxBaseStudioBuilderPage.php
  87. 1 1
      studio/template/scripts/BxBaseStudioFunctions.php
  88. 1 1
      template/scripts/BxBaseAccountForms.php
  89. 1 1
      template/scripts/BxBaseCmtsGridAdministration.php
  90. 2 2
      template/scripts/BxBaseFormAccount.php
  91. 1 1
      template/scripts/BxBaseFormConfirmPhone.php
  92. 2 2
      template/scripts/BxBaseFormLogin.php
  93. 3 3
      template/scripts/BxBasePageHome.php
  94. 1 1
      template/scripts/BxBasePagesSearchResult.php
  95. 1 1
      template/scripts/BxBaseReportsGrid.php
  96. 2 2
      template/scripts/BxBaseSearchResult.php
  97. 5 5
      template/scripts/BxBaseServiceAccount.php
  98. 4 4
      template/scripts/BxBaseServiceLogin.php
  99. 1 1
      template/scripts/BxBaseServices.php

+ 3 - 1
inc/classes/BxDolCmts.php

@@ -463,11 +463,13 @@ class BxDolCmts extends BxDolFactory implements iBxDolReplaceable, iBxDolContent
     	if(empty($this->_aSystem['trigger_field_title']))
             return '';
 
-    	return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink($this->_sViewUrl, [
+        $s = BxDolPermalinks::getInstance()->permalink($this->_sViewUrl, [
             'sys' => $this->_sSystem,
             'id' => $this->_iId,
             'cmt_id' => $iCmtId
         ]);
+
+    	return $bAbsolute ? bx_absolute_url($s) : $s;
     }
 
     public function getViewText($mixedItem)

+ 5 - 0
inc/classes/BxDolContentInfo.php

@@ -272,6 +272,11 @@ class BxDolContentInfo extends BxDolFactory implements iBxDolFactoryObject
         return $this->_call('get_text', $iContentId);
     }
     
+    public function getContentPrivacy ($iContentId)
+    {
+        return $this->_call('get_privacy_view', $iContentId);
+    }
+
     public function getContentEmbed ($iContentId)
     {
         return $this->_call('get_embed', $iContentId);

+ 1 - 1
inc/classes/BxDolFormQuery.php

@@ -87,7 +87,7 @@ class BxDolFormQuery extends BxDolDb
 
         // form action
         if (!empty($aForm['form_attrs']['action']) && 0 !== strncasecmp($aForm['form_attrs']['action'], 'http://', 7) && 0 !== strncasecmp($aForm['form_attrs']['action'], 'https://', 8))
-            $aForm['form_attrs']['action'] = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($aForm['form_attrs']['action']);
+            $aForm['form_attrs']['action'] = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($aForm['form_attrs']['action']));
 
         // params
         if (!empty($aObject['params']))

+ 118 - 9
inc/classes/BxDolPage.php

@@ -166,7 +166,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
         if ($bRedirectCheck && !$sObject && '/' == substr($sURI, -1)) {
             header("HTTP/1.1 301 Moved Permanently");
             unset($_GET['i']);
-            header ('Location:' . bx_append_url_params(BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . trim($sURI, '/')), $_GET));
+            header ('Location:' . bx_append_url_params(bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . trim($sURI, '/'))), $_GET));
             exit;
         }
 
@@ -242,6 +242,73 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
         return true;
     }
 
+    static public function multisiteLinkCheck ($sLink, $sPageUri = '', $sPageModule = '', $aQueryParams = [])
+    {
+        $sMultisiteDomain = self::getMultisite($sLink, $sPageUri, $sPageModule, $aQueryParams);
+        if ($sMultisiteDomain) {
+            if (parse_url($sMultisiteDomain, PHP_URL_HOST) !== $_SERVER['HTTP_HOST'])
+                return $sMultisiteDomain . $sLink;
+        }
+
+        if (!$sMultisiteDomain && parse_url(BX_MULTISITE_URL_MAIN, PHP_URL_HOST) !== $_SERVER['HTTP_HOST']) {
+            return BX_MULTISITE_URL_MAIN . $sLink;
+        }
+
+        return false;
+
+    }
+
+	/**
+     * Get multisite link
+     * @param $sLink link to check
+     * @return return multisite link if provided link is multisite, or false is other case
+     */
+    static public function getMultisite ($sLink, $sPageUri = '', $sPageModule = '', $aQueryParams = [])
+    {
+        $sMultisiteDomain = '';
+        if (!$sPageModule || !$aQueryParams) {
+
+            $sQuery = parse_url($sLink, PHP_URL_QUERY);
+            if ($sQuery) {
+
+                $aQueryParams = bx_parse_str($sQuery);
+                $sPageUri = !empty($aQueryParams['i']) ? $aQueryParams['i'] : false;
+                if ($sPageUri) {
+                    $sPageName = BxDolPageQuery::getPageObjectNameByURI($sPageUri);
+                    $aPage = $sPageName ? BxDolPageQuery::getPageObject($sPageName) : false;
+                    $sPageModule = $aPage ? $aPage['module'] : '';
+                }
+            }
+        }
+
+        $sMultisiteDomain = '';
+        if (!empty($aQueryParams['profile_id'])) {
+            $oProfile = BxDolProfile::getInstance($aQueryParams['profile_id']);
+            if (BX_MULTISITE_MODULE == $oProfile->getModule())
+                $sMultisiteDomain = $oProfile->getDisplayName();
+        }
+        elseif (!empty($aQueryParams['id']) && $sPageModule) {
+            $sContentInfo = !empty($aPage['content_info']) ? $aPage['content_info'] : $sPageModule;
+            $oContentInfo = BxDolContentInfo::getObjectInstance($sContentInfo);
+            if ($oContentInfo && BX_MULTISITE_MODULE == $sPageModule) {
+                $sMultisiteDomain = $oContentInfo->getContentTitle($aQueryParams['id']);
+            }
+            elseif ($oContentInfo && BX_MULTISITE_MODULE != $sPageModule) {
+                $iPrivacy = $oContentInfo->getContentPrivacy($aQueryParams['id']);
+                if (0 > $iPrivacy) {
+                    $oProfile = BxDolProfile::getInstance(abs($iPrivacy));
+                    if (BX_MULTISITE_MODULE == $oProfile->getModule())
+                        $sMultisiteDomain = $oProfile->getDisplayName();
+                }
+            }
+        }
+
+        if ($sMultisiteDomain)
+            return str_replace('{domain}', mb_strtolower($sMultisiteDomain), BX_MULTISITE_URL_PATTERN);
+
+        return false;
+    }
+
 	/**
      * Delete SEO link
      * @param $sModule module name
@@ -327,6 +394,21 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
                 $_GET[$r['param_name']] = $_REQUEST[$r['param_name']] = $r['param_value'];
         }
 
+        // multisite redirect
+        if (defined('BX_MULTISITE_MODULE')) {
+            list($sPageLink, $aPageParams) = bx_get_base_url_inline();
+            unset($aPageParams['_q']);
+            $sLink = bx_append_url_params($sPageLink, $aPageParams);
+            if (0 === strpos($sLink, BX_DOL_URL_ROOT))
+                $sLink = substr($sLink, strlen(BX_DOL_URL_ROOT));
+
+            $s = BxDolPage::multisiteLinkCheck ('', $a[0], $aPage['module'], $_GET);
+            if (false !== $s) {
+                header('Location:' . $s . $sLink, true, 301);
+                exit;
+            }
+        }
+
         // display page
         $_REQUEST['i'] = $_GET['i'] = $a[0];
         $oPage = BxDolPage::getObjectInstanceByURI($a[0], false, true);
@@ -365,6 +447,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
         if (!$sPageUri) // page URI wasn't found
             return false;
 
+        $sPageModule = '';
         $aSeoParams = array('id', 'profile_id'); // supported SEO params which are transformed to SEO strings
         $sSeoParamName = '';
         $sSeoParamValue = '';
@@ -390,7 +473,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
             $sPageName = BxDolPageQuery::getPageObjectNameByURI($sPageUri);
             $aPage = $sPageName ? BxDolPageQuery::getPageObject($sPageName) : false;
             if ($aPage) {
-                $sModule = $aPage['module'];
+                $sPageModule = $aPage['module'];
                 $sContentInfo = !empty($aPage['content_info']) ? $aPage['content_info'] : $aPage['module'];
                 if ('id' == $sSeoParamName) {
                     $oContentInfo = BxDolContentInfo::getObjectInstance($sContentInfo);
@@ -403,13 +486,13 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
                     $sSeoTitle = $oProfile ? $oProfile->getDisplayName() : self::getSeoHash($sSeoParamValue);
                 }
                 
-                $r = BxDolPageQuery::getSeoLink($sModule, $sPageUri, ['param_value' => $sSeoParamValue]);
+                $r = BxDolPageQuery::getSeoLink($sPageModule, $sPageUri, ['param_value' => $sSeoParamValue]);
                 if (!$r) {
                     $sSeoTitleLimited = BxTemplFunctions::getInstance()->getStringWithLimitedLength($sSeoTitle, 45);
-                    $sUri = uriGenerate ($sSeoTitleLimited, 'sys_seo_links', 'uri', ['cond' => ['module' => $sModule, 'page_uri' => $sPageUri]]);
+                    $sUri = uriGenerate ($sSeoTitleLimited, 'sys_seo_links', 'uri', ['cond' => ['module' => $sPageModule, 'page_uri' => $sPageUri]]);
 
                     bx_alert('system', 'uri-generate', 0, false, [
-                        'module' => $sModule,
+                        'module' => $sPageModule,
                         'page_uri' =>$sPageUri,
                         'param_name' => $sSeoParamName,
                         'param_value' => $sSeoParamValue,
@@ -417,7 +500,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
                         'uri' => &$sUri,
                     ]);
 
-                    BxDolPageQuery::insertSeoLink($sModule, $sPageUri, $sSeoParamName, $sSeoParamValue, $sUri);
+                    BxDolPageQuery::insertSeoLink($sPageModule, $sPageUri, $sSeoParamName, $sSeoParamValue, $sUri);
                 }
                 elseif ($r['param_name'] == $sSeoParamName) {
                     $sUri = $r['uri'];
@@ -436,7 +519,14 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
         if (!$sSeoPageUri)
             return false;
 
-        return $sPrefix . bx_append_url_params($sSeoPageUri, array_merge($aQueryParams, $aParams), false);
+        $sLink = $sPrefix . bx_append_url_params($sSeoPageUri, array_merge($aQueryParams, $aParams), false);
+        if (defined('BX_MULTISITE_MODULE')) {
+
+            $s = BxDolPage::multisiteLinkCheck ($sLink, $sPageUri, $sPageModule, [$sSeoParamName => $sSeoParamValue]);
+            if (false !== $s) 
+                return $s;
+        }
+        return $sLink;
     }
 
 	/**
@@ -496,6 +586,14 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
         if (0 === strpos($sLink, BX_DOL_URL_ROOT))
             $sLink = substr($sLink, strlen(BX_DOL_URL_ROOT));
 
+        if (defined('BX_MULTISITE_MODULE')) {
+            $s = BxDolPage::multisiteLinkCheck ($sLink);
+            if (false !== $s) {
+                header('Location:' . $s, true, 301);
+                exit;
+            }
+        }
+
         if ($sSeoLink = self::transformSeoLink ($sLink, BX_DOL_URL_ROOT)) {
             header("Location:{$sSeoLink}", true, 301);
             exit;
@@ -589,7 +687,18 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
 
     public function getType ()
     {
-    	return (int)$this->_aObject['type_id'];
+        if (defined('BX_MULTISITE_FORCE_PAGETYPE') && defined('BX_MULTISITE_MODULE')) {
+
+            list($sPageLink, $aPageParams) = bx_get_base_url_inline();
+            $sLink = bx_append_url_params($sPageLink, $aPageParams);
+            if (0 === strpos($sLink, BX_DOL_URL_ROOT))
+                $sLink = substr($sLink, strlen(BX_DOL_URL_ROOT));
+
+            if (BxDolPage::getMultisite ($sLink))
+                return BX_MULTISITE_FORCE_PAGETYPE;
+        }
+
+        return (int)$this->_aObject['type_id'];
     }
 
     public function getModule ()
@@ -705,7 +814,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
 
     public static function redirectToLoginForm ()
     {
-        header("Location: " . bx_append_url_params(BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login'), ['relocate' => bx_get_self_url()]));
+        header("Location: " . bx_append_url_params(bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=login')), ['relocate' => bx_get_self_url()]));
         exit;
     }
 }

+ 1 - 1
inc/classes/BxDolStorageLocal.php

@@ -139,7 +139,7 @@ class BxDolStorageLocal extends BxDolStorage
     protected function getObjectBaseUrl ($isPrivate = false)
     {
         $o = BxDolPermalinks::getInstance();
-        return BX_DOL_URL_ROOT . $o->permalink('storage.php?o=') . $this->_aObject['object'] . ($o->_isEnabled('storage.php?o=') ? '/' : '&f=');
+        return bx_absolute_url($o->permalink('storage.php?o=') . $this->_aObject['object'] . ($o->_isEnabled('storage.php?o=') ? '/' : '&f='));
     }
 
     protected function mkdir($sDirName, $sRights = false)

+ 1 - 1
inc/classes/BxDolTemplate.php

@@ -1261,7 +1261,7 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         $sRet .= "<link rel=\"alternate\" type=\"application/json+oembed\" href=\"" . BX_DOL_URL_ROOT ."em.php?url=" . urlencode($_SERVER["REQUEST_URI"]) . "&format=json\" title=\"". (isset($this->aPage['header']) ? bx_html_attribute(strip_tags($this->aPage['header'])) : '') . "\" />";
         
         if (!empty($this->aPage['url'])){
-            $sRet .= "<link rel=\"canonical\" href=\"" . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->aPage['url']). "\" />";
+            $sRet .= '<link rel="canonical" href="' . bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->aPage['url'])) . '" />';
         }
         
         return $sRet;

+ 2 - 2
inc/profiles.inc.php

@@ -194,7 +194,7 @@ function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
     
     if ($oAccount->isLocked()){
         bx_import('BxDolLanguages');
-		return _t("_sys_txt_login_locked", BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'));
+		return _t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
 	}
 
     $aAccountInfo = $oAccount->getInfo();
@@ -223,7 +223,7 @@ function bx_check_password($sLogin, $sPassword, $iRole = BX_DOL_ROLE_MEMBER)
             if ($aAccountInfo['login_attempts'] >= $iMaxLoginAttempts){
                 $oAccountQuery->lockAccount($aAccountInfo['id'], 1);
                 bx_import('BxDolLanguages');
-                return _t("_sys_txt_login_locked", BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'));
+                return _t("_sys_txt_login_locked", bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
             }
             else{
                 $oAccountQuery->updateAttemptsCounter($aAccountInfo['id']);

+ 15 - 3
inc/utils.inc.php

@@ -1220,7 +1220,7 @@ function bx_get_reset_password_link($sValue, $sField = 'email', $iLifetime = 0)
 
 function bx_get_reset_password_link_by_key($sKey)
 {
-    return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password', array('key' => $sKey));
+    return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password', array('key' => $sKey)));
 }
 
 function bx_get_reset_password_redirect($iAccountId)
@@ -1257,8 +1257,8 @@ function bx_get_reset_password_redirect($iAccountId)
             break;
     }
 
-    if(!empty($sResult) && mb_stripos($sResult, BX_DOL_URL_ROOT) !== 0)
-        $sResult = BX_DOL_URL_ROOT . $sResult;
+    if(!empty($sResult))
+        $sResult = bx_absolute_url($sResult);
 
     return $sResult;
 }
@@ -2226,6 +2226,11 @@ function bx_setcookie($sName, $sValue = "", $oExpiresOrOptions = 0, $sPath = 'au
 {
     $aUrl = 'auto' === $sPath || 'auto' === $bSecure ? parse_url(BX_DOL_URL_ROOT) : [];
 
+    if (defined('BX_MULTISITE_URL_COOKIE')) {
+        $aUrl = parse_url(BX_MULTISITE_URL_COOKIE);
+        $sDomain = $aUrl['host'];
+    }
+
     if ('auto' === $sPath)
         $sPath = isset($aUrl['path']) && !empty($aUrl['path']) ? $aUrl['path'] : '/';
 
@@ -2265,4 +2270,11 @@ function is_private_ip ($sIp)
     return filter_var($sIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== $sIp;
 }
 
+function bx_absolute_url($sUrl)
+{
+    if (!preg_match('/^https?:\/\//', $sUrl))
+        $sUrl = BX_DOL_URL_ROOT . $sUrl;
+    return $sUrl;
+}
+
 /** @} */

+ 2 - 2
modules/base/connect/classes/BxBaseModConnectModule.php

@@ -283,13 +283,13 @@ class BxBaseModConnectModule extends BxBaseModGeneralModule
 
             case 'settings':
                 if (!$isExistingProfile) { 
-                    $sRedirectUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=account-settings-email');
+                    $sRedirectUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=account-settings-email'));
                     break;
                 }
 
             case 'dashboard':
             default:
-                $sRedirectUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=dashboard');
+                $sRedirectUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=dashboard'));
                 break;
             }
 

+ 2 - 5
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -632,10 +632,7 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         );
         $s = str_replace($aMarkers, $aReplacements, $s);
 
-        $s = BxDolPermalinks::getInstance()->permalink($s);
-
-        if (false === strpos($s, 'http://') && false === strpos($s, 'https://'))
-            $s = BX_DOL_URL_ROOT . $s;
+        $s = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($s));
         
         return $s;
     }
@@ -664,7 +661,7 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         if(empty($CNF[$sKeyUri]))
             return;
 
-        $oForm->setAbsoluteActionUrl(BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF[$sKeyUri]));
+        $oForm->setAbsoluteActionUrl(bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF[$sKeyUri])));
     }
 }
 

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralGridAdministration.php

@@ -221,7 +221,7 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
 
 		$sLink = $oModuleAccounts->_oConfig->CNF['URL_MANAGE_' . $sTypeUpc];
 
-		$sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sLink);
+		$sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sLink));
 		
 		if(!empty($sFilter))
 			$sLink = bx_append_url_params($sLink, array('filter' => $sFilter));

+ 6 - 6
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -379,7 +379,7 @@ class BxBaseModGeneralModule extends BxDolModule
         if(empty($aContentInfo))
             return '';
 
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]));
     }
 
     public function serviceGetTitle ($iContentId)
@@ -1435,7 +1435,7 @@ class BxBaseModGeneralModule extends BxDolModule
 
         $sEntryUrl = !empty($aParams['entry_url']) ? $aParams['entry_url'] : '';
         if(empty($sEntryUrl) && !empty($CNF['URI_VIEW_ENTRY']))
-            $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+            $sEntryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId));
 
         $iEntryThumb = !empty($aParams['entry_thumb']) ? (int)$aParams['entry_thumb'] : 0;
         if(empty($iEntryThumb) && !empty($CNF['FIELD_THUMB']) && !empty($aContentInfo[$CNF['FIELD_THUMB']]))
@@ -1615,7 +1615,7 @@ class BxBaseModGeneralModule extends BxDolModule
         $aMarkers = array(
             'id' => $iContentId,
             'module' => $this->_aModule['name'],
-            'url' => BX_DOL_URL_ROOT . $sUrl,
+            'url' => bx_absolute_url($sUrl),
             'title' => $sTitle,
         );
 
@@ -2229,7 +2229,7 @@ class BxBaseModGeneralModule extends BxDolModule
             'sample' => isset($CNF['T']['txt_sample_single_with_article']) ? $CNF['T']['txt_sample_single_with_article'] : $CNF['T']['txt_sample_single'],
             'sample_wo_article' => $CNF['T']['txt_sample_single'],
             'sample_action' => isset($CNF['T']['txt_sample_action']) ? $CNF['T']['txt_sample_action'] : '',
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']])),
             'content' => $aContent, //a string to display or array to parse default template before displaying.
             'date' => $aContentInfo[$CNF['FIELD_ADDED']],
             'views' => $aViews,
@@ -3128,7 +3128,7 @@ class BxBaseModGeneralModule extends BxDolModule
     public function _getFavoriteListUrl ($iListId, $iProfileId)
     {
         $CNF = &$this->_oConfig->CNF;
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_FAVORITES_LIST'] . '&profile_id=' . $iProfileId . '&list_id=' . $iListId);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_FAVORITES_LIST'] . '&profile_id=' . $iProfileId . '&list_id=' . $iListId));
     }
     
     
@@ -3305,7 +3305,7 @@ class BxBaseModGeneralModule extends BxDolModule
     {
     	$CNF = &$this->_oConfig->CNF;
 
-    	$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+    	$sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]));
 
     	//--- Image(s)
         $aImages = $this->_getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams);

+ 2 - 2
modules/base/general/classes/BxBaseModGeneralSearchResult.php

@@ -33,7 +33,7 @@ class BxBaseModGeneralSearchResult extends BxTemplSearchResult
     {
         $CNF = &$this->oModule->_oConfig->CNF;
 
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $a[$CNF['FIELD_ID']]);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $a[$CNF['FIELD_ID']]));
     }
 
     function getRssPageUrl ()
@@ -42,7 +42,7 @@ class BxBaseModGeneralSearchResult extends BxTemplSearchResult
             return false;
 
         $oPermalinks = BxDolPermalinks::getInstance();
-        return BX_DOL_URL_ROOT . $oPermalinks->permalink($this->aCurrent['rss']['link']);
+        return bx_absolute_url($oPermalinks->permalink($this->aCurrent['rss']['link']));
     }
 
     function rss ()

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralTemplate.php

@@ -213,7 +213,7 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
     	$CNF = &BxDolModule::getInstance($this->MODULE)->_oConfig->CNF;
 
     	return $this->parseHtmlByName('breadcrumb.html', array(
-    		'url_home' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']),
+    		'url_home' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME'])),
     		'icon_home' => $CNF['ICON'],
     		'bx_repeat:items' => $aTmplVarsItems
     	));

+ 2 - 2
modules/base/groups/classes/BxBaseModGroupsAlertsResponse.php

@@ -85,10 +85,10 @@ class BxBaseModGroupsAlertsResponse extends BxBaseModProfileAlertsResponse
 
             $sKey = BxDolKey::getInstance()->getNewKey(false, $CNF["INVITES_KEYS_LIFETIME"]);
             $this->_oModule->_oDb->insertInvite($sKey, $oAlert->iSender, $iInviter, $iInvited);
-            $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], [
+            $sEntryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], [
                 'id' => $oAlert->iObject,
                 'key' => $sKey
-            ]);
+            ]));
         }
 
         sendMailTemplate($this->_oModule->_oConfig->CNF['EMAIL_INVITATION'], 0, $iInvited, array(

+ 2 - 2
modules/base/groups/classes/BxBaseModGroupsMenuSnippetMeta.php

@@ -43,9 +43,9 @@ class BxBaseModGroupsMenuSnippetMeta extends BxBaseModProfileMenuSnippetMeta
 
         return [
             $this->getUnitMetaItemButton(_t('_bx_groups_menu_item_title_pay_and_join'), [
-                'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_JOIN_ENTRY'], [
+                'href' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_JOIN_ENTRY'], [
                     'profile_id' => $this->_oContentProfile->id()
-                ])
+                ]))
             ]),
             'bx-menu-item-button'
         ];

+ 1 - 1
modules/base/groups/classes/BxBaseModGroupsModule.php

@@ -400,7 +400,7 @@ class BxBaseModGroupsModule extends BxBaseModProfileModule
             return false;
 
         $sEntryTitle = $aContentInfo[$CNF['FIELD_NAME']];
-        $sEntryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sEntryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]));
 
         // send invitation to the group 
         $sModule = $this->getName();

+ 1 - 1
modules/base/groups/classes/BxBaseModGroupsPageEntry.php

@@ -108,7 +108,7 @@ class BxBaseModGroupsPageEntry extends BxBaseModProfilePageEntry
         $sCode = $this->_oModule->_oTemplate->getJsCode('invite_popup', array(
             'sPopupId' => $sId,
             'sKey' => $sKey,
-            'sAcceptUrl' =>  BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aProfileInfo['content_id']),
+            'sAcceptUrl' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aProfileInfo['content_id'])),
             'sDeclineUrl' => BX_DOL_URL_ROOT,
             'iGroupProfileId' => $this->_oProfile->id(),
         ));

+ 1 - 1
modules/base/payment/classes/BxBaseModPaymentConfig.php

@@ -171,7 +171,7 @@ class BxBaseModPaymentConfig extends BxBaseModGeneralConfig
 		if(strncmp($this->CNF[$sType], BX_DOL_URL_ROOT, strlen(BX_DOL_URL_ROOT)) === 0)
 			$sResult = bx_append_url_params($this->CNF[$sType], $aParams);
 		else
-			$sResult = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->CNF[$sType], $aParams);
+			$sResult = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->CNF[$sType], $aParams));
 
     	return $bSsl ? $this->http2https($sResult) : $sResult;
     }

+ 1 - 1
modules/base/profile/classes/BxBaseModProfileAlertsResponse.php

@@ -133,7 +133,7 @@ class BxBaseModProfileAlertsResponse extends BxBaseModGeneralAlertsResponse
         sendMailTemplate($CNF['EMAIL_FRIEND_REQUEST'], 0, $iRecipient, array(
             'SenderUrl' => $oSender->getUrl(),
             'SenderDisplayName' => $oSender->getDisplayName(),
-            'FriendsLink' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_FRIEND_REQUESTS'] . '&profile_id=' . $iRecipient),
+            'FriendsLink' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_FRIEND_REQUESTS'] . '&profile_id=' . $iRecipient)),
         ), BX_EMAIL_NOTIFY);
     }
 

+ 6 - 6
modules/base/profile/classes/BxBaseModProfileFormEntry.php

@@ -114,7 +114,7 @@ class BxBaseModProfileFormEntry extends BxBaseModGeneralFormEntry
                 $oConnection = BxDolConnection::getObjectInstance('sys_profiles_friends');
                 $iCount = $oConnection->getConnectedContentCount($oProfile->id(), true);
                 return $this->_oModule->_oTemplate->parseHtmlByName('name_link.html', array(
-                    'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_FRIENDS'] . '&profile_id=' . $oProfile->id()),
+                    'href' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_FRIENDS'] . '&profile_id=' . $oProfile->id())),
                     'title' => '',
                     'content' => $iCount
                 ));
@@ -131,7 +131,7 @@ class BxBaseModProfileFormEntry extends BxBaseModGeneralFormEntry
                 $oConnectionFollow = BxDolConnection::getObjectInstance('sys_profiles_subscriptions');
                 $iCount = $oConnectionFollow->getConnectedInitiatorsCount($oProfile->id());
                 return $this->_oModule->_oTemplate->parseHtmlByName('name_link.html', array(
-                    'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_SUBSCRIPTIONS'] . '&profile_id=' . $oProfile->id()),
+                    'href' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_SUBSCRIPTIONS'] . '&profile_id=' . $oProfile->id())),
                     'title' => '',
                     'content' => $iCount
                 ));
@@ -157,9 +157,9 @@ class BxBaseModProfileFormEntry extends BxBaseModGeneralFormEntry
 			return $sValue;
 
         return $this->_oModule->_oTemplate->parseHtmlByName('name_link.html', array(
-            'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($oModuleAccounts->_oConfig->CNF['URL_MANAGE_ADMINISTRATION'], array(
+            'href' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($oModuleAccounts->_oConfig->CNF['URL_MANAGE_ADMINISTRATION'], array(
             	'filter' => urlencode($sValue)
-            )),
+            ))),
             'title' => '',
             'content' => $sValue
         ));
@@ -176,9 +176,9 @@ class BxBaseModProfileFormEntry extends BxBaseModGeneralFormEntry
             return $sStatus;
 
         return $this->_oModule->_oTemplate->parseHtmlByName('name_link.html', array(
-            'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE_ADMINISTRATION'], array(
+            'href' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE_ADMINISTRATION'], array(
             	'filter' => urlencode($this->aInputs[$CNF['FIELD_TITLE']]['value'])
-            )),
+            ))),
             'title' => '',
             'content' => $sStatus
         ));

+ 5 - 5
modules/base/profile/classes/BxBaseModProfileModule.php

@@ -436,7 +436,7 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
 
     public function serviceProfileEditUrl ($iContentId)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_EDIT_ENTRY'] . '&id=' . $iContentId);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_EDIT_ENTRY'] . '&id=' . $iContentId));
     }
 
     public function serviceProfileThumb ($iContentId)
@@ -469,7 +469,7 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
     	if(empty($CNF['URL_CREATE']))
     		return false;
 
-    	return $bAbsolute ? BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CREATE']) : $CNF['URL_CREATE'];
+    	return $bAbsolute ? bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_CREATE'])) : $CNF['URL_CREATE'];
     }
 
     /**
@@ -496,7 +496,7 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
         if (!$aContentInfo)
             return false;
         $CNF = $this->_oConfig->CNF;
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]));
     }
 
     /**
@@ -1989,7 +1989,7 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
             'sample' => $sSample,
             'sample_wo_article' => $CNF['T'][$aBuildParams['txt_ss']],
             'sample_action' => isset($CNF['T'][$aBuildParams['txt_sa']]) ? $CNF['T'][$aBuildParams['txt_sa']] : '',
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']])),
             'content' => $this->_getContentForTimelineProfileImage($aEvent, $aBrowseParams, $aBuildParams, $aContentInfo, $aFileInfo), //a string to display or array to parse default template before displaying.
             'date' => $aContentInfo[$CNF['FIELD_ADDED']],
             'views' => '',
@@ -2020,7 +2020,7 @@ class BxBaseModProfileModule extends BxBaseModGeneralModule implements iBxDolCon
     {
     	$CNF = &$this->_oConfig->CNF;
 
-    	$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+    	$sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]));
 
     	//--- Image(s)
         $sImage = $this->_oConfig->getImageUrl($aFileInfo['id'], $aBuildParams['trans']);

+ 1 - 1
modules/base/profile/classes/BxBaseModProfilePageEntry.php

@@ -90,7 +90,7 @@ class BxBaseModProfilePageEntry extends BxBaseModGeneralPageEntry
                 $sStatus = $this->_aContentInfo['profile_status'];
                 $sManageUrl = '#';
                 if(!empty($CNF['FIELD_TITLE']) && !empty($CNF['URL_MANAGE_ADMINISTRATION']))
-                    $sManageUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE_ADMINISTRATION'], array('filter' => urlencode($this->_aContentInfo[$CNF['FIELD_TITLE']])));
+                    $sManageUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE_ADMINISTRATION'], array('filter' => urlencode($this->_aContentInfo[$CNF['FIELD_TITLE']]))));
 
                 $aInformer = $CNF['INFORMERS']['status_moderation'];
                 if (isset($aInformer['map'][$sStatus]))

+ 4 - 4
modules/base/profile/classes/BxBaseModProfileTemplate.php

@@ -132,7 +132,7 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
         $iProfile = $oProfile->id();
 
         // get profile's url
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId));
 
         // get profile's title
         $sTitle = $oModule->getProfileName($aData);
@@ -309,7 +309,7 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
         $oProfile = BxDolProfile::getInstanceByContentAndType($aData[$CNF['FIELD_ID']], $this->MODULE);
         $iProfile = $oProfile->id();
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]));
         $sTitle = bx_process_output($oProfile->getDisplayName());
 
         //--- Process Cover
@@ -342,7 +342,7 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
             else
                 $sUrlCover = $this->getImageUrl('cover.svg');
 
-            $sUrlCoverChange = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_COVER'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+            $sUrlCoverChange = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_COVER'] . '&id=' . $aData[$CNF['FIELD_ID']]));
 
             $sAddClassCover = "";
             if(isset($CNF['FIELD_COVER']) && isset($CNF['OBJECT_UPLOADERS_COVER']) && isset($CNF['OBJECT_STORAGE_COVER']) && isset($CNF['OBJECT_IMAGES_TRANSCODER_COVER'])){
@@ -398,7 +398,7 @@ class BxBaseModProfileTemplate extends BxBaseModGeneralTemplate
             $bIsAllowEditPicture = $oModule->checkAllowedEdit($aData) === CHECK_ACTION_RESULT_ALLOWED;
 
             $sUrlPicture = $this->urlPicture ($aData);
-            $sUrlPictureChange = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+            $sUrlPictureChange = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]));
 
             $sAddClassPicture = "";
             if(isset($CNF['FIELD_PICTURE']) && isset($CNF['OBJECT_UPLOADERS_PICTURE']) && isset($CNF['OBJECT_STORAGE']) && isset($CNF['OBJECT_IMAGES_TRANSCODER_THUMB'])){

+ 2 - 2
modules/base/text/classes/BxBaseModTextGridAdministration.php

@@ -180,7 +180,7 @@ class BxBaseModTextGridAdministration extends BxBaseModGeneralGridAdministration
 
     	$CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]));
 
     	$a['attr'] = array_merge($a['attr'], array(
     		"onclick" => "window.open('" . $sUrl . "','_self');"
@@ -193,7 +193,7 @@ class BxBaseModTextGridAdministration extends BxBaseModGeneralGridAdministration
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]));
 
         return $this->_oTemplate->parseHtmlByName('title_link.html', array(
             'href' => $sUrl,

+ 1 - 1
modules/base/text/classes/BxBaseModTextPageEntry.php

@@ -41,7 +41,7 @@ class BxBaseModTextPageEntry extends BxBaseModGeneralPageEntry
         $sTitle = $sUrl = $sIcon = "";
         if ($this->_aContentInfo && CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedView($this->_aContentInfo)) {
             $sTitle = $this->_oModule->_oTemplate->getTitleAuto($this->_aContentInfo);
-            $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aContentInfo[$CNF['FIELD_ID']]);
+            $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aContentInfo[$CNF['FIELD_ID']]));
             $sIcon = $CNF['ICON'];
 
             $this->addMarkers($this->_aContentInfo); // every field can be used as marker

+ 1 - 1
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -860,7 +860,7 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
         }
 
         // get entry url
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]));
 
         $oProfile = BxDolProfile::getInstanceMagic($aData[$CNF['FIELD_AUTHOR']]);
         

+ 3 - 3
modules/boonex/acl/classes/BxAclModule.php

@@ -85,7 +85,7 @@ class BxAclModule extends BxDolModule
     {
         $CNF = &$this->_oConfig->CNF;
 
-    	return  BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
+    	return  bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']));
     }
 
     /**
@@ -216,7 +216,7 @@ class BxAclModule extends BxDolModule
             'name' => $aItem['name'],
             'title' => $sTitle,
             'description' => $sDescription,
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW'])),
             'price_single' => $aItem['price'],
             'price_recurring' => $aItem['price'],
             'period_recurring' => $aItem['period'],
@@ -252,7 +252,7 @@ class BxAclModule extends BxDolModule
     	    return array();
 
         $aItems = $this->_oDb->getPrices(array('type' => 'all_full'));
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW']));
 
         $aResult = array();
         foreach($aItems as $aItem) {

+ 1 - 1
modules/boonex/ads/classes/BxAdsFormEntry.php

@@ -181,7 +181,7 @@ class BxAdsFormEntry extends BxBaseModTextFormEntry
         if(empty($aCategory) || !is_array($aCategory))
             return '';
 
-        $sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $aCategory['id']));
+        $sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $aCategory['id'])));
         return $this->_oModule->_oTemplate->parseLink($sLink, bx_process_output(_t($aCategory['title'])));
     }
 

+ 1 - 1
modules/boonex/ads/classes/BxAdsGridOffersAll.php

@@ -46,7 +46,7 @@ class BxAdsGridOffersAll extends BxTemplGrid
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY_OFFERS'], array('id' => $aRow['content_id']));
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY_OFFERS'], array('id' => $aRow['content_id'])));
 
     	$a['attr'] = array_merge($a['attr'], array(
             "onclick" => "window.open('" . $sUrl . "','_self');"

+ 1 - 1
modules/boonex/ads/classes/BxAdsMenuSnippetMeta.php

@@ -21,7 +21,7 @@ class BxAdsMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
 
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $this->_sCategoryUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => ''));
+        $this->_sCategoryUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => '')));
     }
 
     protected function _getMenuItemCategory($aItem)

+ 22 - 22
modules/boonex/ads/classes/BxAdsModule.php

@@ -105,10 +105,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'viewer_name' => $oViewer->getDisplayName(),
                 'viewer_url' => $oViewer->getUrl(),
                 'ad_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-                'ad_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'ad_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         return echoJson(array('msg' => _t('_bx_ads_txt_msg_author_notified')));
@@ -873,8 +873,8 @@ class BxAdsModule extends BxBaseModTextModule
         $oPermalink = BxDolPermalinks::getInstance();
 
         $aResult = $this->_aModule;
-        $aResult['url_browse_order_common'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_LICENSES_COMMON'], array('filter' => '{order}'));
-        $aResult['url_browse_order_administration'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_LICENSES_ADMINISTRATION'], array('filter' => '{order}'));
+        $aResult['url_browse_order_common'] = bx_absolute_url($oPermalink->permalink($CNF['URL_LICENSES_COMMON'], array('filter' => '{order}')));
+        $aResult['url_browse_order_administration'] = bx_absolute_url($oPermalink->permalink($CNF['URL_LICENSES_ADMINISTRATION'], array('filter' => '{order}')));
 
         return $aResult;
     }
@@ -932,7 +932,7 @@ class BxAdsModule extends BxBaseModTextModule
             'name' => $aItem[$CNF['FIELD_NAME']],
             'title' => $aItem[$CNF['FIELD_TITLE']],
             'description' => $aItem[$CNF['FIELD_TEXT']],
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], array('id' => $aItem[$CNF['FIELD_ID']])),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], array('id' => $aItem[$CNF['FIELD_ID']]))),
             'price_single' => $fItemPrice,
             'price_recurring' => '',
             'period_recurring' => 0,
@@ -980,7 +980,7 @@ class BxAdsModule extends BxBaseModTextModule
                 'name' => $aItem[$CNF['FIELD_NAME']],
                 'title' => $aItem[$CNF['FIELD_TITLE']],
                 'description' => $aItem[$CNF['FIELD_TEXT']],
-                'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], array('id' => $aItem[$CNF['FIELD_ID']])),
+                'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], array('id' => $aItem[$CNF['FIELD_ID']]))),
                 'price_single' => $aItem[$CNF['FIELD_PRICE_SINGLE']],
                 'price_recurring' => '',
                 'period_recurring' => 0,
@@ -1109,7 +1109,7 @@ class BxAdsModule extends BxBaseModTextModule
         $aEmailParams = [
             'client_name' => $oClient->getDisplayName(),
             'entry_name' => $aEntry[$CNF['FIELD_TITLE']],
-            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], ['id' => $aEntry[$CNF['FIELD_ID']]]),
+            'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], ['id' => $aEntry[$CNF['FIELD_ID']]])),
             'vendor_url' => $sSellerUrl,
             'vendor_name' => $sSellerName,
             'count' => (int)$iItemCount,
@@ -1610,10 +1610,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'viewer_name' => $oViewer->getDisplayName(),
                 'viewer_url' => $oViewer->getUrl(),
                 'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-                'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         $aParams = $this->_alertParamsOffer($aContentInfo, $aOfferInfo);
@@ -1645,10 +1645,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'offerer_name' => $oOfferer->getDisplayName(),
                 'offerer_url' => $oOfferer->getUrl(),
                 'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-                'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         $aParams = $this->_alertParamsOffer($aContentInfo, $aOfferInfo);
@@ -1676,10 +1676,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'offerer_name' => $oOfferer->getDisplayName(),
                 'offerer_url' => $oOfferer->getUrl(),
                 'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-                'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         $aParams = $this->_alertParamsOffer($aContentInfo, $aOfferInfo);
@@ -1710,10 +1710,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'offerer_name' => $oOfferer->getDisplayName(),
                 'offerer_url' => $oOfferer->getUrl(),
                 'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-                'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         $aParams = $this->_alertParamsOffer($aContentInfo, $aOfferInfo);
@@ -1747,10 +1747,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'vendor_name' => $oProfileSrc->getDisplayName(),
                 'vendor_url' => $oProfileSrc->getUrl(),
                 'entry_name' => $mixedContent[$CNF['FIELD_TITLE']],
-                'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         $aParams = $this->_alertParams($mixedContent);
@@ -1786,10 +1786,10 @@ class BxAdsModule extends BxBaseModTextModule
                 'client_name' => $oProfileSrc->getDisplayName(),
                 'client_url' => $oProfileSrc->getUrl(),
                 'entry_name' => $mixedContent[$CNF['FIELD_TITLE']],
-                'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                     'i' => $CNF['URI_VIEW_ENTRY'], 
                     $CNF['FIELD_ID'] => $iContentId
-                ))
+                )))
             ));
 
         $aParams = $this->_alertParams($mixedContent);
@@ -1848,10 +1848,10 @@ class BxAdsModule extends BxBaseModTextModule
         $iContentAuthor = (int)$aContent[$CNF['FIELD_AUTHOR']];
 
         $aReturn = array(
-            'redirect' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+            'redirect' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php', array(
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 $CNF['FIELD_ID'] => $aOffer[$CNF['FIELD_OFR_CONTENT']]
-            ))
+            )))
         );
 
         $oPayments = BxDolPayments::getInstance();
@@ -2025,7 +2025,7 @@ class BxAdsModule extends BxBaseModTextModule
             $iCategory = (int)$aContentInfo[$CNF['FIELD_CATEGORY']];
             $aCategory = $this->_oDb->getCategories(array('type' => 'id', 'id' => $iCategory));
             $sCategory = _t($aCategory['title']);
-            $sCategoryLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $iCategory));
+            $sCategoryLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $iCategory)));
         }
 
         $sPrice = _t('_bx_ads_txt_free');

+ 5 - 5
modules/boonex/ads/classes/BxAdsTemplate.php

@@ -58,7 +58,7 @@ class BxAdsTemplate extends BxBaseModTextTemplate
         $aTmplVarsItems = array_reverse($aTmplVarsItems);
         
         $aTmplVarsItems[] = array(
-            'url' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+            'url' => bx_absolute_url($oPermalink->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']])),
             'title' => bx_process_output($aContentInfo[$CNF['FIELD_TITLE']])
         );
 
@@ -70,7 +70,7 @@ class BxAdsTemplate extends BxBaseModTextTemplate
         $CNF = &$this->_oConfig->CNF;
 
         $sResult = $this->_categoriesList(0, array(
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array('category' => ''))
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_CATEGORIES'], array('category' => '')))
         ));
 
         if(empty($sResult) && isset($aParams['show_empty']) && $aParams['show_empty'] === true)
@@ -84,9 +84,9 @@ class BxAdsTemplate extends BxBaseModTextTemplate
         $CNF = &$this->_oConfig->CNF;
 
         return $this->getLink('entry-link', array(
-            'href' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], array(
+            'href' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'], array(
                 'id' => $aEntry[$CNF['FIELD_ID']]
-            )),
+            ))),
             'title' => bx_html_attribute($aEntry[$CNF['FIELD_TITLE']]),
             'content' => $aEntry[$CNF['FIELD_TITLE']]
         ));
@@ -155,7 +155,7 @@ class BxAdsTemplate extends BxBaseModTextTemplate
             return;
 
         $aTmplVarsItems[] = array(
-            'url' => BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $aCategory['id'])),
+            'url' => bx_absolute_url($oPermalink->permalink($CNF['URL_CATEGORIES'], array($CNF['GET_PARAM_CATEGORY'] => $aCategory['id']))),
             'title' => bx_process_output(_t($aCategory['title']))
         );
 

+ 1 - 1
modules/boonex/albums/classes/BxAlbumsContentInfoMedia.php

@@ -89,7 +89,7 @@ class BxAlbumsContentInfoMedia extends BxDolContentInfo
         if(empty($aMedia) || !is_array($aMedia))
             return '';
 
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_MEDIA'] . '&id=' . $iContentId);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_VIEW_MEDIA'] . '&id=' . $iContentId));
     }
 
     public function getContentText ($iContentId)

+ 4 - 4
modules/boonex/albums/classes/BxAlbumsModule.php

@@ -239,7 +239,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         return parent::serviceEntityAllActions (array($iMediaId, $aMediaInfo), array_merge(array(
             'object_menu' => $CNF['OBJECT_MENU_ACTIONS_VIEW_MEDIA_ALL'],
             'object_transcoder' => $CNF['OBJECT_IMAGES_TRANSCODER_BIG'],
-            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $iMediaId),
+            'entry_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $iMediaId)),
             'entry_title' => $aMediaInfo['title'],
             'entry_thumb' => $aMediaInfo['file_id']
         ), $aParams));
@@ -548,7 +548,7 @@ class BxAlbumsModule extends BxBaseModTextModule
             'sample' => isset($CNF['T']['txt_sample_single_with_article']) ? $CNF['T']['txt_sample_single_with_article'] : $CNF['T']['txt_sample_single'],
             'sample_wo_article' => $CNF['T']['txt_sample_single'],
     	    'sample_action' => $CNF['T']['txt_sample_action_changed'],
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId)),
             'content' => $this->_getContentForTimelineMedia($aEvent, $aContentInfo, $aBrowseParams), //a string to display or array to parse default template before displaying.
             'date' => $aContentInfo[$CNF['FIELD_ADDED']],
             'views' => $aViews,
@@ -774,7 +774,7 @@ class BxAlbumsModule extends BxBaseModTextModule
         $oUploader = BxDolUploader::getObjectInstance($CNF['OBJECT_UPLOADERS'][0], $CNF['OBJECT_STORAGE'], '');
         $oUploader->deleteGhost($aMediaInfo['file_id'], bx_get_logged_profile_id());
         
-        echoJson(['redirect' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aMediaInfo['content_id'])]);
+        echoJson(['redirect' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aMediaInfo['content_id']))]);
     }
 
     public function actionMoveMedia($iMediaId)
@@ -978,7 +978,7 @@ class BxAlbumsModule extends BxBaseModTextModule
     {
     	$CNF = &$this->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]));
         $sTitle = isset($CNF['FIELD_TITLE']) && isset($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : (isset($CNF['FIELD_TEXT']) && isset($aContentInfo[$CNF['FIELD_TEXT']]) ? strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 20, '...') : '');
 
         $oStorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);

+ 1 - 1
modules/boonex/albums/classes/BxAlbumsPageMedia.php

@@ -43,7 +43,7 @@ class BxAlbumsPageMedia extends BxTemplPage
             ));
 
             $sTitle = isset($this->_aAlbumInfo[$CNF['FIELD_TITLE']]) ? $this->_aAlbumInfo[$CNF['FIELD_TITLE']] : strmaxtextlen($this->_aAlbumInfo[$CNF['FIELD_TEXT']], 20, '...');
-            $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aAlbumInfo[$CNF['FIELD_ID']]);
+            $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $this->_aAlbumInfo[$CNF['FIELD_ID']]));
 
             // select view entry submenu
             $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');

+ 1 - 1
modules/boonex/albums/classes/BxAlbumsSearchResultMedia.php

@@ -253,7 +253,7 @@ class BxAlbumsSearchResultMedia extends BxBaseModTextSearchResult
 
     function getRssUnitLink (&$a)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->oModule->_oConfig->CNF['URI_VIEW_MEDIA'] . '&id=' . $a['id']);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->oModule->_oConfig->CNF['URI_VIEW_MEDIA'] . '&id=' . $a['id']));
     }
 
     protected function _updateCurrentForOrderByGhosts()

+ 3 - 3
modules/boonex/albums/classes/BxAlbumsTemplate.php

@@ -38,7 +38,7 @@ class BxAlbumsTemplate extends BxBaseModTextTemplate
             return $s;
 
         // get entry url        
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]));
 
         $oProfile = BxDolProfile::getInstance($aData[$CNF['FIELD_AUTHOR']]);
         if (!$oProfile) 
@@ -197,7 +197,7 @@ class BxAlbumsTemplate extends BxBaseModTextTemplate
         if (!($aAlbumInfo = $oModule->_oDb->getContentInfoById($aMediaInfo['content_id'])))
             return '';        
 
-        $sUrlAlbum = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aAlbumInfo[$CNF['FIELD_ID']]);
+        $sUrlAlbum = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aAlbumInfo[$CNF['FIELD_ID']]));
 
         $iProfileId = $aAlbumInfo[$CNF['FIELD_AUTHOR']];
         $oProfile = BxDolProfile::getInstance($iProfileId);
@@ -331,7 +331,7 @@ class BxAlbumsTemplate extends BxBaseModTextTemplate
 
     public function getViewMediaUrl($CNF, $iMediaId, $sContext = '')
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $iMediaId . (!empty($sContext) ? '&context=' . $sContext : ''));
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_MEDIA'] . '&id=' . $iMediaId . (!empty($sContext) ? '&context=' . $sContext : '')));
     }
 
     public function getNextPrevMedia($aMediaInfo, $isNext, $sContext, $aParamsSearchResult = array())

+ 2 - 2
modules/boonex/antispam/classes/BxAntispamModule.php

@@ -271,8 +271,8 @@ class BxAntispamModule extends BxDolModule
         if ('on' == $this->_oConfig->getAntispamOption('toxicity_report') && $sModule) {
             $oModule = BxDolModule::getInstance($sModule);
             $CNF = &$oModule->_oConfig->CNF;
-            $sContentUrl = isset($CNF['URI_VIEW_ENTRY']) ? BX_DOL_URL_ROOT.BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId) : false;
-            $sManageContentUrl = isset($CNF['URL_MANAGE_ADMINISTRATION']) ? BX_DOL_URL_ROOT.BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URL_MANAGE_ADMINISTRATION']) : false;
+            $sContentUrl = isset($CNF['URI_VIEW_ENTRY']) ? bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId)) : false;
+            $sManageContentUrl = isset($CNF['URL_MANAGE_ADMINISTRATION']) ? bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URL_MANAGE_ADMINISTRATION'])) : false;
 
             $oProfile = BxDolProfile::getInstance();
             if (!$oProfile) return;

+ 3 - 3
modules/boonex/antispam/classes/BxAntispamStudioPage.php

@@ -21,9 +21,9 @@ class BxAntispamStudioPage extends BxTemplStudioModule
 
         $this->aMenuItems = array(
             'settings' => array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
-            'ip_table' => array('name' => 'ip_table', 'icon' => 'align-justify', 'title' => '_bx_antispam_ip_table', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-ip-table')),
-            'dnsbl_list' => array('name' => 'dnsbl_list', 'icon' => 'align-justify', 'title' => '_bx_antispam_dnsbl_list', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-dnsbl-list')),
-            'block_log' => array('name' => 'block_log', 'icon' => 'far clock', 'title' => '_bx_antispam_block_log', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-block-log')),
+            'ip_table' => array('name' => 'ip_table', 'icon' => 'align-justify', 'title' => '_bx_antispam_ip_table', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-ip-table'))),
+            'dnsbl_list' => array('name' => 'dnsbl_list', 'icon' => 'align-justify', 'title' => '_bx_antispam_dnsbl_list', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-dnsbl-list'))),
+            'block_log' => array('name' => 'block_log', 'icon' => 'far clock', 'title' => '_bx_antispam_block_log', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=antispam-block-log'))),
             'help' => array('name' => 'help', 'icon' => 'question', 'title' => '_bx_antispam_help'),
         );
     }

+ 1 - 1
modules/boonex/api/classes/BxApiModule.php

@@ -381,7 +381,7 @@ class BxApiModule extends BxDolModule
 		
 		$oKey = BxDolKey::getInstance();
 		$aPlus['key'] = $oKey->getNewKey(array('email' => $sEmail));
-		$aPlus['forgot_password_url'] = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password', array('key' => $aPlus['key']));
+		$aPlus['forgot_password_url'] = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password', array('key' => $aPlus['key'])));
         $aTemplate = BxDolEmailTemplates::getInstance() -> parseTemplate('t_Forgot', $aPlus, $iAccountId);
         if ($aTemplate && sendMail($sEmail, $aTemplate['Subject'], $aTemplate['Body'], 0, $aPlus, BX_EMAIL_SYSTEM)){
             return array('code' => 200);

+ 2 - 2
modules/boonex/artificer/classes/BxArtificerModule.php

@@ -84,8 +84,8 @@ class BxArtificerModule extends BxBaseModTemplateModule
 
             case 'login_agreement':
                 $oPermalink = BxDolPermalinks::getInstance();
-                $sLinkTerms = BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=terms');
-                $sLinkPrivacy = BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=privacy');
+                $sLinkTerms = bx_absolute_url($oPermalink->permalink('page.php?i=terms'));
+                $sLinkPrivacy = bx_absolute_url($oPermalink->permalink('page.php?i=privacy'));
 
                 $sResult = _t('_bx_artificer_txt_splash_login_agreement', $sLinkTerms, $sLinkPrivacy);
                 break;

+ 3 - 3
modules/boonex/artificer/data/template/system/scripts/BxTemplPageHome.php

@@ -24,9 +24,9 @@ class BxTemplPageHome extends BxBasePageHome
 
         BxDolCover::getInstance()->set(array(
             'class' => 'bx-cover-homepage',
-            'title' => _t('_sys_txt_homepage_cover', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')),
-            'link_join' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'),
-            'link_login' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login'),
+            'title' => _t('_sys_txt_homepage_cover', bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'))),
+            'link_join' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')),
+            'link_login' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=login')),
             'bx_if:empty_cover_class' => array (
                 'condition' => !$bTmplVarsCover,
                 'content' => array(),

+ 1 - 1
modules/boonex/attendant/classes/BxAttendantModule.php

@@ -41,7 +41,7 @@ class BxAttendantModule extends BxDolModule
        
         if ($sFirstPage){
             if (getParam('bx_attendant_redirect_to_entered_page') == 'on'){
-                echo json_encode(['redirect' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sFirstPage)]);  
+                echo json_encode(['redirect' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sFirstPage))]);
                 exit();
             }
             else{

+ 1 - 1
modules/boonex/channels/classes/BxCnlModule.php

@@ -549,7 +549,7 @@ class BxCnlModule extends BxBaseModGroupsModule
             if (isset($aContentInfo[$CNF['FIELD_NAME']]))
                 array_push($aVars, array(
                     'title' => $aContentInfo[$CNF['FIELD_NAME']],
-                    'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId),
+                    'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId)),
                     'followers' => $oConnection -> getConnectedInitiatorsCount($iProfileId),
                     'id' => $iProfileId,
                     'icon' => $oProfile -> getThumb()

+ 1 - 1
modules/boonex/classes/classes/BxClssModule.php

@@ -405,7 +405,7 @@ class BxClssModule extends BxBaseModTextModule
                 'condition' => $bAdmin,
                 'content' => array(
                     'context_profile_id' => $iContextProfileId,
-                    'new_class_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-class&profile_id=' . $oContextProfile->id()),
+                    'new_class_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=create-class&profile_id=' . $oContextProfile->id())),
                 ),
             ),
         ));

+ 1 - 1
modules/boonex/contact/classes/BxContactModule.php

@@ -150,7 +150,7 @@ class BxContactModule extends BxDolModule
         //if (true !== $this->isAllowedContact())
         //    return false;
 
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=contact');
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=contact'));
     }
 
     /*

+ 1 - 1
modules/boonex/convos/classes/BxCnvFormsEntryHelper.php

@@ -55,7 +55,7 @@ class BxCnvFormsEntryHelper extends BxBaseModTextFormsEntryHelper
                 'SenderDisplayName' => $oProfile->getDisplayName(),
                 'SenderUrl' => $oProfile->getUrl(),
                 'Message' => $aContentInfo[$CNF['FIELD_TEXT']],
-                'PageUrl' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+                'PageUrl' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']])),
                 'PageTitle' => strmaxtextlen($aContentInfo[$CNF['FIELD_TEXT']], 100),
             ), BX_EMAIL_NOTIFY);
         }

+ 2 - 2
modules/boonex/convos/classes/BxCnvGrid.php

@@ -95,7 +95,7 @@ class BxCnvGrid extends BxBaseModGeneralGridAdministration
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']));
 
         header('Location:' . $sUrl);
     }
@@ -104,7 +104,7 @@ class BxCnvGrid extends BxBaseModGeneralGridAdministration
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']));
 
         $a['attr']['onclick'] = "document.location='$sUrl'";
         unset($a['attr']['bx_grid_action_independent']);

+ 5 - 5
modules/boonex/convos/classes/BxCnvTemplate.php

@@ -159,7 +159,7 @@ class BxCnvTemplate extends BxBaseModTextTemplate
         $oModule = BxDolModule::getInstance($this->MODULE);
 
         $aVars = array(
-            'see_all_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($oModule->_oConfig->CNF['URL_HOME']),
+            'see_all_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($oModule->_oConfig->CNF['URL_HOME'])),
             'bx_repeat:messages' => array(),
         );
         foreach ($a as $r) {
@@ -177,7 +177,7 @@ class BxCnvTemplate extends BxBaseModTextTemplate
 
             $aVars['bx_repeat:messages'][] = array (
                 'id' => $r['id'],
-                'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']),
+                'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id'])),
                 'text' => $sText ? $sText : $oProfileAuthor->getDisplayName(),
                 'cmt_text' => $sTextCmt,
                 'unread_messages' => $r['unread_messages'],
@@ -216,7 +216,7 @@ class BxCnvTemplate extends BxBaseModTextTemplate
             $r['unread_messages'] = $r['comments'] - $r['read_comments'];
 
         $aVars = array (
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id'])),
             'text' => $sText ? $sText : _t('_Empty'),
             'cmt_text' => $sTextCmt,
             'last_reply_time_and_replier' => _t('_bx_cnv_x_date_by_x_replier', bx_time_js($r['last_reply_timestamp'], BX_FORMAT_DATE), $oProfileLast->getDisplayName()),
@@ -248,10 +248,10 @@ class BxCnvTemplate extends BxBaseModTextTemplate
         $iFolder = $this->_oDb->getConversationFolder($aContentInfo[$CNF['FIELD_ID']], bx_get_logged_profile_id());
 
     	$aTmplVarsItems = array(array(
-        	'url' => BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_FOLDER'] . $iFolder),
+        	'url' => bx_absolute_url($oPermalink->permalink($CNF['URL_FOLDER'] . $iFolder)),
         	'title' => _t($CNF['T']['txt_folder_' . $iFolder])
         ), array(
-        	'url' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+        	'url' => bx_absolute_url($oPermalink->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']])),
         	'title' => $sText ? $sText : $oAuthor->getDisplayName(),
         ));
 

+ 2 - 2
modules/boonex/credits/classes/BxCreditsConfig.php

@@ -228,12 +228,12 @@ class BxCreditsConfig extends BxBaseModGeneralConfig
 
     public function getCheckoutUrl()
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->CNF['URL_CHECKOUT']);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->CNF['URL_CHECKOUT']));
     }
 
     public function getBundleUrl($aBundle)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->CNF['URL_HOME']);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->CNF['URL_HOME']));
     }
 
     public function getBundleName($sName)

+ 3 - 3
modules/boonex/credits/classes/BxCreditsModule.php

@@ -372,8 +372,8 @@ class BxCreditsModule extends BxBaseModGeneralModule
         $oPermalink = BxDolPermalinks::getInstance();
 
         $aResult = $this->_aModule;
-        $aResult['url_browse_order_common'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_ORDERS_COMMON'], array('filter' => '{order}'));
-        $aResult['url_browse_order_administration'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_ORDERS_ADMINISTRATION'], array('filter' => '{order}'));
+        $aResult['url_browse_order_common'] = bx_absolute_url($oPermalink->permalink($CNF['URL_ORDERS_COMMON'], array('filter' => '{order}')));
+        $aResult['url_browse_order_administration'] = bx_absolute_url($oPermalink->permalink($CNF['URL_ORDERS_ADMINISTRATION'], array('filter' => '{order}')));
 
         return $aResult;
     }
@@ -901,7 +901,7 @@ class BxCreditsModule extends BxBaseModGeneralModule
             'amount' => $fAmount,
             'rate' => $fRate,
             'message' => $sMessage,
-            'confirm_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_HISTORY_ADMINISTRATION'])
+            'confirm_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_HISTORY_ADMINISTRATION']))
         ];
         $aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate($CNF['ETEMPLATE_WITHDRAW_REQUESTED'], $aTemplateVars);
         if(!$aTemplate)

+ 1 - 1
modules/boonex/developer/classes/BxDevBuilderPage.php

@@ -459,7 +459,7 @@ class BxDevBuilderPage extends BxTemplStudioBuilderPage
 
         return array(
             'js_object' => $sJsObject,
-            'url_view' => BX_DOL_URL_ROOT . $oPermalinks->permalink($this->aPageRebuild['url']),
+            'url_view' => bx_absolute_url($oPermalinks->permalink($this->aPageRebuild['url'])),
             'action_page_export' => $this->sActionPageExport,
             'action_page_edit' => $this->sActionPageEdit,
             'action_block_create' => $this->sActionBlockCreate,

+ 4 - 4
modules/boonex/donations/classes/BxDonationsModule.php

@@ -129,8 +129,8 @@ class BxDonationsModule extends BxBaseModGeneralModule
         $oPermalink = BxDolPermalinks::getInstance();
 
         $aResult = $this->_aModule;
-        $aResult['url_browse_order_common'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_LIST'], array('filter' => '{order}'));
-        $aResult['url_browse_order_administration'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_LIST_ALL'], array('filter' => '{order}'));
+        $aResult['url_browse_order_common'] = bx_absolute_url($oPermalink->permalink($CNF['URL_LIST'], array('filter' => '{order}')));
+        $aResult['url_browse_order_administration'] = bx_absolute_url($oPermalink->permalink($CNF['URL_LIST_ALL'], array('filter' => '{order}')));
 
         return $aResult;
     }
@@ -156,7 +156,7 @@ class BxDonationsModule extends BxBaseModGeneralModule
             'name' => $aItem[$CNF['FIELD_NAME']],
             'title' => _t($this->_oConfig->isShowTitle() && !empty($aItem[$CNF['FIELD_TITLE']]) ? $aItem[$CNF['FIELD_TITLE']] : '_bx_donations_txt_cart_item_title'),
             'description' => _t('_bx_donations_txt_cart_item_description', getParam('site_title')),
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_MAKE']),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_MAKE'])),
             'price_single' => $aItem[$CNF['FIELD_AMOUNT']],
             'price_recurring' => $aItem[$CNF['FIELD_AMOUNT']],
             'period_recurring' => $aItem[$CNF['FIELD_PERIOD']],
@@ -187,7 +187,7 @@ class BxDonationsModule extends BxBaseModGeneralModule
                 'name' => $aItem[$CNF['FIELD_NAME']],
                 'title' => _t($bShowTitle && !empty($aItem[$CNF['FIELD_TITLE']]) ? $aItem[$CNF['FIELD_TITLE']] : '_bx_donations_txt_cart_item_title'),
                 'description' => _t('_bx_donations_txt_cart_item_description', getParam('site_title')),
-                'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_MAKE']),
+                'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_MAKE'])),
                 'price_single' => $aItem[$CNF['FIELD_AMOUNT']],
                 'price_recurring' => $aItem[$CNF['FIELD_AMOUNT']],
                 'period_recurring' => $aItem[$CNF['FIELD_PERIOD']],

+ 1 - 1
modules/boonex/events/classes/BxEventsDb.php

@@ -168,7 +168,7 @@ class BxEventsDb extends BxBaseModGroupsDb
                 $a[$k]['end'] = $oEnd ? $oEnd->format('c') : 0;
                 $a[$k]['start_utc'] = $oDateStart ? $oDateStart->getTimestamp() : 0;
                 $a[$k]['end_utc'] = $oDateEnd ? $oDateEnd->getTimestamp() : 0;
-                $a[$k]['url'] = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']);
+                $a[$k]['url'] = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']));
                 if(($oEvent = BxDolProfile::getInstanceByContentAndType($r['id'], $sModule)) !== false)
                     $a[$k]['extendedProps'] = [
                         'class' => 'bx-events-calendar-unit',

+ 1 - 1
modules/boonex/events/classes/BxEventsModule.php

@@ -555,7 +555,7 @@ class BxEventsModule extends BxBaseModGroupsModule implements iBxDolCalendarServ
         foreach ($aParticipants as $iProfileId) {
 
             $b = sendMailTemplate($CNF['EMAIL_REMINDER'], 0, $iProfileId, array(
-                'EntryUrl' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']]),
+                'EntryUrl' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aContentInfo[$CNF['FIELD_ID']])),
                 'EntryTitle' => $aContentInfo['title'],
                 'EntryBegin' => $sEntryBegin,
                 'EntryBeginShort' => $sEntryBeginShort,

+ 1 - 1
modules/boonex/forum/classes/BxForumGrid.php

@@ -167,7 +167,7 @@ class BxForumGrid extends BxTemplGrid
         if($this->_oModule->checkAllowedAdd() !== CHECK_ACTION_RESULT_ALLOWED)
             return '';
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_ADD_ENTRY']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oModule->_oConfig->CNF['URI_ADD_ENTRY']));
 
         unset($a['attr']['bx_grid_action_independent']);
         $a['attr'] = array_merge($a['attr'], array(

+ 1 - 1
modules/boonex/forum/classes/BxForumTemplate.php

@@ -189,7 +189,7 @@ class BxForumTemplate extends BxBaseModTextTemplate
                 'condition' => (int)$aRow[$CNF['FIELD_LOCK']] == 1,
                 'content' => array()
             ),
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']])),
             'title' => $sTitle ? $sTitle : _t('_Empty'),
             'participants' => $sParticipants,
             'badges' => $this->_oModule->serviceGetBadges($aRow[$CNF['FIELD_ID']]),

+ 1 - 1
modules/boonex/help_tours/classes/BxHelpToursGridItems.php

@@ -293,7 +293,7 @@ class BxHelpToursGridItems extends BxTemplGrid
         if (!$sUrl) return '';
         $sUrl = trim($sUrl, '/');
 
-        $a['attr']['href'] = BX_DOL_URL_ROOT.bx_append_url_params(BxDolPermalinks::getInstance()->permalink($sUrl), ['help_tour_preview' => $this->_iTourId, 'help_tour_item' => $aRow['id']]);
+        $a['attr']['href'] = bx_absolute_url(bx_append_url_params(BxDolPermalinks::getInstance()->permalink($sUrl), ['help_tour_preview' => $this->_iTourId, 'help_tour_item' => $aRow['id']]));
         $a['attr']['target'] = '_blank';
 
         $sButton = $this->_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);

+ 1 - 1
modules/boonex/help_tours/classes/BxHelpToursGridTours.php

@@ -43,7 +43,7 @@ class BxHelpToursGridTours extends BxTemplGrid
         if (!$sUrl) return '';
         $sUrl = trim($sUrl, '/');
 
-        $a['attr']['href'] = BX_DOL_URL_ROOT.bx_append_url_params(BxDolPermalinks::getInstance()->permalink($sUrl), ['help_tour_preview' => $aRow['id']]);
+        $a['attr']['href'] = bx_absolute_url(bx_append_url_params(BxDolPermalinks::getInstance()->permalink($sUrl), ['help_tour_preview' => $aRow['id']]));
         $a['attr']['target'] = '_blank';
 
         $sButton = $this->_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);

+ 2 - 2
modules/boonex/invites/classes/BxInvGridInvites.php

@@ -219,7 +219,7 @@ class BxInvGridInvites extends BxTemplGrid
         $aRequest = $this->_oModule->_oDb->getRequests(array('type' => 'by_id', 'value' => $aRow['request_id']));
         if ($aRequest || true){
             $CNF = &$this->_oModule->_oConfig->CNF;
-            $sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_REQUESTS']);
+            $sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_REQUESTS']));
             $sLink = bx_append_url_params($sLink, array('filter' => $aRequest['email']));
             $sAddon = $this->_oTemplate->parseHtmlByName('account_link.html', array(
                     'href' => $sLink,
@@ -271,7 +271,7 @@ class BxInvGridInvites extends BxTemplGrid
 
 		$sLink = $oModuleAccounts->_oConfig->CNF['URL_MANAGE_ADMINISTRATION'];
 
-		$sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sLink);
+		$sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sLink));
 		
 		if(!empty($sFilter))
 			$sLink = bx_append_url_params($sLink, array('filter' => $sFilter));

+ 1 - 1
modules/boonex/invites/classes/BxInvModule.php

@@ -551,7 +551,7 @@ class BxInvModule extends BxDolModule
     {
         $sKeyCode = $this->_oConfig->getKeyCode();
 
-        $sJoinUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account');
+        $sJoinUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'));
         return bx_append_url_params($sJoinUrl, array($sKeyCode => $sKey));
     }
     

+ 1 - 1
modules/boonex/invites/classes/BxInvStudioPage.php

@@ -19,7 +19,7 @@ class BxInvStudioPage extends BxTemplStudioModule
 
         $this->aMenuItems = array(
             array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
-            array('name' => 'manage', 'icon' => 'edit', 'title' => '_bx_invites_menu_item_title_requests', 'link' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=invites-requests')),
+            array('name' => 'manage', 'icon' => 'edit', 'title' => '_bx_invites_menu_item_title_requests', 'link' => bx_absolute_url($oPermalink->permalink('page.php?i=invites-requests'))),
         );
     }
 }

+ 5 - 5
modules/boonex/invites/classes/BxInvTemplate.php

@@ -66,7 +66,7 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
 		if ($mInvitesRemain === true)
 			$mInvitesRemain = _t('_bx_invites_txt_unlimited');
            
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_INVITE']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_INVITE']));
 
         $this->getCssJs();
         return $this->parseHtmlByName('block_invite.html', array(
@@ -80,7 +80,7 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
 
     public function getBlockRequest()
     {
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_REQUEST']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_REQUEST']));
 
         $this->getCssJs();
         return $this->parseHtmlByName('block_request.html', array(
@@ -109,7 +109,7 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
         $oPermalink = BxDolPermalinks::getInstance();
 
         $oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_request'), $this->_oConfig->getObject('form_display_request_send'));
-        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_REQUEST']);
+        $oForm->aFormAttrs['action'] = bx_absolute_url($oPermalink->permalink($CNF['URL_REQUEST']));
 
         $sFormId = $oForm->getId();
         $sEval = $sJsObject . '.onRequestFormSubmit(oData)';
@@ -136,7 +136,7 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
         $oAccountQuery = BxDolAccountQuery::getInstance();
         $iAccount = $oAccountQuery->getIdByEmail($sEmail);
         if ($iAccount > 0)
-            return array('content' => MsgBox(_t('_bx_invites_err_already_registed', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))), 'content_id' => $sFormId, 'eval' => $sEval);
+            return array('content' => MsgBox(_t('_bx_invites_err_already_registed', bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')))), 'content_id' => $sFormId, 'eval' => $sEval);
         $iCountByEmail = $this->_oDb->getRequests(array('type' => 'count_by_email', 'value' => $sEmail));
         if ($iCountByEmail > 0)
             return array('content' => MsgBox(_t('_bx_invites_err_already_send')), 'content_id' => $sFormId, 'eval' => $sEval);
@@ -148,7 +148,7 @@ class BxInvTemplate extends BxBaseModGeneralTemplate
         $this->getModule()->onRequest($iId);
         $sRequestsEmail = $this->_oConfig->getRequestsEmail();
         if(!empty($sRequestsEmail)) {
-            $sManageUrl = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_REQUESTS']);
+            $sManageUrl = bx_absolute_url($oPermalink->permalink($CNF['URL_REQUESTS']));
 
             $aMessage = BxDolEmailTemplates::getInstance()->parseTemplate('bx_invites_request_form_message', array(
                 'sender_name' => bx_process_output($oForm->getCleanValue('name')),

+ 1 - 1
modules/boonex/market/classes/BxMarketGridLicensesAdministration.php

@@ -62,7 +62,7 @@ class BxMarketGridLicensesAdministration extends BxTemplGrid
     {
     	$CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW_ENTRY'] . $aRow['product_id']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_VIEW_ENTRY'] . $aRow['product_id']));
 
         $mixedValue = $this->_oTemplate->parseHtmlByName('product_link.html', array(
             'href' => $sUrl,

+ 5 - 5
modules/boonex/market/classes/BxMarketModule.php

@@ -759,8 +759,8 @@ class BxMarketModule extends BxBaseModTextModule
         $oPermalink = BxDolPermalinks::getInstance();
 
         $aResult = $this->_aModule;
-        $aResult['url_browse_order_common'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_LICENSES_COMMON'], array('filter' => '{order}'));
-        $aResult['url_browse_order_administration'] = BX_DOL_URL_ROOT . $oPermalink->permalink($CNF['URL_LICENSES_ADMINISTRATION'], array('filter' => '{order}'));
+        $aResult['url_browse_order_common'] = bx_absolute_url($oPermalink->permalink($CNF['URL_LICENSES_COMMON'], array('filter' => '{order}')));
+        $aResult['url_browse_order_administration'] = bx_absolute_url($oPermalink->permalink($CNF['URL_LICENSES_ADMINISTRATION'], array('filter' => '{order}')));
 
         return $aResult;
     }
@@ -804,7 +804,7 @@ class BxMarketModule extends BxBaseModTextModule
             'name' => $aItem[$CNF['FIELD_NAME']],
             'title' => $aItem[$CNF['FIELD_TITLE']],
             'description' => $aItem[$CNF['FIELD_TEXT']],
-            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aItem[$CNF['FIELD_ID']]),
+            'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aItem[$CNF['FIELD_ID']])),
             'price_single' => $aItem[$CNF['FIELD_PRICE_SINGLE']],
             'price_recurring' => $aItem[$CNF['FIELD_PRICE_RECURRING']],
             'period_recurring' => 1,
@@ -849,7 +849,7 @@ class BxMarketModule extends BxBaseModTextModule
                 'name' => $aItem[$CNF['FIELD_NAME']],
                 'title' => $aItem[$CNF['FIELD_TITLE']],
                 'description' => $aItem[$CNF['FIELD_TEXT']],
-                'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aItem[$CNF['FIELD_ID']]),
+                'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aItem[$CNF['FIELD_ID']])),
                 'price_single' => $aItem[$CNF['FIELD_PRICE_SINGLE']],
                 'price_recurring' => $aItem[$CNF['FIELD_PRICE_RECURRING']],
                 'period_recurring' => 1,
@@ -1106,7 +1106,7 @@ class BxMarketModule extends BxBaseModTextModule
         sendMailTemplate($CNF['ETEMPLATE_PURCHASED'], 0, $iClientId, array(
             'client_name' => $oClient->getDisplayName(),
             'product_name' => $aProduct[$CNF['FIELD_TITLE']],
-            'product_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aProduct[$CNF['FIELD_ID']]),
+            'product_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=view-product&id=' . $aProduct[$CNF['FIELD_ID']])),
             'vendor_url' => $sSellerUrl,
             'vendor_name' => $sSellerName,
             'license' => $sLicense,

+ 1 - 1
modules/boonex/market/classes/BxMarketTemplate.php

@@ -202,7 +202,7 @@ class BxMarketTemplate extends BxBaseModTextTemplate
         }
 
         //--- Main Info
-        $sUrl = BX_DOL_URL_ROOT . $oPermalinks->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url($oPermalinks->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aData[$CNF['FIELD_ID']]));
         $sLinkMore = ' <a title="' . bx_html_attribute(_t('_sys_read_more', $aData[$CNF['FIELD_TITLE']])) . '" href="' . $sUrl . '"><i class="sys-icon ellipsis-h"></i></a>';
         $sSummary = strmaxtextlen($aData[$CNF['FIELD_TEXT']], (int)getParam($CNF['PARAM_CHARS_SUMMARY']), $sLinkMore);
         $sSummaryPlain = BxTemplFunctions::getInstance()->getStringWithLimitedLength(strip_tags($sSummary), (int)getParam($CNF['PARAM_CHARS_SUMMARY_PLAIN']));

+ 3 - 3
modules/boonex/massmailer/classes/BxMassMailerGridCampaigns.php

@@ -152,7 +152,7 @@ class BxMassMailerGridCampaigns extends BxTemplGrid
     protected function _getActionAdd ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_CAMPAIGN']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_CAMPAIGN']));
 
         unset($a['attr']['bx_grid_action_independent']);
         $a['attr'] = array_merge($a['attr'], array(
@@ -169,7 +169,7 @@ class BxMassMailerGridCampaigns extends BxTemplGrid
 
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_CAMPAIGN'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_EDIT_CAMPAIGN'] . '&id=' . $aRow[$CNF['FIELD_ID']]));
 
         $a['attr'] = array_merge($a['attr'], array(
             "onclick" => "window.open('" . $sUrl . "','_self');"
@@ -185,7 +185,7 @@ class BxMassMailerGridCampaigns extends BxTemplGrid
         
         $CNF = &$this->_oModule->_oConfig->CNF;
         
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_CAMPAIGN'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_CAMPAIGN'] . '&id=' . $aRow[$CNF['FIELD_ID']]));
 
         unset($a['attr']['bx_grid_action_independent']);
         $a['attr'] = array_merge($a['attr'], array(

+ 1 - 1
modules/boonex/massmailer/classes/BxMassMailerTemplate.php

@@ -160,7 +160,7 @@ class BxMassMailerTemplate extends BxBaseModGeneralTemplate
         ));
 
         return $this->parseHtmlByName('breadcrumb.html', array(
-            'url_home' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE_CAMPAIGNS']),
+            'url_home' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_MANAGE_CAMPAIGNS'])),
             'icon_home' => $CNF['ICON'],
             'bx_repeat:items' => $aTmplVarsItems
         ));

+ 1 - 1
modules/boonex/notifications/classes/BxNtfsConfig.php

@@ -198,7 +198,7 @@ class BxNtfsConfig extends BxBaseModNotificationsConfig
      */
     public function getViewUrl()
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=notifications-view');
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=notifications-view'));
     }
 
     public function getContentModule(&$aEvent)

+ 1 - 1
modules/boonex/notifications/classes/BxNtfsModule.php

@@ -425,7 +425,7 @@ class BxNtfsModule extends BxBaseModNotificationsModule
 
         $oSubmenuSystem->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU'], array (
             'title' => _t('_bx_ntfs'),
-            'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']),
+            'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME'])),
             'icon' => '',
         ));
 

+ 1 - 1
modules/boonex/payment/classes/BxPaymentDetails.php

@@ -71,7 +71,7 @@ class BxPaymentDetails extends BxBaseModPaymentDetails
                     $this->_oModule->_oDb->updateOption($iProfileId, $aOption['id'], bx_process_input($sValue));
                 }
 
-                header('Location: ' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=payment-details'));
+                header('Location: ' . bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=payment-details')));
                 return;
             }
             else

+ 1 - 1
modules/boonex/quoteofday/classes/BxQuoteOfDayStudioPage.php

@@ -17,7 +17,7 @@ class BxQuoteOfDayStudioPage extends BxTemplStudioModule
     {
         parent::__construct($sModule, $mixedPageName, $sPage);
 
-        $this->aMenuItems[BX_DOL_STUDIO_MOD_TYPE_QUOTES] = array('name' => BX_DOL_STUDIO_MOD_TYPE_QUOTES , 'icon' => 'bars', 'title' => '_bx_quoteofday_lmi_cpt_quotes', 'link' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=quoteofday-manage'));
+        $this->aMenuItems[BX_DOL_STUDIO_MOD_TYPE_QUOTES] = array('name' => BX_DOL_STUDIO_MOD_TYPE_QUOTES , 'icon' => 'bars', 'title' => '_bx_quoteofday_lmi_cpt_quotes', 'link' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=quoteofday-manage')));
     }
 }
 

+ 1 - 1
modules/boonex/reviews/classes/BxReviewsTemplate.php

@@ -190,7 +190,7 @@ class BxReviewsTemplate extends BxBaseModTextTemplate
     public function browseReviewedContent() {
         $CNF = &$this->_oConfig->CNF;
 
-        $sPageUrl = BX_DOL_URL_ROOT.BxDolPermalinks::getInstance()->permalink('page.php?i='.bx_get('i'));
+        $sPageUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i='.bx_get('i')));
 
         $sOrderBy = bx_get('order_by');
         if ($sOrderBy != 'avg_rating' && $sOrderBy != 'reviews_num') $sOrderBy = 'avg_rating';

+ 1 - 1
modules/boonex/shopify/classes/BxShopifyModule.php

@@ -157,7 +157,7 @@ class BxShopifyModule extends BxBaseModTextModule
 
     	$aSettings = $this->_oDb->getSettings(array('type' => 'author', 'author' => $this->_iProfileId));
         if(empty($aSettings) || !is_array($aSettings))
-    		return MsgBox(_t('_bx_shopify_err_not_configured', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_SETTINGS'])));
+    		return MsgBox(_t('_bx_shopify_err_not_configured', bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_SETTINGS']))));
 
     	return parent::serviceEntityCreate($sDisplay);
     }

+ 1 - 1
modules/boonex/snipcart/classes/BxSnipcartConfig.php

@@ -176,7 +176,7 @@ class BxSnipcartConfig extends BxBaseModTextConfig
 
     public function getViewUrl($iContentId)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_ENTRY'] . '&id=' . $iContentId));
     }
 
     public function getApiKey($aSettings)

+ 1 - 1
modules/boonex/snipcart/classes/BxSnipcartModule.php

@@ -117,7 +117,7 @@ class BxSnipcartModule extends BxBaseModTextModule
 
     	$aSettings = $this->_oDb->getSettings(array('type' => 'author', 'author' => $this->_iProfileId));
         if(empty($aSettings) || !is_array($aSettings))
-    		return MsgBox(_t('_bx_snipcart_err_not_configured', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($CNF['URL_SETTINGS'])));
+    		return MsgBox(_t('_bx_snipcart_err_not_configured', bx_absolute_url(BxDolPermalinks::getInstance()->permalink($CNF['URL_SETTINGS']))));
 
     	return parent::serviceEntityCreate($sDisplay);
     }

+ 1 - 1
modules/boonex/stream/classes/BxStrmGridRecordings.php

@@ -158,7 +158,7 @@ class BxStrmGridRecordings extends BxTemplGrid
             return false;
         }
 
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_ADD_ENTRY']);
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_ADD_ENTRY']));
     }
 
     protected function _actionWithStorage($iFileId)

+ 1 - 1
modules/boonex/stream/classes/BxStrmModule.php

@@ -192,7 +192,7 @@ class BxStrmModule extends BxBaseModTextModule
 
         if ($this->getStreamEngine()->isSreamFromBrowser()) {
             $sUrl = 'page.php?i=broadcast-stream&id=' . (int)$iContentId;
-            $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sUrl);
+            $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sUrl));
             $aForm['inputs']['header_div'] = array (
                 'type' => 'custom',
                 'content' => _t('_bx_stream_manual_settings_or_stream_from_webcam'),

+ 1 - 1
modules/boonex/stream/classes/BxStrmTemplate.php

@@ -57,7 +57,7 @@ class BxStrmTemplate extends BxBaseModTextTemplate
         $CNF = &$this->getModule()->_oConfig->CNF;
 
         $sUrlViewStream = 'page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . (int)$aContentInfo['id'];
-        $sUrlViewStream = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sUrlViewStream);
+        $sUrlViewStream = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sUrlViewStream));
         $sUrlEmbed = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'embed/' . (int)$aContentInfo['id'];
 
         $aForm = array(

+ 1 - 1
modules/boonex/tasks/classes/BxTasksDb.php

@@ -121,7 +121,7 @@ class BxTasksDb extends BxBaseModTextDb
                 $a[$k]['end'] = $oEnd ? $oEnd->format('c') : 0;
                 $a[$k]['start_utc'] = $oStart ? $oStart->getTimestamp() : 0;
                 $a[$k]['end_utc'] = $oEnd ? $oEnd->getTimestamp() : 0;
-                $a[$k]['url'] = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']);
+                $a[$k]['url'] = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']));
             }
 
             // merge with all other events

+ 1 - 1
modules/boonex/tasks/classes/BxTasksModule.php

@@ -555,7 +555,7 @@ class BxTasksModule extends BxBaseModTextModule implements iBxDolCalendarService
 					'due' => $aTask[$CNF['FIELD_DUEDATE']] > 0 ? bx_time_js($aTask[$CNF['FIELD_DUEDATE']]) : '',
 					'bx_repeat:members' => $aMembersVars,
 					'badges' => $this->serviceGetBadges($aTask[$CNF['FIELD_ID']], true),
-					'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aTask[$CNF['FIELD_ID']]),
+					'url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aTask[$CNF['FIELD_ID']])),
 					'object' => $this->_oConfig->getJsObject('tasks'),
                     'bx_if:allow_manage' => array(
 				        'condition' => $bAllowManage,

+ 6 - 7
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -819,21 +819,20 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
 
     public function getViewUrl($iOwnerId, $bAbsolute = true)
     {
-        return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_LIST'], [
-            'id' => $iOwnerId
-        ]);
+        $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_LIST'], ['id' => $iOwnerId]);
+        return $bAbsolute ? bx_absolute_url($sUrl) : $sUrl;
     }
 
     public function getHomeViewUrl($bAbsolute = true)
     {
-        return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink($this->CNF['URL_HOME']);
+        $sUrl = BxDolPermalinks::getInstance()->permalink($this->CNF['URL_HOME']);
+        return $bAbsolute ? bx_absolute_url($sUrl) : $sUrl;
     }
 
     public function getItemViewUrl($aEvent, $bAbsolute = true)
     {
-        return ($bAbsolute ? BX_DOL_URL_ROOT : '') . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_ENTRY'], [
-            'id' => $aEvent['id']
-        ]);
+        $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=' . $this->CNF['URI_VIEW_ENTRY'], ['id' => $aEvent['id']]);
+        return $bAbsolute ? bx_absolute_url($sUrl) : $sUrl;
     }
 
     public function getLiveUpdateKey($aParams)

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -4955,7 +4955,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
     	$CNF = &$this->_oConfig->CNF;
 
         $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
-    	$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iId);
+    	$sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $iId));
 
         $sText = ''; 
         if(isset($aContentInfo['content'])){

+ 1 - 1
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -462,7 +462,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(isset($_SERVER['HTTP_REFERER']) && mb_stripos($_SERVER['HTTP_REFERER'], BX_DOL_URL_ROOT) === 0)
             $sReferrer = $_SERVER['HTTP_REFERER'];
         else 
-            $sReferrer = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_HOME']);
+            $sReferrer = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($this->_oConfig->CNF['URL_HOME']));
 
         $sJsObject = $this->_oConfig->getJsObjectView($aBrowseParams);
         return array('content' => $this->parseHtmlByName('block_item.html', array(

+ 1 - 1
studio/template/scripts/BxBaseStudioBuilderPage.php

@@ -1907,7 +1907,7 @@ class BxBaseStudioBuilderPage extends BxDolStudioBuilderPage
 
         return array(
             'js_object' => $sJsObject,
-            'url_view' => BX_DOL_URL_ROOT . $oPermalinks->permalink($this->aPageRebuild['url']),
+            'url_view' => bx_absolute_url($oPermalinks->permalink($this->aPageRebuild['url'])),
             'action_page_edit' => $this->sActionPageEdit,
             'bx_if:can_delete' => array(
                 'condition' => (int)$this->aPageRebuild['deletable'] == 1,

+ 1 - 1
studio/template/scripts/BxBaseStudioFunctions.php

@@ -44,7 +44,7 @@ class BxBaseStudioFunctions extends BxBaseFunctions implements iBxDolSingleton
             'csrf_token' => BxDolForm::getCsrfToken(),
             'relocate_url' => bx_html_attribute($sUrlRelocate),
             'action_url' => BX_DOL_URL_ROOT . 'member.php',
-            'forgot_password_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'),
+            'forgot_password_url' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')),
         ));
         $sHtml = $oTemplate->parseHtmlByName('login.html', array (
             'form' => $this->transBox('bx-std-login-form-box', $sHtml, true),

+ 1 - 1
template/scripts/BxBaseAccountForms.php

@@ -49,7 +49,7 @@ class BxBaseAccountForms extends BxDolProfileForms
         if (!$oForm)
             return MsgBox(_t('_sys_txt_error_occured'));
 
-        $oForm->aFormAttrs['action'] = !empty($aParams['action']) ? $aParams['action'] : BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account');
+        $oForm->aFormAttrs['action'] = !empty($aParams['action']) ? $aParams['action'] : bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'));
         $oForm->initChecker(self::$PROFILE_FIELDS);
 
         bx_alert('account', 'add_form_check', 0, 0, array(

+ 1 - 1
template/scripts/BxBaseCmtsGridAdministration.php

@@ -189,7 +189,7 @@ class BxBaseCmtsGridAdministration extends BxDolCmtsGridAdministration
             return '';
 
         $sLink = $oModuleAccounts->_oConfig->CNF['URL_MANAGE_' . $sTypeUpc];
-        $sLink = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sLink);
+        $sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sLink));
         if(!empty($sFilter))
             $sLink = bx_append_url_params($sLink, array('filter' => $sFilter));
 

+ 2 - 2
template/scripts/BxBaseFormAccount.php

@@ -93,7 +93,7 @@ class BxFormAccountCheckerHelper extends BxDolFormCheckerHelper
             return BxDolAccountQuery::getInstance()->getIdByEmail($s) ? _t('_sys_form_account_input_email_uniq_error_loggedin') : true;
         }
 
-        return BxDolAccountQuery::getInstance()->getIdByEmail($s) ? _t('_sys_form_account_input_email_uniq_error', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')) : true;
+        return BxDolAccountQuery::getInstance()->getIdByEmail($s) ? _t('_sys_form_account_input_email_uniq_error', bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'))) : true;
     }
 }
 
@@ -204,7 +204,7 @@ class BxBaseFormAccount extends BxTemplFormView
 	protected function genCustomInputAgreement ($aInput)
     {
     	$oPermalink = BxDolPermalinks::getInstance();
-        return '<div>' . _t('_sys_form_account_input_agreement_value', BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=terms'), BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=privacy')) . '</div>';
+        return '<div>' . _t('_sys_form_account_input_agreement_value', bx_absolute_url($oPermalink->permalink('page.php?i=terms')), bx_absolute_url($oPermalink->permalink('page.php?i=privacy'))) . '</div>';
     }
     
     protected function _setCustomError ($s)

+ 1 - 1
template/scripts/BxBaseFormConfirmPhone.php

@@ -39,7 +39,7 @@ class BxFormConfirmPhoneCheckerHelper extends BxDolFormCheckerHelper
         }
         
         $oSession = BxDolSession::getInstance();
-        return $oSession->getValue(BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE) != $s ? _t('_sys_form_confirm_phone_input_code_error_invalid', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=confirm-phone') . '?step=1') : true;
+        return $oSession->getValue(BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE) != $s ? _t('_sys_form_confirm_phone_input_code_error_invalid', bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=confirm-phone')) . '?step=1') : true;
     }
 }
 

+ 2 - 2
template/scripts/BxBaseFormLogin.php

@@ -37,7 +37,7 @@ class BxFormLoginCheckerHelper extends BxDolFormCheckerHelper
         }
        
         $oSession = BxDolSession::getInstance();
-        return $oSession->getValue(BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE) != $s ? _t('_sys_form_login_input_code_error_invalid', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login-step2')) : true;          
+        return $oSession->getValue(BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE) != $s ? _t('_sys_form_login_input_code_error_invalid', bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=login-step2'))) : true;          
     }   
 }
 
@@ -99,7 +99,7 @@ class BxBaseFormLogin extends BxTemplFormView
 
     protected function genCustomInputSubmitText ($aInput)
     {
-        return '<div><a href="' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password') . '">' . _t("_sys_txt_forgot_pasword") . '</a></div>';
+        return '<div><a href="' . bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')) . '">' . _t("_sys_txt_forgot_pasword") . '</a></div>';
     }
 
     public function getRole()

+ 3 - 3
template/scripts/BxBasePageHome.php

@@ -24,7 +24,7 @@ class BxBasePageHome extends BxTemplPage
 
         BxDolCover::getInstance()->set(array(
             'class' => 'bx-cover-homepage',
-            'title' => _t('_sys_txt_homepage_cover', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')),
+            'title' => _t('_sys_txt_homepage_cover', bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'))),
             'bx_if:empty_cover_class' => array (
                 'condition' => !$bTmplVarsCover,
                 'content' => array(),
@@ -65,10 +65,10 @@ class BxBasePageHome extends BxTemplPage
             $oTemplate = BxDolTemplate::getInstance();
             $oTemplate->addJs(array('lottie.min.js'));
             $aBlock['content'] = $oTemplate->parseHtmlByContent($aBlock['content'], array(
-                'join_link' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=create-account'),
+                'join_link' => bx_absolute_url($oPermalink->permalink('page.php?i=create-account')),
                 'join_form' => $sJoinForm,
                 'join_form_in_box' => !empty($sJoinForm) ? DesignBoxContent(_t('_sys_txt_splash_join'), $sJoinForm, BX_DB_PADDING_DEF) : '',
-                'login_link' => BX_DOL_URL_ROOT . $oPermalink->permalink('page.php?i=login'),
+                'login_link' => bx_absolute_url($oPermalink->permalink('page.php?i=login')),
                 'login_form' => $sLoginForm,
                 'login_form_in_box' => !empty($sLoginForm) ? DesignBoxContent(_t('_sys_txt_splash_login'), $sLoginForm, BX_DB_PADDING_DEF) : '',
             ));

+ 1 - 1
template/scripts/BxBasePagesSearchResult.php

@@ -70,7 +70,7 @@ class BxBasePagesSearchResult extends BxTemplSearchResult
             if (isset($CNF['ICON']))
                 $sIcon = $CNF['ICON'];
         }
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($aData['url']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($aData['url']));
         
         $sTitle = _t($aData['title']);
         if (preg_match ('/{.*?}/', $sTitle))

+ 1 - 1
template/scripts/BxBaseReportsGrid.php

@@ -237,7 +237,7 @@ class BxBaseReportsGrid extends BxTemplGrid
     
     protected function _getActionAudit($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
-        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=dashboard-audit&module=' . $this->_aReportSystemInfo['module_name'] . '&content_id=' . $aRow['object_id']);
+        $sUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=dashboard-audit&module=' . $this->_aReportSystemInfo['module_name'] . '&content_id=' . $aRow['object_id']));
 
     	$a['attr'] = array_merge($a['attr'], array(
     		"onclick" => "window.open('" . $sUrl . "','_self');"

+ 2 - 2
template/scripts/BxBaseSearchResult.php

@@ -164,7 +164,7 @@ class BxBaseSearchResult extends BxDolSearchResult
             return false;
 
         $oPermalinks = BxDolPermalinks::getInstance();
-        return BX_DOL_URL_ROOT . bx_append_url_params($oPermalinks->permalink($this->aCurrent['rss']['link']), 'rss=1');
+        return bx_absolute_url(bx_append_url_params($oPermalinks->permalink($this->aCurrent['rss']['link']), 'rss=1'));
     }
 
     function showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName = 'entry', $bSelectAll = true, $bSelectAllChecked = false, $sCustomHtml = '')
@@ -251,7 +251,7 @@ class BxBaseSearchResult extends BxDolSearchResult
 
         $oPermalinks = BxDolPermalinks::getInstance();
 
-        $sUrlStart = BX_DOL_URL_ROOT . $oPermalinks->permalink($this->sBrowseUrl);
+        $sUrlStart = bx_absolute_url($oPermalinks->permalink($this->sBrowseUrl));
 
         return $this->addAdditionalUrlParams($sUrlStart, $aAdditionalParams, $bReplacePagesParams);
     }

+ 5 - 5
template/scripts/BxBaseServiceAccount.php

@@ -75,7 +75,7 @@ class BxBaseServiceAccount extends BxDol
 
         $aTmplVarsLogin = [];
         if(!isset($aParams['no_login_text']) || false === (bool)$aParams['no_login_text'])
-            $aTmplVarsLogin['url'] = BX_DOL_URL_ROOT . $oPemalink->permalink('page.php?i=login');
+            $aTmplVarsLogin['url'] = bx_absolute_url($oPemalink->permalink('page.php?i=login'));
         
         return BxDolTemplate::getInstance()->parseHtmlByName('block_join.html', [
             'bx_if:show_auth' => [
@@ -90,7 +90,7 @@ class BxBaseServiceAccount extends BxDol
                 'condition' => !empty($aTmplVarsLogin),
                 'content' => $aTmplVarsLogin
             ],
-            'agreement' => _t('_sys_form_account_input_agreement_value', BX_DOL_URL_ROOT . $oPemalink->permalink('page.php?i=terms'), BX_DOL_URL_ROOT . $oPemalink->permalink('page.php?i=privacy')),
+            'agreement' => _t('_sys_form_account_input_agreement_value', bx_absolute_url($oPemalink->permalink('page.php?i=terms')), bx_absolute_url($oPemalink->permalink('page.php?i=privacy'))),
         ]);
     }
 
@@ -281,7 +281,7 @@ class BxBaseServiceAccount extends BxDol
                     }
 
                     $oSession->setValue(BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE, $sActivationCode);
-                    header('Location: ' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=confirm-phone'));
+                    header('Location: ' . bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=confirm-phone')));
                 } 
                 return '<div class="bx-def-padding-sec-bottom">' . _t("_sys_txt_confirm_phone_set_phone_desc_set_phone") . '</div>' .$oForm->getCode();
             }
@@ -340,7 +340,7 @@ class BxBaseServiceAccount extends BxDol
         $oTemplate->setPageNameIndex (BX_PAGE_TRANSITION);
         $oTemplate->setPageHeader (_t('_sys_txt_confirm_email_success'));
         $oTemplate->setPageContent ('page_main_code', MsgBox(_t('_sys_txt_confirm_email_success')));
-        $oTemplate->setPageContent ('url_relocate', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sUrl));
+        $oTemplate->setPageContent ('url_relocate', bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sUrl)));
 
         BxDolTemplate::getInstance()->getPageCode();
         exit;
@@ -553,7 +553,7 @@ class BxBaseServiceAccount extends BxDol
 
         $oForm->initChecker();
         if($oForm->isSubmittedAndValid()) {
-            $sErrorUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password');
+            $sErrorUrl = bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password'));
 
             // check if key exists
             $oKey = BxDolKey::getInstance();

+ 4 - 4
template/scripts/BxBaseServiceLogin.php

@@ -173,7 +173,7 @@ class BxBaseServiceLogin extends BxDol
 
         $aTmplVarsJoin = [];
         if(strpos($sParams, 'no_join_text') === false)
-            $aTmplVarsJoin['url'] = BX_DOL_URL_ROOT . $oPemalink->permalink('page.php?i=create-account');
+            $aTmplVarsJoin['url'] = bx_absolute_url($oPemalink->permalink('page.php?i=create-account'));
 
         $oTemplate = BxDolTemplate::getInstance();
         $oTemplate->addJs(array('jquery.form.min.js'));        
@@ -192,7 +192,7 @@ class BxBaseServiceLogin extends BxDol
                 'condition' => !empty($aTmplVarsJoin),
                 'content' => $aTmplVarsJoin
             ],
-            'agreement' => _t('_sys_form_login_input_agreement_value', BX_DOL_URL_ROOT . $oPemalink->permalink('page.php?i=terms'), BX_DOL_URL_ROOT . $oPemalink->permalink('page.php?i=privacy')),
+            'agreement' => _t('_sys_form_login_input_agreement_value', bx_absolute_url($oPemalink->permalink('page.php?i=terms')), bx_absolute_url($oPemalink->permalink('page.php?i=privacy'))),
             'bx_if:show_js_code' => [
                 'condition' => strpos($sParams, 'ajax_form') !== false,
                 'content' => []
@@ -238,7 +238,7 @@ class BxBaseServiceLogin extends BxDol
             }
             $oSession = BxDolSession::getInstance();
             $oSession->setValue(BX_ACCOUNT_SESSION_KEY_FOR_PHONE_ACTIVATEION_CODE, $sActivationCode);
-            header('Location: ' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login-step3'));
+            header('Location: ' . bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=login-step3')));
         }
         return '<div class="bx-def-padding-sec-bottom">' . _t("_sys_txt_login_2fa_description") . '</div>' .$oForm->getCode();
     }
@@ -251,7 +251,7 @@ class BxBaseServiceLogin extends BxDol
         }
         
         $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login_step3');
-        $oForm->aInputs['back']['caption'] = _t( $oForm->aInputs['back']['caption_src'], BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=login-step2'));
+        $oForm->aInputs['back']['caption'] = _t( $oForm->aInputs['back']['caption_src'], bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=login-step2')));
         $oForm->aFormAttrs['action'] = '';
         $oForm->initChecker();
         

+ 1 - 1
template/scripts/BxBaseServices.php

@@ -504,7 +504,7 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
 
     public function serviceProfileEditUrl ($iContentId)
     {
-        return BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=account-settings-info');
+        return bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=account-settings-info'));
     }
 
     public function serviceProfileThumb ($iContentId)