Browse Source

Removed supporters database!

svn path=/trunk/; revision=34566
tags/stw2018
jonas 3 years ago
parent
commit
6affe3bed8
71 changed files with 4 additions and 3850 deletions
  1. 3
    0
      .htaccess
  2. 0
    3
      fellowship/faq.en.xhtml
  3. 1
    1
      fellowship/index.en.xhtml
  4. BIN
      support/button.fi.png
  5. 0
    5
      support/d3.layout.min.js
  6. 0
    6
      support/d3.min.js
  7. 0
    31
      support/default.xsl
  8. 0
    59
      support/export-support-as-csv-with-obscured-url-lkaf9847h59j7f4s5ds.php
  9. 0
    52
      support/extract_and_import/README.txt
  10. 0
    248
      support/extract_and_import/countries.txt
  11. 0
    131
      support/extract_and_import/format-supporters.sh
  12. 0
    39
      support/massmailing/2012-09-13-fi.py
  13. 0
    129
      support/massmailing/massmailing.py
  14. 0
    2
      support/massmailing/supporters-fi-2012-09-11-with-errors.csv
  15. 0
    93
      support/portal-backend.php
  16. 0
    55
      support/portal.da.xhtml
  17. 0
    45
      support/portal.de.xhtml
  18. 0
    56
      support/portal.el.xhtml
  19. 0
    45
      support/portal.en.xhtml
  20. 0
    49
      support/portal.et.xhtml
  21. 0
    98
      support/portal.fi.xhtml
  22. 0
    49
      support/portal.it.xhtml
  23. 0
    54
      support/portal.ru.xhtml
  24. 0
    45
      support/portal.sq.xhtml
  25. BIN
      support/printable-form.fi.odt
  26. BIN
      support/qrcode.png
  27. 0
    113
      support/remind-unconfirmed-with-obscured-url-sdkfsy3i4j5skd354kmds4w.php
  28. 0
    1
      support/rickshaw.min.css
  29. 0
    6
      support/rickshaw.min.js
  30. 0
    664
      support/stats.php
  31. 0
    86
      support/support.bs.xhtml
  32. 0
    84
      support/support.da.xhtml
  33. 0
    88
      support/support.de.xhtml
  34. 0
    90
      support/support.el.xhtml
  35. 0
    86
      support/support.en.xhtml
  36. 0
    88
      support/support.es.xhtml
  37. 0
    88
      support/support.et.xhtml
  38. 0
    86
      support/support.fi.xhtml
  39. 0
    80
      support/support.fr.xhtml
  40. 0
    88
      support/support.it.xhtml
  41. 0
    84
      support/support.nl.xhtml
  42. 0
    178
      support/support.php
  43. 0
    88
      support/support.ru.xhtml
  44. 0
    87
      support/support.sq.xhtml
  45. 0
    15
      support/template-email-confirm.da.inc
  46. 0
    20
      support/template-email-confirm.de.inc
  47. 0
    15
      support/template-email-confirm.el.inc
  48. 0
    19
      support/template-email-confirm.en.inc
  49. 0
    13
      support/template-email-confirm.et.inc
  50. 0
    13
      support/template-email-confirm.fi.inc
  51. 0
    31
      support/template-email-confirm.it.inc
  52. 0
    16
      support/template-email-confirm.ru.inc
  53. 0
    15
      support/template-email-confirm.sq.inc
  54. 0
    22
      support/template-email-exists.da.inc
  55. 0
    22
      support/template-email-exists.de.inc
  56. 0
    22
      support/template-email-exists.el.inc
  57. 0
    22
      support/template-email-exists.en.inc
  58. 0
    15
      support/template-email-exists.et.inc
  59. 0
    20
      support/template-email-exists.fi.inc
  60. 0
    43
      support/template-email-exists.it.inc
  61. 0
    22
      support/template-email-exists.ru.inc
  62. 0
    22
      support/template-email-exists.sq.inc
  63. 0
    9
      support/template-thankyou.da.inc
  64. 0
    9
      support/template-thankyou.de.inc
  65. 0
    10
      support/template-thankyou.el.inc
  66. 0
    9
      support/template-thankyou.en.inc
  67. 0
    8
      support/template-thankyou.et.inc
  68. 0
    8
      support/template-thankyou.fi.inc
  69. 0
    23
      support/template-thankyou.it.inc
  70. 0
    18
      support/template-thankyou.ru.inc
  71. 0
    9
      support/template-thankyou.sq.inc

+ 3
- 0
.htaccess View File

@@ -9,6 +9,9 @@ RewriteRule ^graphics/fsfeurope.ico /graphics/fsfe.ico [redirect=permanent]
# Translators redirect
RewriteRule ^translate /contribute/translators/ [redirect=permanent]

# Old supporter database
RewriteRule ^support /join [redirect=permanent]

# AskYourCandidates redirect
RewriteRule ^campaigns/ayc(.*) /campaigns/askyourcandidates$1 [redirect=permanent]


+ 0
- 3
fellowship/faq.en.xhtml View File

@@ -24,9 +24,6 @@
<dt>What is the Fellowship?</dt>
<dd>The Fellowship is the primary way people can identify with and support the Free Software Foundation Europe. Fellows are FSFE's sustaining members that enable our financial autonomy and empower our work. Every Fellow is important to us, motivates us, supports us and gives us valuable feedback for our work. Although this is not a must, many Fellows decide to become part of our community, chat with other Fellows, blog about Free Software or even meet in local groups. Read more on the <a href="/fellowship/about/fellowship.html">about FSFE's Fellowship</a> page</dd>
<dt>I am already a supporter - shall I become a Fellow?</dt>
<dd>Decide on your own. Becoming or being a <a href="/support/index.html">supporter of FSFE</a> is a first step that we highly appreciate. By being a supporter of FSFE, you show that you care about users and software freedom and are interested in and appreciate the work of FSFE. It is also the first step into FSFE's community and a way to keep you up to date about our activities. However, in the long run, FSFE needs financial support to pay staff, keep campaigns running, realize projects and have even more influence on politics. By becoming a Fellow you help us with a financial foundation for our work. We are a non-profit organisation and you can be sure, that every Euro you spend to FSFE will be used responsibly.</dd>
<dt><a name="donate"></a>I just would like to donate money to FSFE - how do I do that best?</dt>
<dd>If you would like to spend money to the FSFE but you do not have interest in community activities, still the most efficient and best way would be to join the Fellowship. This is, because you keep our administrative overhead as low as possible if you donate by joining the Fellowship. During the registration process, you will be asked if you are looking for contact to local Fellowship groups. Just leave this box unchecked and we will not bother you with any community news. In Germany, the Netherlands and Switzerland, your Fellowship donation will be tax decuctible just as any usual donation or a single donation to us.</dd>

+ 1
- 1
fellowship/index.en.xhtml View File

@@ -13,7 +13,7 @@

<div id="introduction">
<p>If you feel strong about Free Software and you would like to strengthen the political weight of the Free Software movement, then join our community. Become a <a href="../support/index.en.html">supporter of the FSFE</a> to align yourself with our work and mission. Subscription is easy and no costs are involved. Or become a <a href="about/fellowship.html">Fellow of the FSFE</a> to empower our work and help to assure our financial independence. By joining the Fellowship you will become a donating, sustaining member of the FSFE - including access to our infrastructure. Decide for yourself in which way you would like to get involved in FSFE's activities.</p>
<p>If you feel strong about Free Software and you would like to strengthen the political weight of the Free Software movement, then join our community. You can become a <a href="about/fellowship.html">Fellow of the FSFE</a> to empower our work and help to assure our financial independence. By joining the Fellowship you will become a donating, sustaining member of the FSFE - including access to our infrastructure. Decide for yourself in which way you would like to get involved in FSFE's activities.</p>
</div>


BIN
support/button.fi.png View File


+ 0
- 5
support/d3.layout.min.js
File diff suppressed because it is too large
View File


+ 0
- 6
support/d3.min.js
File diff suppressed because it is too large
View File


+ 0
- 31
support/default.xsl View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str">

<xsl:import href="../build/xslt/gettext.xsl" />
<xsl:import href="../tools/xsltsl/static-elements.xsl" />
<xsl:import href="../tools/xsltsl/tagging.xsl" />

<!-- For pages used on external web servers, load the CSS from absolute URL -->
<xsl:variable name="urlprefix">
<xsl:if test="/buildinfo/document/@external">https://fsfe.org</xsl:if>
</xsl:variable>

<xsl:include href="../build/xslt/fsfe_head.xsl" />
<xsl:include href="../build/xslt/fsfe_body.xsl" />
<xsl:include href="../build/xslt/fsfe_document.xsl" />
<xsl:include href="../build/xslt/fsfe_headings.xsl" />
<xsl:include href="../build/xslt/fsfe_localmenu.xsl" />

<xsl:include href="../build/xslt/support_js.xsl" />
<xsl:include href="../build/xslt/support_countries.xsl" />

<!-- Do not copy non-HTML elements to output -->
<xsl:include href="../build/xslt/fsfe_nolocal.xsl" />

<!-- HTML 5 compatibility doctype, since our XSLT parser doesn't support disabling output escaping -->
<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />

</xsl:stylesheet>

+ 0
- 59
support/export-support-as-csv-with-obscured-url-lkaf9847h59j7f4s5ds.php View File

@@ -1,59 +0,0 @@
<?php
/*
Copyright (C) 2012 Otto Kekäläinen <otto@fsfe.org> for Free Software Foundation Europe

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// This file is temporary - now I just need so see the db contents
// to develop email confirmation function

die("This file is for debugging only.");

$db = new PDO("sqlite:../../../db/support.sqlite");

//$query = $db->query("alter table t1 drop column signed");
// not possible to drop columns in LiteSQL

$query = $db->query("select * from t1");

header("Content-type: text/csv");
header("Cache-Control: no-store, no-cache");
header('Content-Disposition: attachment; filename="supporters.csv"');

$outstream = fopen("php://output",'w');

$first_row = true;
while ($row = $query->fetch(PDO::FETCH_ASSOC))
{
if ($first_row)
{
// I'm not sure how to get the field names using a PDO method but
// we can use the first row's (or any row's) key values as these
// are the field names.
$first_row = false;
$number_of_fields = count($row);
$field_names = array_keys($row);
fputcsv($outstream, $field_names, ',', '"');
}
// do stuff here with the row
fputcsv($outstream, $row, ',', '"');
}

fclose($outstream);

// close the database connection
$db = NULL;

?>

+ 0
- 52
support/extract_and_import/README.txt View File

@@ -1,52 +0,0 @@
## GENERAL
By saving the data about supporters, we have following information about them:

id: ID number, more numbers than supporters because non-confirmed supporters are deleted AFAIK
time: Date and time of subscription
firstname: First Name of Supporter
lastname: Last Name of Supporter
email: Email address of supporter
country_code: Two digit country code of supporter (ISO-639-1 as it seems)
secret: unknown, seemes to be a MD5 hash
signed: unused, maybe a option to subscribe for newsletter
confirmed: Date and time of email confirmation
updated: unused AFAICS
ref_url: Referal URL
ref_id: Referal ID (like "mk" for Matthias or "google" for an Google url)
lang: Maybe language of browser?
reminder1: Date and time of 1st reminder mail?
reminder2: Date and time of 2nd reminder mail?
reminder3: Date and time of 3rd reminder mail?
zip: ZIP Code, unused
city: City, unused


## DOWNLOADING
For downloading the supporters file, follow these steps:
1. Modify the file /fsfe-web/trunk/support/export-support-as-csv-with-obscured-url-lkaf9847h59j7f4s5ds.php:
Change: //die("This file is for debugging only.");
to: die("This file is for debugging only.");

2. Commit the changes, wait for rebuild and open following url:
https://fsfe.org/support/export-support-as-csv-with-obscured-url-lkaf9847h59j7f4s5ds.php
The download should start now. If not, doublecheck step 1 or wait a bit longer (~10 min)

3. After downloading, revert step 1 and add // in front of the debugging file
if not, everybody would be able to download sensitive data.


## FORMATTING
If you want to import this data in CiviCRM, you need to format it first. For example, many names are lower/uppercase only or are empty. The Country Codes are not supported in CiviCRM as well. Additionally, some data is completely useless. If you have another feeling, feel free to change the script.

For this, you can use format-supporters.sh in addition to countries.txt. Just define a file to import (default: supporters.csv), the desired filename at output (default: supporters_format.csv) and the CountryCode-to-Country-Name file (default: countries.txt).

Now execute the shell script in your local terminal:
./format-supporters.sh

After ~5-10 minutes, all entries should be written to the output file. Please do not worry if the output file keeps empty until the end of the script: It writes the data to a temporary file during the execution process.


To understand what the script exactly does, please see the comments in the bash script.


## IMPORTING

+ 0
- 248
support/extract_and_import/countries.txt View File

@@ -1,248 +0,0 @@
# This file is needed to translate the Country Codes used by FSFE to the countries CiviCRM knows. If CiviCRM does not change the names, this file should not be modified
# Kosovo is not available in CiviCRM, so XK = Serbia
# Netherlands Antilles is not available in CiviCRM, so AN = Netherlands
country_code:country
AD:Andorra
AE:United Arab Emirates
AF:Afghanistan
AG:Antigua and Barbuda
AI:Anguilla
AM:Armenia
AN:Netherlands
AO:Angola
AQ:Antarctica
AR:Argentina
AS:American Samoa
AT:Austria
AU:Australia
AW:Aruba
AX:Åland Islands
AZ:Azerbaijan
BA:Bosnia and Herzegovina
BB:Barbados
BD:Bangladesh
BE:Belgium
BF:Burkina Faso
BG:Bulgaria
BH:Bahrain
BI:Burundi
BJ:Benin
BM:Bermuda
BN:Brunei Darussalam
BO:Bolivia
BR:Brazil
BS:Bahamas
BT:Bhutan
BV:Bouvet Island
BW:Botswana
BY:Belarus
BZ:Belize
CA:Canada
CC:Cocos (Keeling) Islands
CD:Congo, The Democratic Republic of the
CF:Central African Republic
CG:Congo, Republic of the
CH:Switzerland
CI:Côte d'Ivoire
CK:Cook Islands
CL:Chile
CM:Cameroon
CN:China
CO:Colombia
CR:Costa Rica
CU:Cuba
CV:Cape Verde
CX:Christmas Island
CY:Cyprus
CZ:Czech Republic
DE:Germany
DJ:Djibouti
DK:Denmark
DM:Dominica
DO:Dominican Republic
DZ:Algeria
EC:Ecuador
EE:Estonia
EG:Egypt
EH:Western Sahara
ER:Eritrea
ES:Spain
ET:Ethiopia
FI:Finland
FJ:Fiji
FK:Falkland Islands (Malvinas)
FM:Micronesia, Federated States of
FO:Faroe Islands
FR:France
GA:Gabon
GB:United Kingdom
GD:Grenada
GE:Georgia
GF:French Guiana
GG:Guernsey
GH:Ghana
GI:Gibraltar
GL:Greenland
GM:Gambia
GN:Guinea
GP:Guadeloupe
GQ:Equatorial Guinea
GR:Greece
GS:South Georgia and the South Sandwich Islands
GT:Guatemala
GU:Guam
GW:Guinea-Bissau
GY:Guyana
HK:Hong Kong
HM:Heard Island and McDonald Islands
HN:Honduras
HR:Croatia
HT:Haiti
HU:Hungary
ID:Indonesia
IE:Ireland
IL:Israel
IM:Isle of Man
IN:India
IO:British Indian Ocean Territory
IQ:Iraq
IR:Iran, Islamic Republic of
IS:Iceland
IT:Italy
JE:Jersey
JM:Jamaica
JO:Jordan
JP:Japan
KE:Kenya
KG:Kyrgyzstan
KH:Cambodia
KI:Kiribati
KM:Comoros
KN:Saint Kitts and Nevis
KP:Korea, Democratic People's Republic of
KR:Korea, Republic of
KW:Kuwait
KY:Cayman Islands
KZ:Kazakhstan
LA:Lao People's Democratic Republic
LB:Lebanon
LC:Saint Lucia
LI:Liechtenstein
LK:Sri Lanka
LR:Liberia
LS:Lesotho
LT:Lithuania
LU:Luxembourg
LV:Latvia
LY:Libya
MA:Morocco
MC:Monaco
MD:Moldova
ME:Montenegro
MG:Madagascar
MH:Marshall Islands
MK:Macedonia, Republic of
ML:Mali
MM:Myanmar
MN:Mongolia
MO:Macao
MP:Northern Mariana Islands
MQ:Martinique
MR:Mauritania
MS:Montserrat
MT:Malta
MU:Mauritius
MV:Maldives
MW:Malawi
MX:Mexico
MY:Malaysia
MZ:Mozambique
NA:Namibia
NC:New Caledonia
NE:Niger
NF:Norfolk Island
NG:Nigeria
NI:Nicaragua
NL:Netherlands
NO:Norway
NP:Nepal
NR:Nauru
NU:Niue
NZ:New Zealand
OM:Oman
PA:Panama
PE:Peru
PF:French Polynesia
PG:Papua New Guinea
PH:Philippines
PK:Pakistan
PL:Poland
PM:Saint Pierre and Miquelon
PN:Pitcairn
PR:Puerto Rico
PS:Palestinian Territory, Occupied
PT:Portugal
PW:Palau
PY:Paraguay
QA:Qatar
RE:Reunion
RO:Romania
RS:Serbia
RU:Russian Federation
RW:Rwanda
SA:Saudi Arabia
SB:Solomon Islands
SC:Seychelles
SD:Sudan
SE:Sweden
SG:Singapore
SH:Saint Helena
SI:Slovenia
SJ:Svalbard and Jan Mayen
SK:Slovakia
SL:Sierra Leone
SM:San Marino
SN:Senegal
SO:Somalia
SR:Suriname
ST:Sao Tome and Principe
SV:El Salvador
SY:Syrian Arab Republic
SZ:Swaziland
TC:Turks and Caicos Islands
TD:Chad
TF:French Southern Territories
TG:Togo
TH:Thailand
TJ:Tajikistan
TK:Tokelau
TL:Timor-Leste
TM:Turkmenistan
TN:Tunisia
TO:Tonga
TR:Turkey
TT:Trinidad and Tobago
TV:Tuvalu
TW:Taiwan
TZ:Tanzania, United Republic of
UA:Ukraine
UG:Uganda
UM:United States Minor Outlying Islands
US:United States
UY:Uruguay
UZ:Uzbekistan
VA:Holy See (Vatican City State)
VC:Saint Vincent and the Grenadines
VE:Venezuela
VG:Virgin Islands, British
VI:Virgin Islands, U.S.
VN:Viet Nam
VU:Vanuatu
WF:Wallis and Futuna
WS:Samoa
XK:Serbia
YE:Yemen
YT:Mayotte
ZA:South Africa
ZM:Zambia
ZW:Zimbabwe

+ 0
- 131
support/extract_and_import/format-supporters.sh View File

@@ -1,131 +0,0 @@
#!/bin/bash


# Please read README.txt before executing this file
# This script is able to format the exported supporter file (.csv) so it can be imported in CiviCRM directly
# It only takes the First Name, Last Name, Email Address and the Country because everything else seemed to be of no interest for further campaigning
# Of course you can change that easily but please be aware that CiviCRM has fields like "ref_url" not by default
# This script is by far not perfect but does what it should do. For 3500 supporters, it needed ~5 minutes

# Written by Max Mehl <max.mehl@fsfe.org> for Free Software Foundation Europe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


# CHANGE these files if needed
INPUT=input_test.csv
OUTPUT=supporters_format.csv
COUNTRIES=countries.txt

## FROM HERE you (hopefully) do not need to change something
# empty output file
> $OUTPUT
> temp131031.txt
> temp131031_new.txt

# Makes all first letters of max. 3 names uppercase and the rest lowercase
function nameformat {
ORIGINALNAME=$1 # Name which should be formatted, should be given by function call
t=1 # start with the first name
AWK="1"
while [ "$AWK" != "" ]; do # only runs if there is still a name

NAME=$(echo $ORIGINALNAME | awk -F\ '{print $'$t'}') # takes out first part of name

NAME=$(echo $NAME | sed "s:[A-Z]:\L&:g") # make all letters lowercase
NAME_1l=$(echo $NAME | sed -e 's/\([a-z]\).*/\1/') # first lowercase letter
NAME_REST=$(echo $NAME | sed -e 's/^'$NAME_1l'//' ) # rest of lowercase letters remain unchanged
NAME_1u=$(echo $NAME_1l | tr [a-z] [A-Z] ) # make first letter uppercase
NAME=$NAME_1u$NAME_REST # put strings together
NAME[$t]=$NAME # Put the formatted name in a different NAME variable each loop
(( t++ )) # Counts 1 up for next part of name
AWK=$(echo $line | awk -F\ '{print $'$t'}') # reads second name, if existing
done

CORRECTNAME="${NAME[1]}" # if there is only one name
if [ "${NAME[3]}" != "" ]; then # if there are 3 names, every additional name is lowercase only
CORRECTNAME=""${NAME[1]}" "${NAME[2]}" "${NAME[3]}""
elif [ "${NAME[2]}" != "" ]; then # if there are 2 names
CORRECTNAME=""${NAME[1]}" "${NAME[2]}""
fi
}


while read line
do
# erase all "", will be added later
line=$(echo $line | sed 's/"//g')
#ID=$(echo $line | awk -F, '{ print $1 }')
#DATE=$(echo $line | awk -F, '{ print $2 }')
FIRSTNAME=$(echo $line | awk -F, '{ print $3 }')
LASTNAME=$(echo $line | awk -F, '{ print $4 }')
EMAIL=$(echo $line | awk -F, '{ print $5 }')
CCODE=$(echo $line | awk -F, '{ print $6 }')
#SECRET=$(echo $line | awk -F, '{ print $7 }')
#SIGNED=$(echo $line | awk -F, '{ print $8 }')
CONFIRMDATE=$(echo $line | awk -F, '{ print $9 }')
#UPDATEDATE=$(echo $line | awk -F, '{ print $10 }')
#REFURL=$(echo $line | awk -F, '{ print $11 }')
#REFID=$(echo $line | awk -F, '{ print $12 }')
# DATE: erase time, only keep date
DATE=$(echo $DATE | awk -F\ '{ print $1 }')

# FIRSTNAME: (only) first letters uppercase
nameformat "$FIRSTNAME"
FIRSTNAME="$CORRECTNAME"
# LASTNAME: (only) first letters uppercase
nameformat "$LASTNAME"
LASTNAME="$CORRECTNAME"
# EMAIL: all letters lowercase
EMAIL=$(echo $EMAIL | sed "s:[A-Z]:\L&:g") # make all letters lowercase

## Replace Country Code with full Country name
## FAR TOO SLOW!!!
#while read line
#do
#GREP=$(echo "$line" | grep "$CCODE")
#if [ $? = 0 ]; then
#COUNTRY=$(echo "$line" | awk -F: '{print $2}')
#fi
#done <"$COUNTRIES"
# Output of all interesting strings with "" surrounded, only if Firstname not empty
if ! ([ "$FIRSTNAME" = "" ] || [ "$CONFIRMDATE" = "" ]); then # this also kicks out the first subscripted supporters, but only in first import
# if [ "$FIRSTNAME" != "" ]; then # this also contains supporters whose emails are not confirmed yet
echo "\"$FIRSTNAME\",\"$LASTNAME\",$EMAIL,\"$CCODE\"" >> temp131031.txt
fi
done <"$INPUT"

# Replaces all Country Codes with the Full Country name used in CiviCRM
while read line
do
CCODE=$(echo $line | awk -F: '{print $1}')
CNAME=$(echo $line | awk -F: '{print $2}')
sed s/"\"$CCODE\""/"\"$CNAME\""/g temp131031.txt > temp131031_new.txt
mv temp131031_new.txt temp131031.txt
done <"$COUNTRIES"

mv temp131031.txt $OUTPUT




+ 0
- 39
support/massmailing/2012-09-13-fi.py View File

@@ -1,39 +0,0 @@
# -*- coding: utf-8 -*-
fromname = "FSFE"
fromaddr = "otto@fsfe.org"
subject = "Tiedote FSFE:n tukijoille Suomessa"
message_body_unwrapped = """
Hyvä FSFE:n tukija!

Kiitos että olet ilmoittautunut tukijaksi sivulla fsfe.org/support

Haluaisitko myös liittyä Fellowship-jäseneksi (http://fellowship.fsfe.org/) tai auttaa FSFE:tä osallistumalla sen toimintaan (http://fsfe.org/contribute/contribute.fi.html)?

FSFE kaipaa suomalaisten vapaaohjelmistojen käyttäjien ja kehittäjien apua erityisesti nyt, koska
* kuntavaalit lähestyvät ja poliitikoihin vaikuttamiseen pitää panostaa erityisesti nyt
* EU:n parlamentti käsittelee kohta yhtenäispatenttia, johon sisältyy vaara, että ohjelmistopatentit tulevat Suomeenkin
* Patenttisotien, mobiilialustakilpailun ja Windows 8:n myötä tuleva rajoitettu käynnistys -toiminto saattaa rajoittaa Linux-yhteensopivien laitteiden saatavuutta

Lisätietoa näistä aiheista löytyy FSFE:n sivuilta, mm.
http://fsfe.org/news/2012/news-20120907-01.fi.html
http://fsfe.org/campaigns/generalpurposecomputing/secure-boot-analysis.en.html

Suomen paikallisryhmän sivuilta näet mitä FSFE on tehnyt Suomessa viime aikoina:
http://fsfe.org/fi/

Vapaiden ja avoimen lähdekoodin ohjelmistojen käyttäjiä uhkaa ajoittain eräiden monikansallisten yritysten epäreilu toiminta. Tehokkain tapa puolustautua monikansallisia yrityksiä vastaan on tukea omia oikeuksiaan puolustavaa monikansallista järjestöä. Tästä syystä minä olen itsekin mukana FSFE:n toiminnassa.

Auta FSFE:tä seuraavin tavoin:
1. Kerro tutuillesi FSFE:stä ja suosittele sivua http://fsfe.org/support
2. Liity Fellowship-jäseneksi osoitteessa http://fellowship.fsfe.org/
3. Osallistu FSFE:n toimintaan esimerkiksi graafisena suunnittelijana, kääntäjänä, www-ylläpitäjänä tai tilaisuuksien järjestäjänä. Katso osallistumisvaihtoehtoja sivulla http://fsfe.org/contribute/contribute.fi.html


Kiitos!


Terveisin,

Otto Kekäläinen
FSFE:n Suomen paikallisryhmän koordinaattori
"""

+ 0
- 129
support/massmailing/massmailing.py View File

@@ -1,129 +0,0 @@
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
# TODO: -u does not seem to have any effect

"""
This script does mass mailing using your Google account to avoid being blacklisted.
Please only send proper mass mails, like press releases and not spam.

Usage:
massmailing.py <username@gmail.com> <message file txt> <recipients list csv>

The script must be called with exactly these parameters, no less nor more.

Before execution the script asks for you password interactively.
"""

import sys, getpass, csv, time, smtplib
import textwrap
from email.mime.text import MIMEText
from email.header import Header

def main():
if len(sys.argv) != 4:
print __doc__
sys.exit(0)
else:
# Open connection
username = sys.argv[1]
password = getpass.unix_getpass("Enter password for account " + username + ": ")
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
print "Authenticating " + username
server.login(username,password)
print "Connection opened."

# Read each line fron recipients and send mail
messagefilename = sys.argv[2]
print "Opening " + messagefilename + ".py"
msg = __import__(messagefilename)
addressfilename = sys.argv[3]
print "Opening " + addressfilename
addresses = csv.reader(open(addressfilename, 'r'))
counter = 0
# Now take a pause to send one message to self and check everything is OK
toaddr = msg.fromaddr
toname = "Massmailer"
msg.message_body = ""
lines = msg.message_body_unwrapped.split("\n")
for line in lines:
if len(line) > 78:
w = textwrap.TextWrapper(width=78, break_long_words=False)
line = '\n'.join(w.wrap(line))
msg.message_body += line + "\n"
#msg.message_body = textwrap.fill(msg.message_body_unwrapped, 75, break_long_words=False, replace_whitespace=False)
# withouth replace_whitespace entire message is reflowed and old line breaks forgotten
# with it extra line breaks are added at odd places
massmail(server, msg.fromname, msg.fromaddr, msg.subject, msg.message_body, toaddr, toname)
print "A test message was sent. Check that it is OK."
check = "empty"
while not check in ['y','n']:
check = (raw_input("Can we continue with the mass mailing? (y/n) ")).lower()[0]
if check == "n":
print("Aborting...")
server.quit() # Maybe it closes automatically, but close it to be sure
sys.exit(0)
# OK, start sending
for row in addresses:
if not row:
continue
if row[0]:
firstname = row[0]
if row[1]:
lastname = row[1]
else:
firstname = ""
lastname = ""
toname = firstname + " " + lastname
toaddr = row[2]
sys.stdout.flush()
# Send mail
massmail(server, msg.fromname, msg.fromaddr, msg.subject, msg.message_body, toaddr, toname)
# Wait before sending next
delay = 3
for i in range(delay):
countertext = str(i) + "/" + str(delay) + "s until next"
sys.stdout.write(countertext + '\x08'*len(countertext))
sys.stdout.flush()
time.sleep(1)
counter += 1
# Finally, close the connection
print str(counter) + " mails sent! "
# extra space at the end to overwrite seconds counter
server.quit()
print "Connection closed."

def massmail(server, fromname, fromaddr, subject, message_body, toaddr, toname):
print "Sending to " + toname,
print "<" + toaddr + ">",
text = message_body
# no wordwrap, copy-pasting text from press release to article easier without
# text = textwrap.fill(text, 75)
msg = MIMEText(text, 'plain', 'utf-8')
msg['From'] = str(Header(fromname, 'utf-8')) + ' <' + str(fromaddr) + '>'
if toname:
msg['To'] = str(Header(toname, 'utf-8')) + ' <' + str(toaddr) + '>'
else:
msg['To'] = toaddr
msg['Subject'] = Header(subject, 'utf-8')
# force utf-8 since MIMEText() somehow generates a base64 encoded payload
# instead of utf-8 or quoted-printable
msg.set_payload(text)
msg.replace_header('Content-Transfer-Encoding', '8bit')
server.sendmail(fromaddr, toaddr, msg.as_string())
print "[OK]"

main()

+ 0
- 2
support/massmailing/supporters-fi-2012-09-11-with-errors.csv View File

@@ -1,2 +0,0 @@
Matti,Nurmi,mtnurmi@luukku.com,over quota
Jarmo ,Reinilä,jartre@gmail.coom,.coom

+ 0
- 93
support/portal-backend.php View File

@@ -1,93 +0,0 @@
<?php
/*
Copyright (C) 2012 Otto Kekäläinen <otto@fsfe.org> for Free Software Foundation Europe

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// report errors
/*
error_reporting(E_ALL);
ini_set('display_errors', 'On');
*/

if (preg_match("/[a-z0-9]/i", $_SERVER["QUERY_STRING"])) {
// keep old way to be backwards compatible
$secret = $_SERVER["QUERY_STRING"];
} else {
die("This page must be called with a parameter");
}

try {
// open the database
$db = new PDO( 'sqlite:../../../db/support.sqlite' );
}
catch(PDOException $e) {
print 'Error while connecting to Database: '.$e->getMessage();
}

try {
// check data
$query = $db->prepare("SELECT
confirmed,
country_code,
email,
firstname,
lastname,
lang,
zip,
city
FROM t1 where secret='". sqlite_escape_string($secret) ."'");
$query->execute();
}
catch(PDOException $e) {
print "Database Error: \n";
print_r($db->errorInfo());
}

$row = $query->fetch(PDO::FETCH_ASSOC);

if ($row['email'] != '') {

// if portal has never been opened before,
// mark the e-mail address confirmed
// as the secret string has only been delivered via e-mail
if ($row['confirmed'] == ''){
$timestamp = date('Y-m-d H:i:s');
$row['confirmed'] = $timestamp;
try {
$query = $db->prepare("UPDATE t1 SET
confirmed='$timestamp'
where secret='$secret'");
$query->execute();
}
catch(PDOException $e) {
print "Database Error: \n";
print_r($db->errorInfo());
}
}
// send JSON off to JS code waiting to recieve it at the portal page
echo json_encode($row);
} else {

echo '{"error":"There was an error in confirming the e-mail address. Please sign up again. If the problem presists, please send feedback at <a href=\'http://fsfe.org/contact/\'>fsfe.org/contact</a>."}';

}

// close the database connection
$db = NULL;

?>

+ 0
- 55
support/portal.da.xhtml View File

@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Støtteportal - FSFE</title>
</head>

<body>
<h1>Tak for din støtte!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>

<!--<p id="support_portal_loading">Indlæser ...</p>-->

<div id="support_portal">
<p>Hej <firstname/> <lastname/></p>
<p>Din adresse <email/> blev bekræftet den <confirmed/>.</p>
<p>Tak for din støtte til <a href="http://fsfe.org/">FSFE</a>!</p>
<p>Du er velkomme til at benytte
<a href="/graphics/supporter/FSFE_supporter.svg">FSFE's støtter-logoer</a>
for at vise din tilknytning.</p>

<h2>Har du lyst til at blive endnu mere involveret i FSFE?</h2>
<!-- In future here should just be some short information wih a link to our community-portal. As this is not-ready and only living on test.fsfe.org, we keep the following text for now. This change should be done soon, so our translators do not have to translate stuff that will soon not be on the page -->

<p>Du er mere end velkommen til at diskutere nyheder eller generelle
spørgsmål om fri software og FSFE på vores
<a href="https://mail.fsfeurope.org/mailman/listinfo/discussion">liste
til generelle diskussioner</a> eller på
<a href="https://lists.fsfe.org/mailman/listinfo">en af vores specifikke
landelister</a>. Er du på udkig efter en lokal kontakt, så se vores
<a href="http://fsfe.org/about/localteams.en.html">liste over lokale
FSFE-grupper</a>.</p>

<p>Slutteligt er FSFE en nonprofitorganisation, som er gjort mulig
takket være individuelle donationer. Overvej at
<a href="https://fsfe.org/fellowship">blive en del af vores
Fellowship</a>, hvis du gerne vil give økonomisk støtte til vores
arbejde.</p>
</div>

<support-portal-javascript/>
</div>

</body>

<timestamp>$Date$ $Author$</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 45
support/portal.de.xhtml View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Portal für Unterstützer - FSFE</title>
</head>

<body>
<h1>Vielen Dank für Ihre Unterstützung!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<!-- <p id="support_portal_loading">Loading..</p> -->
<div id="support_portal">
<p>Hallo, <firstname/> <lastname/></p>
<p>Ihre Adresse <email/> wurde am <confirmed/> bestätigt.</p>
<p>Wir danken Ihnen für Ihre Unterstützung der <a href="/">FSFE</a>!</p>
<p>Wir laden Sie dazu ein, die <a href="/graphics/supporter/FSFE_supporter.svg">FSFE Unterstützer-Logos</a> herunterladen, um Ihre Position zu zeigen.</p>
<h2>Sie möchten noch mehr in die FSFE involviert sein?</h2>
<!-- In future here should just be some short information wih a link to our community-portal. As this is not-ready and only living on test.fsfe.org, we keep the following text for now. This change should be done soon, so our translators do not have to translate stuff that will soon not be on the page -->
<p>Sie sind mehr als willkommen, sich über unsere jüngsten Neuigkeiten oder generelle Fragen über Freie Software und die FSFE auf unserer <a href="https://mail.fsfeurope.org/mailman/listinfo/discussion">allgemeinen Diskussionsliste</a> oder einer unserer <a href="https://lists.fsfe.org/mailman/listinfo">spezifischen Länderlisten</a> auszutauschen. Wenn Sie nach lokalen Ansprechpartnern suchen, werfen Sie bitte einen Blick auf unsere <a href="/about/localteams.html">Liste der lokalen FSFE-Gruppen</a>.</p>
<p>Die FSFE ist eine gemeinnützige Organisation, deren Arbeit durch Einzelspenden erst möglich gemacht wird. Bitte erwägen Sie den <a href="/fellowship">Beitritt zum Fellowship</a>, wenn Sie unsere Arbeit finanziell unterstützen möchten.</p>
</div>

<support-portal-javascript/>
</div>
</body>

<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 56
support/portal.el.xhtml View File

@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Πύλη υποστήριξης - FSFE</title>
</head>

<body>
<h1>Ευχαριστούμε για την υποστήριξή σας!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<p id="support_portal_loading">Φορτώνει..</p>
<div id="support_portal">
<p>Γεια σας, <firstname/> <lastname/></p>
<p>Η διεύθυνσή σας <email/> επιβεβαιώθηκε στο <confirmed/>.</p>
<p>Ευχαριστούμε για την υποστήριξή σας στο
<a href="http://fsfe.org/">FSFE</a>!</p>

<h2>Θα συμβάλλετε περισσότερο;</h2>

<p>Αν θέλετε να συμβάλλετε περισσότερο από μια απλή εγγραφή ως
υποστηρικτής, μπορείτε επίσης:</p>
<ul>
<li><a href="http://fsfe.org/news/newsletter">Να εγγραφείτε
στο Ενημερωτικό δελτίο του FSFE</a></li>
<li><a href="http://fsfe.org/contact/community">Να εγγραφείτε σε
ενδιαφέρουσες λίστες αλληλογραφίας</a></li>
<li><a href="http://fsfe.org/contact/local">Να συναντηθείτε με την ομάδα
της χώρας σας</a></li>
<li><a href="http://fellowship.fsfe.org/">Να εγγραφείτε
στην Κοινότητα</a></li>
<li><a href="http://fsfe.org/donate/">Να κάνετε μια δωρεά
στο FSFE</a></li>
</ul>

<p><a href="http://fsfe.org/contribute/">Δείτε όλες τις επιλογές
για να συμβάλλετε</a></p>
</div>

<support-portal-javascript/>
</div>
</body>

<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 45
support/portal.en.xhtml View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Support portal - FSFE</title>
</head>

<body>
<h1>Thank you for your support!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<!-- <p id="support_portal_loading">Loading..</p> -->
<div id="support_portal">
<p>Hello, <firstname/> <lastname/></p>
<p>Your address <email/> was confirmed on <confirmed/>.</p>
<p>Thank you for your support to the <a href="/">FSFE</a>!</p>
<p>Feel free to use <a href="/graphics/supporter/FSFE_supporter.svg">FSFE's supporter logos</a> to show your affiliation.</p>
<h2>You like to get even more involved into the FSFE?</h2>
<!-- In future here should just be some short information wih a link to our community-portal. As this is not-ready and only living on test.fsfe.org, we keep the following text for now. This change should be done soon, so our translators do not have to translate stuff that will soon not be on the page -->

<p>You are more than welcome to discuss recent news or general questions about Free Software and the FSFE on our <a href="https://mail.fsfeurope.org/mailman/listinfo/discussion">general discussion list</a> or in <a href="https://lists.fsfe.org/mailman/listinfo">one of our specific country lists</a>. If you are looking for local contact, see our <a href="/about/localteams.en.html">local FSFE groups list</a>.</p>
<p>Finally, the FSFE is a non-profit organisation that is enabled by individual donations. Consider to <a href="/fellowship">join the Fellowship</a> if you like to support our work financially.</p>
</div>

<support-portal-javascript/>
</div>
</body>

<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 49
support/portal.et.xhtml View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Toetajaportaal - Euroopa Vaba Tarkvara Fond</title>
</head>

<body>
<h1>Täname sind toetuse eest!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<p id="support_portal_loading">Laen…</p>
<div id="support_portal">

<h1>Tere, <firstname/> <lastname/></h1>
<p>Sinu e-posti aadress <email/> kinnitati <confirmed/>.</p>
<p>Täname sind toetuse eest <a href="http://fsfe.org/">FSFEle</a>!</p>

<h2>Kas sa tahad rohkem teha?</h2>

<p>Kui sa soovid teha rohkem kui end toetajana kirja panna, siis võid</p>
<ul>
<li><a href="http://fsfe.org/news/newsletter">tellida FSFE uudiskirja</a>;</li>
<li><a href="http://fsfe.org/contact/community">liituda huvitavate postiloenditega</a>;</li>
<li><a href="http://fsfe.org/contact/local">kohtuda oma riigitiimi liikmetega</a>;</li>
<li><a href="http://fellowship.fsfe.org/">liituda Vennaskonnaga</a>;</li>
<li><a href="http://fsfe.org/donate/">annetada FSFEle</a>.</li>
</ul>

<p><a href="http://fsfe.org/contribute/">Vaata kõiki võimalusi kaasa löömiseks</a>.</p>
</div>

<support-portal-javascript/>
</div>
</body>
<translator>Repentinus</translator>
<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 98
support/portal.fi.xhtml View File

@@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Support portal - FSFE</title>
</head>

<body>
<h1>Kiitos tuestasi!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<p id="support_portal_loading">Loading..</p>
<div id="support_portal">
<p>Terve <firstname/> <lastname/></p>
<p>Osoitteesi <email/> on vahvistettu <confirmed/>.</p>
<p>Kiitos tukesi osoittamisesta <a href="http://fsfe.org/">FSFE:lle</a>!</p>

<h2>Haluatko tehdä enemmän?</h2>

<p>Jos haluat tehdä enemmäin kuin vain ilmoittautua tukijaksi, voit myös:</p>
<ul>
<li><a href="http://fsfe.org/news/newsletter">Tilata FSFE:n uutiskirjeen</a></li>
<li><a href="http://fsfe.org/contact/community">Liittyä kiinnostaville sähköpostilistoille</a></li>
<li><a href="http://fsfe.org/fi/">Tavata paikallistiimisi</a></li>
<li><a href="http://fellowship.fsfe.org/">Liittyä Fellowship-jäseneksi</a></li>
<li><a href="http://fsfe.org/donate/">Tukea FSFE:tä lahjoituksella</a></li>
</ul>

<p><a href="http://fsfe.org/contribute/">Katso kaikki osallistumisvaihtoehdot</a></p>

<!-- form method="post" action="" class="support">
<p>
<label id="firstname">First name
<input type="text" name="firstname" required="required"/>
</label>
</p>
<p>
<label id="lastname">Last name
<input type="text" name="lastname" required="required"/>
</label>
</p>
<p>
<label id="zip">Zip code
<input type="text" name="zip" />
</label>
</p>
<p>
<label id="city">City
<input type="text" name="city" />
</label>
</p>
<p>
<label id="country">Country
<select name="country_code" required="required">
<option value="">Select..</option>
<optgroup label="Europe">
<country-list-europe/>
</optgroup>
<optgroup label="Other continents">
<country-list-other-continents/>
</optgroup>
</select>
</label>
</p -->
<!-- p>
<label id="lang">Language
<select name="lang" required="required">
<option value="">Select..</option>
where to get a ISO 639-1 list here..?
</select>
</label>
</p -->

<!-- p><input type="submit" name="submit" value="Update" data-loading-text="Sending.."/></p>
<p><em>Our privacy policy is simple: We will never share your data with anyone outside FSFE. Period.</em></p>
</form -->

</div>


<support-portal-javascript/>
</div>
</body>

<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 49
support/portal.it.xhtml View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Portale sostegno - FSFE</title>
</head>

<body>
<h1>Grazie per il tuo sostegno!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<p id="support_portal_loading">Loading..</p>
<div id="support_portal">
<p>Salve, <firstname/> <lastname/></p>
<p>Il tuo indirizzo <email/> è stato confermato il <confirmed/>.</p>
<p>Grazie per il tuo sostegno alla <a href="http://fsfe.org/">FSFE</a>!</p>

<h2>Contribuire ulteriormente?</h2>

<p>Se vuoi contribuire in modo maggiore rispetto alla semplice sottoscrizione come "sostenitore", visita i link:</p>
<ul>
<li><a href="http://fsfe.org/news/newsletter">Iscriviti alla newsletter della FSFE</a></li>
<li><a href="http://fsfe.org/contact/community">Aderisci ad interessanti mailing list</a></li>
<li><a href="http://fsfe.org/it/">Incontra il team locale della FSFE</a></li>
<li><a href="http://fellowship.fsfe.org/">Aderisci alla Fellowship</a></li>
<li><a href="http://fsfe.org/donate/">Dona alla FSFE</a></li>
</ul>

<p><a href="http://fsfe.org/contribute/">Vedi tutte le opzioni per contribuire</a></p>
</div>

<support-portal-javascript/>
</div>
</body>

<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
<translator>Alessandro Polvani</translator>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 54
support/portal.ru.xhtml View File

@@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Портал поддержки - ЕФСПО</title>
</head>

<body>
<h1>Благодарим вас за поддержку!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Звезды"/>
</div>
<p id="support_portal_loading">Загрузка..</p>
<div id="support_portal">
<p>Здравствуйте, <firstname/> <lastname/></p>
<p>Ваш адрес, <email/>, был подтвержден <confirmed/>.</p>
<p>Спасибо за поддержку <a href="http://fsfe.org/">ЕФСПО</a>!</p>

<h2>Хотите еще как-то помочь?</h2>

<p>Если вы хотите помочь больше, чем просто подписавшись в поддержку
фонда, вы можете также:</p>

<ul>
<li><a href="http://fsfe.org/news/newsletter">Подписаться на новости
ЕФСПО</a></li>
<li><a href="http://fsfe.org/contact/community"> Присоединиться
к спискам рассылки по интересам</a></li>
<li><a href="http://fsfe.org/contact/local"> Встретиться с местной
группой сторонников</a></li>
<li><a href="http://fellowship.fsfe.org/"> Вступить
в Содружество</a></li>
<li><a href="http://fsfe.org/donate/">Внести пожертвование</a></li>
</ul>

<p><a href="http://fsfe.org/contribute/">Все варианты содействия</a></p>
</div>

<support-portal-javascript/>
</div>
</body>

<timestamp>$Date$ $Author$</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

+ 0
- 45
support/portal.sq.xhtml View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

<html>
<head>
<title>Portal përkrahjeje - FSFE</title>
</head>

<body>
<h1>Ju faleminderit për përkrahjen tuaj!</h1>
<div id="introduction" class="support_page">
<div class="image">
<img src="/graphics/stars-smaller.png" alt="Stars"/>
</div>
<!-- <p id="support_portal_loading">Po ngarkohet..</p> -->
<div id="support_portal">
<p>Tungjatjeta, <firstname/> <lastname/></p>
<p>Adresa juaj <email/> u konfirmua më <confirmed/>.</p>
<p>Ju falënderojmë për përkrahjen tuaj ndaj <a href="http://fsfe.org/">FSFE-së</a>!</p>
<p>Mos ngurroni të përdorni <a href="/graphics/supporter/FSFE_supporter.svg">logot e përkrahësve të FSFE-së</a> për të shfaqur pjesëmarrjen tuaj në radhët tona.</p>
<h2>Doni të përfshiheni më thellë në FSFE?</h2>
<!-- In future here should just be some short information wih a link to our community-portal. As this is not-ready and only living on test.fsfe.org, we keep the following text for now. This change should be done soon, so our translators do not have to translate stuff that will soon not be on the page -->

<p>Jeni më tepër se i mirëpritur të diskutoni lajmet e fundit ose rreth pyetjesh të përgjithshme mbi Software-in e Lirë dhe FSFE-në, te <a href="https://mail.fsfeurope.org/mailman/listinfo/discussion">lista jonë e diskutimeve në përgjithësi</a> ose te <a href="https://lists.fsfe.org/mailman/listinfo">një nga listat tona për vende të caktuara</a>. Nëse po kërkoni për një kontakt vendor, shihni <a href="http://fsfe.org/about/localteams.en.html">listën tonë të grupeve vendore FSFE</a>.</p>
Së fundi, FSFE-ja është një organizëm jofitimprurës që e mundësojnë dhurimet individuale. Nëse dëshironi ta mbështetni financiarisht punën tonë, shihni mundësinë e <a href="https://fsfe.org/fellowship">Anëtarësimit Shok</a>.
</div>

<support-portal-javascript/>
</div>
</body>

<timestamp>$Date: 2012-08-30 14:53:43 +0300 (to, 30 elo 2012) $ $Author: otto $</timestamp>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

BIN
support/printable-form.fi.odt View File


BIN
support/qrcode.png View File


+ 0
- 113
support/remind-unconfirmed-with-obscured-url-sdkfsy3i4j5skd354kmds4w.php View File

@@ -1,113 +0,0 @@
<?php
/*
Copyright (C) 2012 Otto Kekäläinen <otto@fsfe.org> for Free Software Foundation Europe

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

header("Content-Type: text/plain")
?>
Sending reminders to supporters who's e-mail is still unconfirmed:
<?
/*
ini_set( "display_errors","1" );
ERROR_REPORTING( E_ALL) ;
*/

$timestamp = date('Y-m-d H:i:s');

try {
//open the database
$db = new PDO( 'sqlite:../../../db/support.sqlite' );
}
catch(PDOException $e) {
print 'Error while connecting to Database: '.$e->getMessage();
}

// get all unconfirmed rows
try {
$query = $db->prepare("SELECT * FROM t1 WHERE confirmed is NULL
AND time > '".date('Y-m-d', time()-60*60*24*30)." 00:00:00'"); // restrict to rows younger than a month
$query->execute();
}
catch(PDOException $e) {
print "Database Error: \n";
print_r($db->errorInfo());
}


while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
echo "\n".$row['email'].
" signed up ".$row['time'].
", confirmed: ".$row['confirmed']."\n".
" reminder 1: ".$row['reminder1'].
" 2: ".$row['reminder2'].
" 3: ".$row['reminder3']."\n";
$two_days_ago = date('Y-m-d', time()-60*60*24*2)." 00:00:00";
// send only one reminder
// don't send reminders more frequent than every third day
if ($row['reminder1'] == '' && $row['time'] < $two_days_ago) {
send_reminder("1", $row);
} elseif ($row['reminder2'] == '' && $row['reminder1'] != '' && $row['reminder1'] < $two_days_ago) {
send_reminder("2", $row);
} elseif ($row['reminder3'] == '' && $row['reminder2'] != '' && $row['reminder2'] < $two_days_ago) {
send_reminder("3", $row);
} // else do nothing
}


// close the database connection
$db = NULL;


function send_reminder($reminder_number, $row) {
GLOBAL $db, $timestamp;
$secret = $row['secret'];

// don't send reminders to yahoo.com addresses
if (preg_match("/yahoo.com/i", $row['email'])) {
echo " => Don't send reminder to Yahoo.com address.";
return false;
}

if (file_exists('template-email-confirm.'. $row['lang'] .'.inc')) {
require('template-email-confirm.'. $row['lang'] .'.inc');
} else {
require('template-email-confirm.en.inc');
}
$to = $row['email'];
$headers = 'From: "FSFE" <office@fsfe.org>' . "\r\n";
mail($to, $subject, $message, $headers);

echo " => Sent reminder number ".$reminder_number." to ".$row['email']."\n";
try {
$query = $db->prepare("UPDATE t1 SET
reminder".$reminder_number." = '". $timestamp ."'
where secret='". $row['secret'] ."'");
$query->execute();
}
catch(PDOException $e) {
print "Database Error: \n";
print_r($db->errorInfo());
return false;
}
return true;
}

?>

+ 0
- 1
support/rickshaw.min.css View File

@@ -1 +0,0 @@
.rickshaw_graph .detail{pointer-events:none;position:absolute;top:0;z-index:2;background:rgba(0,0,0,.1);bottom:0;width:1px;transition:opacity .25s linear;-moz-transition:opacity .25s linear;-o-transition:opacity .25s linear;-webkit-transition:opacity .25s linear}.rickshaw_graph .detail.inactive{opacity:0}.rickshaw_graph .detail .item.active{opacity:1}.rickshaw_graph .detail .x_label{font-family:Arial,sans-serif;border-radius:3px;padding:6px;opacity:.5;border:1px solid #e0e0e0;font-size:12px;position:absolute;background:#fff;white-space:nowrap}.rickshaw_graph .detail .item{position:absolute;z-index:2;border-radius:3px;padding:.25em;font-size:12px;font-family:Arial,sans-serif;opacity:0;background:rgba(0,0,0,.4);color:#fff;border:1px solid rgba(0,0,0,.4);margin-left:1em;margin-top:-1em;white-space:nowrap}.rickshaw_graph .detail .item.active{opacity:1;background:rgba(0,0,0,.8)}.rickshaw_graph .detail .item:before{content:"\25c2";position:absolute;left:-.5em;color:rgba(0,0,0,.7);width:0}.rickshaw_graph .detail .dot{width:4px;height:4px;margin-left:-4px;margin-top:-3px;border-radius:5px;position:absolute;box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;border-width:2px;border-style:solid;display:none;background-clip:padding-box}.rickshaw_graph .detail .dot.active{display:block}.rickshaw_graph{position:relative}.rickshaw_graph svg{display:block;overflow:hidden}.rickshaw_graph .x_tick{position:absolute;top:0;bottom:0;width:0;border-left:1px dotted rgba(0,0,0,.2);pointer-events:none}.rickshaw_graph .x_tick .title{position:absolute;font-size:12px;font-family:Arial,sans-serif;opacity:.5;white-space:nowrap;margin-left:3px;bottom:1px}.rickshaw_annotation_timeline{height:1px;border-top:1px solid #e0e0e0;margin-top:10px;position:relative}.rickshaw_annotation_timeline .annotation{position:absolute;height:6px;width:6px;margin-left:-2px;top:-3px;border-radius:5px;background-color:rgba(0,0,0,.25)}.rickshaw_graph .annotation_line{position:absolute;top:0;bottom:-6px;width:0;border-left:2px solid rgba(0,0,0,.3);display:none}.rickshaw_graph .annotation_line.active{display:block}.rickshaw_annotation_timeline .annotation .content{background:#fff;color:#000;opacity:.9;padding:5px 5px;box-shadow:0 0 2px rgba(0,0,0,.8);border-radius:3px;position:relative;z-index:20;font-size:12px;padding:6px 8px 8px;top:18px;left:-11px;width:160px;display:none;cursor:pointer}.rickshaw_annotation_timeline .annotation .content:before{content:"\25b2";position:absolute;top:-11px;color:#fff;text-shadow:0 -1px 1px rgba(0,0,0,.8)}.rickshaw_annotation_timeline .annotation.active,.rickshaw_annotation_timeline .annotation:hover{background-color:rgba(0,0,0,.8);cursor:none}.rickshaw_annotation_timeline .annotation .content:hover{z-index:50}.rickshaw_annotation_timeline .annotation.active .content{display:block}.rickshaw_annotation_timeline .annotation:hover .content{display:block;z-index:50}.rickshaw_graph .y_axis{fill:none}.rickshaw_graph .y_ticks .tick{stroke:rgba(0,0,0,.16);stroke-width:2px;shape-rendering:crisp-edges;pointer-events:none}.rickshaw_graph .y_grid .tick{z-index:-1;stroke:rgba(0,0,0,.20);stroke-width:1px;stroke-dasharray:1 1}.rickshaw_graph .y_grid path{fill:none;stroke:none}.rickshaw_graph .y_ticks path{fill:none;stroke:#808080}.rickshaw_graph .y_ticks text{opacity:.5;font-size:12px;pointer-events:none}.rickshaw_graph .x_tick.glow .title,.rickshaw_graph .y_ticks.glow text{fill:black;color:#000;text-shadow:-1px 1px 0 rgba(255,255,255,.1),1px -1px 0 rgba(255,255,255,.1),1px 1px 0 rgba(255,255,255,.1),0px 1px 0 rgba(255,255,255,.1),0px -1px 0 rgba(255,255,255,.1),1px 0 0 rgba(255,255,255,.1),-1px 0 0 rgba(255,255,255,.1),-1px -1px 0 rgba(255,255,255,.1)}.rickshaw_graph .x_tick.inverse .title,.rickshaw_graph .y_ticks.inverse text{fill:white;color:#fff;text-shadow:-1px 1px 0 rgba(0,0,0,.8),1px -1px 0 rgba(0,0,0,.8),1px 1px 0 rgba(0,0,0,.8),0px 1px 0 rgba(0,0,0,.8),0px -1px 0 rgba(0,0,0,.8),1px 0 0 rgba(0,0,0,.8),-1px 0 0 rgba(0,0,0,.8),-1px -1px 0 rgba(0,0,0,.8)}.rickshaw_legend{font-family:Arial;font-size:12px;color:#fff;background:#404040;display:inline-block;padding:12px 5px;border-radius:2px;position:relative}.rickshaw_legend:hover{z-index:10}.rickshaw_legend .swatch{width:10px;height:10px;border:1px solid rgba(0,0,0,.2)}.rickshaw_legend .line{clear:both;line-height:140%;padding-right:15px}.rickshaw_legend .line .swatch{display:inline-block;margin-right:3px;border-radius:2px}.rickshaw_legend .label{white-space:nowrap;display:inline}.rickshaw_legend .action:hover{opacity:.6}.rickshaw_legend .action{margin-right:.2em;font-size:10px;opacity:.2;cursor:pointer;font-size:14px}.rickshaw_legend .line.disabled{opacity:.4}.rickshaw_legend ul{list-style-type:none;margin:0;padding:0;margin:2px;cursor:pointer}.rickshaw_legend li{padding:0 0 0 2px;min-width:80px;white-space:nowrap}.rickshaw_legend li:hover{background:rgba(255,255,255,.08);border-radius:3px}.rickshaw_legend li:active{background:rgba(255,255,255,.2);border-radius:3px}

+ 0
- 6
support/rickshaw.min.js
File diff suppressed because it is too large
View File


+ 0
- 664
support/stats.php View File

</
@@ -1,664 +0,0 @@
<?php
/*
Copyright (C) 2012 Otto Kekäläinen <otto@fsfe.org> for Free Software Foundation Europe

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// report errors
//error_reporting(E_ALL);
//ini_set('display_errors', 'On');

/*
TODO:
- refactor to use standard FSFE header and footer
- restrict access to FSFE Fellows
- sort countries by sum of last date, not on sum of first date like is done now
*/

try {
// open the database
$db = new PDO( 'sqlite:../../../db/support.sqlite' );
}
catch(PDOException $e) {
print 'Error while connecting to Database: '.$e->getMessage();
}



// total supporters ever, including unconfirmed
try {
$sql = "SELECT *, COUNT(*) AS supporters FROM t1 ";
// enable stats for single referrers
if (isset($_GET['ref_id'])) {
$sql .= "WHERE ref_id = '". sqlite_escape_string($_GET['ref_id']) ."' ";
}
if (isset($_GET['ref_url'])) {
$sql .= "WHERE ref_url LIKE '%". sqlite_escape_string($_GET['ref_url']) ."%' ";
}
if (isset($_GET['country_code'])) {
$sql .= "WHERE country_code = '". sqlite_escape_string($_GET['country_code']) ."' ";
}
$query = $db->prepare($sql);
$query->execute();
}
catch(PDOException $e) {
print "Database Error: \n";
print_r($db->errorInfo());
}

$row = $query->fetch(PDO::FETCH_ASSOC);
$total = $row['supporters'];



function ts_days_ago($days) {
$days_ago = mktime(0, 0, 0, date("m"), date("d")-$days, date("Y"));
return date("Y-m-d", $days_ago) . " 23:59:59";
}

function epoc_days_ago($days) {
return mktime(0, 0, 0, date("m"), date("d")-$days, date("Y"));
}

$series = array();

for ($i = 90; $i >= 0; $i--) {

try {
// check data
$sql = "SELECT *, COUNT(*) AS supporters FROM t1 WHERE confirmed != '' AND time <= Datetime('". ts_days_ago($i) ."') ";

// enable stats for single referrers
if (isset($_GET['ref_id'])) {
$sql .= "AND ref_id = '". sqlite_escape_string($_GET['ref_id']) ."' ";
}
if (isset($_GET['ref_url'])) {
$sql .= "AND ref_url LIKE '%". sqlite_escape_string($_GET['ref_url']) ."%' ";
}
if (isset($_GET['country_code'])) {
$sql .= "AND country_code = '". sqlite_escape_string($_GET['country_code']) ."' ";
}
$sql .= "GROUP BY country_code ORDER BY supporters DESC";
//echo $sql;
$query = $db->prepare($sql);
$query->execute();
}
catch(PDOException $e) {
print "Database Error: \n";
print_r($db->errorInfo());
}

if ($i == 0) { $total_confirmed = 0; }
if ($i == 90) { $total_confirmed_at_beginning = 0; }

while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
// true if at least one row to return
if ($row["country_code"] == "") { continue; } // skip to next row if country empty

$series[$row["country_code"]][] = array(
"x" => epoc_days_ago($i),
"y" => $row["supporters"]
);
/* print_r($row);
example: Array
(
[id] => 157
[time] => 2012-07-13 05:27:41
[firstname] => Krrtrtta
[lastname] => Toirtrla
[email] => krifgfga.tofgfgla@luukku.com
[country_code] => FI
[secret] => 7c016a4ab30efa2899a0ec76a92fg6b
[signed] =>
[confirmed] =>
[updated] =>
[supporters] => 116
)
*/

if ($i == 0) { $total_confirmed += $row["supporters"]; } // at the end of the time period, equals totals now
if ($i == 90) { $total_confirmed_at_beginning += $row["supporters"]; }
}

}

$growth = $total_confirmed - $total_confirmed_at_beginning;
$estimate = $total_confirmed + $growth*4;



// country list
$countries = array (
'AD' => 'Andorra',
'AE' => 'United Arab Emirates',
'AF' => 'Afghanistan',
'AG' => 'Antigua and Barbuda',
'AI' => 'Anguilla',
'AL' => 'Albania',
'AM' => 'Armenia',
'AN' => 'Netherlands Antilles',
'AO' => 'Angola',
'AQ' => 'Antarctica',
'AR' => 'Argentina',
'AS' => 'American Samoa',
'AT' => 'Austria',
'AU' => 'Australia',
'AW' => 'Aruba',
'AX' => 'Åland Islands',
'AZ' => 'Azerbaijan',
'BA' => 'Bosnia and Herzegovina',
'BB' => 'Barbados',
'BD' => 'Bangladesh',
'BE' => 'Belgium',
'BF' => 'Burkina Faso',
'BG' => 'Bulgaria',
'BH' => 'Bahrain',
'BI' => 'Burundi',
'BJ' => 'Benin',
'BL' => 'Saint Barthélemy',
'BM' => 'Bermuda',
'BN' => 'Brunei',
'BO' => 'Bolivia',
'BQ' => 'British Antarctic Territory',
'BR' => 'Brazil',
'BS' => 'Bahamas',
'BT' => 'Bhutan',
'BV' => 'Bouvet Island',
'BW' => 'Botswana',
'BY' => 'Belarus',
'BZ' => 'Belize',
'CA' => 'Canada',
'CC' => 'Cocos [Keeling] Islands',
'CD' => 'Congo - Kinshasa',
'CF' => 'Central African Republic',
'CG' => 'Congo - Brazzaville',
'CH' => 'Switzerland',
'CI' => 'Côte d’Ivoire',
'CK' => 'Cook Islands',
'CL' => 'Chile',
'CM' => 'Cameroon',
'CN' => 'China',
'CO' => 'Colombia',
'CR' => 'Costa Rica',
'CS' => 'Serbia and Montenegro',
'CT' => 'Canton and Enderbury Islands',
'CU' => 'Cuba',
'CV' => 'Cape Verde',
'CX' => 'Christmas Island',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DD' => 'East Germany',
'DE' => 'Germany',
'DJ' => 'Djibouti',
'DK' => 'Denmark',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'DZ' => 'Algeria',
'EC' => 'Ecuador',
'EE' => 'Estonia',
'EG' => 'Egypt',
'EH' => 'Western Sahara',
'ER' => 'Eritrea',
'ES' => 'Spain',
'ET' => 'Ethiopia',
'FI' => 'Finland',
'FJ' => 'Fiji',
'FK' => 'Falkland Islands',
'FM' => 'Micronesia',
'FO' => 'Faroe Islands',
'FQ' => 'French Southern and Antarctic Territories',
'FR' => 'France',
'FX' => 'Metropolitan France',
'GA' => 'Gabon',
'GB' => 'United Kingdom',
'GD' => 'Grenada',
'GE' => 'Georgia',
'GF' => 'French Guiana',
'GG' => 'Guernsey',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GL' => 'Greenland',
'GM' => 'Gambia',
'GN' => 'Guinea',
'GP' => 'Guadeloupe',
'GQ' => 'Equatorial Guinea',
'GR' => 'Greece',
'GS' => 'South Georgia and the South Sandwich Islands',
'GT' => 'Guatemala',
'GU' => 'Guam',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HK' => 'Hong Kong SAR China',
'HM' => 'Heard Island and McDonald Islands',
'HN' => 'Honduras',
'HR' => 'Croatia',
'HT' => 'Haiti',
'HU' => 'Hungary',
'ID' => 'Indonesia',
'IE' => 'Ireland',
'IL' => 'Israel',
'IM' => 'Isle of Man',
'IN' => 'India',
'IO' => 'British Indian Ocean Territory',
'IQ' => 'Iraq',
'IR' => 'Iran',
'IS' => 'Iceland',
'IT' => 'Italy',
'JE' => 'Jersey',
'JM' => 'Jamaica',
'JO' => 'Jordan',
'JP' => 'Japan',
'JT' => 'Johnston Island',
'KE' => 'Kenya',
'KG' => 'Kyrgyzstan',
'KH' => 'Cambodia',
'KI' => 'Kiribati',
'KM' => 'Comoros',
'KN' => 'Saint Kitts and Nevis',
'KP' => 'North Korea',
'KR' => 'South Korea',
'KW' => 'Kuwait',
'KY' => 'Cayman Islands',
'KZ' => 'Kazakhstan',
'LA' => 'Laos',
'LB' => 'Lebanon',
'LC' => 'Saint Lucia',
'LI' => 'Liechtenstein',
'LK' => 'Sri Lanka',
'LR' => 'Liberia',
'LS' => 'Lesotho',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'LV' => 'Latvia',
'LY' => 'Libya',
'MA' => 'Morocco',
'MC' => 'Monaco',
'MD' => 'Moldova',
'ME' => 'Montenegro',
'MF' => 'Saint Martin',
'MG' => 'Madagascar',
'MH' => 'Marshall Islands',
'MI' => 'Midway Islands',
'MK' => 'Macedonia',
'ML' => 'Mali',
'MM' => 'Myanmar [Burma]',
'MN' => 'Mongolia',
'MO' => 'Macau SAR China',
'MP' => 'Northern Mariana Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MS' => 'Montserrat',
'MT' => 'Malta',
'MU' => 'Mauritius',
'MV' => 'Maldives',
'MW' => 'Malawi',
'MX' => 'Mexico',
'MY' => 'Malaysia',
'MZ' => 'Mozambique',
'NA' => 'Namibia',
'NC' => 'New Caledonia',
'NE' => 'Niger',
'NF' => 'Norfolk Island',
'NG' => 'Nigeria',
'NI' => 'Nicaragua',
'NL' => 'Netherlands',
'NO' => 'Norway',
'NP' => 'Nepal',
'NQ' => 'Dronning Maud Land',
'NR' => 'Nauru',
'NT' => 'Neutral Zone',
'NU' => 'Niue',
'NZ' => 'New Zealand',
'OM' => 'Oman',
'PA' => 'Panama',
'PC' => 'Pacific Islands Trust Territory',
'PE' => 'Peru',
'PF' => 'French Polynesia',
'PG' => 'Papua New Guinea',
'PH' => 'Philippines',
'PK' => 'Pakistan',
'PL' => 'Poland',
'PM' => 'Saint Pierre and Miquelon',
'PN' => 'Pitcairn Islands',
'PR' => 'Puerto Rico',
'PS' => 'Palestinian Territories',
'PT' => 'Portugal',
'PU' => 'U.S. Miscellaneous Pacific Islands',
'PW' => 'Palau',
'PY' => 'Paraguay',
'PZ' => 'Panama Canal Zone',
'QA' => 'Qatar',
'RE' => 'Réunion',
'RO' => 'Romania',
'RS' => 'Serbia',
'RU' => 'Russia',
'RW' => 'Rwanda',
'SA' => 'Saudi Arabia',
'SB' => 'Solomon Islands',
'SC' => 'Seychelles',
'SD' => 'Sudan',
'SE' => 'Sweden',
'SG' => 'Singapore',
'SH' => 'Saint Helena',
'SI' => 'Slovenia',
'SJ' => 'Svalbard and Jan Mayen',
'SK' => 'Slovakia',
'SL' => 'Sierra Leone',
'SM' => 'San Marino',
'SN' => 'Senegal',
'SO' => 'Somalia',
'SR' => 'Suriname',
'ST' => 'São Tomé and Príncipe',
'SU' => 'Union of Soviet Socialist Republics',
'SV' => 'El Salvador',
'SY' => 'Syria',
'SZ' => 'Swaziland',
'TC' => 'Turks and Caicos Islands',
'TD' => 'Chad',
'TF' => 'French Southern Territories',
'TG' => 'Togo',
'TH' => 'Thailand',
'TJ' => 'Tajikistan',
'TK' => 'Tokelau',
'TL' => 'Timor-Leste',
'TM' => 'Turkmenistan',
'TN' => 'Tunisia',
'TO' => 'Tonga',
'TR' => 'Turkey',
'TT' => 'Trinidad and Tobago',
'TV' => 'Tuvalu',
'TW' => 'Taiwan',
'TZ' => 'Tanzania',
'UA' => 'Ukraine',
'UG' => 'Uganda',
'UM' => 'U.S. Minor Outlying Islands',
'US' => 'United States',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VA' => 'Vatican City',
'VC' => 'Saint Vincent and the Grenadines',
'VD' => 'North Vietnam',
'VE' => 'Venezuela',
'VG' => 'British Virgin Islands',
'VI' => 'U.S. Virgin Islands',
'VN' => 'Vietnam',
'VU' => 'Vanuatu',
'WF' => 'Wallis and Futuna',
'WK' => 'Wake Island',
'WS' => 'Samoa',
'YD' => 'People\'s Democratic Republic of Yemen',
'YE' => 'Yemen',
'YT' => 'Mayotte',
'ZA' => 'South Africa',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
'ZZ' => 'Unknown or Invalid Region',
'XK' => 'Kosovo',
);

$series_json = "";

foreach ($series as $k => $v) {

$series_json .= '
{
name: "'. $countries[$k] .'",
data: [ ';

foreach ($v as $subk => $subv) {
$series_json .= '{ x: '. $subv["x"] .', y: '. $subv["y"] .' },';
}

$series_json .= ' ],
color: palette.color()
},
';

}
?>
<!doctype html public "✰">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title dir="ltr">FSFE Supporter statistics</title>
<meta name="viewport" content="width=device-width">

<link type="text/css" rel="stylesheet" href="rickshaw.min.css">
<script src="d3.min.js"></script>
<script src="d3.layout.min.js"></script>
<script src="rickshaw.min.js"></script>

<style>
body {
font-family: Arial, Helvetica, sans-serif;
color: #555;
padding: 1em;
}

#chart_container {
position: relative;
display: inline-block;
left: 14em;
}
#chart {
display: inline-block;
margin-left: 40px;
}
#y_axis {
position: absolute;
top: 0;
bottom: 0;
width: 40px;
}
#legend {
display: inline-block;
vertical-align: top;
margin: 0 0 0 10px;
}

.statusbox {
width: 12em;
border: 1px solid #ccc;
background: #eee;
padding: 1em;
font-size: 15px;
position: absolute;
left: 2em;
}

.statusbox h3 {
font-size: 17px;
}
.statusbox p {
margin: 0;
}
.statusbox strong {
font-size: 80px;
}

.statusbox em {
font-size: 16px;
font-weight: bold;
}
#lastlog {
background: #ccc;
font-size: 10pt;
}

#lastlog th {
text-align: left;
}
#lastlog td {
background: #eee;
padding: 6px;
}
</style>

</head>
<body>

<h1>Supporter count status
<?php
if (isset($_GET['ref_url'])) { echo " for referrer URLs containing ". htmlspecialchars($_GET['ref_url']); }
if (isset($_GET['ref_id'])) { echo " for referrer fsfe.org/support?". htmlspecialchars($_GET['ref_id']); }
?>
<small><?php date("Y-m-d") ?></small></h1>

<div class="statusbox">
<h3>Total supporters</h3>
<p><strong><?php echo $total_confirmed; ?></strong></p>
<p>with e-mail confirmed.</p>
<p>Total with unconfirmed included is <em><?php echo $total; ?></em>.</p>
</div>

<div class="statusbox" style="top:26em;">
<p>Three months ago there where <em><?php echo $total_confirmed_at_beginning; ?></em> supporters, so growth was <em><?php echo $growth; ?></em> supporters. If growth continues at the same pace, we'll have <em><?php echo $estimate; ?></em> supporters in a year from now!</p>
</div>

<div id="chart_container">
<div id="y_axis"></div>
<div id="chart"></div>
<div id="legend"></div>
</div>

<script>