Skip to content

Instantly share code, notes, and snippets.

@sonicpunk
Created October 20, 2015 08:57
Show Gist options
  • Save sonicpunk/401e84e03363d370ee1c to your computer and use it in GitHub Desktop.
Save sonicpunk/401e84e03363d370ee1c to your computer and use it in GitHub Desktop.
[[-+image:add_mediasourcepath=`2`:phpthumbof=`w=150`]]
<?php
$output = str_replace('./','',$input);
if ($mediasource = $modx->getObject('sources.modMediaSource',$options)){
$output = $mediasource->prepareOutputUrl($output);
}
return '/' . $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment