Giter Club home page Giter Club logo

shariff's Introduction

Shariff plugin

This plugin adds social media buttons to your web site (to the footer of each page, the article page or the sidebar) without compromising the privacy of website users. It implements shariff by Heise Medien GmbH (Github, article) in Open Journal Systems.

This plugin has been tested with OJS version 3.4.0. It should also be compatible with OMP 3.4 and OPS 3.4.

Features

Available social media services (as of Shariff 3.2.1) are:

  • Twitter
  • Facebook
  • LinkedIn
  • Pinterest
  • XING
  • Whatsapp
  • AddThis
  • Tumblr
  • Flattr
  • diaspora*
  • reddit
  • StumbleUpon
  • Threema
  • Weibo
  • Qzone
  • Mail
  • Print
  • Buffer
  • Flipboard
  • Tencent-Weibo
  • Pocket
  • Telegram
  • vk
  • Info

Additionally an info button that links to the heise article can be added. You can also add a mail icon.

The plugin offers a selection of settings like themes, orientation and position of the social media buttons (see settings below) accessible via "Website -> Appearance".

The plugins will be displayed in the language of the website.

You can add the Shariff PHP Backend to display the number of likes (not tested, see below).

License

This plugin is licensed under the GNU General Public License v3. See the file LICENSE for the complete terms of this license.

System Requirements

This plugin is compatible with OJS version 3.4.0. It should also be compatible with OMP 3.4 and OPS 3.4.

Installation

Clone this repo in your plugin folder (/plugins/generic) or download the code and tar.gz it and upload it via the gui (Website Settings > Plugins).

Settings

The settings form can be found unter "Website -> Appearance -> Shariff Plugin". The following settings are available:

  • choose the services you would like to provide on the journal pages (see list above)
  • choose a provided theme for the social media buttons (standard, white, grey)
  • determine the position of the social media buttons on your journal web site (footer, sidebar or article/book page)
  • choose the orientation of the social media buttins (vertical or horizontal)

Usage

Install the plugin as described above, activate it and choose the settings you prefer. If you choose the sidebar option, you need to enable the new Shariff-block under management/settings/website.

Display numbers

To display the numbers how often a page is shared in social media, you need to add the Shariff PHP Backend (https://github.com/heiseonline/shariff-backend-php/releases) to you OJS installation. To set up the backend you need to have access to the code. Follow the steps:

  1. Download the Shariff PHP Backend release zip file and unzip it.
  2. Copy the folder to the top level of your installation, name it "shariff-backend" and make it writable.
  3. Change the domain in index.php to your domain.
  4. The installation registers the folder if is named "shariff-backend" and everything should be working.

Contact/Support

Documentation, bug listings, and updates can be found on this plugin's homepage at http://github.com/ojsde/shariff. Contact us via [email protected]. Find out more about the project OJS-de.net.

Version History

  • 3.4 - plugin version for OJS 3.4
  • 3.3 - plugin version for OJS 3.3
  • 3.2 - plugin version for OJS 3.2
  • 3.0 - Adaption to OJS/OMP 3.1.2, update to Shariff Version 3.2.1
  • 2.0 - Adaption to OJS/OMP 3
  • 1.0 - Shariff plugin for OJS 2

Technical Documentation

This plugin works for OJS and OMP 3 (the code is the same). The shariff solution by heise (version v3.2.1) is included in the plugin code (MIT License). It adds the social media buttons using html, css and js. The plugin uses hooks to add content, no existing templates are being overwritten. No database access is needed.

Hooks

The buttons are added via template hooks:

  • Templates::Common::Footer::PageFooter
  • Templates::Article::Details
  • Templates::Catalog::Book::Details
  • Templates::Preprint::Details

To add the plugin to the sidebar, this plugin is also a block plugin.

Attributes

The shariff solution offers different settings (see data attributes https://github.com/heiseonline/shariff). A selection of them are used in this plugin (some are filled automatically, some can be chosen by the user in the plugin setting):

  • data-lang: The plugin reads the selected language of the GUI automatically and uses it to display the buttons in that language.
  • data-services: The user can choose from a list of services in the plugin settings (see above).
  • data-mail-url: The automatically set string "mailto" allows the usage of local mail clients.
  • data-mail-body: The plugin enters the respective url automatically.
  • data-backend-url: The backend url is read automatically if the folder exists. The folder has to be placed at the document root and named "shariff-backend".
  • data-theme: The user can choose between different themes in the plugin settings (see above).
  • data-orientation: The user can choose between two orientation in the plugin settings (see above).
  • data-url: The plugin adds the respective url automatically.

shariff's People

Contributors

bolelligallevi avatar cfanselow avatar jhonathanlepidus avatar lilients avatar majaroenne avatar mtub avatar ohilbig01 avatar open-encyclopedia-system avatar ronste avatar tgc avatar vormia avatar zuphilip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shariff's Issues

Compatibility with OJS3 bootstrap themes

Hi everyone,

when using shariff with the bootstrap3 themes, there seems to be a minor styling issues. From what I saw it's not much of a problem (could probably be fixed with a height: 100%; somewhere), but perhaps there are other, less obvious problems to be found in this context.

grafik

Kind regards and many thanks for all the good work!

Error 500 upon plugin upload

Hi!

I am running OJS 3.1.2 and as soon as I uploaded and activated the plugin, the whole website went down and started showing a 500 Error. I then had to rename the plugin fodler to get the site back up and running. I dig up the logs and they say this:

[Mon Oct 12 10:29:20.032690 2020] [:error] [pid 19769] [client 109.177.14.16:55886] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/plugins/generic/shariff/ShariffPlugin.inc.php:42\nStack trace:\n#0 /var/www/html/lib/pkp/classes/plugins/PluginRegistry.inc.php(65): ShariffPlugin->register('generic', 'plugins/generic...', NULL)\n#1 /var/www/html/lib/pkp/classes/plugins/PluginRegistry.inc.php(138): PluginRegistry::register('generic', Object(ShariffPlugin), 'plugins/generic...', NULL)\n#2 /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php(132): PluginRegistry::loadCategory('generic', true)\n#3 /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php(252): Dispatcher->dispatch(Object(Request))\n#4 /var/www/html/index.php(68): PKPApplication->execute()\n#5 {main}\n thrown in /var/www/html/plugins/generic/shariff/ShariffPlugin.inc.php on line 42

What could be the issue here?

delete text (tweet, share) next to the icons

Hi!

1.- I need to delete the text (tweet, share) next to the icons. that is, only the icon is displayed, not the text.

2.- Is it possible to change the text, for example, instead of "share" that appears "spread"?
Thanks!

No social media sharing ribbon or plugin settings displayed

It looks like there's an across the board issue with this OJS plugin (tested in several OJS 3.3 journals):

  1. The plugin is enabled but the social media sharing ribbon is not displayed
  2. There is no "Settings" button for the plugin in the Gallery

image

AddThis service was discontinued this month so perhaps it's affected the plugin in some way?

Adressierbares div-Element für Seitenblock bzw. Artikeldetailseite

Empfehlung für Zeile 124 von ShariffPlugin.inc.php , ein mit einer Klasse versehenes div-Element zu verwenden:

Z.B. anstelle von $divWrapper = '<div><div>';

$divWrapper = '<div class="shariffblock"><div>';

verwenden.

Damit kann das div-Element geeignet mit CSS adressiert werden. Beispielsweise lässt sich dann mit CSS flexbox die Anordung des Elements auf der Artikeldetailseite beliebig setzen.

Beispiel: https://doi.org/10.26043/GISo.2020.1.3 --> Shariffblock ist an vierter Stelle anstatt am Ende der Artikeldetails.

Funktioniert nicht mit OJS 3.2.1.1

  • taucht nicht auf in der Plugin-Gallery
  • manuelle Installation via tar.gz in /plugins/generic/ --> Plugin erscheint nicht in der Plugin-Liste

Fehler:

Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function getSubmissionId() on null in /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php:118\nStack trace:\n#0 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/controllers/grid/notifications/NotificationsGridCellProvider.inc.php(44): NotificationsGridCellProvider->_getTitle(Object(Notification))\n#1 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/controllers/grid/GridCellProvider.inc.php(56): NotificationsGridCellProvider->getCellActions(Object(Request), Object(GridRow), Object(GridColumn))\n#2 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/controllers/grid/GridHandler.inc.php(1104): GridCellProvider->render(Object(Request), Object(GridRow), Object(GridColumn))\n#3 /var/www/virtual/devojs.chimia.ch/htdocs/ojs/lib/pkp/classes/controllers/grid/GridHandler.inc.php(1011): GridHandler->_renderCellInternally(Object(Request), Object(GridRow), Obj...', referer: https://devojs.chimia.ch/management/settings/website

Upgrade to OJS 3.2

Hi guys. Shariff plugin breaks in our OJS 3.2. We know that there is not a version suited for OJS 3.2 yet, but do you have any plan for upgrading the plugin?

Share the article's DOI instead of the OJS link.

We had a request to share the DOI link instead of the OJS link, which has a higher probability of being changed over time. Integrating this functionality into the Shariff plugin seemed ideal to us. Can we submit a pull request with this feature?

We are considering three alternatives:

  1. If a DOI is available, the shared link will point to the DOI.
  2. Configurable option, maintaining the current default.
  3. Configurable option, setting the DOI link as the default.

base_url override settings ignored

Dear Božana Bokan

it seems that the plugin ignores the base_url override settings declared in config.inc.php

I`m using the plugin on www.medienpaed.com and the URLs contain the install path, which should not be shown due to the base_url override settings.
Maybe the problem is the construction of the URLs via $requestedUrl and getCompleteUrl() . Are there any workarounds or alternative methods to contruct the URL?

Thanks

Missing locale key for settings success message - OJS 3.4

There is a missing locale key on the version released for OJS3.4.
Everytime the dashboard loads , the webserver error log file returns:

Missing locale key "plugins.generic.shariff.settings.form.success" for the locale "en"

The key is missing in en locale PO file, but I assume it is worth the while to check all locale files.

Enabling the plugin in the site context breaks the index

We just had downtime on our OJS3 index page and upon investigation I found this in the error log:
PHP Fatal error: Call to a member function getId() on null in /srv/ojs/webroot/plugins/generic/shariff/ShariffPlugin.inc.php on line 42

I immediately suspected that it might have been enabled somewhere inappropriate and looking at the database I found an entry in the plugin_settings table where shariffplugin had been enabled for context_id=0.
This can happen if the plugin is enabled in the site context which is very tempting for a site admin to do.
To resolve the issue I removed the offending row in the plugin_settings table, but it would be nice if enabling it in the site context didn't trigger a fatal error requiring DB surgery to fix.

I am running OJS 3.1.1-2 and shariff from the v3_0_0 tag.

Improve to Documentation

Hello there .. I have installed this plugin on OJS 3.3.0-14 and had a little problem finding where to configure it, as usually OJS plugins are configured from the Installed Plugin list and this one is not. This discrepancy is not reflected in the README.md file's Settings section (https://github.com/ojsde/shariff#settings)

There should be a mention there that says that the plugin creates a new Shariff Plugin Tab under Settings -> Appearence from where you can configure it.

Thanks a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.