OG и чистый текст - добавил вырезание ссылок на точки
This commit is contained in:
parent
a08f5ca858
commit
5f5750c834
|
|
@ -114,7 +114,7 @@ class Helper
|
||||||
$og = array();
|
$og = array();
|
||||||
$og['title'] = str_replace('"', 'ʺ', $point->name) . ' [wikipoints.ru]';
|
$og['title'] = str_replace('"', 'ʺ', $point->name) . ' [wikipoints.ru]';
|
||||||
$point->description = str_replace('"', 'ʺ', $point->description);
|
$point->description = str_replace('"', 'ʺ', $point->description);
|
||||||
$og['description'] = mb_substr($point->description, 0, 97, 'UTF-8') . '...';
|
$og['description'] = mb_substr($point->description, 0, 99, 'UTF-8') . '…';
|
||||||
$og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!';
|
$og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!';
|
||||||
$og['type'] = 'website';
|
$og['type'] = 'website';
|
||||||
$og['url'] = 'http://wikipoints.ru/?point=' . $point->id;
|
$og['url'] = 'http://wikipoints.ru/?point=' . $point->id;
|
||||||
|
|
@ -128,7 +128,7 @@ class Helper
|
||||||
$og = array();
|
$og = array();
|
||||||
$og['title'] = str_replace('"', 'ʺ', $article->title) . ' [wikipoints.ru]';
|
$og['title'] = str_replace('"', 'ʺ', $article->title) . ' [wikipoints.ru]';
|
||||||
$article->text = Markdown::getClear(str_replace('"', 'ʺ', $article->text));
|
$article->text = Markdown::getClear(str_replace('"', 'ʺ', $article->text));
|
||||||
$og['description'] = mb_substr($article->text, 0, 97, 'UTF-8') . '...';
|
$og['description'] = mb_substr($article->text, 0, 99, 'UTF-8') . '…';
|
||||||
$og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!';
|
$og['site_name'] = 'WikiPoints: Лучшие выходные - это выходные в путешествии!';
|
||||||
$og['type'] = 'website';
|
$og['type'] = 'website';
|
||||||
$og['url'] = 'http://wikipoints.ru/page/article/id/' . $article->id;
|
$og['url'] = 'http://wikipoints.ru/page/article/id/' . $article->id;
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,11 @@ class Markdown
|
||||||
$rep = '';
|
$rep = '';
|
||||||
$string = preg_replace($pr, $rep, $string);
|
$string = preg_replace($pr, $rep, $string);
|
||||||
|
|
||||||
|
// Points
|
||||||
|
$pr = '((\[#(\d+)[>\|](.*?)\])|(\[#(\d+)\]))';
|
||||||
|
$rep = ' ';
|
||||||
|
$string = preg_replace($pr, $rep, $string);
|
||||||
|
|
||||||
// multi-space
|
// multi-space
|
||||||
$pr = '(\s{2,})';
|
$pr = '(\s{2,})';
|
||||||
$rep = ' ';
|
$rep = ' ';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue