Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Yokihito Oki
/
kanoya-univercity-prod
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b985b251
authored
2021-01-31 11:58:01 +0900
by
Yokihito Oki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
twittercard修正
1 parent
f68d82c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
plugins/content/tweetcards/tweetcards.php
plugins/content/tweetcards/tweetcards.php
View file @
b985b25
...
...
@@ -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
->
t
itle
==
'home'
?
''
:
$row
->
t
ext
),
$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
=
''
;
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment