NAVIGATION
This shows you the differences between two versions of the page.
|
english:phpwcms-system:article:templates:article-list [2009/12/25 21:57] Knut Heermann (flip-flop) created |
english:phpwcms-system:article:templates:article-list [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{indexmenu_n>10}} | {{indexmenu_n>10}} | ||
| - | ====== Article list ====== | + | ====== 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) | ||
| + | <code php> | ||
| + | {SHOW_CONTENT:CPA, {ARTICLEID} } | ||
| + | </code> | ||
| + | |||
| + | OLD phpwcms (<18112014) | ||
| + | <code php> | ||
| + | [PHP] | ||
| + | // 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); | ||
| + | } | ||
| + | [/PHP] | ||
| + | </code> | ||
| + | |||
| + | \\ | ||
| + | |||
| + | Check this too: | ||
| + | |||
| + | [[deutsch/ersetzer_rts/frontend_render/show_article_cp]] | ||
| + | |||
| + | [[http://www.phpwcms-docu.de/artikel_tags.phtml|RT: {SHOW_CONTENT:MODE,id,id,id}]] | ||
| + | |||
| + | <file> | ||
| + | 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). | ||
| + | </file> | ||
| + | |||
| + | \\ | ||