This patch adds a admin settings page which lets you :

* Set a site wide flattr account, which can optionally be overruled by user flattr accounts
* Set the mapping relationship between your sites content types and the flattr categories on the admin page (all in one place)

As well as several other changes to :

* Changed to use 'manual' mode of the JS API instead of the 'not recommended' direct mode it currently uses
* Added a static HTML button for instances where JS is disabled (only links to the users profile)
* Added functionality to allow more than one button (with different users) per page
* Added param's to the theme_flattr_button to allow for use of 'compact' button mode (not implemented in UI)

Not yet fully tested in production, but seems to work. (oh and if you like this patch, please flattr https://flattr.com/profile/demotix :o) )

CommentFileSizeAuthor
#3 flattr_update.2.patch8.01 KBa_c_m
flattr_update.patch7.54 KBa_c_m
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nunoveloso’s picture

subscribe

nunoveloso’s picture

I just finished to test this patch and it is working as described.

I've tested:
- site wide VS user overriden flattr account
- mapping relationships between node types and flattr catrgories

- HTML version (disabled JS)
- different kind of buttons in the same page

a_c_m’s picture

FileSize
8.01 KB

Minor update, to improve wording of the Flattr settings fieldset on users settings pages.

voxpelli’s picture

Subscribe

dawehner’s picture

Status: Active » Needs work

Please write patches against the dev versions :( There are many changes since the beta5
This patch doesn't not apply anymore. It's not only a online-line not apply change.

Additional it would be cool if the admin settings could be moved into a .admin.inc file

Additional i'm wondering whether it makes sense to use $(document).ready instead of Drupal.behaviors.foo
This fixes ajax issues


+  $flattr_uid = variable_get('flattr_sitewide_account', 'drupal');

Also check plain it here.

+  global $flattr_script_added;

A static extra helper function to add the head code would work too, and is less hacky.


+  if ($account->flattr['uid'] AND variable_get('flattr_sitewide_useage', 2)) {

Drupal uses && instead of AND.


+  $output = '<div id="'. $id .'"><a href="https://flattr.com/profile/'.$flattr_uid.'" <img alt="Flattr Button" src="https://api.flattr.com/button/flattr-badge-large.png"></a></div>';

Can we make this translatable?

Instead of generate js directly we could also use drupal_add_js 'setting' and use this settings in the behaviours function

asb’s picture

sub

pribeh’s picture

sub

Letharion’s picture

Status: Needs work » Closed (won't fix)

Closing this one as the patch hasn't been updated for very long. Please re-open if the patch gets an update.