I hacked up a new wordpress plugin that gives users more control over the appearance of their blogs. This plugin is especially useful for WordpressMU maintainers and users. Read more about it or visit its wordpress.org home.
Recent Updates RSS Hide threads | Keyboard Shortcuts
-
Custom-User-CSS - Wordpress Plugin
oremj
-
Simple bash locking
oremj
I often need to create lock files in my scripts, so crontab doesn’t spawn more than one process. This is a simple bash lock file function I like to use:
function create_lock { LOCK_NAME=$1 if [[ -e "$LOCK_NAME" ]] then OLDPID=`cat $LOCK_NAME` if ps p $OLDPID > /dev/null then return 1 fi rm $LOCK_NAME fi echo $$ > $LOCK_NAME return 0 }create_lock doesn’t handle race conditions, but it is typically good enough for me.
-
Mediawiki Google Search Appliance Integration
oremj
I was given the task of integrating our old Google Search Appliance with our internal wiki. It turns out MediaWiki offers a couple of different ways to alter search functionality: $wgSearchForwardUrl and $wgSearchType. The $wgSearchType variable accepts a SearchEngine class name and enables custom search back-ends. SimpleXML and the GSA XML API then allowed me to fetch and process the search results. After a few hours of tweaking I am pretty happy with the result, a tightly integrated full text search.
If you are interested in setting up your Google Search Appliance with a mediawiki instance, installation is simple, download or checkout the extension and follow the installation instructions.
My Life is a Little Bit Easier Now
oremj
Lately, I’ve found the process of assigning a bug to myself slightly cumbersome and wanted to speed up the process. I happen to be a fan of Ubiquity, so I decided to write a command.
The command assigntome, by default, changes the assigned to field to your user. The whole process can be automated by tacking on the submit noun, which will simulate clicking the “Commit” button.
To install assigntome subscribe to my Ubiquity feed.
DRORASSEMYDAY
Hi
Nice site!
G’night
ClarkT
Wow, what a coincidence I hate ubiquity feeds as well. I am so glad you developed this amazing tool. Where can I find more of your work.
MediaWiki: HttpAuth Plugin
oremj
All HttpAuth Plugin development has moved here from my work blog. Mozilla’s internal wikis have been using the extension without issue. Is anyone aware of issues that need fixing?
-
joe
If you could put the snippet from your diff that goes in to LocalSettings.php into the mediawiki article on your plugin, that’d be swell. The directions for which hook to change didn’t parse too well in my head, I’m afraid.
SimpleCaptcha Update
oremj
I’ve decided to move SimpleCaptcha development to my personal server.
-
baron
hi. Thanks for plugin
perfect.
Regards
sethb 9:18 am on February 12, 2009 Permalink |
Thanks, Jeremy. I hope to use this to practice some basic CSS experiments with my blog. It’ll be very helpful and I really appreciate your work.
Frederick 3:12 pm on February 15, 2009 Permalink |
Hello and thanks.
I have a few recommendations for this plugin, especially when used on WordPress µ.
First of all, add the menu page under the Appearance menu. This can be accomplished with
add_theme_page('Custom CSS Options', 'Custom CSS', 'switch_themes', __FILE__, 'custom_user_css_options');as opposed to the current call under the custom_user_css_menu() function.
Secondly, when installing for WordPress µ, it is wise to place the plugin folder under /wp-content/plugins/ BUT also to move the main plugin file to /wp-content/mu-plugins/. This will enable the Custom CSS feature for all blogs and users. It is necessary to rewrite the include() function so that the menu page, which exists in /wp-content/plugins/custom-user-css/, can be included or required by the plugin file.
Hope this helps the plugin.
Regards,
Frederick
Philip M. Hofer (Frumph) 5:51 pm on March 26, 2009 Permalink |
custom_user_css.php line(52)
$css_val = $wpdb->escape(strip_tags($_POST[ $opt_name ]));
….
Yeah I know, redundant, but still helpful. Makes it extra secure.
Philip M. Hofer (Frumph) 5:59 pm on March 26, 2009 Permalink |
function custom_user_css_menu() {
add_submenu_page(’themes.php’, ‘Custom User CSS’, ‘Custom User CSS’, 8, ‘Custom User CSS’, ‘custom_user_css_options’);
}
This puts the Custom CSS inside the Appearance Menu for users.