Update of /cvsroot/phpwebapp/top10/templates/proj_list
In directory sc8-pr-cvs1:/tmp/cvs-serv5584/templates/proj_list
Modified Files:
proj_list.php
Log Message:
Index: proj_list.php
===================================================================
RCS file: /cvsroot/phpwebapp/top10/templates/proj_list/proj_list.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** proj_list.php 26 Sep 2003 15:32:20 -0000 1.3
--- proj_list.php 2 Oct 2003 07:09:40 -0000 1.4
***************
*** 38,52 ****
function get_filter_condition()
{
//get the state vars of the WebBox filter
$language = WebApp::getSVar("filter->language");
$license = WebApp::getSVar("filter->license");
$search_term = WebApp::getSVar("filter->search_term");
$category = WebApp::getSVar("filter->category");
$conditions = array();
if ($language <> '') $conditions[] = "prog_lang='$language'";
if ($license <> '') $conditions[] = "license='$license'";
if ($category <> '') $conditions[] = "category='$category'";
! if (trim($search_term) <> '')
{
$conditions[] = "(proj_id LIKE '%$search_term%'"
--- 38,66 ----
function get_filter_condition()
{
+ if (ADMIN=='true')
+ {
+ $new = WebApp::getSVar("filter->new");
+ if ($new=='true')
+ {
+ //display all the new projects, regardless
+ //of the other filtering conditions
+ $condition = "status='new'";
+ return $condition;
+ }
+ }
+
//get the state vars of the WebBox filter
$language = WebApp::getSVar("filter->language");
$license = WebApp::getSVar("filter->license");
$search_term = WebApp::getSVar("filter->search_term");
+ $search_term = trim($search_term);
$category = WebApp::getSVar("filter->category");
$conditions = array();
+ $conditions[] = "status='approved'";
if ($language <> '') $conditions[] = "prog_lang='$language'";
if ($license <> '') $conditions[] = "license='$license'";
if ($category <> '') $conditions[] = "category='$category'";
! if ($search_term <> '')
{
$conditions[] = "(proj_id LIKE '%$search_term%'"
***************
*** 55,59 ****
}
$condition = implode(" AND ", $conditions);
- if ($condition=='') $condition = "1=1";
return $condition;
--- 69,72 ----
|