Default Viewer Record

6 posts by 3 authors in: Forums > CMS Builder
Last Post: June 2, 2010   (RSS)

By mark99 - May 27, 2010 - edited: May 27, 2010

I've created several detail (not list) viewer PHP files, each representing different categories.

Now I have one minor problem, everybody who gets to these detail pages comes from a list that uses manually constructed links, for example one list might send an individual product to.. Example_Detail.php?Cameras-5 (productname-record num). But if you try to view Example_Detail.php by itself then it will always display record number 1 and I'd rather the page just returned "no record" or something if that happens.

Now I can at least limit the records to be category specific by doing this at the top:

// 'where' => whereRecordNumberInUrl(1),
'where' => " category LIKE '%Consumer Cameras%' ",

But then it just display the first record associated with that category instead, by default.

Re: [mark99] Default Viewer Recorder

By mark99 - May 27, 2010

Just realised that using 'where' => " category LIKE '%Consumer Cameras%' ", on a detail viewer page doesn't work either as it will then ONLY display the first record for that category and not the others regardless of whats in the URL.

Re: [mark99] Default Viewer Record

By Dave - May 27, 2010

Hi mark99,

Try this:
'where' => whereRecordNumberInUrl(0),

The value in the brackets is what's used if no number is found in the url. So 0 means match nothing.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [mark99] Default Viewer Record

By Jason - May 31, 2010

Hi Mark,

Could you provide a link to the page in question so I can see what's happening?

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Default Viewer Record

By mark99 - June 2, 2010

Never mind, the problem was staring me in the face.. I just had to tweak a few things:

if (!$isp_listRecord) {
// header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}