World Community Grid – Widget

Die deutsche Version ist weiter unten verfügbar…

English

This plugin allows you to show your World Community Grid badges and statistics in the sidebar of your wordpress blog. The data will be updated once a day. The data base of this plugin is a xml-file, which is located here: http://www.worldcommunitygrid.org/verifyMember.do?name=WCGMemberName&code=YourWCGVerificationCode

Features

  • Show your WCG badges/projects, statistics and your team in the sidebar of your blog
  • You don’t need HTML knowledge (use a template!)
  • You can create and customize your individual WCG-Widget with HTML and over 25 tags
  • The widget works also if worldcommunitygrid.org is down

Requirements

You need the following PHP features to let the widget work correctly:

  • allow_url_fopen ON (php.ini configuration: to access the remote xml-file at WCG)
  • simpleXML (is available by default: to process the xml-file)

Download

world-community-grid-widget

Installation

  1. Copy the plugin in plugin directory (/wp-content/plugins/)
  2. /world-community-grid-widget/data must be writeable & executable (777)
  3. Activate the plugin
  4. Configure the widget (see configuration) & add it to your sidebar.

Configuration

There are 7 input fields in widget admin panel for the World Community Grid widget:

Administration
Configuration
  1. Title – The title/topic of the widget
  2. WCG Member Name -Your World Community Grid member name
  3. WCG Verification Code – Your Verification Code from your profile
  4. Templates – Choose a template (with preview on mouseover the title)
  5. What HTML should precede the badge items – insert your HTML here, which will be shown above the badges. You can use these * variables.
  6. HTML of badge items – insert your HTML, which will be generate for every badge. These ** variables can be used.
  7. What HTML should follow the badge items – This HTML will be shown below badges. You can use these * variables.

Variables

* (only available for HTMLprecede/follow Badges)
[MemberName]
[MemberID]
[RegisterDate PHPDateFormat] – e.g. [RegisterDate Y-m-d] (Warning: no time available!!)
[LastResult PHPDateFormat] – e.g. [LastResult d.m.Y H:i] (Warning: time available!)
[NumDevices]
[TotalRunTime] – in years:days:hours:minutes:seconds
[TotalRunTimeRank]
[TotalPoints]
[TotalPointsRank]
[TotalResults]
[TotalResultsRank]
[AverageRunTimePerDay] – in years:days:hours:minutes:seconds
[AverageRunTimePerResult] – in years:days:hours:minutes:seconds
[AveragePointsPerHourRunTime]
[AveragePointsPerDay]
[AveragePointsPerResult]
[AverageResultsPerDay]
[TeamName]
[TeamId]
[TeamRetireDate PHPDateFormat] (Warning: no time available!!)
[TeamJoinDate PHPDateFormat] (Warning: no time available!!)
[TeamRunTime]
[TeamPoints]
[TeamResults]
use tags like [TeamName|1] to get team name of your previous team, [TeamRetireDate|2 Y-m-d] for your penultimate team etc.

** (only available for HTML of badge items)
[ProjectName]
[ProjectShortName] – e.g. faah
[ProjectResearchUrl] – URL to the project research site at WCG
[BadgeDescription]
[BadgePictureUrl]URL of badge picture!

Examples

1.

Screenshot with default values
Screenshot with default values

HTML above Badges:
[code lang=“html“]
[MemberName] calculated [TotalResults] results & got the following badges:
[/code]

HTML of Badges:
[code lang=“html“]
[BadgeDescription]
[/code]

HTML below Badges:
[code lang=“html“]

WCG – technology solving problems – register & help.
[/code]

2.

list
Screenshot with a list of projects

HTML above Badges:
[code lang=“html“]
[MemberName] registered [RegisterDate d.m.Y] and crunched [AverageResultsPerDay] results per day. [MemberName] helped these projects:

    [/code]

    HTML of Badges:
    [code lang=“html“]

  • [ProjectName]
  • [/code]

    HTML below Badges:
    [code lang=“html“]

[MemberName] is a member of SETI.Germany.
WCG – technology solving problems – register & help.
[/code]

Support

Please use the comments for questions and feedback. Thanks.

Deutsch

Mit dem World Community Grid-Widget kannst du in der Sidebar deines WordPress-Blogs deine Badges und Statistiken von WCG anzeigen lassen. Die Daten werden 1x pro Tag vom World Community Grid heruntergeladen und aktualisiert. Als Grundlage des Widgets dient diese XML-Datei, die unter http://www.worldcommunitygrid.org/verifyMember.do?name=WCGMemberName&code=YourWCGVerificationCode verfügbar ist.

Features

  • Zeige deine WCG Badges, Statistiken und dein Team in der Sidebar deines Blogs
  • Du brauchst keine HTML-Kenntnisse, denn du kannst einfach ein Template (Vorlage) benutzen
  • Wenn du Ahnung von HTML hast, kannst du deine Sidebar individuell gestaltet und hast Zugriff auf über 25 Variablen/Tags
  • Das Widget funktioniert auch, wenn World Community Grid offline ist

Voraussetzungen

Um das Widget nutzen zu können, müssen folgende PHP-Features erlaubt sein:

  • allow_url_fopen ON (php.ini-Einstellung: zum Zugriff auf die entfernte XML-Datei bei WCG)
  • simpleXML (ist standardmäßig vorhanden: Zur Verarbeitung der XML-Datei)

Download

world-community-grid-widget

Installation

  1. Kopiere das Plugin in das Plugin-Verzeichnis (/wp-content/plugins/)
  2. Das Verzeichnis /data/ muss beschreibbar und ausführbar sein (777)
  3. Aktiviere über die Plugin-Verwaltung das Plugin
  4. Administriere das Widget und pass es deinen Vorstellungen entsprechend an (siehe Administration)

Administration

In dem Widget Administrationsbereich gibt es zur Konfiguration 7 Felder:

Administration
Administration
  1. Titel – Die Überschrift des Widgets
  2. WCG Member Name – Dein Name beim World Community Grid
  3. WCG Verification Code – der Code ist in deinem Profil
  4. Template – Hier kannst du eine Vorlage wählen, um nicht selber HTML/Code schreiben zu müssen. Wenn du mit der Maus über den Titel gehst, siehst du eine Vorschau des Templates.
    Die folgenden Felder sind standardmäßig ausgeblendet:
  5. What HTML should precede the badge items – Hier kannst du HTML einfügen, der vor deinen Badges angezeigt wird. Dabei können diese * Felder/Variablen benutzt werden
  6. HTML of badge items – Gebe hier das HTML ein, welches für jeden Badge generiert werden soll. Diese ** Felder/Variablen sind benutzbar.
  7. What HTML should follow the badge items – Das HTML, welches unterhalb der Badges angezeigt werden wollen. Diese * Felder/Variablen sind hinterlegt.

Felder/Variablen/Tags

* (nur in den Feldern HTML precede/follow Badges verfügbar)
[MemberName]
[MemberID]
[RegisterDate PHPDateFormat] – z.B. [RegisterDate Y-m-d] (ACHTUNG: Keine Uhrzeit vorhanden!!)
[LastResult PHPDateFormat] – z.B. [LastResult d.m.Y H:i] (ACHTUNG: Uhrzeit vorhanden!)
[NumDevices]
[TotalRunTime] – in Jahre:Tage:Stunden:Minuten:Sekunden
[TotalRunTimeRank]
[TotalPoints]
[TotalPointsRank]
[TotalResults]
[TotalResultsRank]
[AverageRunTimePerDay] – in Jahre:Tage:Stunden:Minuten:Sekunden
[AverageRunTimePerResult] – in Jahre:Tage:Stunden:Minuten:Sekunden
[AveragePointsPerHourRunTime]
[AveragePointsPerDay]
[AveragePointsPerResult]
[AverageResultsPerDay]
[TeamName]
[TeamId]
[TeamRetireDate PHPDateFormat] (Warning: no time available!!)
[TeamJoinDate PHPDateFormat] (Warning: no time available!!)
[TeamRunTime]
[TeamPoints]
[TeamResults]
Um auf ältere Teams deiner Teamhistorie zuzugreifen, musst  du solche Tags nutzen: [TeamName|1] ist der Teamname deines vorherigen Teams, [TeamRetireDate|2 Y-m-d] bezieht sich auf das vorvorletzte Team.

** (nur im Feld HTML of badge items verfügbar)
[ProjectName]
[ProjectShortName] – z.B. faah
[ProjectResearchUrl] – URL zur entsprechenden Research-Seite bei WCG
[BadgeDescription]
[BadgePictureUrl]URL zum Badge-Bild

Beispiele

1.

Screenshot with default values
Screenshot mit den vorbelegten Einstellungen

HTML above Badges:
[code lang=“html“]
[MemberName] calculated [TotalResults] results & got the following badges:
[/code]

HTML of Badges:
[code lang=“html“]
[BadgeDescription]
[/code]

HTML below Badges:
[code lang=“html“]

WCG – technology solving problems – register & help.
[/code]

2.

list
Screenshot mit einer Liste der Projekte

HTML above Badges:
[code lang=“html“]
[MemberName] registered [RegisterDate d.m.Y] and crunched [AverageResultsPerDay] results per day. [MemberName] helped these projects:

    [/code]

    HTML of Badges:
    [code lang=“html“]

  • [ProjectName]
  • [/code]

    HTML below Badges:
    [code lang=“html“]

[MemberName] is a member of SETI.Germany.
WCG – technology solving problems – register & help.
[/code]

Support

Bitte benutzt die Kommentar-Funktion für Fragen und Feedback. Danke.

22 Gedanken zu „World Community Grid – Widget

    1. Hi Phong!

      First: Just try to reload the page – it seems that the plugin caches old values for $xml_file.
      If the reload doesn’t work – read on: There are different reasons for the „No $xml_file available“ error:

      wcg_data.xml permission is not 666
      The WCG Member Name is wrong. You can check it by using this URL & substitute WCGMemberName for your name
      WCG’s xml file is not available because WCG update their statistics
      your php.ini configuration (allow_url_fopen) don’t allow to access WCG’s xml file

      I’ll try to output better error messages in version 1.1.

  1. Now I got ‚Error: WCG error: Missing Argument‘ with v1.1

    At first it didn’t have the write permission on wcg_data.xml (what should the permission on this file?)

  2. I’m not that good in German, so i’m posting in English…

    I just downloaded your plugin for WCG and installed it. Unfortunaly i got the following error: Warning: wcg_widget::view() [function.wcg-widget-view]: Node no longer exists in /var/www/vhosts/winandrenkema.nl/httpdocs/wp-content/plugins/world-community-grid-widget/wcg_widget.php on line 421

    I just updated my wordpress to version 2.8, so mayby this is een version problem. I don’t know if it is, but i just want to notify you … so you can fix it in time.

    1. Hi Winand!

      Thanks for your feedback. I also updated to WordPress 2.8 and I have no problems with my wcg widget.

      The missing view() function is in the widget code, but it’s a little bit curious that this function view() is neither called nor defined on line 421.

      Please do me a favour and delete, download the widget again and reinstall it. Please inform me of the result.

      Thanks
      crille

  3. Morning Crille,

    I still get the error after reinstalling.

    I also forgot to mention that putting the widget on the sidebar will give a really odd error. I made a screenshot of it, and placed it here: http://nl.tinypic.com/r/96b53d/5 This behavior showed up when i was dragging the „World Community Grid“ widget to the right.

    I use WordPress 2.8 with a dutch language-pack installed on it.

    Until now other widgets work fine with me, so i suppose its a related to this one.

    Thanks for the quick reply.

    1. Hi Winand!

      I have the same behaviour when putting the widget on sidebar. I’ll check it after the NovaRock Festival. Thanks for your reply.

      crille

      PS: On which page do you get the view()-error? In the sidebar or on administration page?

  4. Good evening,

    I get the error on the sidebar on the frontside. On the administration page it’s only the odd behavior.

    Have fun at the festival. Look like a lot of fun. :D

    Winand.

  5. Good evening (agian),

    I have been fiddling around it figured out what the problem is. For some reason i don’t have the so called badges in the XML file requested via http://www.worldcommunitygrid.org/verifyMember.do? … really strange but i probably didn’t earn them yet.

    I fixed the error by inserting the next line at 423: if (isset($xml->MemberStats->MemberStat->Badges))
    {
    and ofcours } at 475.

    For now this will do for me. I hope you can use this info.

    Winand

    1. Thanks for your solution, Winand. I updated the wcg widget to version 2.1. Now, the plugin uses the new WordPress Widget API and I hope everything works, because I had to edit a lot of code.

  6. Hi,

    I’m not able to use this plugin under WordPress 3.3.1 (apache2, php5). I can activate the plugin without any problems, but when I try to use the widget and to drag-and-drop-it into my sidebar, it spawns itself.

    In apache logfile there’s an entry: simplexml_load_file(): I/O warning : failed to load external entity $PATH/plugins/world-community-grid-widget/data/wcg_user.xml“ in $PATH/plugins/world-community-grid-widget/wcg_widget.php on line 595

    Creating an empty one does not help.

  7. The other day, while I was at work, my cousin stole my apple ipad and tested to see if it can survive a 40 foot drop, just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views. I know this is totally off topic but I had to share it with someone!

  8. Hey, I think your site might be having browser compatibility issues. When I look at your blog site in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, wonderful blog!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *