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
e157d5f2
authored
2021-03-03 12:10:43 +0900
by
Yokihito Oki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
twittercards setImage修正
1 parent
409ad2ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
plugins/content/tweetcards/tweetcards.php
plugins/content/tweetcards/tweetcards.php
View file @
e157d5f
...
...
@@ -45,7 +45,9 @@ class PlgContentTweetcards extends JPlugin
),
$this
->
setImage
(
$row
->
images
,
$row
->
text
$row
->
text
,
$context
,
$row
->
category_alias
),
$this
->
setMetadesc
(
$row
->
metadesc
,
...
...
@@ -81,16 +83,16 @@ class PlgContentTweetcards extends JPlugin
*
* @since 0.0.1
*/
protected
function
setImage
(
$images
,
$text
)
{
protected
function
setImage
(
$images
,
$text
,
$context
,
$category_alias
)
{
$fullImage
=
json_decode
(
$images
);
preg_match_all
(
'|<img.*?src=[\'"](.*?)[\'"].*?>|i'
,
$text
,
$matches
);
if
(
!
empty
(
$fullImage
->
image_fulltext
)
)
{
$image
=
JURI
::
base
()
.
$fullImage
->
image_fulltext
;
// 本文中の画像の自動選択を
OFF
// } elseif(
!empty($matches[ 1 ][ 0 ]) ) {
//
$image = $matches[ 1 ][ 0 ];
//
$image = str_replace(JURI::base(), '', $image);
//
$image = JURI::base() . $image;
// 本文中の画像の自動選択を
カテゴリ:インフォメーションのみ有効化
}
elseif
(
$category_alias
==
'target-info'
&&
$context
==
'com_content.article'
&&
!
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