twittercard修正
Showing
1 changed file
with
9 additions
and
10 deletions
... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment