Query to get cataloger images
Posted: Fri Feb 13, 2009 5:06 pm
Hi,
I'm building a custom search for a site the displays results from the cataloger module. The search itself is basically a form and based what the user submits, I show predefined results. What I'm trying to do though is show the thumbnail image associated with the results and I'm having a really hard time understanding how to grab those.
Here's what I've got so far. I've hard coded a url for the image but it's not accurate always
You can see my path to the image is /uploads/images/catalog/".$row['content_alias']."_s_1_100_0.jpg and what I'm wondering is how to get the image path so it's accurate if it changes. I'm not sure how to get that last part of the filename _s_1_100_0.jpg.
Anyone able to help here?
Thanks!
I'm building a custom search for a site the displays results from the cataloger module. The search itself is basically a form and based what the user submits, I show predefined results. What I'm trying to do though is show the thumbnail image associated with the results and I'm having a really hard time understanding how to grab those.
Here's what I've got so far. I've hard coded a url for the image but it's not accurate always
Code: Select all
global $gCms;
$db =& $gCms->GetDB();
$query = "SELECT * FROM cms_content WHERE menu_text IN(".$cleanpianos.")";
$result = $db->Execute($query);
//$resultImage = '/images/catalog_src/'.$row['content_alias'].'_src_1.jpg';
if ($result->RecordCount() > 0)
{
echo "<ul class=\"listItems\"> \n";
while ($result && !$result->EOF)
{
$row = $result->FetchRow();
echo "<li><a href=\"".$row['hierarchy_path']."\"><img src=\"/uploads/images/catalog/".$row['content_alias']."_t_1_100_1.jpg\" title=\"".$row['content_name']."\" />".$row['content_name']."</a></li> \n";
}
echo "</ul> \n";
echo $cleanpianos;
}
else
{
echo "<p class=\"error\">There were no search results in the database";
}
Anyone able to help here?
Thanks!