Archive for the ‘Hack’ Category

My tractor for a wiki farm

Thursday, May 28th, 2009
Image credit: gem66’s “Farm Tractor and Family” The recent annoucnement and sharing of the various extensions and code that enables user integration between WPMu and MediaWiki, I have once again returned to the idea of make the UMW Blogs Wiki a MediaWiki farm. The blog needs a new theme, I know, but more importantly, we need to be able to propagate new wiki installs for any faculty or student who may want to experiment more with this application.  We have slowed down the development around MediaWiki for a number of reasons: the absence of a WYSIWYG editor, spam hordes, and growing belief that anything you can do in a wiki you can do in a blog better—-which is an idea I continually flirt with, even though the applications are radically different in conception and design and I am most likely blinded by my WordPress habit. I’m also of the opinion that the wiki is best used by a very few people or many, many people, the middle-space seems to be where wikis go to die, but once again this is more a feeling than a theory. With all that said, I know the wiki isn’t dead. And the integration of MediaWiki and WPMu at UMW Blogs may be the first step along the route of my rehabilitation. I installed the extensions and got the integration up and running without a hitch, save the re-direct issue back to the article after signing in from MediaWiki—an issue that is being worked on currently. The realization of integration has prompted me to experiment more with wiki farms which I am committing to this Summer (and may actually happen give n that Joss Winn is also interested, and he actually knows what he is doing), but in the interim, here are a couple of extra quick hacks that allowed me to shut down editing for un-authenticated users (read spam control), as well as preventing anyone from creating a new account through the MediaWiki install, mainly because all registrations are now handled through WPMu. And when I say simple hacks I mean simple hacks: To prevent editing by un-authenticated users add this line to the LocalSettings.php file: $wgGroupPermissions['*']['edit'] = false; To prevent users from creating  accounts on the MediaWiki install add this line to the LocalSettings.php file: $wgGroupPermissions['*']['createaccount'] = false; That’s it, it ain’t much, I know, but now whenever anyone logs into UMW Blogs, they can simply head over the UMW Wiki and have full editing rights.  Now, if we could just allow anyone within the UMW Blogs community to quickly and easily create their own wiki within this wiki….that’s the real trick and hopefully I’ll have something to blog about as I experiment more and more with this possibility.

Simple Forums Plugin for WPMu

Sunday, November 18th, 2007

Once again, I must thank Dr. Mike for pointing me to the Simple Forums plugin at Yellow Swordfish. This is an amazing plugin that basically allows you to include a pretty powerful forum right into a blog on WPMu. You can see it in action on the Yellow Swordfish site here, or take a look at a version I am playing with at (more on this site to come shortly).

Image of WPuEd Forums

There are a host of features, a couple I particularly like are the following:

  • It integrates seamlessly with a WordPress theme as a separate page, so if you have class site and want a powerful forum in your blog here is an excellent option
  • It has advanced permissions to control who can post and/or see the forum
  • It can integrate with the blog it is installed on you more in-depth conversations about bog post can carry over to a forum –very cool!
  • It automatically integrates users from the blog, allowing all registered users to post without an additional sign-up
  • It has a simple spam blocking feature built in
  • It has RSS and e-mail subscriptions for individual topic as well as the entire forum -wow!
  • It allows for avatars, and can grab gravatars as well
  • An admin interface in the WP backend that is simple and intuitive
  • The forum itself is highly customizable with a series of skins to boot
  • Best of all, the developer Andy Staines is still tirelessly supporting users and working on integrating their feedback into the future builds–he is pretty remarkable

Image of Simple Forums backend

And did I mention that this is a plugin!!! A fact that truly amazes me given all the functionality and seamless integration at work here.

That said, there is one simple hack you need to do to get it to work with WPMu, and here it is:

You need to edit the following lines on sf-includes.php file in the plugin so that WPMu can recognize the users:

define(’SFUSERS’, $wpdb->prefix.’users’);
define(’SFUSERMETA’, $wpdb->prefix.’usermeta’);

To this:
define(’SFUSERS’, ‘wp_users’);
define(’SFUSERMETA’, ‘wp_usermeta’);

This is not be offered as a sitewide feature for all sites on UMW Blogs, but rather as an option for users on a site-by-site basis as a plugin they can activate.

There is one issue of WPMu that makes this plugin a bit difficult that I haven’t entirely gotten my head around yet, and maybe someone out there has figured it out. In the Simple Foums Options (under the Manage tab in the WP backend) their is the ability to “Show Login/Logout/Register if allowed:” I couldn’t check this option, and I realized it is because you can’t allow users who have not signed-up for a blog or username in a WPMu environment to to register for specific blogs independently. They must first have a username at the minimum. Not too big an issue, but since I am running multiple domains I need to find a way to allow any user to sign-up for an account yet keep it distinct from UMW Blogs, hmmm…I have to think on this more though–any ideas or experience with this out there?

Related posts on bavatuesdays

Customize the WPMu Dashboard

Saturday, November 10th, 2007

Here’s a simple hack to make your WordPress Multi-User Dashboard display news and recent posts from within your specific WPMu community. For example, I am going to briefly illustrate how to display the “Latest News” for our community (traditionally where the WordPress development news appears) as well as the 20 most recent posts from around UMW Blogs (traditionally where posts from Planet WordPress are displayed).

Below is a screen shot of what it looks like (click on the image to see a larger version to get a fuller sense of how this looks).

UMW Blogs Dashboard

The idea was sparked by Gardner Campbell during the UMW Blogs forum we had a couple of weeks ago, and I think it is an awesome way to connect each individual with the larger UMW Blogs community right where they live—their blog dashboard.

It is a really simple hack that only requires changing a few lines of code in both the index.php and index-extra.php files within the wp-admin folder.

Here’s how:

First the index.php file found in the wp-admin folder:

Find the following line in this file:

<h2><?php _e('Welcome to WordPress'); ?></h2>

And change it to the title of your WPMu community. Ours looks like this:

<h2><?php _e('Welcome to UMW Blogs'); ?></h2>

Next, find the following line of code:

Image of Need help WP

And link it to your own documentation if you have some handy. Ours looks like this:

Image Need Help UMW Code

That’s it for the index.php file in wp-admin. Now, we need to modify a few lines on the index-extra.php file in the same directory and that’s all there is to it!

Find the following lines of code:

case 'devnews' :
$rss = @fetch_rss(apply_filters( 'dashboard_primary_feed', '' ));
if ( isset($rss->items) && 0 != count($rss->items) ) {
<h3><?php echo apply_filters( 'dashboard_primary_title', __('WordPress Development Blog') ); ?></h3>

And change the ‘devnews’ primary feed to a feed URL that will deliver news specific to your community. Then change the title from ‘WordPress Development Blog’ to something more appropriate. Ours looks like this:

case 'devnews' :
$rss = @fetch_rss(apply_filters( 'dashboard_primary_feed', '' ));
if ( isset($rss->items) && 0 != count($rss->items) ) {
<h3><?php echo apply_filters( 'dashboard_primary_title', __('UMW Blogs News') ); ?></h3>

Next, do the same exact thing for the Planet News feed, just use the Sitewide Feed for WPMu or some other feed you might have that will feature a range of content from a number of blogs in the community.

case 'planetnews' :
$rss = @fetch_rss(apply_filters( 'dashboard_secondary_feed', '' ));
if ( isset($rss->items) && 0 != count($rss->items) ) {
<h3><?php echo apply_filters( 'dashboard_secondary_title', __('Other WordPress News') ); ?></h3>

Ours looks like this:
case 'planetnews' :
$rss = @fetch_rss(apply_filters( 'dashboard_secondary_feed', '' ));
if ( isset($rss->items) && 0 != count($rss->items) ) {
<h3><?php echo apply_filters( 'dashboard_secondary_title', __('Posts from around UMW Blogs') ); ?></h3>

Finally, find the following line of code (which is the “More” link after 20 most recent posts in the blog community):

Image of Read More Code Hack

And change the URL to something that will bring the readers to more recent post. In our case we have a page that list excerpts from the fifty most recent posts, and that would be where we would want to send folks who want to see more. Below is the UMW Blogs code:

Image of read more code hack 2

That’s it, now each and every user in your community has immediate access to a range of information and other people’s posts from right within their dashboard. Bring the content to them, don’t make them search too hard for it!

Related posts on bavatuesdays