Author Archives: Boone Gorges

Displaying the BuddyPress admin bar in other applications

Cross-posted at the CUNY Academic Commons Dev Blog

By popular demand, here’s the method we used at the CUNY Academic Commons to get the BuddyPress admin bar to appear on the non-WP/BP portions of our site. In our case, that means MediaWiki and bbPress, but theoretically this method could work for any kind of software out there.

I should note that I did not devise this method. It was invented by the inimitable Zach and Lucas of Cast Iron Coding.

The concept is as follows. A bit of jQuery looks for a div of a certain ID on a page and, when it finds it, opens a dummy WP page that contains essentially nothing but the BP admin bar loader, which then appears on your page. Download the zip file containing the necessary files (admin-bar-integration) and follow these steps to make it happen.

  1. Upload the file page-component.php to your WP theme directory.
  2. Create a new page in WordPress. The page should be blank. In the Attributes box, select the Template called “Component (do not use)”. Name the page bpnavslug and publish it, making sure that you take note of the permalink. You’ll need that URL (relative to your site’s webroot) in step 4.
  3. If any part of your site creates a menu or a list of your WordPress pages, you’ll want to exclude this empty page from those listings. Find the function call wp_list_pages in your theme (often in header.php or index.php) and add an exclude argument. For example, if the page number of bpnavslug is 4, make sure all references to wp_list_pages read wp_list_pages('exclude=4').
  4. Open the file bp-bar-integration.js. On line 3, you’ll see the path /bpnavslug/. Replace it with the path to the bpnavslug post you created in step 2.
  5. Upload bp-bar-integration.js to your server. For the sake of argument, I’ll put mine at /wp-content/js/bp-bar-integration.js.
  6. Now let’s turn to the application where you want the admin bar to appear. Open the theme file that contains the </body> tag. In bbPress, for example, this is usually footer.php.
  7. Immediately before the body close tag, paste the following code:
    <div id="bpContainer">
    </div>
  8. Next, open the template file that contains the document head (header.php in bbPress, for instance). Make sure that jQuery is also called somewhere in the head. If it’s not, the following code will call up jQuery on a standard installation of WP:
    <script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>
    Now paste the following line somewhere in the head (make sure it comes after the call to jQuery):
    <script type="text/javascript" src="/wp-content/js/bp-bar-integration.js"></script>
    Be sure to replace the src attribute with path from your upload in step 5.
    Finally, you’ll have to include the CSS for the admin bar. On a default installation of BuddyPress 1.0.3 or less, the following code will work:
    <link rel='stylesheet' id='bp-admin-bar-css' href='/wp-content/plugins/buddypress/bp-core/css/admin-bar.css' type='text/css' media='screen' />
    On a more recent version of BP (1.1+), the admin bar stylesheet has been rolled in with the rest of the styles. Either create your own stylesheet containing just the admin bar code, or import the entire stylesheet:
    <link rel='stylesheet' id='bp-admin-bar-css' href='/wp-content/themes/bp-default/style.css' type='text/css' media='screen' />

A note: This method appears to be incompatible with the Google Analytics WP plugin (which appends Google’s JS to the footer of every WP page, and thus into bpnavslug, and ends up gumming up the works). You could probably get around this with some creative if-statements in the GA plugin itself.

Good luck. Because of the diversity of people’s setups, I can’t guarantee that this method will work for everyone, nor can I provide support to everyone who tries it. But I do encourage you to post whether you’ve been successful in the comments, and to help each other figure things out.

Help me alpha test BuddyPress Forum Attachments

Now that bbPress is integrated into the Very Fabric of BuddyPress, there’s some demand for useful bbPress plugins to be ported over to BP. One of the most useful is _ck_’s excellent bb-attachments, which allows users to add attachments to their forum posts. I have spent a bit of time in the last few days porting it over to BP. If anyone out there is running a BP+bbPress setup (I think it should work in any recent version of BP, but I’ve only tested in BP 1.1) and would like to help me to test what is I think a functional BP version of the plugin, please do so. Here are the details.

  1. Download the plugin bb-attachments.php.zip
  2. Unzip and upload to your WPMU plugin directory. Activate it.
  3. You’ll have to make a few changes/additions to your theme files to make it work. In your BP theme directory, go to groups/single/forum/topic.php. On line 9, after the ‘template_notices’ hook, add
    [code language=’html’][/code]
    Next: After line 61, which reads
    [code language=’html’][/code]
    insert the following line
    [code language=’html’][/code]
    Next: On line 26, replace
    [code language=’html’]

    [/code]
    with
    [code language=’html’]

    [/code]
  4. In the same theme directory, open edit.php and index.php. Find the <form> tags, as described in the last part of the previous step, and replace them with the alternative <form> tag (with the enctype specified)
  5. Follow steps 1 and 2 from here. Step 5 on that page (the “optional settings”) you can do as well, and those settings might take some tweaking for certain filetypes to be allowed.
  6. Start uploading!

A few caveats:

  • I have not tested any of the AWS abilities. It’s possible that they will still work, as the AWS functionality is more or less abstracted from the specific bbPress hooks.
  • Inline images are not yet supported. I’m working on it.
  • Things look a little bit ugly with the default BP 1.1 theme. I haven’t done much to make it pretty. I’m happy to take aesthetic suggestions, if you have any.

Thanks in advance for your help. Please leave any comments here in this post’s thread.

New BuddyPress / bbPress plugin: Group Forum Subscription

BuddyPress and bbPress can be plugged into each other such that BuddyPress groups get their own discussion forums, which are powered by bbPress. Adding Burt Adsit’s bpGroups means that private and hidden groups can have their discussion forums private too. But a major hurdle is email notification: Certain kinds of BP communities simply won’t get rolling if there’s no easy way for users to get email notification of new discussions. There are solutions out there to assuage this problem within bbPress (notably Thomas Klaiber’s Post Notification, which served as the inspiration for the mechanics of my own plugin), but email notification remains hidden in bbPress favorites, instead of in an out-front toggle.

Group forum notification is coming in a future version of BuddyPress, but it’s important enough that I needed it now.

This set of plugins, called Group Forum Subscription, fixes that. Features:

  • Users can subscribe to individual discussion topics from within BuddyPress
  • Users can subscribe to topics on a group-by-group basis – that is, one can subscribe to all existing and future topics associated with a particular BuddyPress group
  • Users are automatically unsubscribed from a group’s discussions when they leave the group
  • Administrators can subscribe all users to the appropriate forums with a single click (potentially handy for first-time setup
  • Administrators can toggle whether email notification is turned on by default.
  • Administrators can determine whether the topic links in the notification emails will point to bbPress or to the BuddyPress forum interface

Installation instructions

  1. Download the package
  2. Upload the BuddyPress plugin bp-group-forum-subscription.php to the plugins directory of your main WPMU blog and activate it
  3. If you prefer for the members of your community to use the BuddyPress posting interface for discussions, add the following hook: [sourcecode language=”php”][/sourcecode] immediately after [sourcecode language=”php”]
    [/sourcecode] in /[your bp theme dir]/groups/forums/topic.php
  4. If you plan for your users to use bbPress for forum reading and posting, upload the bbPress trigger plugin bb-group-forum-subscription.php to [bbpress-install-dir]/my-plugins/ and activate it through the bbPress admin screen. Please note: the bbPress plugin changes the (IMO somewhat opaque) “Add to favorites” link on each topic page to a more straightforward Subscribe/Unsubscribe. If you like this change, open up [bbPress-theme-dir]/topic.php, and change
    [sourcecode language=”php”]user_favorites_link();[/sourcecode]
    to
    [sourcecode language=”php”]user_favorites_link( array(‘mid’ => __(‘Subscribe to this discussion’)),array(‘mid’ => __(‘Unsubscribe from this discussion’)));[/sourcecode]

You can configure the plugin on the admin page (Group Forum Subscription under Dashboard Settings. Members of your BP community can tinker with their subscriptions either on the individual topic pages (in bp or bbpress) or on their BP Settings > Notification page (where they can subscribe/unsubscribe to entire groups).

I’m in the process of setting up BuddyPress 1.1, which was just released today. Once I’ve got a dev instance of it up and running, I will do the necessary fixes to make the plugin run on the new version. (I don’t think it will be too hard, given the number of craptastic workarounds I had to do in this version because of the absence of all the nice 1.1 hooks.) Stay tuned.

Sitewide Tag Suggestion, Part II, Sort of

If you are interested in the Sitewide Tag Suggestion plugin that I blogged about a few weeks ago, you might like to know that I have finally found some time to write up some proper instructions and implement the changes on the CUNY Academic Commons. If you’re interested, you can download the bugger from the Commons dev blog, and let me know what you think.

Automated and redundant Wordpress backup via email

The WordPress worm that was going around a few days ago got me thinking about backups. A lot of people harp about how you really ought to be backing up your data, but backing up something like Wordpress is a little more complicated than backing up local data, especially if you don’t know how to set up cron jobs. And even if you do, this only protects you from certain kinds of problems (malware, database corruption and the like), not catastrophic hardware failure (since it’s likely that you’re keeping the backups on the same physical machine).

backup

So I set myself up with with a very simple but apparently quite effective solution for Wordpress backups. Three parts:

  • The WordPress Database Backup plugin is a spiffy little plugin that lets you schedule snapshots of your entire WP database, with the option to include additional tables created by third-party plugins. Most importantly for my purposes, the plugin allows you to schedule backups to be emailed to yourself.
  • The plugin zips the database dump and sends it as an attachment to my Gmail address. I created a Gmail filter that takes all emails from that address, marks them as read, and archives them. That means that every day I have an up-to-date snapshot of my Wordpress installation on Gmail’s servers, instead of on the server where my blog is hosted.
  • Once a month or so (more frequently when the web interface goes down), I open up Thunderbird on my laptop, which grabs copies of all old mail via IMAP. Now I have copies of my WP database on my computer as well.

This is probably an obvious system that other people have implemented, but I haven’t seen many people write about it. Hope it helps someone.

WPMU 2.8, bbPress and cookie problems solved

Upgrading the CUNY Academic Commons from WPMU 2.7.somethingorother to 2.8.4 went quite smoothly overall. A big problem cropped up a few days after the upgrade, though: integration with bbPress (version 1.0 alpha 6) wasn’t working right. Shared user tables still worked fine, but sessions weren’t carrying over between the platforms – and, worse yet, you had to flush your cookies to be able to log into the other system at all.

A bunch of Googling turned up people with similar problems, but no real solutions (other than the standard setup procedures, such as making sure that the auth_salt etc matched in wp-config.php and bb-config.php). Then I found this thread, where a few people who are smarter than I am had a conversation about WP2.8’s new method for handling cookies. So I understood the problem a little better. Then someone near the end of the thread suggested upgrading bbPress. I did – to bbPress 1.0.2 – and the integration instantly worked perfectly. You don’t even need a plugin on the WP side for it to work anymore.

The moral of the story: The devs at bbPress are awesome. Also, upgrade to bbPress 1.0.2 if you can.

New BuddyPress plugin: Enhanced BuddyPress Widgets

I just posted at the CUNY Academic Commons Dev blog about a new plugin I’m releasing for BuddyPress. The plugin adds two new widgets to your BP/WP install – Groups and Members – which duplicate the functions of the core widgets of the same name, with the added feature that users can choose whether the default view will be Newest, Active, or Popular.

If I can think of other ways in which those widgets could be enhanced, I might add them to the plugin in the future. If you can think of some ways, please let me know.

Why are you still reading this? Go download the plugin already, and enjoy having my name on your WordPress plugins page yet again.

The ethics of Turnitin, or How I Learned To Stop Detecting Plagiarism

Yesterday I was feeling sorry for myself with regard to Turnitin and the like. I ended up having an interesting discussion with @LanceStrate, @mattthomas, and @KelliMarshall about the ethics surrounding plagiarism detection service. It got me to thinking about why it bothers me.

My gut feeling is this: Turnitin, SafeAssign et al make big bucks off of their database. More papers scanned means a bigger database; bigger database means (in theory) better plagiarism detection; better detection means (in theory) more value and more profit. Forcing students to relinquish their papers to this machine feels exploitative.


John Stuart Mill – Awesome Guy | cc licensed flickr photo shared by netNicholls

But I wonder why this bothers me. I have no problem feeding different kinds of information-gathering machines. Take Google. I use Gmail, Google Reader, Google Calendar, and google.com extensively. The more I use these services, the more information they gather about my online activities; bigger database means better ad targeting; better targeting means more value and more profit. My “stuff” – information about me, writing I produce, records of my activity, etc. – is not sacrosanct. I’m willing to give it up in some cases.

So what’s the difference? Most obviously, I am choosing to use Google’s products in a way that students are not asking to use Turnitin. I will grant that there are different levels of “forcedness”, as @LanceStrate points out. Students can opt out of a class, or out of school in general. And if instructors make the Turnitin requirement explicit in the syllabus on the first day of class (or earlier), students will be reasonably well-informed about what they will be “forced” to do. But no matter how you conceive of the spectrum of requirement, the fact remains that my use of Google is far freer than students’ use of Turnitin.

That a professor requires students to do certain things that they wouldn’t otherwise do is not, in itself, an indictment of the requirement. I doubt that my own students would write about the Nicomachean Ethics if their grade didn’t depend on it. But, in this case, I as an instructor am obligated to exercise my power in a responsible way. (Heavy is the head that wears the crown.) Requirements should not be arbitrary, but should serve the goals of the class and the best interest of the students. Requiring a paper on Aristotle has negative effects on students – it takes away from the time and energy they could be spending on other things that are valuable to them – and it’s my responsibility to ensure that these negative effects are outweighed by the benefits bestowed by such an assignment. A well thought-out term paper assignment will, in the long run, have positive utility for the student.

Is the same true for plagiarism detection? Are the negative effects of such technologies (being forced to enrich a corporate entity, losing control over one’s intellectual property, feeling a presumption of one’s own guilt in the absence of supporting evidence) outweighed by some benefits? It’s at this point in the thought process that the pedagogical implications of Turnitin should be considered.

  • Is Turnitin good at detecting plagiarism? My experience says: Not really. While Google’s database doesn’t include as many student papers as Turnitin’s, Turnitin is in turn pretty awful at identifying plagiarism from the open web. Thoughtful reading and Googling has been more effective for me. I’d like to see data on the larger trends, though – for example, what percentage of student copying comes from the open web (Google’s domain) versus for-sale paper databases.
  • How much harm does “plagiarism” really do? This is really the more important question. Even if it turns out that Turnitin is very, very good at plagiarism detection, there is very little benefit from the software’s use if it turns out that plagiarism, as defined, isn’t really that harmful. This question is tough to answer, though. For one thing, there are lots of different kinds of plagiarism, certain kinds of which are more harmful than others. A student who copies a paper wholesale from Wikipedia is doing more harm than one who synthesizes a coherent paper from a bunch of different sources, or one who fails to cite a paraphrased argument. Surely the second and third students are getting more out of the assignment than the first. Furthermore, I have an untested gut feeling that the most harmful types of plagiarism – where a student steals wholesale – are easier to detect without using Turnitin, since they’re more likely not to be even approximately in the student’s voice or level of expertise. If this is right, then it might be the case that Turnitin is most necessary for the least harmful varieties of “plagiarism” – varieties whose ethical implications, some might argue, ought to be reassessed in light of how new technologies are affecting knowledge creation. (Too big a topic to address here, but you get the idea.)
  • Are there less troubling alternatives to Turnitin? Let’s grant that Turnitin is very good at detecting plagiarism, and that plagiarism is hugely pernicious. All things being equal, if we could avoid plagiarism by means that have less of a downside, we should choose those other means. In my experience (again, I have no comprehensive data to back this up), the answer is yes, there are far better ways. @KelliMarshall suggests assigning unique paper prompts, making plagiarism more difficult. I’ve found that the scaffolding of assignments – such that students write early, write often, and write in a low-stakes milieu – is extremely effective at lowering the tempation to plagiarize. To be more specific: When students are writing in journals or blogs – spaces where they are not harshly graded – and when their formal assignments allow students to pull from and build upon the ideas that they’ve already put to paper(/bits), cheating simply doesn’t happen very often. That initial moment – when a student sits down at the computer the night before the due date, not having written a single word, not knowing where to start, and copying out of desparation – is averted altogether. In the semesters I’ve used blogs and structured assignments in this way, I’ve had to deal with plagiarism maybe once per semester (out of 70+ students writing hundreds of papers). Another thing that’s worked really well for me is having frank discussions with students about why plagiarism is so demonized in academia in the first place (perhaps this conversation is a little more justified in an Ethics course). When they understand the motivations, and are not simply handed seemingly (and perhaps actually?) arbitrary rules about the Evils Of Plagiarism, they’re more likely to grok.

On balance, then, it seems to me that there is very little, if anything, to be gained from Turnitin et al that cannot be gained through other, less harmful means. Now I have to work up the guts to start sending links to this post whenever a faculty member asks me how to do plagiarism detection! But I suppose my lack of intestinal fortitude is a topic for another blog post.