Recent Topics

1 Jan 13, 2005 07:04    

I need help!

With the the [url=http://forums.b2evolution.net/viewtopic.php?p=13289]CC plugin[/url], I've run into a little snag.

These CC licenses should (ideally) have some hidden XML that goes with them, but b2e rejects the code (plugin adds code to the post body). I'm assuming I have to edit _formatting.php but I was wondering if there is an easier (plugin-friendly) method.

Here's the "bare minimum" required code as per [url=http://creativecommons.org/technology/web-integration#html-output-manual]CC instructions[/url]:

<!--
<rdf:RDF xmlns="http://web.resource.org/cc/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
<license rdf:resource="{license_url}" />
</Work>
</rdf:RDF>
-->

2 Jan 17, 2005 23:14

I dug into _formatting,php and had some luck, but I then ran into some other problems. For example, <Work> causes problems because the parser converts it to lowercase, and therefore thinks its illegal.

So my current thought is this: The code above is inside a comment, therefore it doesn't need to be valid XHTML.

Can I turn off comment-parsing? Is there any instance where this could be dangerous?

3 Jan 18, 2005 02:16

Um... you don't mean comments like leave a comment right? In formatting.php half is for posts and half is for leave a comments.

I had a thought on this but I didn't want to be cracking a whip too frequently. Suppose you cheated a bit. Instead of putting the RDF immediately after the blahbdeeblah how about making a new function that can go in conf/hacks.php to strip the post content looking for "/licenses/" then using everything up to the next / to craft the RDF? Put this new function call right after the $Item->content() and it's buddy the page maker so that the RDF will be pretty derned close to the license bit.

Anyway that was just a thought. Today I thought about playing with the hitlog table and almost completely broke it. Oopsie! I backed it up, but only after I recovered from my near fatal flaw :roll:

4 Jan 18, 2005 07:26

EdB,

I should have been clearer, I meant HTML comments.... The RDF is all in posts, and the RDF bit is surrounded by an HTML comment.

Your hack idea is interesting. My goal was to keep this a strict plugin solution, but I may look into that.

5 Jan 18, 2005 15:24

danielmorrison wrote:

My goal was to keep this a strict plugin solution, but I may look into that.

if you can tell the devs exactly what kind of hook you need, it's maybe implemented in the next release.

6 Jan 21, 2005 06:53

I added a renderer plugin to add the RDF. Works perfectly. Now I can keep it a pure plugin (well, 2 +additional classes) and not have to hack stuff.

I don't know why I didn't think of this before! Oh well. I can't wait for 0.9.1 plugins, so this can consolidate into one file...


Form is loading...