/ Published in: PHP
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
function columnList( $articles, $articles_start_char ) {
// divide list into three equal chunks
// get and display header
$r = '<table width="100%"><tr valign="top">';
$prev_start_char = 'none';
// loop through the chunks
for($startChunk = 0, $endChunk = $chunk, $chunkIndex = 0;
$chunkIndex < 3;
$chunkIndex++, $startChunk = $endChunk, $endChunk += $chunk + 1)
{
$r .= "<td>\n";
$atColumnTop = true;
// output all articles in category
for ($index = $startChunk ;
$index++ )
{
// check for change of starting letter or begining of chunk
if ( ($index == $startChunk) ||
($articles_start_char[$index] != $articles_start_char[$index - 1]) )
{
if( $atColumnTop ) {
$atColumnTop = false;
} else {
$r .= "</ul>\n";
}
$cont_msg = "";
if ( $articles_start_char[$index] == $prev_start_char )
$cont_msg = ' ' . wfMsgHtml( 'listingcontinuesabbrev' );
$prev_start_char = $articles_start_char[$index];
}
$r .= "<li>{$articles[$index]}</li>";
}
if( !$atColumnTop ) {
$r .= "</ul>\n";
}
$r .= "</td>\n";
}
$r .= '</tr></table>';
return $r;
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                