Hello! I've been using Habari for a couple months now, and I like it. So far I've been able to get it to do nearly everything I needed it to do right off the bat (despite my general ignorance of PHP), but there's a couple few things I need that I'd like to learn about. I've created a custom post type using the '<a href="http:// www.habariproject.org/dist/plugins/eventscontent/" title="eventscontent plugin" target="_blank">eventscontent</a>' plugin as a base (of course I modded it a bit to add some extra fields). Basically it's a 'Shows' category, I'm using it as a sort of calendar of events for my band. What I need is for these posts to be sorted not by post entry date, but by the date of the event itself (one of the new fields added to the new content type - post->info->eventdate), and ultimately (details, details) would only display events in the future (though it would also be nice to have them all displayable in an archive). I know this is 'easy'. I've done a lot of reading up before posting this question, finding a handful of references to how simple it is to <a href="http://groups.google.com/group/habari-dev/msg/ c5a4499d1f9aef37" title="A Post By Owen" target="_blank">do this sort of thing</a> with Habari, but I just don't get it. I tried to add a sort of filter to the home.php page (I'm using Michael Harris' Connections theme as a base), but to no avail. It appears to sort, but only gets through 5 (the limit of posts to display per page) then displays the rest in standard order. Here's the snippet I used (boy I hope this displays, I've never tried to post code before): <code> <?php if ( $request->display_entries_by_tag && $tag == 'shows' && ! $request->display_home ) { ?> <?php $theme->display ( 'showtop' ); ?> <?php $eventposts = Posts::get( array ('content_type' => 'ideamen_show', 'status' => Post::status('published'), 'orderby' => $post->info->eventdate ) ); ?> <?php foreach ( $eventposts as $post ) { include( 'ideamen_show.php' ); } ?> <?php } ?> </code>
I know I'm going about it the wrong way trying to splatter code all over the home page, but I'm fuzzy on how to move this sort of thing up into the plugin (or the theme) to get it to behave correctly. There's more that I'd like to tweak, but I don't want to ask too much in my first post :) My site: <a href="http://www.iloveideamen.com/" title="iloveideamen.com" target="_blank">iloveideamen.com</a> The content type plugin in text format: <a href="http:// www.iloveideamen.com/habaristuff/ideamenshowscontent.plugin.php.txt" title="ideamenshowscontent.plugin.php.txt" target="_blank">ideamenshowscontent.plugin.php.txt</a> Thanks a whole bunch in advance, --D.G. Solar -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/habari-users
