b985b251 by Yokihito Oki

twittercard修正

1 parent f68d82c9
......@@ -36,14 +36,12 @@ class PlgContentTweetcards extends JPlugin
$twitteraccount = $this->params->get('twitteraccount', '@htmgarcia');
$type = $this->params->get('type', 'summary');
if ($context == 'com_content.article') {
// Load twitter meta tags
// カテゴリページも追加
if ($context == 'com_content.article' || $context == 'com_content.category') {
$this->setMetadata (
$this->setMetatitle(
$row->metadata,
$row->title
$row->title == 'home' ? '鹿屋体育大学' : $row->title
),
$this->setImage(
$row->images,
......@@ -51,7 +49,7 @@ class PlgContentTweetcards extends JPlugin
),
$this->setMetadesc(
$row->metadesc,
$row->text
$row->title == 'home' ? '' : $row->text
),
$twitteraccount,
$type
......@@ -88,10 +86,11 @@ class PlgContentTweetcards extends JPlugin
preg_match_all('|<img.*?src=[\'"](.*?)[\'"].*?>|i', $text, $matches);
if ( !empty($fullImage->image_fulltext) ) {
$image = JURI::base() . $fullImage->image_fulltext;
} elseif( !empty($matches[ 1 ][ 0 ]) ) {
$image = $matches[ 1 ][ 0 ];
$image = str_replace(JURI::base(), '', $image);
$image = JURI::base() . $image;
// 本文中の画像の自動選択をOFF
// } elseif( !empty($matches[ 1 ][ 0 ]) ) {
// $image = $matches[ 1 ][ 0 ];
// $image = str_replace(JURI::base(), '', $image);
// $image = JURI::base() . $image;
} else {
$image = '';
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!