User:mikelietz
From Habari Project
Cabal member, plugin developer, (occasionally) troublesome user, likes lurking in the IRC channel. Unsuccessfully ported a custom Wordpress theme to Habari, never to be released.
TheSixtyOne: thesixtyone.com/mikelietz
Twitter: twitter.com/mikelietz
Website: mikelietz.org
sandbox:
Candidates for 0.6.4
Committed the following to makaanga:
r3623 (ticket #1110)r3899 (ticket #1100)- r3885, r3904, r3911, and r3912 (ticket #1075)
- r3925, r3926, and r3927 (ticket #699)
r3938 (ticket #1112)- r3951 (ticket #1109)
r3956 (ticket #1115)- r3958, r3959, r3962, r3963, and r3964 (ticket #1116)
-
rXXXX (ticket #1117)
Wanted Pages
- What makes Habari so secure?
- Dev:Using a Token that you created when Dev:Creating A Plugin ... a more practical Core:ACL_Class
- Dev:Naming Tokens ... would come in handy on Dev:Adding an Admin Page
- Dev:Core Tokens ... same.
- Dev:Creating a Dropbutton ... or just Dropbutton.
- Dev:Adding a Search Filter ... how to add, say, search=category:whatever
- Dev:Working With URLs - rewrite rule stuff. Dev:Adding Rewrite Rules should redirect there.
- Dev:Creating a Custom Content Type, including how to add it to the feed, and even better, how to modify what goes in the feed.
- Dev:Adding to the Header as seen in the typekit and geotags plugins.
Using the author imageurl
Outside of the loop (this is from a header.php):
<?php if( $request->display_entries_by_author && isset( $posts ) ) { ?> <img src="<?php echo $posts[0]->author->info->imageurl; ?>" alt="Posts by <?php echo $posts[0]->author->displayname; ?>"> <?php } else { ?> <img src="header.png" alt="regular header image"> <?php } ?>
I suppose I should point out that display_entries_by_author up there is from a custom version of 0.5.2, not a core feature (yet).
Textarea rows and cols on the publish page
(for /dev/plugin)
Textareas don't always need to be massive. This works for both tabcontrol_textarea and admincontrol_textarea templates.
$instructions = $myform->append('textarea','plugin_version_instructions', 'null:null', Instructions'); $instructions->value = $plugin_versions->info->instructions; $instructions->rows = '3'; $instructions->cols = '75'; $instructions->class[] = 'resizable'; $instructions->template = 'tabcontrol_textarea';
$Request display content
These are the possible display methods(? attributes?) for a $request object (plus any added through rewrite rules):
- display_home
- display_entries
- display_entries_by_date
- display_entries_by_tag
- display_entry
- display_page
- display_search
- display_404
In the example below I only want to display the search form when I am not displaying the search results page(s).
<?php if( !($request->display_search ) ) { ?> <li id="search"> <?php include 'searchform.php'; ?> </li> <?php } ?>
Friendlier ordinal comments links
"Friendlier" only in English, that is.
<? // pointless and dirty hack. $ordinals = array("no","one","two"); ?> <div class="feedback"> <a href="<?php echo $post->permalink; ?>" title="Comments on this post"><? echo ($post->comments->approved->count >= count($ordinals) ? $post->comments->approved->count : $ordinals[$post->comments->approved->count ] ); echo _n( ' comment', ' comments', $post->comments->approved->count ); ?></a>
Counting words in a post
Not counting the title, though:
<? echo count( explode( " ", strip_tags( $post->content_out ) ) ); ?> words.
This is the basis of my word count plugins.
XHTML to HTML
Wow. Amazingly easy way to fix all of the horizontal rules:
UPDATE habari__posts SET content=REPLACE(content,'hr /','hr');
Pulling out the most recent entry outside of Habari
$conn = mysql_connect($host,$user,$password) or die ('Connection failed'); mysql_select_db( $db ); $query = "SELECT * FROM habari__posts where id = (SELECT max(id) FROM habari__posts WHERE content_type = '1' and status = '2')"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $date = date("j F Y",strtotime($row['pubdate'])); $title = $row['title']; $content = wpautop($row['content']); } mysql_close( $conn );
Merging to the makaanga
# svn co https://svn.habariproject.org/habari/makaanga/0.x/htdocs makaangaMerge r3958-59 (note first rev is one less):
# svn merge -r 3957:3959 https://svn.habariproject.org/habari/trunk/htdocs/Merge r3962-64 (note first rev is one less):
# svn merge -r 3961:3964 https://svn.habariproject.org/habari/trunk/htdocs/
Releasing a minor point release
See Release Checklist.
Make sure system/classes/version.php has been updated with the new version.
Tag it:
svn copy https://svn.habariproject.org/habari/makaanga/0.x https://svn.habariproject.org/habari/tags/0.6.4Create a zip for /dist - svn export only the https://svn.habariproject.org/habari/makaanga/0.x/htdocs folder, not everything.
Update the downloads page, both the post *and* the template. @TODO make updating the template obsolete by adding an option that can be edited.
Update the wiki - release notes and front page.
Update Wikipedia. Habari @ Wikipedia
Update the beacon.
Free webhosts that don't support Habari
x10Hosting - Installs fine, but Flickr silo does not work. Inactivity policy somewhat aggressive.
110mb.com - PHP5.1.6 and, as of 10/2009, no plans to upgrade to 5.2.anything.
UnlimitedMB - missing many extensions.
Host.sk - missing PDO.
T35 - forced ads on all pages, including admin. Unacceptable, and breaks admin.
iLive - Streams disabled and no Curl.
Installer testing (on hold for now)
I think I'll make a spreadsheet for this.
| case | db type | / writable | /user writable | results |
|---|---|---|---|---|
| sqlite | no | no | yes | big red box |
random musings, not ticket worthy until thought through
- Would there be any merit to having a $comment->permalink? Instead of hardcoding {$comment-post->url}#comment-{$comment->id} in both the admin and the theme (as well as anywhere else) wouldn't it be more flexible to have a permalink function (as well as a configurable option) to do it?
