Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnail doesn't display #3

Closed
hansfn opened this issue Sep 28, 2012 · 0 comments
Closed

Thumbnail doesn't display #3

hansfn opened this issue Sep 28, 2012 · 0 comments

Comments

@hansfn
Copy link
Contributor

hansfn commented Sep 28, 2012

If you install Bolt outside the document root, timthumb doesn't work.

Patch:

diff --git a/app/timthumb.php b/app/timthumb.php
index 37daddd..9c62148 100644
--- a/app/timthumb.php
+++ b/app/timthumb.php
@@ -34,9 +34,9 @@ if (empty($matches[1]) || empty($matches[2]) || empty($matches[4])) {
     //die("Malformed thumbnail URL. Should look like '/thumbs/320x240c/filename.jpg'.");
 }

-
-
-$_GET['src'] = "../files/".urldecode($matches[4]);
+// Bolt specific
+define('LOCAL_FILE_BASE_DIRECTORY', dirname(dirname(__FILE__)));
+$_GET['src'] = "files/".urldecode($matches[4]);
 $_GET['src'] = str_replace("/files/files/", "/files/", $_GET['src']);

 $_GET['w'] = $matches[1];

This is bullet proof - even handling Bolt installations when UserDir is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants