Difference between revisions of "List-Cat.php"
From Organic Design wiki
(let's do some cat-listing on OD :-)) |
(Change to plain list (no columns)) |
||
| Line 1: | Line 1: | ||
<? | <? | ||
| − | # Append article content with | + | # Append article content with a list of article-names from category specified in properties |
| − | $db =& wfGetDB(DB_SLAVE); | + | $db =& wfGetDB( DB_SLAVE ); |
| − | $cl = $db->tableName('categorylinks'); | + | $cl = $db->tableName( 'categorylinks' ); |
| − | xwGetProperty($properties, 'list-cat', $cat); | + | xwGetProperty( $properties, 'list-cat', $cat ); |
| − | $result = $db->query("SELECT cl_sortkey FROM $cl WHERE cl_to = '$cat'") | + | $result = $db->query( "SELECT cl_sortkey FROM $cl WHERE cl_to = '$cat'" ); |
| − | + | while ( $row = mysql_fetch_assoc($result) ) | |
| − | + | $article .= "*[[".str_replace('_', ' ', $row['cl_sortkey'])."]]\n"; | |
| − | while ($row = mysql_fetch_assoc($result)) | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
?> | ?> | ||
Revision as of 07:03, 14 January 2006
<?
- Append article content with a list of article-names from category specified in properties
$db =& wfGetDB( DB_SLAVE ); $cl = $db->tableName( 'categorylinks' ); xwGetProperty( $properties, 'list-cat', $cat ); $result = $db->query( "SELECT cl_sortkey FROM $cl WHERE cl_to = '$cat'" ); while ( $row = mysql_fetch_assoc($result) ) $article .= "*[[".str_replace('_', ' ', $row['cl_sortkey'])."]]\n"; ?>



