b985b251 by Yokihito Oki

twittercard修正

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