Merge pull request #3944 from annando/always-preview
Always show small preview pictures, not the big ones
This commit is contained in:
commit
e76ea3f5b8
|
@ -23,6 +23,7 @@ Example: To set the directory value please add this line to your .htconfig.php:
|
||||||
## system ##
|
## system ##
|
||||||
|
|
||||||
* **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed.
|
* **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed.
|
||||||
|
* **always_show_preview** (Boolean) - Only show small preview picures. Default value is false.
|
||||||
* **birthday_input_format** - Default value is "ymd".
|
* **birthday_input_format** - Default value is "ymd".
|
||||||
* **block_local_dir** (Boolean) - Blocks the access to the directory of the local users.
|
* **block_local_dir** (Boolean) - Blocks the access to the directory of the local users.
|
||||||
* **auth_cookie_lifetime** (Integer) - Number of days that should pass without any activity before a user who chose "Remember me" when logging in is considered logged out. Defaults to 7.
|
* **auth_cookie_lifetime** (Integer) - Number of days that should pass without any activity before a user who chose "Remember me" when logging in is considered logged out. Defaults to 7.
|
||||||
|
|
|
@ -207,7 +207,8 @@ function add_page_info_data($data) {
|
||||||
$preview = str_replace(array("[", "]"), array("[", "]"), htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
|
$preview = str_replace(array("[", "]"), array("[", "]"), htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
|
||||||
// if the preview picture is larger than 500 pixels then show it in a larger mode
|
// if the preview picture is larger than 500 pixels then show it in a larger mode
|
||||||
// But only, if the picture isn't higher than large (To prevent huge posts)
|
// But only, if the picture isn't higher than large (To prevent huge posts)
|
||||||
if (($data["images"][0]["width"] >= 500) && ($data["images"][0]["width"] >= $data["images"][0]["height"])) {
|
if (!Config::get('system', 'always_show_preview') && ($data["images"][0]["width"] >= 500)
|
||||||
|
&& ($data["images"][0]["width"] >= $data["images"][0]["height"])) {
|
||||||
$text .= " image='".$preview."'";
|
$text .= " image='".$preview."'";
|
||||||
} else {
|
} else {
|
||||||
$text .= " preview='".$preview."'";
|
$text .= " preview='".$preview."'";
|
||||||
|
|
Loading…
Reference in a new issue