Created
October 1, 2016 17:37
-
-
Save pmfx/6f08c5e2c7c18a9b1bff7300f3c04a3d to your computer and use it in GitHub Desktop.
Get first picture thumb path from EvoGallery MODX snippet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$output=''; | |
if($id){ | |
$table = $modx->getFullTableName( 'portfolio_galleries' ); | |
$query = $modx->db->query('SELECT content_id,filename,sortorder FROM '.$table.' WHERE content_id='.$id.' ORDER BY sortorder ASC LIMIT 0,1'); | |
$row = $modx->db->getRow($query); | |
$gal_id = $row['content_id']; | |
$gal_filename = $row['filename']; | |
if ($row){ | |
$output = 'assets/galleries/'.$gal_id.'/thumbs/'.$gal_filename; | |
} | |
} | |
return $output; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment