CreativeCommons bug (after update)

Creating and modifying plugins.
Post Reply
deedw
Regular
Posts: 61
Joined: Thu Oct 07, 2010 5:57 am

CreativeCommons bug (after update)

Post by deedw »

Hello,

I've updated from 1.6.2 to 2.1.2 today. But the CreativeCommons plugin for the sidepane does not work correctly anymore because the image is missing. The source code:

Code: Select all

<img style="border: 0px" alt="Creative Commons License - Some Rights Reserved" title="Creative Commons License - Some Rights Reserved" src="" />
So, yeah, the image source is missing. I've checked the php-files but I do not understand how this html code is generated.

Maybe someone can help me fixing it.

Best regards
Dee
Blog: http://www.deesaster.org/blog/
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: CreativeCommons bug (after update)

Post by onli »

Hi
The sidebar-plugin is calling an event and displaying the result:

Code: Select all

serendipity_plugin_api::hook_event('frontend_display:html_layout', $eventData);
echo $eventData['display_dat'];
Now, frontend_display:html_layout is used in serendipity_event_creativecommons. There are several variations of this code:

Code: Select all

$eventData['display_dat'] .= '<img style="border: 0px" alt="' . $image_titel. '" title="' . $image_titel. '" src="' . serendipity_getTemplateFile('img/norights.png') .'" />';
But you are right: The crux of the issue is that the plugin does not have the image file available. I think that the images you need live in /templates/default/img. You could either move them to plugins/serendipity_event_createivecommons/img/, a directory that would need to be created, which I think is the best solution. Or you could add them to templates/2k11/img/

The image files I see are: norights.png, somerights20.gif. That is a bit strange, isn't it? Apart from mixing gif and png, shouldn't there be more images for the different type of CC-licences?
deedw
Regular
Posts: 61
Joined: Thu Oct 07, 2010 5:57 am

Re: CreativeCommons bug (after update)

Post by deedw »

I think that the images you need live in /templates/default/img. You could either move them to plugins/serendipity_event_createivecommons/img/, a directory that would need to be created, which I think is the best solution. Or you could add them to templates/2k11/img/
The file in plugins/serendipity_event_createivecommons/img/ did not work but in templates/2k11/img/ it works. It's seems wrong that you need to copy these files from the default-template-img-folder to every template (if you are changing them from time to time).
That is a bit strange, isn't it? Apart from mixing gif and png,
I'm not sure where the norights logo is from but it's not an official CreativeCommons logo. I think the CC0 or PD-logo would be better.
shouldn't there be more images for the different type of CC-licences?
It depends. If you want you could create a filename from the selected settings and use one of those logos: https://creativecommons.org/about/downloads But because this is a lot of programming and cases you usually just show the generic CC-logo.

One other question: In the creativecommons_event-settings there is a field for "PLUGIN_CREATIVECOMMONS_IMAGETYPE"? What does this setting change? I don't see it.

Best regards
Dee
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: CreativeCommons bug (after update)

Post by onli »

It's seems wrong that you need to copy these files from the default-template-img-folder to every template (if you are changing them from time to time).
It is wrong, I'd guess it is an oversight from when we moved the default theme from default to 2k11, because the templates in default were so old.
One other question: In the creativecommons_event-settings there is a field for "PLUGIN_CREATIVECOMMONS_IMAGETYPE"?
From the config values it seems like this was used to toggle between different sizes of those images, but neither the event nor the sidebar plugin seems to use the variable.

It would be great if you could send a PR with the necessary changes to make the plugin work again (you could also make it use the correct images). I think we have a new plugin api function to include files like this from the plugin directory, I should have a look. We could also remvoe the unused plugin config variable.
Post Reply