Article list with CP included

Actually there is no way to show CPs in article listing too. This little enhancement will change that

Author: Robert Based on a work of K.Heermann (flip-flop)
Template: Article listing Template:

New phpwcms (>=18112014)


OLD phpwcms (<18112014)

      // Artikel in der DB suchen und CP-ID bereitstellen
      // Search for the article and make the CP-ID available
      $sql  = "SELECT acontent_id, acontent_aid ";
      $sql .= "FROM ".DB_PREPEND."phpwcms_articlecontent ";
      $sql .= "WHERE acontent_visible=1 AND acontent_trash=0 ";
      $sql .= 'AND acontent_aid = ' . {ARTICLEID} . ' ';
      $sql .= "ORDER BY acontent_sorting";
      $result = _dbQuery($sql);
      if(isset($result[0]['acontent_id'])) {  // Any result available?
         // Create CP-IDs string for SHOW_CONTENT
         $cp_my_id_str   = '';
            foreach($result as $value) {
              $cp_my_id_str .= ','.$value['acontent_id'];
         // Make the encountered CPs available
         echo showSelectedContent('CP'.$cp_my_id_str);

Check this too:



2. {SHOW_CONTENT:CPA, art-id, art-id, art-id}
    Ascending output of CPs, this time the IDs are Article-IDs.

3. {SHOW_CONTENT:CPAD, art-id, art-id, art-id}
    Descending output of CPs. IDs are Article-IDs.
    (slowing the output a little bit).

english/phpwcms-system/article/templates/article-list.txt · Last modified: 2018/06/03 18:09 (external edit) Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0