Summary and content

2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 11, 2009   (RSS)

Re: [Ginslinger] Summary and content

By Dave - March 11, 2009

Hi Ginslinger,

You can add some options to the viewer code.

To load just one result, try this:
'limit' => 1,

To load some results from the same author, first figure out how to print out their name. It will be something like this (but the variable name will be different):
<?php echo $articleRecord['author'] ?>

Once you get that working, add another viewer code block _below_ the first one at the top of the page that loads all articles and has a where option like this:
'where' => " author = '" .mysql_real_escape_string(@$articleRecord['author']). "' ",

It's a little complex. I can break it down into multiple lines but one line is easiest for cut and paste. Basically we get the author name, then we do another query for all articles from that author. And the escape string bit is just for security.

Hope that helps, let me know how far you get or if you need more help!
Dave Edis - Senior Developer
interactivetools.com