Skip to content

Instantly share code, notes, and snippets.

@kolber
Created February 2, 2012 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kolber/1725749 to your computer and use it in GitHub Desktop.
Save kolber/1725749 to your computer and use it in GitHub Desktop.
- open /app/page-data.inc.php
-- about line 130 add
# @absolute_url
$page->absolute_url = $page->data['@base_url'].'/'.str_replace('./','', $page->file_path);
-- about line 52 (get_thumbnail function) replace with this:
static function get_thumbnail($file_path) {
$thumbnails = array_keys(Helpers::list_files($file_path, '/thumb\.(gif|jpg|png|jpeg)$/i', false));
# replace './content' with relative path back to the root of the app
$relative_path = 'http://'.$_SERVER['HTTP_HOST'].str_replace('/index.php', '', $_SERVER['PHP_SELF']).'/'.str_replace('./','', $file_path);
return (!empty($thumbnails)) ? $relative_path.'/'.$thumbnails[0] : false;
}
-open /app/asset-types/asset.inc.php
-- about line 30 add
# @absolute_url
$this->data['@absolute_url'] = 'http://'.$_SERVER['HTTP_HOST'].str_replace('/index.php', '', $_SERVER['PHP_SELF']).'/'.str_replace('./','', $file_path);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment