-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
459909c
commit 7b64797
Showing
6 changed files
with
54 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: darkfriend <[email protected]> | ||
* Date: 09.01.2018 | ||
* Time: 23:46 | ||
* Class for SEO | ||
* @author darkfriend <[email protected]> | ||
* @version 0.1.31 | ||
*/ | ||
|
||
namespace Dev2fun\MultiDomain; | ||
|
@@ -30,9 +29,15 @@ public static function getInstance() { | |
public function show($hlId) { | ||
global $APPLICATION; | ||
if(!$hlId) return false; | ||
|
||
$seoData = $this->getDomain($hlId); | ||
if(!$seoData) return false; | ||
$APPLICATION->SetTitle($seoData['UF_TITLE']); | ||
|
||
$APPLICATION->SetPageProperty('title',$seoData['UF_TITLE']); | ||
|
||
// if(!empty($seoData['UF_H1'])) { | ||
// $APPLICATION->SetTitle($seoData['UF_H1']); | ||
// } | ||
if(!empty($seoData['UF_DESCRIPTION'])) { | ||
$APPLICATION->SetPageProperty('description',$seoData['UF_DESCRIPTION']); | ||
} | ||
|
@@ -46,6 +51,7 @@ public function getDomain($hlId,$host=false,$path=false) { | |
$curUrl = $this->getUrl(); | ||
if(!$host) $host = $curUrl['host']; | ||
if(!$path) $path = $curUrl['path']; | ||
|
||
$domain = $this->getQuery($hlId,$host,$path); | ||
return $domain; | ||
} | ||
|
@@ -65,6 +71,7 @@ private function getQuery($hlId,$host,$path) { | |
'UF_DOMAIN' => $host, | ||
'UF_PATH' => $path, | ||
]); | ||
|
||
return (empty($el[0])?false:$el[0]); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
$arModuleVersion = array( | ||
"VERSION" => "0.1.30", | ||
"VERSION_DATE" => "2019-02-28 10:00:00", | ||
"VERSION" => "0.1.31", | ||
"VERSION_DATE" => "2019-03-04 10:00:00", | ||
); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: darkfriend <[email protected]> | ||
* Date: 09.01.2018 | ||
* Time: 23:46 | ||
* Class for SEO | ||
* @author darkfriend <[email protected]> | ||
* @version 0.1.31 | ||
*/ | ||
|
||
namespace Dev2fun\MultiDomain; | ||
|
@@ -30,9 +29,15 @@ public static function getInstance() { | |
public function show($hlId) { | ||
global $APPLICATION; | ||
if(!$hlId) return false; | ||
|
||
$seoData = $this->getDomain($hlId); | ||
if(!$seoData) return false; | ||
$APPLICATION->SetTitle($seoData['UF_TITLE']); | ||
|
||
$APPLICATION->SetPageProperty('title',$seoData['UF_TITLE']); | ||
|
||
// if(!empty($seoData['UF_H1'])) { | ||
// $APPLICATION->SetTitle($seoData['UF_H1']); | ||
// } | ||
if(!empty($seoData['UF_DESCRIPTION'])) { | ||
$APPLICATION->SetPageProperty('description',$seoData['UF_DESCRIPTION']); | ||
} | ||
|
@@ -46,6 +51,7 @@ public function getDomain($hlId,$host=false,$path=false) { | |
$curUrl = $this->getUrl(); | ||
if(!$host) $host = $curUrl['host']; | ||
if(!$path) $path = $curUrl['path']; | ||
|
||
$domain = $this->getQuery($hlId,$host,$path); | ||
return $domain; | ||
} | ||
|
@@ -65,6 +71,7 @@ private function getQuery($hlId,$host,$path) { | |
'UF_DOMAIN' => $host, | ||
'UF_PATH' => $path, | ||
]); | ||
|
||
return (empty($el[0])?false:$el[0]); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
$arModuleVersion = array( | ||
"VERSION" => "0.1.30", | ||
"VERSION_DATE" => "2019-02-28 10:00:00", | ||
"VERSION" => "0.1.31", | ||
"VERSION_DATE" => "2019-03-04 10:00:00", | ||
); | ||
?> |