Created
February 6, 2009 01:33
-
-
Save mrkurt/59158 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$by_category = array(); | |
$by_category_flat = array(); | |
<mt:TopLevelCategories trim="1"> | |
if(!array_key_exists('<mt:CategoryBasename separator="-" encode_php="q" />', $by_category)){ | |
$by_category['<mt:CategoryBasename separator="-" encode_php="q" />'] = array(); | |
$by_category['<mt:CategoryBasename separator="-" encode_php="q" />']['entries'] = array(); | |
} | |
$by_category['<mt:CategoryBasename separator="-" encode_php="q" />']['include_on_fp'] = <mt:if tag="CategoryIncludeOnFrontpage">true<mt:Else>false</mt:If>; | |
$by_category['<mt:CategoryBasename separator="-" encode_php="q" />']['url'] = '<mt:ArchiveLink type="Category" encode_php="q" />'; | |
$by_category['<mt:CategoryBasename separator="-" encode_php="q" />']['name'] = '<mt:If tag="CategoryDataJournalName"><mt:CategoryDataJournalName encode_php="q" /><mt:Else><mt:CategoryLabel encode_php="q" /></mt:If>'; | |
<mt:Entries lastn="30" trim="1"><mt:Unless tag="EntryPromotedToFrontpage"> | |
$entry_array = array('id' => '<mt:EntryID />', 'title' => '<mt:EntryTitle encode_php="q" />', 'url' => '<mt:EntryPermalink encode_php="q" />', 'date' => <mt:EntryDate format_name="iso8601" convert_to_epoch="1" />, 'category' => '<mt:CategoryBasename separator="-" encode_php="q" />'); | |
<mt:IfNonEmpty tag="EntryListingImage"><mt:EntryListingImageAsset> | |
$entry_array['img'] = '<mt:AssetThumbnailURL width="140" encode_php="q" />';</mt:EntryListingImageAsset></mt:IfNonEmpty> | |
$by_category['<mt:CategoryBasename separator="-" encode_php="q" />']['entries']['<mt:EntryID />'] = $entry_array; | |
if(strpos($entry_array['url'], $by_category['<mt:CategoryBasename separator="-" encode_php="q" />']['url']) === 0){ | |
$by_category_flat['<mt:EntryID />'] = $entry_array; | |
} | |
</mt:Unless></mt:Entries> | |
</mt:TopLevelCategories> | |
uasort($by_category_flat, 'sort_by_date_rev'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment