-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
9e8fda8
commit e1f343d
Showing
15 changed files
with
2,805 additions
and
2,338 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Как правильно мигрировать с версии на версию | ||
|
||
* В папке нужной кодировке нужно запустить нужный файл версии (на которую вы хотите мигрировать). | ||
* если вы ставите модуль с нуля, то запускать файлы не нужно | ||
* если вы мигрируете на несколько версий вперед, то нужно запустить все файлы поочередно от старой к новой | ||
* Например у вас версия 1.0.1. Нужно мигрировать на 1.3.7, то вы запускаете `1.2.0 -> 1.2.1 -> 1.3.7` | ||
* После выполнении вы должны увидеть "DONE", если что-то иное, то миграция не применилась и нужно написать в техподдержку |
1,604 changes: 863 additions & 741 deletions
1,604
utf8/dev2fun.opengraph/admin/dev2fun_settings.php
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/** | ||
* @author dev2fun <darkfriend> | ||
* @copyright (c) 2019, darkfriend <[email protected]> | ||
* @version 1.3.6 | ||
* @version 1.3.7 | ||
*/ | ||
|
||
namespace Dev2fun\Module; | ||
|
@@ -16,7 +16,6 @@ | |
|
||
class OpenGraph | ||
{ | ||
|
||
public $lastError; | ||
private static $instance; | ||
private static $_type; | ||
|
@@ -745,6 +744,11 @@ public function setPropertyDefault($ogData) | |
} | ||
} | ||
break; | ||
case 'og:image:secure_url' : | ||
if (!empty($ogData['image'])) { | ||
$ogValue = $ogData['image']; | ||
} | ||
break; | ||
case 'og:type' : | ||
$ogValue = 'website'; | ||
break; | ||
|
@@ -894,9 +898,43 @@ public function getParam($key, $default = '') | |
return empty($this->params[$key]) ? $default : $this->params[$key]; | ||
} | ||
|
||
/** | ||
* Get option from params | ||
* @param string $key | ||
* @param mixed $default | ||
* @return mixed | ||
*/ | ||
public function getOptionByParams($key, $default = '') | ||
{ | ||
$options = $this->getOptionsByParams(); | ||
return empty($options[$key]) ? $default : $options[$key]; | ||
} | ||
|
||
/** | ||
* Get options from params | ||
* @return array | ||
*/ | ||
public function getOptionsByParams() | ||
{ | ||
return $this->getParam('options', []); | ||
} | ||
|
||
public function getDefaultByField($fieldKey, $default = '') | ||
{ | ||
$defaultFields = $this->getParam('default', []); | ||
return empty($defaultFields[$fieldKey]) ? $default : $defaultFields[$fieldKey]; | ||
} | ||
|
||
/** | ||
* @param array $fields | ||
* @return array | ||
*/ | ||
public function prepareOpenGraphFields($fields) | ||
{ | ||
if(in_array('og:image',$fields) && \CMain::IsHTTPS()) { | ||
$fields[] = 'og:image:secure_url'; | ||
} | ||
|
||
return $fields; | ||
} | ||
} |
Oops, something went wrong.