SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 313 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

'filter_state',
Rendering Output
[ 234 ]
'filter_state');
// prepare the WHERE clause
$where = '';
// Determine published state
if ($filter_state == 'P')
{
$where = 'published = 1';
}
elseif ($filter_state == 'U')
{
$where = 'published = 0';
}
// return the WHERE clause
return ($where) ? ' WHERE '.$where : '';
}
The first thing we do is retrieve the published state value from the user state.
This will be one of four values: null, P, U, or A. null means 'any'. P and U relate to
'published' and 'unpublished' respectively. A means 'archived'.
Use of the archived published state is unusual. Archived refers to items that are no
longer in use and aren't to be modified or viewed in any form. If we want to use
archive as a published state, we would have to modify our use of grid.state. This
is explained earlier in the chapter.
We then build our WHERE clause and return the result. When we create a method such
as this, it is important to remember that any external data we use is sanitized and
escaped for use with the database.


Pages:
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6