zencart简易页面原理分析

2012-06-28 23:29 来源:www.chinab4c.com 作者:admin

     zencart简易页面原理分析,主要是从zen cart的数据库表zen_ezpages,zen_ezpages_content这2个表里面的,一个是存储zen cart简易页面的基本信息,一个是存储简容页面的内容信息。

     首先我们看includes/modules/pages/page/header_php.php页面,首先他通过简易页面的地址来取得该简易页面的具体信息。

     $var_pageDetails = $db->Execute("select e.pages_id, e.page_open_new_window, e.page_is_ssl, e.alt_url, e.alt_url_external, e.header_sort_order, e.sidebox_sort_order,
                                 e.footer_sort_order, e.toc_sort_order, e.toc_chapter, e.status_header, e.status_sidebox, e.status_footer, status_toc, et.pages_title,
                  et.pages_html_text
         from  " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et
                  where e.pages_id = et.pages_id
                              and et.languages_id = '" . (int)$_SESSION['languages_id'] . "'
               and e.pages_id = " . (int)$ezpage_id );

    但是如果要取得某指定的分类的简易页面内容怎么办呢,我们直接调用以下代码就可以实现。

    $pages_order_query = "SELECT e.pages_id, e.page_open_new_window, e.page_is_ssl, e.alt_url, e.alt_url_external, e.header_sort_order, e.sidebox_sort_order,
                      e.footer_sort_order, e.toc_sort_order, e.toc_chapter, e.status_header, e.status_sidebox, e.status_footer, status_toc, et.pages_title,
       et.pages_html_text 
       FROM  " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et
                      WHERE ((status_toc = 1 and toc_sort_order <> 0) and toc_chapter= :chapterID )
                      AND alt_url_external = '' and alt_url = ''
       AND et.languages_id = '" . (int)$_SESSION['languages_id'] . "'
       AND e.pages_id = et.pages_id
                      ORDER BY toc_sort_order, pages_title";

     这样就可以很轻松的把zencart中简易页面内容调用出来。从而通过以分类的形式,来获取类似简单的新闻分类。

    来源:http://www.chinab4c.com