Index: branches/wmf-deployment/extensions/ContributionReporting/cc-reporting.php |
— | — | @@ -1,4 +1,6 @@ |
2 | 2 | <?php |
| 3 | + |
| 4 | +//handle request |
3 | 5 | if(isset ($_REQUEST['load'])){ |
4 | 6 | handleLoad(); |
5 | 7 | } |
— | — | @@ -6,30 +8,41 @@ |
7 | 9 | handleSubmit(); |
8 | 10 | } |
9 | 11 | |
| 12 | +//handle load |
10 | 13 | function handleLoad(){ |
11 | 14 | $cc_id = randomCookie(); |
12 | 15 | |
13 | | - if(!isset($_COOKIE['cc-cookie'])){ |
14 | | - $cc_id = $_REQUEST['cc-cookie']; |
| 16 | + //already have a cookie? use it, else set randomly generated one |
| 17 | + if(isset($_COOKIE['cc-cookie'])){ |
| 18 | + $cc_id = $_COOKIE['cc-cookie']; |
15 | 19 | } |
16 | 20 | else{ |
17 | 21 | //set cookie to expire in maybe about a year or so... 300 days |
18 | 22 | setcookie('cc-cookie', $cc_id, time() + (60 * 60 * 24 * 300), '/', "payments.wikimedia.org"); |
19 | 23 | } |
20 | 24 | |
21 | | - //if not exist insert into DB |
22 | | - //via REQUEST['utm_src'] |
| 25 | + //add into DB |
| 26 | + $cc_id = addslashes($cc_id); |
| 27 | + $utm_src = isset($_REQUEST['utm_src']) ? |
| 28 | + addslashes($_REQUEST['utm_src']) : "unknown"; |
| 29 | + $sql = "INSERT IGNORE INTO cc-track (cookie_id, utm_src, contribs) VALUES ('$cc_id','$utm_src', 0)"; |
23 | 30 | } |
24 | 31 | |
| 32 | +//handle submit |
25 | 33 | function handleSubmit(){ |
| 34 | + |
| 35 | + //for people with cookies turned off, track them via "NULL" cookie |
26 | 36 | $cc_id = "NULL"; |
27 | 37 | if(isset($_COOKIE['cc-cookie'])){ |
28 | 38 | $cc_id = $_COOKIE['cc-cookie']; |
29 | 39 | } |
30 | 40 | |
31 | | - //donations++ |
| 41 | + //update in DB |
| 42 | + $cc_id = addslashes($cc_id); |
| 43 | + $sql = "UPDATE cc-track SET contribs=contribs+1 WHERE cookie_id = '$cc_id'"; |
32 | 44 | } |
33 | 45 | |
| 46 | +//random cookie |
34 | 47 | function randomCookie(){ |
35 | 48 | return md5(mt_rand() + time()); |
36 | 49 | } |
\ No newline at end of file |
Index: branches/wmf-deployment/extensions/ContributionReporting/cc-reporting.js |
— | — | @@ -3,6 +3,7 @@ |
4 | 4 | sendReq("cc-reporting.php?load=1&utm_src=" + document.payment.utm_source.value); |
5 | 5 | } |
6 | 6 | |
| 7 | +//replace "validate_form" call with this |
7 | 8 | submitForm = function(){ |
8 | 9 | sendReq("cc-reporting.php?submit=1&utm_src="+ document.payment.utm_source.value); |
9 | 10 | return validate_form(document.payment); |
Index: branches/wmf-deployment/extensions/ContributionReporting/ContributionReporting.i18n.php |
— | — | @@ -383,6 +383,9 @@ |
384 | 384 | 'contribstats-conversion' => 'Узровень канвэрсіі (%)', |
385 | 385 | 'contribstats-template' => 'Шаблён', |
386 | 386 | 'contribstats-nodata' => 'Зьвесткі не пададзеныя', |
| 387 | + 'contribstats-landingpage' => 'Прывітальная старонка', |
| 388 | + 'contribstats-donatepage' => 'Старонка ахвяраваньняў', |
| 389 | + 'contribstats-average' => 'Сярэдняе', |
387 | 390 | 'fundraiserstatistics' => 'Статыстыка сабраных ахвяраваньняў', |
388 | 391 | 'fundraiserstats-date' => 'Дата', |
389 | 392 | 'fundraiserstats-day' => 'Дзень $1 з $2', |
— | — | @@ -472,10 +475,11 @@ |
473 | 476 | 'contribstats-avg' => 'Keitat (SUA)', |
474 | 477 | 'contribstats-percentage-ytd' => 'Dregantad (er bl.-mañ)', |
475 | 478 | 'contribstats-total-ytd' => 'Hollad (er bloaz-mañ)', |
476 | | - 'contribstats-day-totals' => 'Hollad evit hiziv', |
| 479 | + 'contribstats-day-totals' => 'Hollad an deiz', |
477 | 480 | 'contribstats-week' => 'Sizhun', |
478 | 481 | 'contribstats-clicks' => 'Klikoù', |
479 | 482 | 'contribstats-template' => 'Patrom', |
| 483 | + 'fundraiserstats-tab-totals' => 'Hollad (dollaroù SUA)', |
480 | 484 | ); |
481 | 485 | |
482 | 486 | /** Bosnian (Bosanski) |
— | — | @@ -643,6 +647,9 @@ |
644 | 648 | 'contribstats-conversion' => 'Konverzní poměr (%)', |
645 | 649 | 'contribstats-template' => 'Šablona', |
646 | 650 | 'contribstats-nodata' => 'Údaje nejsou k dispozici', |
| 651 | + 'contribstats-landingpage' => 'Cílová stránka', |
| 652 | + 'contribstats-donatepage' => 'Přispívací stránka', |
| 653 | + 'contribstats-average' => 'Průměr', |
647 | 654 | 'fundraiserstatistics' => 'Statistika příspěvkové kampaně', |
648 | 655 | 'fundraiserstats-date' => 'Datum', |
649 | 656 | 'fundraiserstats-day' => '$2, $1. den', |
— | — | @@ -719,6 +726,7 @@ |
720 | 727 | |
721 | 728 | /** German (Deutsch) |
722 | 729 | * @author Imre |
| 730 | + * @author MF-Warburg |
723 | 731 | * @author Metalhead64 |
724 | 732 | * @author Omnipaedista |
725 | 733 | * @author Purodha |
— | — | @@ -766,6 +774,8 @@ |
767 | 775 | 'contribstats-conversion' => 'Umrechnungskurs (%)', |
768 | 776 | 'contribstats-template' => 'Vorlage', |
769 | 777 | 'contribstats-nodata' => 'Keine Daten vorhanden', |
| 778 | + 'contribstats-donatepage' => 'Spenden-Seite', |
| 779 | + 'contribstats-average' => 'Durchschnitt', |
770 | 780 | 'fundraiserstatistics' => 'Spendenstatistiken', |
771 | 781 | 'fundraiserstats-date' => 'Datum', |
772 | 782 | 'fundraiserstats-day' => 'Tag $1 von $2', |
— | — | @@ -1090,28 +1100,49 @@ |
1091 | 1101 | * @author Pikne |
1092 | 1102 | */ |
1093 | 1103 | $messages['et'] = array( |
1094 | | - 'contributionhistory' => 'Redigeerimise ajalugu', |
| 1104 | + 'contributiontotal' => 'Annetamise kogusumma', |
| 1105 | + 'contributionhistory' => 'Annetamise ajalugu', |
| 1106 | + 'contrib-hist-header' => 'Reaalajas kommentaarid annetajatelt üle maailma', |
1095 | 1107 | 'contrib-hist-name' => 'Nimi', |
1096 | 1108 | 'contrib-hist-date' => 'Kellaaeg ja kuupäev', |
| 1109 | + 'contrib-hist-amount' => 'Summa', |
1097 | 1110 | 'contrib-hist-next' => 'Varasemad annetused', |
1098 | 1111 | 'contrib-hist-previous' => 'Värskemad annetused', |
1099 | 1112 | 'contrib-hist-anonymous' => 'Anonüümne', |
1100 | | - 'contributionstatistics' => 'Redigeerimise arvandmed', |
1101 | | - 'contribstats-desc' => 'Kuvab Wikimedia Sihtasutusele tehtud koostöö arvandmed.', |
| 1113 | + 'contributionstatistics' => 'Annetamise arvandmed', |
| 1114 | + 'contribstats-desc' => 'Kuvab arvandmed Wikimedia Sihtasutusele tehtud annetuste kohta.', |
| 1115 | + 'contribstats-daily-totals' => '{{PLURAL:$1|Tänane kogusumma|Viimase $1 päeva kogusummad}}', |
| 1116 | + 'contribstats-monthly-totals' => '{{PLURAL:$1|Selle kuu kogusumma|Viimase $1 kuu kogusummad}}', |
| 1117 | + 'contribstats-month-range-totals' => '{{PLURAL:$1|Ühe kuu kogusumma|$1 kuu kogusummad}}', |
| 1118 | + 'contribstats-contribution-range-breakdown' => 'Annetuste jaotumine summati ($1–$2)', |
| 1119 | + 'contribstats-currency-totals' => 'Eelarveaasta $1 kogusummad vääringuti', |
| 1120 | + 'contribstats-contribution-breakdown' => 'Eelarveaasta $1 annetuste jaotumine summati', |
1102 | 1121 | 'contribstats-day' => 'Päev', |
1103 | 1122 | 'contribstats-month' => 'Kuu', |
1104 | 1123 | 'contribstats-currency' => 'Rahaühik', |
1105 | | - 'contribstats-amount' => 'Hulk (USD)', |
1106 | | - 'contribstats-contributions' => 'Annetused', |
1107 | | - 'contribstats-total' => 'Summa (USD)', |
| 1124 | + 'contribstats-amount' => 'Summa (USD)', |
| 1125 | + 'contribstats-contributions' => 'Annetusi', |
| 1126 | + 'contribstats-total' => 'Kokku (USD)', |
1108 | 1127 | 'contribstats-avg' => 'Keskmine (USD)', |
1109 | | - 'contribstats-max' => 'Maksimum (USD)', |
| 1128 | + 'contribstats-max' => 'Suurim annetus', |
| 1129 | + 'contribstats-percentage-ytd' => 'Protsent (sel aastal)', |
| 1130 | + 'contribstats-total-ytd' => 'Kokku (sel aastal)', |
1110 | 1131 | 'contribstats-value-exactly' => 'Täpselt $1', |
1111 | 1132 | 'contribstats-value-under' => 'Alla $1', |
1112 | | - 'contribstats-value-from' => '$1 - $2', |
| 1133 | + 'contribstats-value-from' => '$1 – $2', |
1113 | 1134 | 'contribstats-value-over' => 'Üle $1', |
| 1135 | + 'contributiontrackingstatistics' => 'Annetamise jälgimisarvandmed', |
| 1136 | + 'contribstats-day-totals' => 'Päeva kogusumma', |
| 1137 | + 'contribstats-clicks' => 'Klõpse', |
| 1138 | + 'contribstats-donations' => 'Annetusi', |
| 1139 | + 'contribstats-conversion' => 'Annetusmäär (%)', |
| 1140 | + 'contribstats-template' => 'Mall', |
| 1141 | + 'contribstats-donatepage' => 'Annetamislehekülg', |
| 1142 | + 'contribstats-average' => 'Keskmine', |
| 1143 | + 'fundraiserstatistics' => 'Korjanduse arvandmed', |
1114 | 1144 | 'fundraiserstats-date' => 'Kuupäev', |
1115 | | - 'fundraiserstats-contributions' => 'Annetused', |
| 1145 | + 'fundraiserstats-day' => '$1. päev ($2)', |
| 1146 | + 'fundraiserstats-contributions' => 'Annetusi', |
1116 | 1147 | 'fundraiserstats-total' => 'Kokku (USD)', |
1117 | 1148 | 'fundraiserstats-avg' => 'Keskmine (USD)', |
1118 | 1149 | 'fundraiserstats-max' => 'Maksimum (USD)', |
— | — | @@ -1119,6 +1150,7 @@ |
1120 | 1151 | 'fundraiserstats-tab-contributions' => 'Annetuste hulk', |
1121 | 1152 | 'fundraiserstats-tab-averages' => 'Keskmised (USD)', |
1122 | 1153 | 'fundraiserstats-tab-maximums' => 'Maksimumid (USD)', |
| 1154 | + 'specialpages-group-contribution' => 'Annetamine / korjandused', |
1123 | 1155 | ); |
1124 | 1156 | |
1125 | 1157 | /** Basque (Euskara) |
— | — | @@ -1252,6 +1284,8 @@ |
1253 | 1285 | 'contribstats-clicks' => 'Klikkaukset', |
1254 | 1286 | 'contribstats-donations' => 'Lahjoitukset', |
1255 | 1287 | 'contribstats-template' => 'Malline', |
| 1288 | + 'contribstats-donatepage' => 'Lahjoitussivu', |
| 1289 | + 'contribstats-average' => 'Keskiarvo', |
1256 | 1290 | 'fundraiserstatistics' => 'Rahankeräyksen tilastoja', |
1257 | 1291 | 'fundraiserstats-date' => 'Päiväys', |
1258 | 1292 | 'fundraiserstats-day' => 'Päivä $1 / $2', |
— | — | @@ -1878,6 +1912,7 @@ |
1879 | 1913 | 'contribstats-value-from' => 'Inter $1 - $2', |
1880 | 1914 | 'contribstats-value-over' => 'Plu kam $1', |
1881 | 1915 | 'contribstats-week' => 'Semano', |
| 1916 | + 'contribstats-template' => 'Shablono', |
1882 | 1917 | 'fundraiserstats-date' => 'Dato', |
1883 | 1918 | 'fundraiserstats-day' => 'Dio $1 di $2', |
1884 | 1919 | ); |
— | — | @@ -2677,6 +2712,7 @@ |
2678 | 2713 | ); |
2679 | 2714 | |
2680 | 2715 | /** Norwegian Nynorsk (Norsk (nynorsk)) |
| 2716 | + * @author Gunnernett |
2681 | 2717 | * @author Harald Khan |
2682 | 2718 | */ |
2683 | 2719 | $messages['nn'] = array( |
— | — | @@ -2713,6 +2749,17 @@ |
2714 | 2750 | 'contribstats-value-under' => 'Under $1', |
2715 | 2751 | 'contribstats-value-from' => 'Frå $1–$2', |
2716 | 2752 | 'contribstats-value-over' => 'Over $1', |
| 2753 | + 'contributiontrackingstatistics' => 'Gåvestatistikk', |
| 2754 | + 'contribstats-day-totals' => 'Totalt for dagen', |
| 2755 | + 'contribstats-week' => 'Veke', |
| 2756 | + 'contribstats-weekly-totals' => '{{PLURAL:$1|Totalt denne veka|Vekesummar for dei seinaste $1 vekene}}', |
| 2757 | + 'contribstats-clicks' => 'Klikk', |
| 2758 | + 'contribstats-donations' => 'Gåver', |
| 2759 | + 'contribstats-conversion' => 'Konverteringsgrad (%)', |
| 2760 | + 'contribstats-template' => 'Mal', |
| 2761 | + 'contribstats-nodata' => 'Ingen data oppgjeve', |
| 2762 | + 'contribstats-donatepage' => 'Side for å gje gåver', |
| 2763 | + 'contribstats-average' => 'Gjennomsnitt', |
2717 | 2764 | 'fundraiserstatistics' => 'Innsamlingsstatistikk', |
2718 | 2765 | 'fundraiserstats-date' => 'Dato', |
2719 | 2766 | 'fundraiserstats-day' => 'Dag $1 av $2', |
— | — | @@ -3278,6 +3325,9 @@ |
3279 | 3326 | 'contribstats-conversion' => 'Konverzný kurz (%)', |
3280 | 3327 | 'contribstats-template' => 'Šablóna', |
3281 | 3328 | 'contribstats-nodata' => 'Neboli poskytnuté žiadne údaje', |
| 3329 | + 'contribstats-landingpage' => 'Cieľová stránka', |
| 3330 | + 'contribstats-donatepage' => 'Stránka darov', |
| 3331 | + 'contribstats-average' => 'Priemer', |
3282 | 3332 | 'fundraiserstatistics' => 'Štatistika fundraisingu', |
3283 | 3333 | 'fundraiserstats-date' => 'Dátum', |
3284 | 3334 | 'fundraiserstats-day' => 'Deň $1 z $2', |
— | — | @@ -3443,6 +3493,7 @@ |
3444 | 3494 | 'contribstats-clicks' => 'నొక్కులు', |
3445 | 3495 | 'contribstats-donations' => 'విరాళాలు', |
3446 | 3496 | 'contribstats-template' => 'మూస', |
| 3497 | + 'contribstats-average' => 'సగటు', |
3447 | 3498 | 'fundraiserstatistics' => 'నిధుల సేకరణ గణాంకాలు', |
3448 | 3499 | 'fundraiserstats-date' => 'తేదీ', |
3449 | 3500 | 'fundraiserstats-contributions' => 'దాతలు', |
Index: branches/wmf-deployment/extensions/ContributionReporting/ContributionStatistics_body.php |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | $factor = $numContributions > 0 ? 100.0 / $numContributions : 0; |
246 | 246 | |
247 | 247 | $list = array( |
248 | | - wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 30 ) ) => array( 30 ), |
| 248 | + wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 35 ) ) => array( 35 ), |
249 | 249 | wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 75 ) ) => array( 75 ), |
250 | 250 | wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 100 ) ) => array( 100 ), |
251 | 251 | wfMsg( 'contribstats-value-under', $wgLang->formatNum( 99.99 ) ) => array( 0, 99.99 ), |
— | — | @@ -414,9 +414,9 @@ |
415 | 415 | // Merge null and USD |
416 | 416 | $totals['USD'][1] += $totals[null][1]; |
417 | 417 | $totals['USD'][2] += $totals[null][2]; |
418 | | - $totals['USD'][3] = ( $totals['USD'][3] + $totals[null][3] ) / 2; |
419 | | - $totals['USD'][4] = min( $totals['USD'][4], $totals[null][4] ); |
420 | | - $totals['USD'][5] = max( $totals['USD'][5], $totals[null][5] ); |
| 418 | + $totals['USD'][3] = ( $totals[null][3] == 0 ) ? $totals['USD'][3] : ( $totals['USD'][3] + $totals[null][3] ) / 2; |
| 419 | + $totals['USD'][4] = max( $totals['USD'][4], $totals[null][4] ); |
| 420 | + /* $totals['USD'][5] = min( $totals['USD'][5], $totals[null][5] ); */ |
421 | 421 | unset( $totals[null] ); |
422 | 422 | } |
423 | 423 | |
Property changes on: branches/wmf-deployment/extensions/ContributionReporting |
___________________________________________________________________ |
Name: svn:mergeinfo |
424 | 424 | - /branches/REL1_15/phase3/extensions/ContributionReporting:51646 |
/trunk/extensions/ContributionReporting:56151-57449,58684,58687-59049,59134-59163,59176,59690 |
/trunk/extensions/ContributionTracking:58684 |
/trunk/phase3/extensions/ContributionReporting:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57541,57916,58151,58219,58633,58816 |
425 | 425 | + /branches/REL1_15/phase3/extensions/ContributionReporting:51646 |
/trunk/extensions/ContributionReporting:56151-57449,58684,58687-59049,59134-59163,59165-59752 |
/trunk/extensions/ContributionTracking:58684 |
/trunk/phase3/extensions/ContributionReporting:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57541,57916,58151,58219,58633,58816 |