listingData Class Reference

Gestion de la production des listing. More...

List of all members.

Static Public Member Functions

  • static _reset ()
  • static listing ($type_object, $category_depth)
  • static orderby ($_sort)
    Add condition order by.
  • static limit ($limit)
    Add condition limit.
  • static currentCatId ($cID)
    Add Force current_category_id.

Static Public Attributes

Static Private Member Functions

Static Private Attributes


Detailed Description

Gestion de la production des listing.

Definition at line 83 of file page.listing.php.


Member Function Documentation

static listingData::_reset (  )  [static]

Definition at line 102 of file page.listing.php.

00102                                  {
00103     self::$limit='';
00104     self::$category_id=false;
00105     self::$sql_sort='';
00106   }

static listingData::currentCatId ( cID  )  [static]

Add Force current_category_id.

Definition at line 208 of file page.listing.php.

00208                                            {
00209     self::$category_id=(int)$cID ;
00210   }

static listingData::Exeorderby ( sql_sort = ''  )  [static, private]

Definition at line 181 of file page.listing.php.

Referenced by listing().

00181                                                   {
00182     $listing_sql = ' order by ';
00183 
00184     $sort=listingUtility::sortby(@$_GET['sort']);
00185     $listing_sql .= ((strlen(self::$sql_sort)>0 && strlen($sort)>0)? self::$sql_sort.',': self::$sql_sort);
00186     $listing_sql .= $sort;
00187     return $listing_sql;
00188   }

static listingData::limit ( limit  )  [static]

Add condition limit.

Definition at line 201 of file page.listing.php.

00201                                       {
00202     self::$limit=$limit ;
00203   }

static listingData::listing ( type_object,
category_depth 
) [static]

Definition at line 108 of file page.listing.php.

00108                                                               {
00109     global $page;
00110 
00111     if($category_depth=='nested')self::$type_object= 'nested';
00112     elseif((isset($type_object) && $type_object=='products') || $category_depth=='products') self::$type_object= 'products';
00113     elseif((isset($type_object) && $type_object=='pages') || $category_depth=='pages') self::$type_object= 'pages';
00114 
00115 
00116     $listing_sql=self::query();
00117 
00118     $listing_sql .=self::Exeorderby().self::$limit;
00119 
00120     if( empty(self::$limit) ) {
00121       if(!class_exists('splitPageResults')) require_once(DIR_WS_CLASSES . 'split_page_results.php');
00122       if( self::$type_object =='products' || isset($_GET['manufacturers_id']))
00123         $listing_split = new splitPageResults($listing_sql,  $page->_conf_value('MAX_DISPLAY_PAGE_LINKS'), 'p.products_id');
00124       elseif( self::$type_object =='pages')
00125         $listing_split = new splitPageResults($listing_sql,  $page->_conf_value('MAX_DISPLAY_PAGE_LINKS'));
00126       elseif( self::$type_object =='nested')
00127         $listing_split = new splitPageResults($listing_sql,  $page->_conf_value('MAX_DISPLAY_PAGE_LINKS'), 'p.products_id');
00128 
00129       return $listing_split;
00130     }
00131     else
00132       return $listing_sql;
00133 
00134 
00135   }

static listingData::orderby ( _sort  )  [static]

Add condition order by.

Definition at line 194 of file page.listing.php.

Referenced by query().

00194                                         {
00195     self::$sql_sort=((strlen(self::$sql_sort)>0)?',':'').$_sort ;
00196   }

static listingData::query (  )  [static, private]

cat courante

We show them all and all type (page, products,link )

Definition at line 137 of file page.listing.php.

Referenced by listing().

00137                                  {
00138     global $languages_id, $current_category_id;
00139 
00141     $cID=(self::$category_id ===false)? $current_category_id : self::$category_id;
00142 
00144     switch (self::$type_object){
00145       case 'products':
00146         $listing_sql = " select DISTINCT p.*, pd.products_name from  ".TABLE_V_PRODUCTS." p
00147                           LEFT JOIN  " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id
00148                           LEFT JOIN   " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p2c.products_id= p.products_id
00149                           WHERE pd.language_id = '" . (int)$languages_id . "'  ";
00150 
00151         if (isset($_GET['manufacturers_id']) && isset($_GET['filter_id']) && tep_not_null($_GET['filter_id']))
00152           $listing_sql .=" and manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and p2c.categories_id = '" . (int)$_GET['filter_id'] . "' ";
00153         elseif (isset($_GET['filter_id']) && tep_not_null($_GET['filter_id']))
00154           $listing_sql .=" and manufacturers_id = '" . (int)$_GET['filter_id'] . "'";
00155         elseif (isset($_GET['manufacturers_id']))
00156           $listing_sql .=" and manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
00157         elseif (!empty($cID))
00158           $listing_sql .=" and p2c.categories_id = '" . (int)$cID . "'";
00159 
00160 
00161       break;
00162 
00163       case 'pages':
00164 
00165         $listing_sql = "select DISTINCT c.content_id,ctc.categories_id, content_name,content_title,content_text, c.date_added, c.last_modified, content_status, ctc.categories_id    from " . TABLE_CONTENT_DESCRIPTION . " cd, " . TABLE_CONTENT . " c,   " . TABLE_CONTENT_TO_CATEGORIES . " ctc, " . TABLE_CATEGORIES . " cat where cat.categories_id=ctc.categories_id and cat.categories_status='1' and c.content_status = '1' and c.content_id = ctc.content_id and cd.content_id = ctc.content_id and cd.language_id = '" . (int)$languages_id . "' and cat.categories_id = '" . (int)$cID . "'";
00166       break;
00167 
00168       case 'nested':
00169         global $list;
00170 
00171         $listing_sql = "select DISTINCT p.*, pd.products_name from ".TABLE_V_PRODUCTS." p, " . TABLE_PRODUCTS_DESCRIPTION . " pd,  " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c WHERE  c.categories_id=p2c.categories_id and c.categories_status='1' AND  pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id ".(tep_not_null($list)? " AND  p2c.categories_id IN (" . $list . ")" : '');
00172 
00173         self::orderby('c.sort_order ');
00174       break;
00175     }
00176 
00177     return $listing_sql;
00178   }


Member Data Documentation

listingData::$category_id = false [static, private]

Definition at line 100 of file page.listing.php.

listingData::$limit = '' [static]

string limit

Definition at line 98 of file page.listing.php.

Referenced by limit().

listingData::$listing_sql [static]

string requet sql

Definition at line 90 of file page.listing.php.

Referenced by Exeorderby(), listing(), and query().

listingData::$sql_sort = '' [static]

string force orderby

Definition at line 94 of file page.listing.php.

listingData::$type_object = 'products' [static]

Definition at line 85 of file page.listing.php.

Referenced by listing(), and listingUtility::sortby().


The documentation for this class was generated from the following file: