git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
c0f9162
)
nieuws: alternate cover image for .groot file name
v3.9
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 28 Apr 2019 23:16:31 +0000
(
01:16
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 28 Apr 2019 23:25:52 +0000
(
01:25
+0200)
Assume any picture with such extension has a corresponding version preferred
as article thumbnail (cropped for smaller sizes).
nieuws.inc.php
patch
|
blob
|
history
diff --git
a/nieuws.inc.php
b/nieuws.inc.php
index 1a68993f42bcd2387ad5e14257d5059c149d41f6..40432a9c22cfc6aa1411ac866e6cf9e5e577ac9a 100644
(file)
--- a/
nieuws.inc.php
+++ b/
nieuws.inc.php
@@
-113,7
+113,10
@@
class ArchiveArticle
function thumb($size = '300x')
{
if (!$this->image or $this->image[0] !== '/') return;
- return preg_replace('{^(?:/thumb/[^/]*)?}', "thumb/$size", $this->image);
+ return preg_replace(
+ ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''],
+ $this->image
+ );
}
}