Elgg 1.8 Tidypics Group Fix

I’m creating a new community site using the Elgg 1.8 platform, but a lot of the widgets are still using the old 1.7 CSS for their displays so it means a lot of fixing.

The existing tidypics/views/default/tidypics/groupprofile_albums.php suffers from this problem but is simply fixed by changing

<br />

if ($vars[’entity’]->photos_enable != ’no’) {<br /> echo ‘</p> <div class=“group_tool_widget photos”>’;<br /> echo ‘<span class=“group_widget_link”><a href="’ . $vars[‘url’] . ‘pg/photos/owner/’ . page_owner_entity()->username . ‘">’ . elgg_echo(’link:view:all’) . ‘</a></span>’;<br /> echo ‘</p> <h3>’ . elgg_echo(‘album:group’) . ‘</h3> <p>’;<br /> echo elgg_view(’tidypics/albums’, array(’num_albums’ => 5));<br /> echo ‘</p></div> <p>’;<br /> }<br /> ?><br />

to

Unique Article Wizard needs strip slashes!

I’m playing about with the Unique Article Wizard plugin for WordPress (for a friend, not for this site!!!) and there’s an obvious problem where all of the articles need their slashes to be stripped. It looks like a serious case of magic quote paranoia!

A look at the plugin code makes article_mods.php the obvious candidate for tweaking:

Change lines 370 – 384 from

<br /> $uawarticle_id = wp_update_post(array (<br /> 'ID' => $pageposts[0]->post_id,<br /> 'post_author' => $uawuser_id,<br /> 'post_title' => stripslashes($title),<br /> 'post_content' => stripslashes($article . "\n\n\n\n" . $_REQUEST['resource_box']."\n\ncategories: ".$_REQUEST['keywords']) ,<br /> 'post_excerpt' => stripslashes(stripslashes($description)),<br /> 'post_type' => 'post',<br /> 'post_status' => $uawstatus,<br /> 'post_modified_date' => date("Y-m-d H:i:s"),<br /> 'post_modified_date_gmt' => gmdate("Y-m-d H:i:s"),<br /> 'post_category' => array (<br /> $uawcategory_id<br /> ),<br />

Atom feeds with PHP 5 Dom and XSL

All blogs require silly amounts of feed generators, right? And this is a silly blog so requires a silly generator. The entire site is written using PHP5, and my automagic ‘datahandler’ activepage concept creates an XML document using DOM that then uses XSL as a templating engine, so I figured it wouldn’t be too hard to knock up a stylesheet to turn the default datahandler for the blog in to a nice atom feed! Just make sure you set the content-type to application/atom+xml when generate the page!

PHP Java Bridge in Ubuntu Gutsy with Lucene

The php/java bridge it a pretty awesome little protocol that basically lets us use java classes inside our own PHP applications! This lets you harness the awesome power of all the Java libraries that exist, including the popular Lucene search engine library.

I referenced two excellent blog entries here and here whilst implementing Lucene search for this blog, but I am writing up the experience anyway to compare issues and difficulties and enhance my understanding of the process.