[Openfontlibrary] Fwd: [Cctools-cchost] Wordpress music blogs as Sample Pools

Dave Crossland dave at lab6.com
Tue Aug 26 02:06:35 PDT 2008


Looks promising...

---------- Forwarded message ----------
From: Victor Stone <fourstones.net at gmail.com>
Date: 2008/8/26
Subject: [Cctools-cchost] Wordpress music blogs as Sample Pools
To: "cctools-cchost at lists.sourceforge.net"
<cctools-cchost at lists.sourceforge.net>
Cc: John Keston <johnkeston at gmail.com>


I've been working with John Keston over at http://audiocookbook.org on
turning any Wordpress blog that specializes in media into a Creative
Commons Sample Pool. Getting this particular hack to work means any
ccHost installation can cross-attribute with any Wordpress
installation that hosts remixable media.

99% of the functionality needed to be a passive Sample Pool is already
built into recent Wordpress installations so the tweaking needed is
extremely minimal. Here are the steps:

1) If you have a plugin or some other mechanism that adds a <*.license
tag to your feed entries, then skip to step (2). Otherwise, find the
'functions.php' file in your theme. That would be in a place like
wp-content/themes/your_theme_name/functions.php

Put the following code into that file:

---------------- CUT BELOW HERE -----------------

//Add CC license to namespace, item, inline img link within description
function add_license_ns()
 { echo
    'xmlns:cc="http://backend.userland.com/creativeCommonsRssModule"' .
    "\n\t" ; }

add_action('rss2_ns', 'add_license_ns');

function add_license_item()
 { if( !empty($_GET['pool']) )
     { echo "\t" .
       '<cc:license>http://creativecommons.org/licenses/by/3.0/</cc:license>'
.
       "\n"; } }

add_action('rss2_item', 'add_license_item');

--------------- CUT ABOVE HERE ----------------------

The code above assumes a BY 3.0 license for your items. If you have a
different default license then replace the license URL in the code
above. If you have difference licenses for each item then I leave that
as an exercise for the reader.


2) This hack assumes you have mod_rewrite enabled on your WP site. In
the line directy after:

RewriteBase /

Put the following code:

--------------- CUT BELOW HERE -------------

RewriteCond %{QUERY_STRING}  ^query=(.+)$
RewriteRule ^pool/search$ tag/remixable/?feed=rss2&pool=1&s=%1 [L,R]
RewriteRule ^pool(/info/?)?$   tag/_?feed=rss2&pool=1 [L,R]

--------------- CUT ABOVE HERE ---------------

(It's possible my mail client breaks the lines apart, there should be
three lines that each start with "Rewrite...")

3) Tag all entries that you want in the Sample Pool as 'remixable'. If
you use a different tag, replace the word 'remixable' in step (2)
above with your tag. If you use a category, replace the word 'tag'
with 'category'.

That's it!

I've got this working on several WP sites and ccHost test
installations. Unfortunately there's something going at audiocookbook
that's preventing this from working 100% and we are tracking that
down.

If you install these hacks into your WP installation definitely met me
know so I can test it against our test sites.

These sites should work with either 4.x ccHost sites as well as 5.

Thanks,
VS

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Cctools-cchost mailing list
Cctools-cchost at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cctools-cchost



-- 
Regards,
Dave

"Nothing would please me more than being able to hire ten programmers
and deluge the hobby market with good software."
- Bill Gates, 1976, in want of www.gnuherds.org


More information about the Openfontlibrary mailing list