Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Minds
Minds
Commits
8e76694f
Commit
8e76694f
authored
Dec 28, 2016
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): blogs now use common storage engine
parent
d08082dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
plugins/blog/api/v1/blog.php
plugins/blog/api/v1/blog.php
+14
-12
plugins/blog/api/v1/header.php
plugins/blog/api/v1/header.php
+2
-1
No files found.
plugins/blog/api/v1/blog.php
View file @
8e76694f
...
...
@@ -132,18 +132,20 @@ class blog implements Interfaces\Api
case
"header"
:
$blog
=
new
entities\Blog
(
$pages
[
1
]);
$header
=
new
\
ElggFile
();
$header
->
owner_guid
=
$blog
->
owner_guid
;
$header
->
setFilename
(
"blog/
{
$blog
->
guid
}
.jpg"
);
header
(
'Content-Type: image/jpeg'
);
header
(
'Expires: '
.
date
(
'r'
,
time
()
+
864000
));
header
(
"Pragma: public"
);
header
(
"Cache-Control: public"
);
try
{
echo
file_get_contents
(
$header
->
getFilenameOnFilestore
());
}
catch
(
\
Exception
$e
)
{
}
exit
;
$header
->
owner_guid
=
$blog
->
owner_guid
;
$header
->
setFilename
(
"blog/
{
$blog
->
guid
}
.jpg"
);
$header
->
open
(
'read'
);
header
(
'Content-Type: image/jpeg'
);
header
(
'Expires: '
.
date
(
'r'
,
time
()
+
864000
));
header
(
"Pragma: public"
);
header
(
"Cache-Control: public"
);
try
{
echo
$header
->
read
();
}
catch
(
\
Exception
$e
)
{
}
exit
;
break
;
}
...
...
plugins/blog/api/v1/header.php
View file @
8e76694f
...
...
@@ -26,13 +26,14 @@ class header implements Interfaces\Api, Interfaces\ApiIgnorePam
$header
=
new
\
ElggFile
();
$header
->
owner_guid
=
$blog
->
owner_guid
;
$header
->
setFilename
(
"blog/
{
$blog
->
guid
}
.jpg"
);
$header
->
open
(
'read'
);
header
(
'Content-Type: image/jpeg'
);
header
(
'Expires: '
.
date
(
'r'
,
time
()
+
864000
));
header
(
"Pragma: public"
);
header
(
"Cache-Control: public"
);
try
{
echo
file_get_contents
(
$header
->
getFilenameOnFilestore
()
);
echo
$header
->
read
(
);
}
catch
(
\
Exception
$e
)
{
}
exit
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment