Query to get cataloger images

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Query to get cataloger images

Post by climberusa »

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

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";
	}
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!
JeremyBASS

Re: Query to get cataloger images

Post by JeremyBASS »

You'd want to start by doing a search for this... look for my name and cataloger .. I have posted on this, and how to get the img file src path...

Hope this helps

jeremyBass

PS... you don't need a custom query for this... for what it's worth
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Query to get cataloger images

Post by climberusa »

Thanks for your reply. I have searched and went back to your other posts and what I found was good except it's still being called inside a cataloger template from what I could tell and what I think is different here is that I'm  accessing the images from outside of the module and cataloger templates. It's just in a plain template. I've created a custom search and thrown that into a UDT and then results spit out predetermined catalog items. It works fine, I just am trying to find a solution that won't break if the client changes an image later on.
JeremyBASS

Re: Query to get cataloger images

Post by JeremyBASS »

well.. I was thinking for you it'd be a Catalog Category Sub-template... so you would just have the list of the images, products and what have you... then use formbuilder with submation template useing a capture tag for the catalog tag. 

some thing like this but with Cataloger instead of FEU
http://www.corbensproducts.com/examples ... rcher.html

Just throwing out another way to handle what your asking to do.

Cheers
jeremyBass
Post Reply

Return to “Modules/Add-Ons”