WassUp Real Time Analytics - Version 1.9

Version Description

Download this release

Release Info

Developer michelem
Plugin Icon 128x128 WassUp Real Time Analytics
Version 1.9
Comparing to
See all releases

Code changes from version 1.8.7 to 1.9

Files changed (46) hide show
  1. badhosts-intl.txt +34 -0
  2. badhosts.txt +23 -16
  3. css/images/logo-small.png +0 -0
  4. css/images/logo.gif +0 -0
  5. css/images/logo.png +0 -0
  6. css/wassup-widget.css +34 -0
  7. css/wassup.css +349 -776
  8. img/btn_donateCC_LG.gif +0 -0
  9. img/donate-button-sm.png +0 -0
  10. img/donate_64.png +0 -0
  11. img/map_add.png +0 -0
  12. img/popup.png +0 -0
  13. js/jquery-migrate.js +2 -0
  14. js/jquery-ui/css/images/animated-overlay.gif +0 -0
  15. js/jquery-ui/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  16. js/jquery-ui/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  17. js/jquery-ui/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  18. js/jquery-ui/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  19. js/jquery-ui/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  20. js/jquery-ui/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  21. js/jquery-ui/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  22. js/jquery-ui/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  23. js/jquery-ui/css/images/ui-icons_222222_256x240.png +0 -0
  24. js/jquery-ui/css/images/ui-icons_2e83ff_256x240.png +0 -0
  25. js/jquery-ui/css/images/ui-icons_454545_256x240.png +0 -0
  26. js/jquery-ui/css/images/ui-icons_888888_256x240.png +0 -0
  27. js/jquery-ui/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  28. js/jquery-ui/css/jquery-ui.css +4 -0
  29. js/jquery-ui/css/jquery.ui.core.css +5 -0
  30. js/jquery-ui/css/jquery.ui.tabs.css +54 -0
  31. js/jquery-ui/css/jquery.ui.theme.css +5 -0
  32. js/jquery-ui/js/jquery-ui.min.js +7 -0
  33. js/jquery.js +3 -154
  34. js/spia.js +34 -93
  35. js/thickbox/thickbox.css +33 -164
  36. js/wassup.js +14 -0
  37. language/wassup.pot +2135 -766
  38. lib/action.php +209 -167
  39. lib/admin.class.php +215 -0
  40. lib/akismet.class.php +151 -259
  41. lib/compat-lib/admin.class.php +212 -0
  42. lib/compat-lib/compat_functions.php +149 -0
  43. lib/compat-lib/wassup.class.php +2157 -0
  44. lib/main.php +1232 -1338
  45. lib/settings.php +746 -335
  46. lib/uadetector.class.php +20 -1152
badhosts-intl.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  111odfuod\.us
2
  111ouroue\.us
3
  1ead1ead\.us
@@ -5,16 +11,19 @@
5
  24h\.to
6
  88\.to
7
  88dns\.cn
 
8
  a\-team\.com\.sg
9
  a1car\.com\.sg
10
  aa0ru08\.us
11
  abe8748biz\.us
12
  abjuration2appaloosa\.us
 
13
  accessibly4168pi11\.us
14
  actualize2achy\.us
15
  adrugstoreandmore\.us
16
  advantagedrugstore\.us
17
  aelefa\.us
 
18
  affinitydrugstores\.us
19
  affordable\-drugstore\.us
20
  agents\.com\.sg
@@ -47,6 +56,8 @@ barraca\.us
47
  barscan\.com\.sg
48
  base191tads\.us
49
  basicgentle\.cn
 
 
50
  bb03480\.us
51
  bb30480\.us
52
  bcgroup\.com\.sg
@@ -71,6 +82,7 @@ caraway307biz\.us
71
  careerjet\.com\.au
72
  carlz\.us
73
  cartsite\.us
 
74
  cheapermortgage\.cn
75
  choice\-funds\.us
76
  clan\.ws
@@ -96,6 +108,7 @@ digi\.ws
96
  directwife\.cn
97
  disneyland1937pill\.us
98
  dubnh\.us
 
99
  east\.net\.cn
100
  easy\-herbal\.us
101
  edificagrowth\.tc
@@ -108,6 +121,7 @@ flonosoft\.eu
108
  foetus4647rx\.us
109
  forgivable8459biz\.us
110
  fractionfield\.cn
 
111
  frankly8033pi11s\.us
112
  freesexonthewebs\.bz
113
  freewarechannel\.de
@@ -130,6 +144,7 @@ great\-stuff\.us
130
  gtrrrez\.us
131
  guaranapureza\.us
132
  guidefamily\.cn
 
133
  harsh8isobit\.us
134
  healthproducts\.bz
135
  helllobay\.ch
@@ -164,10 +179,12 @@ kpth\.us
164
  levin\.hk
165
  lifemedien\.de
166
  lifesaver5subitem\.us
 
167
  lists\.com\.sg
168
  livemarket\.com\.ua
169
  looking\-to\-get\-laid\.us
170
  looktruck\.cn
 
171
  mafer\.hk
172
  manhole4962biz\.us
173
  manifesto8098tads\.us
@@ -189,6 +206,8 @@ narrowly9558pi11\.us
189
  net\-salez\.us
190
  newhorizons\.com\.sg
191
  newportcorp\.cn
 
 
192
  ni\.com\.au
193
  ninemilk\.cn
194
  nlp\-transform\.com\.sg
@@ -204,6 +223,7 @@ nude7755pi11s\.us
204
  o2\.ie
205
  ocsc\.com\.sg
206
  oil\-bank\.ru
 
207
  omnisoft\.ws
208
  onet\.pl
209
  online\.cx
@@ -223,12 +243,15 @@ pantropic\.com\.sg
223
  papasite\.us
224
  paperhis\.cn
225
  patronizer6687tads\.us
 
226
  pekingtrail\.com\.ph
227
  penumbral7470drugs\.us
228
  phonehome\.com\.sg
229
  pillsdoc\.us
230
  pluckz\.us
 
231
  polsurvey\.com\.sg
 
232
  practiceled\.cn
233
  prado29\.us
234
  presentindicate\.cn
@@ -242,6 +265,7 @@ professor\.com\.sg
242
  promote9796drug\.us
243
  propulsion3417drug\.us
244
  provable6567pi11\.us
 
245
  pssp\.com\.cn
246
  puddle2\.us
247
  puling7796meds\.us
@@ -263,6 +287,7 @@ readingpower\.com\.sg
263
  reassess837rx\.us
264
  recherche\.fr
265
  recruitu\.to
 
266
  redrawing5984biz\.us
267
  referral9466pill\.us
268
  remake9252tabs\.us
@@ -273,8 +298,10 @@ samaengineering\.com\.pk
273
  saver9straight\.us
274
  scout\.org\.tw
275
  scrapbook3383meds\.us
 
276
  servsite\.us
277
  sevrre\.co
 
278
  shop\.tc
279
  shopin\.to
280
  shrink\.ws
@@ -285,13 +312,16 @@ slimdoctor\.ru
285
  sminet\.com\.my
286
  smuuchi\.hk
287
  snap\.to
 
288
  sp\.st
289
  squareskin\.cn
290
  start\.bg
 
291
  stesa\.com\.sg
292
  surepass\.com\.sg
293
  syphilitic1illustrate\.us
294
  talonet\.it
 
295
  target\.sg
296
  telcall\.com\.au
297
  terra\.es
@@ -299,15 +329,19 @@ thoughteach\.cn
299
  top100\.ro
300
  topsitez\.us
301
  tr\.cx
 
302
  uol\.com\.br
303
  up\.com\.sg
304
  us\.tc
305
  v56yu8rt\.ph
306
  web\-ip\.de
 
307
  website\.ws
308
  wetrack\.it
309
  wholegrew\.cn
 
310
  withpoem\.cn
311
  wonderdrug\.ws
 
312
  x67fr22v\.ph
313
  xer\.com\.au
1
+ /**
2
+ * known referrer spammer domains with 2-digit TLDS and in regex format.
3
+ *
4
+ * @package WassUp Real-time Analytics
5
+ * @subpackage badhosts-intl.txt module
6
+ */
7
  111odfuod\.us
8
  111ouroue\.us
9
  1ead1ead\.us
11
  24h\.to
12
  88\.to
13
  88dns\.cn
14
+ [a-z]+19[0-9]{2}\.co\.cc
15
  a\-team\.com\.sg
16
  a1car\.com\.sg
17
  aa0ru08\.us
18
  abe8748biz\.us
19
  abjuration2appaloosa\.us
20
+ abv\.bg
21
  accessibly4168pi11\.us
22
  actualize2achy\.us
23
  adrugstoreandmore\.us
24
  advantagedrugstore\.us
25
  aelefa\.us
26
+ aenf55\.neoplus\.adsl\.tpnet\.pl
27
  affinitydrugstores\.us
28
  affordable\-drugstore\.us
29
  agents\.com\.sg
56
  barscan\.com\.sg
57
  base191tads\.us
58
  basicgentle\.cn
59
+ bayanbag\.tk
60
+ bazaprac\.pl
61
  bb03480\.us
62
  bb30480\.us
63
  bcgroup\.com\.sg
82
  careerjet\.com\.au
83
  carlz\.us
84
  cartsite\.us
85
+ cheapchristianlouboutins\.us
86
  cheapermortgage\.cn
87
  choice\-funds\.us
88
  clan\.ws
108
  directwife\.cn
109
  disneyland1937pill\.us
110
  dubnh\.us
111
+ duunot\.eu
112
  east\.net\.cn
113
  easy\-herbal\.us
114
  edificagrowth\.tc
121
  foetus4647rx\.us
122
  forgivable8459biz\.us
123
  fractionfield\.cn
124
+ fragmenty\.masternet\.pl
125
  frankly8033pi11s\.us
126
  freesexonthewebs\.bz
127
  freewarechannel\.de
144
  gtrrrez\.us
145
  guaranapureza\.us
146
  guidefamily\.cn
147
+ h\-1.+\.cssgroup\.lv
148
  harsh8isobit\.us
149
  healthproducts\.bz
150
  helllobay\.ch
179
  levin\.hk
180
  lifemedien\.de
181
  lifesaver5subitem\.us
182
+ lineout\.pl
183
  lists\.com\.sg
184
  livemarket\.com\.ua
185
  looking\-to\-get\-laid\.us
186
  looktruck\.cn
187
+ luia\.ru
188
  mafer\.hk
189
  manhole4962biz\.us
190
  manifesto8098tads\.us
206
  net\-salez\.us
207
  newhorizons\.com\.sg
208
  newportcorp\.cn
209
+ news4all\.pl
210
+ nextcars\.net
211
  ni\.com\.au
212
  ninemilk\.cn
213
  nlp\-transform\.com\.sg
223
  o2\.ie
224
  ocsc\.com\.sg
225
  oil\-bank\.ru
226
+ oma\-chat\-live\.de
227
  omnisoft\.ws
228
  onet\.pl
229
  online\.cx
243
  papasite\.us
244
  paperhis\.cn
245
  patronizer6687tads\.us
246
+ pc\-games\-10\.de
247
  pekingtrail\.com\.ph
248
  penumbral7470drugs\.us
249
  phonehome\.com\.sg
250
  pillsdoc\.us
251
  pluckz\.us
252
+ poker\-review\.tk
253
  polsurvey\.com\.sg
254
+ pornobesto\.ru
255
  practiceled\.cn
256
  prado29\.us
257
  presentindicate\.cn
265
  promote9796drug\.us
266
  propulsion3417drug\.us
267
  provable6567pi11\.us
268
+ przezorni\.civ\.pl
269
  pssp\.com\.cn
270
  puddle2\.us
271
  puling7796meds\.us
287
  reassess837rx\.us
288
  recherche\.fr
289
  recruitu\.to
290
+ red\-black\.ru
291
  redrawing5984biz\.us
292
  referral9466pill\.us
293
  remake9252tabs\.us
298
  saver9straight\.us
299
  scout\.org\.tw
300
  scrapbook3383meds\.us
301
+ sensownie\.edu\.pl
302
  servsite\.us
303
  sevrre\.co
304
+ sexcam\-girls\.at
305
  shop\.tc
306
  shopin\.to
307
  shrink\.ws
312
  sminet\.com\.my
313
  smuuchi\.hk
314
  snap\.to
315
+ socratestheme\.me
316
  sp\.st
317
  squareskin\.cn
318
  start\.bg
319
+ statysta\.ionic\.pl
320
  stesa\.com\.sg
321
  surepass\.com\.sg
322
  syphilitic1illustrate\.us
323
  talonet\.it
324
+ tanieculicy\.pl
325
  target\.sg
326
  telcall\.com\.au
327
  terra\.es
329
  top100\.ro
330
  topsitez\.us
331
  tr\.cx
332
+ uggs\-for\-sale\.us
333
  uol\.com\.br
334
  up\.com\.sg
335
  us\.tc
336
  v56yu8rt\.ph
337
  web\-ip\.de
338
+ webholder\.pl
339
  website\.ws
340
  wetrack\.it
341
  wholegrew\.cn
342
+ wholesalelobster\.ca
343
  withpoem\.cn
344
  wonderdrug\.ws
345
+ wycinki\.iswift\.eu
346
  x67fr22v\.ph
347
  xer\.com\.au
badhosts.txt CHANGED
@@ -1,6 +1,13 @@
 
 
 
 
 
 
1
  0k0k\.net
2
  0riginals\.net
3
  1010101010\.biz
 
4
  123bargain\.net
5
  123getit\.com
6
  123getnow\.com
@@ -77,6 +84,7 @@ adultactioncam\.com
77
  adultactioncash\.com
78
  adultmegacash\.com
79
  advertising\.com
 
80
  aeterna\-tech\.com
81
  afdb\.org
82
  afeet\.com
@@ -87,9 +95,11 @@ ahilles\.com
87
  ahmort\.(com|net)
88
  ahomelender\.com
89
  aidemail\.net
 
90
  akella\.biz
91
  akmort\.net
92
  alansis\.com
 
93
  allaboutfatloss\.com
94
  allbestprice\.info
95
  allbigcocks\.com
@@ -99,6 +109,7 @@ allforhealth\.info
99
  allinfohere\.info
100
  allinternal\.com
101
  allisonroyce\.com
 
102
  allpassports\.com
103
  allpharmaonline\.com
104
  allthemeds\.info
@@ -113,14 +124,17 @@ amason\.info
113
  amateurvoetbal\.net
114
  ambein\.net
115
  america\-loans\.net
 
116
  american\-loans\.org
117
  americangreetings\.com
118
  amhang\.com
 
119
  amomentlikethisagain\.com
120
  amtradebiz\.com
121
  andthen\.info
122
  andrewsaluk\.com
123
  andipink\.com
 
124
  angellenders\.com
125
  annualised\.net
126
  antiaging\.com
@@ -129,6 +143,7 @@ antiquemarketplace\.net
129
  antispysoft2005\.com
130
  apcotinternational\.com
131
  approved\-loans\.net
 
132
  artsmallforsenate\.com
133
  asdce\.com
134
  asstraffic\.com
@@ -144,6 +159,7 @@ available\-casino\.com
144
  available\-credit\.com
145
  available\-prescription\.com
146
  availableonlyonline\.com
 
147
  awayoutofdebtfast\.com
148
  axionfootwear\.com
149
  azogle\.com
@@ -151,6 +167,7 @@ b3tterh3alth\.com
151
  b7x\.net
152
  b888\.info
153
  baba\-song\.com
 
154
  baby30\.com
155
  babz\.info
156
  backpackgirl\.com
@@ -160,6 +177,7 @@ bangmatch\.com
160
  bangthem\.com
161
  bankgeld\.com
162
  bankir\.info
 
163
  barnyardteenies\.com
164
  base\-poker\.com
165
  basedn\.com
@@ -167,6 +185,7 @@ bayfronthomes\.net
167
  bbahostcity\.com
168
  bbbrx\.org
169
  be\-young\.com
 
170
  beatrxbillz\.com
171
  beautifulpants\.com
172
  beill\.com
@@ -209,6 +228,8 @@ blah\-rx\.com
209
  blankmaven\.com
210
  blazinwebtraffic\.com
211
  blest\-money\.com
 
 
212
  bluebroom\.com
213
  bluedolphin\.com
214
  bluemountain\.com
@@ -238,6 +259,7 @@ broadcastemailingtoday\.biz
238
  brutalblowjobs\.com
239
  bservicesp\.com
240
  budgethawaii\.net
 
241
  businesswire\.com
242
  butidoloveyou\.com
243
  buy\-2005\.com
@@ -1566,12 +1588,10 @@ verybestmeds\.com
1566
  vgr100\.com
1567
  viags\.com
1568
  victoriassecret\.com
1569
- victorymeds\.com
1570
  viewhelp\.info
1571
  vinetka\.info
1572
  vinsider\.com
1573
  vippills\.net
1574
- viproyalcasino\.net
1575
  virtual\-pc\.org
1576
  virtualstoragecenter\.com
1577
  visagraph\.net
@@ -1591,14 +1611,10 @@ vselling\.com
1591
  vsymphony\.com
1592
  vthought\.com
1593
  vz6\.net
1594
- w0wo\.com
1595
- walnuttownfireco\.org
1596
  wandweb\.com
1597
  wannavisit\.com
1598
  wantahomeloan\.com
1599
  warehousemedical\.com
1600
- wasabi\-online\.com
1601
- watch\-the\-time\.com
1602
  watchesbazaar\.com
1603
  wauy\.com
1604
  wayaround\.info
@@ -1610,17 +1626,13 @@ webleads\.info
1610
  webpronews\.com
1611
  weightlossbusiness\.net
1612
  weightlossfirm\.com
1613
- wellahost\.com
1614
  wellness\-i\.com
1615
  wetparts\.com
1616
- whatatosser\.com
1617
- white\-pills\.com
1618
  who\-remembers\-me\.com
1619
  whvc\.net
1620
  wickedground\.com
1621
  wieg\.biz
1622
  wifecheaters\.info
1623
- wifejoker\.com
1624
  wildpass\.com
1625
  windowflower\.com
1626
  windowscasino\.com
@@ -1635,11 +1647,10 @@ wondermed\.info
1635
  wonderstuff\.biz
1636
  woomen\.biz
1637
  workandsleep\.com
1638
- workxz\.com
1639
  worlduniversityonline\.com
1640
  wowhealth\.info
1641
  wowoffer\.com
1642
- wowpillzale.com
1643
  wowrates\.com
1644
  wringman\.com
1645
  wrongsideoftown\.com
@@ -1681,10 +1692,8 @@ yo6\.net
1681
  your\-financial\.com
1682
  yourbignight\.com
1683
  yourcasinobiz\.com
1684
- yourcheap\-rx\.com
1685
  yourhostingaccount\.com
1686
  yourmeds\.info
1687
- yourmort\.com
1688
  yourname\.com
1689
  yourowndoctor\.info
1690
  yourpsychic\.net
@@ -1694,7 +1703,5 @@ yx\-colorweaving\.com
1694
  zapbook\.info
1695
  zolotko\.info
1696
  zoomgirls\.net
1697
- zoophilelinks\.net
1698
  zowk\.com
1699
- ztcash\.com
1700
  zwallet\.com
1
+ /**
2
+ * known referrer spammer domains in regex format.
3
+ *
4
+ * @package WassUp Real-time Analytics
5
+ * @subpackage badhosts.txt module
6
+ */
7
  0k0k\.net
8
  0riginals\.net
9
  1010101010\.biz
10
+ 123666123\.com
11
  123bargain\.net
12
  123getit\.com
13
  123getnow\.com
84
  adultactioncash\.com
85
  adultmegacash\.com
86
  advertising\.com
87
+ aerhaethjsry\.com
88
  aeterna\-tech\.com
89
  afdb\.org
90
  afeet\.com
95
  ahmort\.(com|net)
96
  ahomelender\.com
97
  aidemail\.net
98
+ aimtrust\.com
99
  akella\.biz
100
  akmort\.net
101
  alansis\.com
102
+ all\-lasik\-centers\.com
103
  allaboutfatloss\.com
104
  allbestprice\.info
105
  allbigcocks\.com
109
  allinfohere\.info
110
  allinternal\.com
111
  allisonroyce\.com
112
+ allmymovies\.biz
113
  allpassports\.com
114
  allpharmaonline\.com
115
  allthemeds\.info
124
  amateurvoetbal\.net
125
  ambein\.net
126
  america\-loans\.net
127
+ american\-insurance\-companies\.com
128
  american\-loans\.org
129
  americangreetings\.com
130
  amhang\.com
131
+ amipregnantquizzes\.com
132
  amomentlikethisagain\.com
133
  amtradebiz\.com
134
  andthen\.info
135
  andrewsaluk\.com
136
  andipink\.com
137
+ andysreviews\.com
138
  angellenders\.com
139
  annualised\.net
140
  antiaging\.com
143
  antispysoft2005\.com
144
  apcotinternational\.com
145
  approved\-loans\.net
146
+ articlemarketingrobots\.org
147
  artsmallforsenate\.com
148
  asdce\.com
149
  asstraffic\.com
159
  available\-credit\.com
160
  available\-prescription\.com
161
  availableonlyonline\.com
162
+ Avanti\.net
163
  awayoutofdebtfast\.com
164
  axionfootwear\.com
165
  azogle\.com
167
  b7x\.net
168
  b888\.info
169
  baba\-song\.com
170
+ baby\-kleidung\.runashop\.com
171
  baby30\.com
172
  babz\.info
173
  backpackgirl\.com
177
  bangthem\.com
178
  bankgeld\.com
179
  bankir\.info
180
+ bantaloh\.net
181
  barnyardteenies\.com
182
  base\-poker\.com
183
  basedn\.com
185
  bbahostcity\.com
186
  bbbrx\.org
187
  be\-young\.com
188
+ beachvitality\.com
189
  beatrxbillz\.com
190
  beautifulpants\.com
191
  beill\.com
228
  blankmaven\.com
229
  blazinwebtraffic\.com
230
  blest\-money\.com
231
+ bloggingtomakemoney\.net
232
+ blueberryvitamin\.com
233
  bluebroom\.com
234
  bluedolphin\.com
235
  bluemountain\.com
259
  brutalblowjobs\.com
260
  bservicesp\.com
261
  budgethawaii\.net
262
+ bumphero\.com
263
  businesswire\.com
264
  butidoloveyou\.com
265
  buy\-2005\.com
1588
  vgr100\.com
1589
  viags\.com
1590
  victoriassecret\.com
 
1591
  viewhelp\.info
1592
  vinetka\.info
1593
  vinsider\.com
1594
  vippills\.net
 
1595
  virtual\-pc\.org
1596
  virtualstoragecenter\.com
1597
  visagraph\.net
1611
  vsymphony\.com
1612
  vthought\.com
1613
  vz6\.net
 
 
1614
  wandweb\.com
1615
  wannavisit\.com
1616
  wantahomeloan\.com
1617
  warehousemedical\.com
 
 
1618
  watchesbazaar\.com
1619
  wauy\.com
1620
  wayaround\.info
1626
  webpronews\.com
1627
  weightlossbusiness\.net
1628
  weightlossfirm\.com
 
1629
  wellness\-i\.com
1630
  wetparts\.com
 
 
1631
  who\-remembers\-me\.com
1632
  whvc\.net
1633
  wickedground\.com
1634
  wieg\.biz
1635
  wifecheaters\.info
 
1636
  wildpass\.com
1637
  windowflower\.com
1638
  windowscasino\.com
1647
  wonderstuff\.biz
1648
  woomen\.biz
1649
  workandsleep\.com
 
1650
  worlduniversityonline\.com
1651
  wowhealth\.info
1652
  wowoffer\.com
1653
+ wowpillzale\.com
1654
  wowrates\.com
1655
  wringman\.com
1656
  wrongsideoftown\.com
1692
  your\-financial\.com
1693
  yourbignight\.com
1694
  yourcasinobiz\.com
 
1695
  yourhostingaccount\.com
1696
  yourmeds\.info
 
1697
  yourname\.com
1698
  yourowndoctor\.info
1699
  yourpsychic\.net
1703
  zapbook\.info
1704
  zolotko\.info
1705
  zoomgirls\.net
 
1706
  zowk\.com
 
1707
  zwallet\.com
css/images/logo-small.png ADDED
Binary file
css/images/logo.gif ADDED
Binary file
css/images/logo.png ADDED
Binary file
css/wassup-widget.css ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * styles for aside widgets and 'wassup_sidebar' template tag display
3
+ *
4
+ * -no-bullet lists
5
+ * -numbers styled for monospaced font and a color background.
6
+ *
7
+ * @package WassUp Real-time Analytics
8
+ * @subpackage css/wassup-widget.css module
9
+ */
10
+ .wassup-widget{white-space:normal;}
11
+ .wassup-widget ul{}
12
+ .wassup-widget ul.nobullet li{list-style-type:none;}
13
+ .wassup-widget ul li{min-height:1em;clear:left;} /* clearfix */
14
+ .wassup-widget strong{font-size:1.1em;text-shadow:-1px 1px 0 #efe;}
15
+ .wassup-widget p{text-indent:0 !important;}
16
+ .wassup-widget .nobullet li p,.wassup-widget .nobullet li div{max-width:90%;margin:1em 0 0;padding:2px 2px 3px 5px;word-wrap:normal;}
17
+ .wassup-widget li a{}
18
+ .wassup-widget .online-count{min-width:25px;margin:0 2px 5px 7px;padding:2px 3px 0;font-family:"Lucida Console",Monaco,monospace;display:inline;display:inline-block;line-height:1.2em;color:#223;font-size:1.1em;text-align:center;background-color:#ddf0ff;border:1px solid #bbb;border-radius:3px;}
19
+ .wassup-widget .online-total{min-width:30px;margin-left:5px;padding:2px 4px 0;font-size:1.3em;}
20
+ .wassup-widget p img {margin:0 2px;padding:0;vertical-align:middle;}
21
+ .wassup-widget .online-user{background-color:#e8e8f8;}
22
+ .wassup-widget .online-comauth{background-color:#fcfaac;}
23
+ .wassup-widget .online-spider{background-color:#f6ecce;}
24
+ .wassup-widget .online-loggedin{background-color:#dfffcc;}
25
+ .wassup-widget p.online-loggedin{color:#223;background-color:#efffe0;border:1px solid #eee;border-radius:7px;}
26
+ .wassup-widget .wassup-flag img,.wassup-widget .icon{margin-left:3px;padding:0;border:1px solid #eee;}
27
+ .wassup-widget li.stat-count .top-item,.wassup-widget li .top-url{max-width:95%;display:inline-block;float:none;}
28
+ .wassup-widget ul li.stat-count .top-item,.wassup-widget ul li.stat-count .top-url{max-width:83%;vertical-align:top;}
29
+ .wassup-widget ul li .top-url a{display:block;line-height:1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
30
+ .wassup-widget ul li .fixed{display:block;display:inline-block;float:left;padding-right:3px;font-family:"Lucida Console",Monaco,monospace;text-align:right;font-size:1.1em;clear:left;}
31
+ .wassup-widget li.stat-count .fixed{float:none;}
32
+ .wassup-widget .wassup-marque{display:block;width:100%;margin:-5px 0 0;padding:2px 10px 0 0;text-align:center;font-size:7pt !important;color:#999;opacity:0.7;}
33
+ .wassup-widget .wassup-marque a{color:#779;opacity:0.7;text-decoration:none;}
34
+ .wassup-widget .wassup-marque a:hover {color:#000;}
css/wassup.css CHANGED
@@ -1,779 +1,352 @@
1
  /**
2
- * @package WassUP
3
- * wassup.css - stylesheet for WassUp plugin
 
 
4
  */
5
- .wrap { margin: 0px 20px 0 2px; }
6
- #wassup-wrap {
7
- min-height: 500px;
8
- padding: 1px 7px 3px;
9
- font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
10
- font-size: 13px;
11
- border-top: 3px solid #d6d7d6;
12
- /* background: #efebef ; */
13
- /* background: #efebef url("images/menu-shadow-rtl.png") left top repeat-y; */
14
- -moz-border-radius: 5px 5px 0 0;
15
- -webkit-border-top-left-radius: 5px;
16
- -webkit-border-top-right-radius: 5px;
17
- -khtml-border-top-left-radius: 5px;
18
- -khtml-border-top-right-radius: 5px;
19
- border-top-right-radius: 0px;
20
- border-top-left-radius: 0px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
- #wassup-wrap table { border-collapse: collapse; padding: 2px; }
23
- #wassup-wrap h2 {
24
- margin-top: 10px;
25
- color: #00284a;
26
- text-shadow:rgba(255,255,221,0.5) 0 2px 0;
27
- }
28
- #wassup-wrap img {
29
- display: inline;
30
- vertical-align: middle;
31
- margin: 0 2px 2px 0;
32
- padding:0;
33
- }
34
- #wassup-wrap a, #wassup-wrap a:link {
35
- color: #00b;
36
- border-bottom: 0 none;
37
- text-decoration: none;
38
- }
39
- #wassup-wrap td.legend a { border-bottom: 1px solid; }
40
- #wassup-wrap a:visited { color: #229; }
41
- #wassup-wrap a:hover { color: #ff6d06; }
42
- #wassup-wrap a:active { color: #d11; }
43
- .wassup-icon {}
44
- .wassup-content { min-height:225px; }
45
- /*
46
- * for wassup admin top menu styles in Wordpress 2.7+ */
47
- .wassup-menu-link {
48
- float: right;
49
- font-family: Arial,"Bitstream Vera Sans",Helvetica,Verdana,sans-serif;
50
- font-size: 12px;
51
- height: 28px;
52
- padding: 0;
53
- margin: 10px 4px 0 0;
54
- text-decoration: none;
55
- text-align:center;
56
- text-shadow:rgba(255,255,221,0.3) 0 1px 0;
57
- border: 1px solid #d6d6d6;
58
- -moz-border-radius-topleft: 3px;
59
- -moz-border-radius-topright: 3px;
60
- -webkit-border-top-left-radius: 3px;
61
- -webkit-border-top-right-radius: 3px;
62
- border-top-left-radius: 3px;
63
- border-top-right-radius: 3px;
64
- border-bottom: 0px none;
65
- background: url("images/link2.png") no-repeat 0 0;
66
- }
67
- /* Wordpress css adjustments */
68
- #contextual-help-link {
69
- -moz-border-radius-topleft: 3px;
70
- -moz-border-radius-topright: 3px;
71
- -webkit-border-top-left-radius: 3px;
72
- -webkit-border-top-right-radius: 3px;
73
- border-top-left-radius: 3px;
74
- border-top-right-radius: 3px;
75
- border-bottom: 0px none;
76
- border: 1px solid #d6d6d6;
77
- background: url("images/link2.png") no-repeat 0 0 !important;
78
- }
79
- #wpbody-content { margin-bottom: -5px; padding-top: 3px; }
80
- #ozh_menu_wrap { margin-top: -3px !important; } /* for ozh drop-down menu */
81
-
82
- #wassup-menu {
83
- display: inline;
84
- position: relative;
85
- height: 22px;
86
- }
87
- #wassup-menu a, #wassup-menu a:link {
88
- text-decoration: none !important;
89
- z-index: 1;
90
- margin: 0 auto;
91
- padding: 0 6px 0 6px;
92
- height: 22px;
93
- line-height: 22px;
94
- }
95
- #wassup-menu li.current a {
96
- color: #00284a;
97
- font-weight:bold;
98
- text-shadow:rgba(255,255,221,0.3) 0 -1px 0;
99
- }
100
- #wassup-menu a {
101
- color: #00b;
102
- text-decoration: underline;
103
- border-bottom: 0 none;
104
- }
105
- #wassup-menu a:visited { color: #c40; }
106
- #wassup-menu a:hover, #wassup-menu a:active,
107
- #wassup-menu li.current a:hover,
108
- .wassup-menu-link:hover a { color: #d85; }
109
- .wassup-menu-link:hover {
110
- background: url("images/link.png") no-repeat bottom center;
111
- border-top: 1px solid #c8c8c4;
112
- border-right: 1px solid #c8c8c4;
113
- border-left: 1px solid #c8c8c4;
114
- border-bottom: 0 none;
115
- }
116
- #wassup-menu li:first-child { margin-right: 20px; }
117
- #wassup-menu li.current, #wassup-menu-link:active {
118
- height: 30px !important;
119
- margin-bottom: -2px !important;
120
- color: #00284a;
121
- background: url("images/link.png") no-repeat bottom center;
122
- border-top: 1px solid #c8c8c4;
123
- border-right: 1px solid #c8c8c4;
124
- border-left: 1px solid #c8c8c4;
125
- border-bottom: 0 none;
126
- }
127
- .wassup-options form h3 {
128
- margin-top: 15px;
129
- margin-bottom: 0px;
130
- padding-bottom: 5px;
131
- color: #333;
132
- }
133
- .wassup-options form p {
134
- margin-top: 0px;
135
- padding-top: 0px;
136
- padding-left: 15px;
137
- }
138
- div.main-tabs {
139
- margin: 10px auto 3px auto;
140
- padding: 10px;
141
- color: #445;
142
- background-color: #E0E0E0;
143
- -moz-box-shadow: 0 0 3px rgba(24, 24, 30, 0.9);
144
- -webkit-box-shadow: 0 0 3px rgba(24, 24, 30, 0.9);
145
- box-shadow: 0 0 3px rgba(24, 24, 30, 0.9);
146
- border: 1px solid #e9e9ee;
147
- -moz-border-radius: 3px 3px 0 0;
148
- -webkit-border-top-left-radius: 3px;
149
- -webkit-border-top-right-radius: 3px;
150
- -khtml-border-top-left-radius: 3px;
151
- -khtml-border-top-right-radius: 3px;
152
- border-top-right-radius: 3px;
153
- border-top-left-radius: 3px;
154
- }
155
- .main-tabs a, .main-tabs a:link {
156
- color: #00b;
157
- border-bottom: 0 none;
158
- }
159
- .main-tabs a:visited { color: #229; }
160
- .main-tabs a:hover { color: #d11; }
161
- .main-tabs table { margin: 0 3px 0 2px; padding:0; }
162
- .main-tabs td { padding: 2px 5px 2px 2px; }
163
- .main-tabs td a { border-bottom: 1px solid; }
164
- .main-tabs textarea, .main-tabs input, .main-tabs select {
165
- background-color: #eee !important;
166
- border-color: #bbb9bb !important;
167
- font-size: 11px;
168
- }
169
- #minisub {
170
- display: none;
171
- }
172
- .pagination {
173
- margin: 5px 0 10px !important;
174
- padding: 3px !important;
175
- text-align: center;
176
- width: 100%;
177
- font-size: 12px !important;
178
- }
179
- .pagination a {
180
- margin: 2px;
181
- padding: 2px 5px 2px 5px;
182
- color: #777 !important;
183
- background-color: #eee;
184
- border: 1px solid #bbb !important;
185
- }
186
- .pagination a:hover,
187
- .pagination a:active {
188
- color: #dedede !important;
189
- background-color: #779;
190
- border-color: #f7f7f7;
191
- }
192
- .pagination .current {
193
- margin: 2px;
194
- padding: 2px 5px 2px 5px;
195
- font-weight: bold;
196
- color: #dedede;
197
- background-color: #778;
198
- border: 1px solid #fafeee;
199
- -moz-box-shadow:0 0 2px rgba(50, 80, 80, 0.3);
200
- -webkit-box-shadow:0 0 2px rgba(50, 80, 80, 0.3);
201
- box-shadow: 0 0 2px rgba(50, 80, 80, 0.3);
202
- }
203
- .pagination .disabled {
204
- padding: 2px 5px 2px 5px;
205
- margin: 2px;
206
- color: #b7b7b7;
207
- border: 1px solid #c7c7c7;
208
- }
209
- .legend {
210
- font-size: 11px;
211
- padding: 0 2px;
212
- }
213
- .pagination .legend { padding:0 !important; }
214
- .boxed {
215
- padding: 2px 5px 2px 5px;
216
- text-align:center;
217
- background-color: #eae9e9;
218
- border: 1px solid #c7c7c7;
219
- border-color: #c7c7c7 !important;
220
- }
221
- .borders a { text-decoration: none !important; border-bottom: 0px none; }
222
- /* a.toggle-all { width: 100px !important; }
223
- a.toggle-allcrono { width: 140px !important; }
224
- a.toggle-allcrono:hover, a.toggle-all:hover { background-color: #676767 !important; } */
225
- .sum-rec, .sum {
226
- margin: 0 0 12px;
227
- padding: 1px 0 0 !important;
228
- font-size: 11px;
229
- background-color: #f4f6f6;
230
- border: 1px solid #ababca; /* 89a; */
231
- border-top: 1px solid #cdccdc; /* #c7c7cc; */
232
- /* border-bottom: 3px solid #347; */
233
- }
234
- .sum-nav, .sum-nav-mark, .sum-spy {
235
- position: relative;
236
- clear: left;
237
- /* width: 100%; */
238
- min-height: 50px;
239
- margin: 0 !important;
240
- padding: 22px 0 0;
241
- font-size: 11px;
242
- border-top: 1px solid #fffcff;
243
- border-left: 1px solid #efefe0;
244
- border-right: 1px solid #efefe0;
245
- border-bottom: 0 none;
246
- background: url("images/list-bg.png") repeat-x;
247
- }
248
- .wassup-online .sum-nav { height:60px; }
249
- .sum-mark { background-color: #f7f707 !important; }
250
- .sum-nav-mark {
251
- background-image: none;
252
- background-color: #f7f707;
253
- }
254
- .sum-nav-spy {
255
- width: 100%;
256
- margin: 0 !important;
257
- padding: 15px 0 7px;
258
- border-bottom: 1px solid #ddd;
259
- background: #f3f3f3 url("images/list-bg.png") repeat-x;
260
- }
261
- div.sum-spy {
262
- margin: 12px 0 0 0 !important;
263
- padding: 1px 1px 0 !important;
264
- border-top: 1px solid #fefffe;
265
- border-right: 1px solid #779;
266
- border-left: 1px solid #779;
267
- border-bottom: 3px solid #347;
268
- min-height: 50px;
269
- background: #f4f6f6 url("images/list-bg.png") repeat-x;
270
- -moz-box-shadow:0 2px 5px #779;
271
- -webkit-box-shadow: 0 2px 5px #779;
272
- box-shadow: 0 2px 5px #779;
273
- }
274
- .delbut {
275
- position: absolute;
276
- top: 5px;
277
- right: 5px;
278
- width: 150px;
279
- /* padding: 0 5px 5px 0;
280
- clear:both; */
281
- }
282
- .delbut img {
283
- float: right;
284
- padding: 0 5px 0 5px !important;
285
- }
286
- .sum-footer {
287
- margin: 0 !important;
288
- padding: 0;
289
- /* width: 100%; */
290
- height: 3px;
291
- clear: both;
292
- background-color: #77799f;
293
- }
294
- .sum-det, .sum-det-spy {
295
- display:block;
296
- clear:right;
297
- margin: 0 0 0 165px;
298
- padding: 0;
299
- line-height: 1.3em;
300
- }
301
- .sum-det-spy span {
302
- margin: 0;
303
- padding: 0;
304
- }
305
- .det1 {
306
- line-height: 1.5em;
307
- display: block;
308
- font-size: 14px;
309
- }
310
- .det2 {
311
- line-height: 1.5em;
312
- display: block;
313
- }
314
- .det3 { padding-left: 20px; }
315
- .det1 a { font-weight: bold; border-bottom: 1px solid !important; }
316
- .det2 a, .det2 a:link, .sum-det span.det2 a {
317
- color: #349 !important;
318
- }
319
- .det2 a:hover, .sum-det span.det2 a:hover {
320
- color: #d54d22 !important;
321
- }
322
- .det2 strong { color: #001616; font-weight: normal; }
323
- .agent strong { font-weight: bold; }
324
- .sum-box {
325
- float: left;
326
- display: block;
327
- width: 163px;
328
- min-height: 50px;
329
- margin: 0 0 3px 0;
330
- padding:0;
331
- color: #00284a;
332
- font-size: 11px;
333
- text-align: center;
334
- }
335
- .wassup-online .sum-box { min-height: 30px !important }
336
- .sum-box span {
337
- display: block;
338
- margin: 0 auto;
339
- padding:0;
340
- }
341
- .sum-box .sum-box-ip {
342
- width: 140px;
343
- height: 28px;
344
- padding-top: 5px !important;
345
- border: 1px solid #c0cccf;
346
- /* -moz-box-shadow: 0 -2px 10px #BFBFBD inset;
347
- -webkit-box-shadow: 0 -2px 10px #BFBFBD inset;
348
- box-shadow: 0 --2px 10px #BFBFBD inset; */
349
- }
350
- .sum-box-ip {
351
- font-family: tahoma, verdana, arial, sans-serif;
352
- font-size: 12px;
353
- font-weight: bold;
354
- text-shadow: rgba(255,253,240,0.7) 0 -1px 0;
355
- background: #dde url("images/sum-box.png") bottom left;
356
- border: 3px solid #fffeff;
357
- }
358
- .sum-spy-ip {
359
- width: 140px;
360
- height: 28px;
361
- margin-top: 15px;
362
- padding: 7px 0 0 0 !important;
363
- font-family: tahoma, verdana, arial, sans-serif;
364
- font-size: 12px;
365
- font-weight: bold;
366
- text-shadow:rgba(255,253,240,0.7) 0 -1px 0;
367
- background: #dde url("images/sum-box.png") bottom left;
368
- border: 1px solid #aaaab0;
369
- }
370
- .sum-box-ip a, .sum-spy-ip a {
371
- color: #336 !important;
372
- border-bottom: 1px solid #279 !important;
373
- }
374
- .sum-box-ip a:hover, .sum-spy-ip a:hover { color: #c64; }
375
- .sum-box-spider { background-color: #dcbc9c; }
376
- .sum-spy-spider { background-color: #dcbc9c; }
377
- .sum-spy-spam { background-color: #dcbc9c; }
378
- .sum-spy-aut { background-color: #fafaaa; }
379
- .sum-spy-log { background-color: #dfa; }
380
- .sum-date {
381
- width: 160px;
382
- margin: 5px auto 0 auto !important;
383
- line-height: 1.1em;
384
- }
385
- #toptenchart { margin:0 auto; padding:0; }
386
- #toptenchart table {
387
- margin: 0;
388
- padding: 0;
389
- border-collapse: collapse;
390
- border: 0 none;
391
- }
392
- #toptenchart a { color: #464646; margin-left: 1px; }
393
- #toptenchart a:hover { color: #d54d22; }
394
- ul.charts {
395
- list-style-type: none;
396
- margin: 0;
397
- padding: 0;
398
- font: 8pt sans-serif;
399
- line-height: 1.1em;
400
- border-bottom: 1px solid #dedede;
401
- border-right: 1px solid #fff;
402
- }
403
- li.charts {
404
- height: 25px !important;
405
- list-style-type: none;
406
- /* font-size: 11px; */
407
- line-height: 22px;
408
- border-top: 1px #ddd solid;
409
- margin: 0;
410
- padding: 0 2px 0 2px;
411
- background: url("images/list-bg3.png");
412
- }
413
- li.chartsT {
414
- height: 25px !important;
415
- margin: 0;
416
- padding: 2px 2px 0 2px;
417
- list-style-type: none;
418
- color: #2683ae;
419
- /* font-size: 11px; */
420
- border-bottom: 2px solid #bfd0dd;
421
- vertical-align: bottom;
422
- background: #cee1ef;
423
- }
424
- ul.rownums { background-color: #e6e9ef !important; }
425
- .sum-rec ul { border-top: 1px solid #999; }
426
- .detail-data {
427
- margin: 0 auto !important;
428
- clear:both;
429
- border-left: 1px solid #eeeeef;
430
- border-right: 1px solid #eeeeef;
431
- border-top: 0 none;
432
- border-bottom: 1px solid #bcbcbf;
433
- color: #445;
434
- font-size: 11px;
435
- }
436
- .detail-data a, .detail-data a:link { color: #349 !important; }
437
- .detail-data a:hover { color: #c64 !important; }
438
- .detail-data ul {
439
- list-style-type: none;
440
- /* width: 100%; */
441
- margin: 0;
442
- padding: 3px 0 4px 0;
443
- font-size: 11px;
444
- border-top: 1px solid #ddd;
445
- border-bottom: 1px solid #bbb;
446
- }
447
- .detail-data ul li { height: 25px; line-height: 22px; }
448
- ul.searcheng {
449
- background-color: #abdbff;
450
- border-color: #9cd;
451
- }
452
- .searchimage {
453
- background-color: #abbbff !important;
454
- border-color: #9b9bff !important;
455
- }
456
- li.searcheng {
457
- list-style-type: none;
458
- width: 100%;
459
- padding: 0 4px 0 4px;
460
- display: inline;
461
- border-right: 1px dotted #8e8e8e;
462
- }
463
- ul.useragent {
464
- padding: 0;
465
- background-color: #67a;
466
- border-bottom: 1px #ccc solid;
467
- }
468
- li.useragent {
469
- list-style-type: none;
470
- color: #f5f5f5;
471
- width: 100%;
472
- padding: 4px 6px 0 0;
473
- line-height: 1.5em !important;
474
- text-align: center;
475
- }
476
- ul.spam {
477
- background-color: #f23;
478
- border-color: #e21e21;
479
- }
480
- li.spam {
481
- list-style-type: none;
482
- display: inline;
483
- width: 100%;
484
- padding: 0 6px 0 0;
485
- color: #eff;
486
- }
487
- ul.spider {
488
- background-color: #cc9980;
489
- border-color: #b87;
490
- }
491
- ul.spider li {
492
- list-style-type: none;
493
- display: inline;
494
- width: 100%;
495
- }
496
- li.spider { padding: 0 6px 0 0; color: #f5f5f5; }
497
- li.spider a, li.spider a:link { color: #f5f5f5 !important; }
498
- li.spider a:hover { color: #fda !important; }
499
- ul.feed {
500
- background-color: #edc !important;
501
- border-color: #dcb !important;
502
- }
503
- li.feed {
504
- padding: 0 4px 0 4px;
505
- border-right: 1px dotted #8e8e8e;
506
- }
507
- ul.agent {
508
- border-color: #ddd;
509
- /* -moz-box-shadow: 0 -2px 10px #CDD0EE inset;
510
- -webkit-box-shadow: 0 -2px 10px #CDD0EE inset;
511
- box-shadow: 0 -2px 10px #CDD0EE inset; */
512
- }
513
- li.agent {
514
- list-style-type: none;
515
- display: inline; width: 100%;
516
- padding: 0 4px 0 4px;
517
- border-right: 1px dotted #8e8e8e;
518
- }
519
- ul.users {
520
- background-color: #faeaaa;
521
- border-color: #db7;
522
- }
523
- ul.userslogged {
524
- background-color: #cfff99;
525
- border-color: #bc6;
526
- }
527
- .adminlogged {
528
- background-color: #cda !important;
529
- border-color: #bc9 !important;
530
- }
531
- li.users {
532
- list-style-type: none;
533
- display: inline;
534
- width: 100%;
535
- padding: 0 4px 0 4px;
536
- border-right: 1px dotted #8e8e8e;
537
- }
538
- ul.url {
539
- list-style-type: none;
540
- /* width: 100%; */
541
- margin: 0;
542
- padding: 0;
543
- border: 0 none;
544
- clear: left;
545
- }
546
- li.url, li.urlodd {
547
- list-style-type: none;
548
- width: 100%;
549
- margin: 0;
550
- padding: 0;
551
- height: 25px;
552
- line-height: 22px;
553
- background-image: url("images/list-bg2.png");
554
- border-top: 1px solid #c0cfcf;
555
- }
556
- ul.url li.url {
557
- background-image: url("images/list-bg3.png") !important;
558
- }
559
- .url a, .url a:link { border-bottom: 1px solid !important; }
560
- .indent-li { padding-left: 165px; }
561
- .indent-li-nav { padding-left: 80px; }
562
- .indent-li-agent { padding-left: 12px; padding-right: 12px; }
563
- .box-log {
564
- margin: 0;
565
- padding: 0;
566
- background-color: #e7f1c8;
567
- border: 1px #bbb solid;
568
- }
569
- .box-aut {
570
- margin: 0;
571
- padding: 0;
572
- background-color: #fbf9d3;
573
- border: 1px #ccc solid;
574
- }
575
- .box-spider {
576
- margin: 0;
577
- padding: 0;
578
- background-color: #c98;
579
- border: 1px #999 solid;
580
- }
581
- #placeholder {
582
- min-height: 30px;
583
- width: 100%;
584
- margin: 0 -3px;
585
- padding: 3px;
586
- background: url("images/loading.gif") no-repeat center center;
587
- overflow: auto;
588
- }
589
- #placeholder .chart, #placeholder #map {
590
- margin: 5px auto !important;
591
- padding: 1px 1px 2px !important;
592
- background-color: #dedade;
593
- box-shadow: 0 0 4px rgba(24, 24, 30, 0.9);
594
- -moz-box-shadow: 0 0 4px rgba(24, 24, 30, 0.9);
595
- -webkit-box-shadow: 0 0 4px rgba(24, 24, 30, 0.9);
596
- border: 1px solid #ededef;
597
- -moz-border-radius: 3px;
598
- -webkit-border-radius: 3px;
599
- -khtml-border-radius: 3px;
600
- border-radius: 3px;
601
- }
602
- #spyContainer { clear: both; padding: 5px 5px 0 0; }
603
- #settings {
604
- width: 100%;
605
- margin:0 auto;
606
- padding: 4px 4px 6px 4px;
607
- border-bottom: 1px #ddd solid;
608
- border-top: 2px #ddd solid;
609
- background: url("images/list-bg.png") repeat-x;
610
- }
611
- #usage {
612
- width: 100%;
613
- margin: 0 auto;
614
- padding: 10px 0px 12px 0px;
615
- font-size: 1em;
616
- color: #464646;
617
- text-align: center;
618
- }
619
- #usage a { color: #a30000 !important; }
620
- #usage ul li { list-style-type: none; padding: 4px; }
621
- #usage li { display: inline; margin: 10px; }
622
- #usage span {
623
- color: #00284a;
624
- font-size: 1.5em;
625
- font-weight: bold;
626
- text-shadow: 0 2px 2px rgba(165, 165, 138, 0.3);
627
- }
628
- #usage small { color: #8e8e8e; }
629
- ul.usage-title {
630
- list-style-type: none;
631
- width: 120px;
632
- margin: 0;
633
- padding: 2px;
634
- text-align: center;
635
- color: #fff;
636
- font-size: 7pt;
637
- font-weight: bold;
638
- background: #565656;
639
- }
640
- ul.usage-title li { display: inline; list-style-type: none; }
641
- #hiddenspam { width: 440px; font-size: .9em; }
642
- #usage a .plaintext {
643
- color: #a30000 !important;
644
- font-size: .9em !important;
645
- }
646
- .bubble { font-size:11px; }
647
- .top10 { color: #542; padding-left: 1px; }
648
- .fixed { font-size:11px; font-family: monospace; color: #887; }
649
-
650
- /* wassup-option tabs styles */
651
- #tabcontainer {
652
- /* width: 97%; */
653
- margin: 10px auto 3px auto;
654
- padding: 2px 2px 1px;
655
- font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif !important;
656
- font-size: 14px;
657
- color: #445;
658
- border: 1px solid #efebef;
659
- border-radius: 3px;
660
- -webkit-border-radius: 3px;
661
- -moz-border-radius: 3px;
662
- background-color: #E0E0E0;
663
- list-style:none;
664
- -moz-box-shadow: 0 0 3px rgba(24, 24, 30, 0.9);
665
- -webkit-box-shadow: 0 0 3px rgba(24, 24, 30, 0.9);
666
- box-shadow: 0 0 3px rgba(24, 24, 30, 0.9);
667
- }
668
- #tabcontainer ul.ui-tabs-nav {
669
- background: none !important;
670
- border: 0 none;
671
- border-bottom: 1px solid #aaa;
672
- list-style: none;
673
- clear: right;
674
- font-size: 1em !important;
675
- }
676
- /* jqueryui tab css elements */
677
- ul.ui-tabs-nav li {
678
- min-width: 120px;
679
- height: 28px;
680
- list-style: none;
681
- line-height: 1.1em;
682
- text-indent: -10px;
683
- font-size: 1em important!;
684
- float: left;
685
- }
686
- /* .ui-widget-header .ua-state-default {
687
- border-color: #c9c9c9;
688
- } */
689
- ul.ui-tabs-nav li.ui-state-default {
690
- background-image: none !important;
691
- border-color: #bbb;
692
- }
693
- ul.ui-tabs-nav li.ui-state-active {
694
- background-image: none !important;
695
- background-color: #f4f6f6;
696
- }
697
- .ui-corner-top { /* {cornerRadius}, adopted from jqueryui css */
698
- -moz-border-radius-topleft: 4px;
699
- -moz-border-radius-topright: 4px;
700
- -webkit-border-top-left-radius: 4px;
701
- -webkit-border-top-right-radius: 4px;
702
- border-top-left-radius: 4px;
703
- border-top-right-radius: 4px;
704
- }
705
- .ui-widget-header a {
706
- color: #999 !important;
707
- font-size: 1.1em;
708
- font-weight: bold;
709
- text-shadow: 0 -1px 0 rgba(255,255,221,0.5);
710
- }
711
- .ui-state-active a, .ui-widget-header a:hover {
712
- color: #212121 !important;
713
- }
714
-
715
- #wassup_opt_frag-1, #wassup_opt_frag-2, #wassup_opt_frag-3,
716
- #wassup_opt_frag-4 {
717
- height: 100%;
718
- margin: 0 0 5px 0;
719
- font-size: 90%;
720
- line-height: 1.3em;
721
- background-color: #f4f6f6;
722
- border-left: 1px solid #aaa;
723
- border-right: 1px solid #aaa;
724
- border-bottom: 1px solid #aaa;
725
- }
726
- .optionstab { display: none; }
727
- .tabselected {
728
- display: block !important;
729
- clear: both;
730
- background-color: #f7f7f7;
731
- border-left: 1px solid #cce;
732
- border-right: 1px solid #cce;
733
- border-bottom: 1px solid #cce;
734
- }
735
-
736
- #CountDownPanel { font: 1.2em Fixed, monospace; color: #555; }
737
- #CountDownPanel:hover { color: #c64; }
738
- ul.varlist { list-style:none; margin:0; padding:5px 0 0 17px; }
739
- .varlist li { display:block !important; clear:right !important; }
740
- .separator { padding: 0 7px 0 5px; }
741
- #spy-pause, #spy-play {
742
- display: block;
743
- float:left;
744
- width: 50px;
745
- height: 18px;
746
- margin: 5px 15px 0 0;
747
- padding: 0 0 2px 0;
748
- border: 1px solid #c7c7c7;
749
- background-color: #eae9e9;
750
- text-align:center;
751
- }
752
- #spy-pause a, #spy-play a { text-decoration: none; border-bottom: 0 none; }
753
- .wassup-button {
754
- width: 155px !important;
755
- background: url("images/button.png") top center no-repeat;
756
- border-color: #999 !important;
757
- border-radius: 10px !important;
758
- -moz-border-radius: 10px;
759
- -webkit-border-radius: 10px;
760
- -khtml-border-radius: 10px;
761
- }
762
- .wassup-hot-button {
763
- width: 155px;
764
- background: url("images/button2.png") top center no-repeat;
765
- border-color: #777 !important;
766
- border-radius: 10px !important;
767
- -moz-border-radius: 10px;
768
- -webkit-border-radius: 10px;
769
- -khtml-border-radius: 10px;
770
- }
771
- .wassup-button:hover {
772
- background-image: url("images/button2.png");
773
- background-color: transparent !important;
774
- color: #157 !important;
775
- }
776
- .wassup-hot-button:hover {
777
- background-image: url("images/hot-button.png");
778
- }
779
- .button-primary { border-color: #157 !important; }
1
  /**
2
+ * styles for admin panels, dashboard widget, top stats popup, and widget-control form
3
+ *
4
+ * @package WassUp Real-time Analytics
5
+ * @subpackage css/wassup.css module
6
  */
7
+ #wassup-wrap{min-height:500px;position:relative;padding:1px 7px 3px;margin-top:0 !important;font-family:"Open Sans","Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:14px;background-color:transparent;border:0 none;}
8
+ .wassup-wp-legacy{font-size:13px;}
9
+ #wassup-wrap table{border-collapse:collapse;padding:2px;}
10
+ #wassup-wrap h2{margin-top:5px;color:#00284a;}
11
+ #wassup-wrap strong{color:#00284a;font-weight:bold;}
12
+ #wassup-wrap p{font-size:14px;}
13
+ .wassup-wp-legacy p{font-size:13px;}
14
+ #wassup-wrap li strong{text-shadow:none;color:inherit;}
15
+ #wassup-wrap img{display:inline;vertical-align:middle;margin:0 2px 2px 0;padding:0;background:transparent;border:0 none;box-shadow:none;}
16
+ #wassup-wrap .legend{font-size:13px;padding:0 2px;}
17
+ #wassup-wrap table.legend{width:100%;margin:15px 3px;}
18
+ #wassup-wrap td.legend{margin:0;padding:0 5px;}
19
+ #wassup-wrap a,#wassup-wrap a:link {color:#00b;border-bottom:0 none;text-decoration:none;outline:none;}
20
+ #wassup-wrap td.legend a,#wassup-wrap td.legend a:link {border-bottom:1px solid;}
21
+ #wassup-wrap td.legend a.icon,#wassup-wrap td.legend a.icon:link{border:0 none;}
22
+ #wassup-wrap td.legend a >img{margin-right:3px;}
23
+ #wassup-wrap a:visited {color:#229;}
24
+ #wassup-wrap a:hover {color:#ff6d06;}
25
+ #wassup-wrap a:active, #wassup-wrap a:focus {color:#d11;outline:none;-webkit-box-shadow:none;box-shadow:none;}
26
+ .wassup-icon{}
27
+ #wassup-wrap .favicon{vertical-align:middle;width:16px;height:16px;}
28
+ .wassup-content{min-height:225px;}
29
+ .wassup-nowrap{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
30
+ #wassup-wrap .indent-text,#wassup-wrap li.indent-text{text-indent:10px;}
31
+ #wassup-wrap .scrolltop{position:absolute;bottom:0;right:0;width:50px;padding:5px 10px 5px 5px;text-align:right;}
32
+ #wassup-message{font-size:13px;color:#447;padding:10px;}
33
+ #wassup-message.error{color:#d00;}
34
+ #wassup-message.notice-warning{color:#a21;}
35
+ #wassup-message.updated{color:#040;}
36
+ /* Form fields */
37
+ #wassup-wrap input,#wassup-wrap select,#wassup-wrap textarea,#wassup-wrap text{font-size:13px;background-color:#fdfdfd;border-color:#d6d6d3;}
38
+ /* Wassup buttons */
39
+ #wassup-wrap button,#wassup-wrap .button,#wassup-wrap input[type="button"],#wassup-wrap input[type="reset"],#wassup-wrap input[type="submit"] {display:inline;display:inline-block;height:auto;min-height:25px;margin-left:5px;margin-right:5px;padding:2px 10px;font-size:13px;font-weight:normal;line-height:1.7em;text-align:center;color:#123;text-shadow:0 1px 2px #fff;text-decoration:none;white-space:nowrap;vertical-align:baseline;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;background-image:none;background-color:#ececec;box-sizing:border-box;border:1px solid #bcbcbc;border-bottom-color:#999;-moz-border-radius:5px;-webkit-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);-webkit-box-shadow:0 1px 0 #fff inset,0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 #fff inset,0 1px 0 rgba(0,0,0,0.25);}
40
+ #wassup-wrap .button:hover,#wassup-wrap .button:focus,#wassup-wrap .button:active {background-color:#d9d9d9;border-color:#9f9f9f;border-bottom-color:#888;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;}
41
+ #wassup-wrap .button-primary{color:#fefff9 !important;text-shadow:0 1px 3px rgba(0,20,40,.25) !important;font-weight:bold !important;background-color:#0555aa !important;border-color:#7b97bb #557faa #315070 !important;-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25) !important;-webkit-box-shadow:0 1px 0 #9dcdfd inset,0 1px 0 rgba(0,0,0,0.25) !important;box-shadow:0 1px 0 #056eee inset,0 1px 0 rgba(0,0,0,0.5) !important;}
42
+ #wassup-wrap .button-primary:hover,#wassup-wrap .button-primary:focus,#wassup-wrap .button-primary:active {background-color:#056eee !important;border-color:#315070 #557faa #7b97bb !important;-moz-box-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important;}
43
+ #wassup-wrap .button-danger{font-weight:bold !important;background-color:#faaa33 !important;border-color:#baaa9a #baaa9a #b19c6c !important;-moz-box-shadow:0 1px 0 rgba(0,0,0,0.5) !important;-webkit-box-shadow:0 1px 0 #ffee66 inset,0 1px 0 rgba(0,0,0,0.5) !important;box-shadow:0 1px 0 #ffee66 inset,0 1px 0 rgba(0,0,0,0.5) !important;}
44
+ #wassup-wrap .button-danger:hover,#wassup-wrap .button-danger:focus,#wassup-wrap .button-danger:active {color:#fefff9 !important;text-shadow:0 1px 3px rgba(0,20,40,.25) !important;background-color:#f93939 !important;border-color:#976769 !important;-moz-box-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important;}
45
+ /* ------------------------------------------------------------------
46
+ * Wassup topmenu */
47
+ #wassup-screen-links{position:relative;top:0;margin:0 25px 0 0;padding:0;}
48
+ #wassup-menu{display:block;height:40px;margin:0;padding:0;overflow:hidden;}
49
+ #wassup-menu li{display:block;height:30px;min-width:95px;max-width:135px;margin:0 0 0 6px;float:right;text-decoration:none;text-align:center;}
50
+ .wassup-menu-link{height:33px;color:#667;background-color:#f9f9f9;background-image:none;border:1px solid #c9c9c9;border-bottom-color:#b9b9b9;border-top:0 none;box-shadow:0 1px 2px -1px rgba(100,100,100,0.5);}
51
+ .wassup-wp-legacy .wassup-menu-link{font-family:Arial,"Bitstream Vera Sans",Helvetica,Verdana,sans-serif;font-size:13px;background-color:#f1f1f3;}
52
+ #wassup-menu #donate-link{width:100px;height:33px;margin-right:7px;padding:0;background-color:#fafadc;border-color:#cca;}
53
+ #wassup-menu li.current,.wassup-menu-link:active {height:33px;margin-right:5px;color:#585858;background-color:#fff;border-bottom-color:#779;border-left:3px solid #056eee;-webkit-box-shadow:0 1px 0 #ebebeb inset,0 3px 5px -1px rgba(90,90,90,0.7);box-shadow:0 1px 0 #ebebeb inset,0 3px 5px -1px rgba(90,90,90,0.7);}
54
+ .wassup-menu-link:active, .wassup-menu-link:focus {outline:none;}
55
+ .wassup-menu-link:hover {background-color:#fdfefe;}
56
+ #wassup-menu a,#wassup-menu a:link {display:block;height:33px;line-height:30px;margin:0 auto;padding:0 6px;color:#777;text-decoration:none;z-index:1;}
57
+ #wassup-menu li.current a{color:#443;font-weight:bold;text-shadow:rgba(255,255,245,0.9) 0 -1px 0;}
58
+ #wassup-menu a:visited {color:#777;outline:none;}
59
+ #wassup-menu a:hover, #wassup-menu a:active, #wassup-menu li.current a:hover, .wassup-menu-link:hover a{color:#667;}
60
+ #wassup-menu #donate-link a img {vertical-align:middle;margin:0 auto;}
61
+ #wassup-menu li:first-child {margin-right:20px;}
62
+ .wassup-wp-legacy #screen-meta #contextual-help-link,.wassup-wp-legacy #screen-meta #contextual-help-link.show-settings{display:none;}
63
+ @media (max-width: 640px) {
64
+ #wassup-menu #donate-link{display:none;}
65
+ }
66
+ /* ------------------------------------------------------------------
67
+ * Visitor/Detail View */
68
+ #wassup-wrap .pagination{margin:5px 0 10px !important;padding:3px !important;text-align:center;width:100%;font-size:12px;}
69
+ #wassup-wrap .pagination a{margin:2px;padding:2px 5px 2px 5px;color:#777 !important;background-color:#fcfcfc;border:1px solid #c0cccf !important;}
70
+ #wassup-wrap .pagination a:hover, #wassup-wrap .pagination a:active {color:#dedede !important;background-color:#2e3e5e;border-color:#e7f6f6;}
71
+ #wassup-wrap .pagination .current{margin:2px;padding:2px 5px 2px 5px;font-weight:bold;color:#f1fcfc;background-color:#2e3e5e;border:1px solid #e7f6f6;-webkit-box-shadow:0 0 2px rgba(50,80,80,0.3);box-shadow:0 0 2px rgba(50,80,80,0.3);}
72
+ #wassup-wrap .pagination .disabled{padding:2px 5px;margin:2px;color:#b7b7b7;border:1px solid #c7d7d7;}
73
+ #wassup-wrap .pagination .legend{padding:0 !important;}
74
+ div.main-tabs{margin:10px auto 3px;padding:3px;color:#445;background-color:#e1dfe3;border:1px solid #ededef;-moz-box-shadow:0 0 3px rgba(24, 24, 30, 0.7);-webkit-box-shadow:0 0 3px rgba(24, 24, 30, 0.7);box-shadow:0 0 3px rgba(24, 24, 30, 0.7);}
75
+ #wassup-wrap .main-tabs{margin:10px auto 3px;padding:3px;font-size:13px;color:#445;background-color:#e9e9ea;border:1px solid #9f9f9f;border-top-color:#b9b9b9;-webkit-box-shadow:0 2px 3px 0 rgba(69,69,60,0.7);box-shadow:0 2px 3px 0 rgba(69,69,60,0.7);}
76
+ .admin-color-classic #wassup-wrap .main-tabs{background-color:#dce6ec;-webkit-box-shadow:0 0 3px rgba(0,50,30,0.7);box-shadow:0 0 3px rgba(0,50,30,0.7);}
77
+ #wassup-wrap .main-tabs table{width:100%;margin:0 3px 0 2px;padding:0;}
78
+ #wassup-wrap .main-tabs table.toggle{margin:5px 0;padding:0;}
79
+ #wassup-wrap .main-tabs td{padding:2px 5px 2px 2px;}
80
+ #wassup-wrap .search-ip{padding:10px 5px 0;}
81
+ #wassup-wrap #hiddenspam .indent-opt{padding-left:30px;}
82
+ #wassup-wrap .boxed{display:inline;display:inline-block;min-width:100px;margin:0 3px;padding:2px 5px;text-align:center;background-color:#ededee;border:1px solid #d6d6df !important;}
83
+ #wassup-wrap .borders a{text-decoration:none !important;border-bottom:0 none;}
84
+ #wassup-wrap .sum-rec{margin:0;padding:0;background-color:#fffdfe;border:1px solid #bbb;}
85
+ #wassup-wrap .sum-nav{clear:left;min-height:50px;padding:10px 0 0;border-top:1px solid #fffcff;border-left:1px solid #efefe0;border-right:1px solid #efefe0;border-bottom:0 none;background:url("images/list-bg3.png") repeat-x;}
86
+ #wassup-wrap .sum-mark{background-color:#f7f707;}
87
+ #wassup-wrap .sum-nav-mark{background-image:none;background-color:#f7f707;}
88
+ #wassup-wrap .delbut{position:absolute;top:-15px;right:0;width:130px;}
89
+ #wassup-wrap.wassup-wp-legacy .delbut{top:-5px;}
90
+ #wassup-wrap .delbut a{text-decoration:none;}
91
+ #wassup-wrap .delbut img{float:right;margin-right:17px;}
92
+ #wassup-wrap .sum-footer{margin:0 !important;padding:0;height:7px;clear:both;background-color:#2e3e5e;border-top:1px solid #79a;}
93
+ #wassup-wrap .sum-det,#wassup-wrap .sum-det-spy{margin:0 0 0 180px;padding:0;line-height:1.3em;display:block;clear:right;position:relative;}
94
+ #wassup-wrap .det1,#wassup-wrap .det2{padding-left:5px;line-height:1.5em;display:block;}
95
+ #wassup-wrap.wassup .det1{margin-right:90px;}
96
+ #wassup-wrap .sum-det .det1{padding-left:10px;text-indent:-5px;font-size:14px;}
97
+ #wassup-wrap .det3{padding-left:20px;}
98
+ #wassup-wrap .det1 span{color:#00284a;}
99
+ #wassup-wrap .det1 a{font-weight:bold;border-bottom:1px solid !important;}
100
+ #wassup-wrap .det2 a,#wassup-wrap .det2 a:link, #wassup-wrap .sum-det span.det2 a{color:#02a !important;}
101
+ #wassup-wrap .det2 a:hover, #wassup-wrap .sum-det span.det2 a:hover {color:#d54d22 !important;}
102
+ #wassup-wrap .det2 strong{color:#001616;font-weight:normal;text-shadow:none;}
103
+ #wassup-wrap .sum-box{float:left;display:block;width:180px;min-height:50px;margin:0 0 3px 0;padding:0;color:#00284a;text-align:center;}
104
+ #wassup-wrap .sum-box span{display:block;margin:0 auto;padding:0;}
105
+ #wassup-wrap .sum-box-ip{width:140px;height:25px;padding:5px 0 0 0 !important;font-family:tahoma,verdana,arial,sans-serif;font-weight:bold;text-shadow:rgba(255,253,240,0.7) 0 -1px 0;background:#dde url("images/sum-box.png") bottom left;border:1px solid #b6c6cf;border-radius:3px;}
106
+ #wassup-wrap .sum-det-spy span{margin:0;padding:0;margin:0 3px 0 2px;padding:0;}
107
+ #wassup-wrap .sum-box-log{background-color:#dfa;border-color:#bda;}
108
+ #wassup-wrap .sum-box-spider2{background-color:#dcbc9c;border-color:#d6c6bb !important;}
109
+ #wassup-wrap .sum-box-spam{background-color:#fbbf77;border-color:#cba !important;}
110
+ #wassup-wrap .sum-box-spider{background-color:#dcbc9c;border-color:#cba !important;}
111
+ #wassup-wrap .sum-box-aut{background-color:#fafaaa;border-color:#eede6e;}
112
+ #wassup-wrap .sum-box-ip a,#wassup-wrap .sum-box-ip a:link {color:#336 !important;border-bottom:1px solid #279 !important;}
113
+ #wassup-wrap .sum-box-spider a,#wassup-wrap .sum-box-spider a:link {border-color:#977 !important;}
114
+ #wassup-wrap .sum-box-ip a:hover{color:#c64 !important;border-color:#c64 !important;}
115
+ #wassup-wrap .sum-date{width:175px;margin:5px auto 0 !important;line-height:1.1em;}
116
+ #wassup-wrap .sum-rec ul{border-top:1px solid #999;}
117
+ #wassup-wrap .detail-data{margin:0 auto !important;clear:both;border:0 none;color:#445;}
118
+ #wassup-wrap .detail-data a,#wassup-wrap .detail-data a:link {color:#02a;}
119
+ #wassup-wrap .detail-data a:hover {color:#c64;}
120
+ #wassup-wrap .detail-data ul{list-style-type:none;width:100%;min-height:28px;margin:0;padding:0;clear:left;border-top:1px solid #ccc;overflow:hidden;}
121
+ #wassup-wrap .detail-data li{list-style-type:none;min-height:27px;margin:0;padding:0;line-height:1.4em;display:block;display:inline-block;float:left;}
122
+ #wassup-wrap .detail-data li span{display:inline;display:inline-block;padding:3px 0 0;}
123
+ #wassup-wrap ul.searcheng{background-color:#abdbff;border-color:#9cd;}
124
+ #wassup-wrap .searchmedia{background-color:#abbbff !important;border-color:#9b9bff !important;}
125
+ #wassup-wrap ul.useragent{background-color:#46a;border-bottom:2px solid #67a;}
126
+ #wassup-wrap .togglenavi li.useragent{width:100%;display:block;float:none;color:#fcfcff;text-align:center;}
127
+ #wassup-wrap .detail-data li.spider,#wassup-wrap .detail-data li.spam{width:100%;padding:0 6px 0 0;display:block;float:none;}
128
+ #wassup-wrap li.useragent strong{color:#fff;}
129
+ #wassup-wrap ul.spam{background-color:#f23;border-color:#e21e21;}
130
+ #wassup-wrap li.spam{color:#ffffef;font-weight:bold;}
131
+ #wassup-wrap ul.spider{background-color:#cc9980;border-color:#b87;}
132
+ #wassup-wrap li.spider{color:#f5f5f5;}
133
+ #wassup-wrap li.spider a,#wassup-wrap li.spider a:link {color:#f5f5f5 !important;}
134
+ #wassup-wrap li.spider a:hover {color:#fda !important;}
135
+ #wassup-wrap ul.feed{background-color:#edc !important;border-color:#dcb !important;}
136
+ #wassup-wrap li.feed,#wassup-wrap li.searcheng{padding:2px 10px 0 5px;border-right:1px dotted #8e8e8e;}
137
+ #wassup-wrap ul.agent{border-color:#bbb;}
138
+ #wassup-wrap .detail-data li.agent{padding:0 10px 0 5px;border-right:1px dotted #8e8e8e;}
139
+ #wassup-wrap li.agent strong{color:#00284a;}
140
+ #wassup-wrap ul.users{background-color:#faeaaa;border-color:#db7;}
141
+ #wassup-wrap ul.userslogged{background-color:#cfff99;border-color:#bc6;}
142
+ #wassup-wrap .adminlogged{background-color:#cda !important;border-color:#bc9 !important;}
143
+ #wassup-wrap li.users{list-style-type:none;border-right:1px dotted #8e8e8e;}
144
+ #wassup-wrap .userslogged img.avatar{border:1px solid #d6d6d6;}
145
+ #wassup-wrap ul.url{list-style-type:none;margin:0;min-height:0;padding:0;border:0 none;}
146
+ #wassup-wrap ul.url li{width:100%;display:block;background:#fffdfe url("images/list-bg3.png") repeat-x;border-top:1px solid #c0cfcf;}
147
+ #wassup-wrap .url a,#wassup-wrap .url a:link {border-bottom:1px solid !important;}
148
+ #wassup-wrap .indent-li{padding-left:12px;}
149
+ #wassup-wrap .detail-data li.url span{color:#00284a;}
150
+ #wassup-wrap .detail-data li .request-time{width:180px;margin:0;padding-left:0;padding-right:0;text-align:right;}
151
+ #wassup-wrap .detail-data li .request-uri{padding-left:5px !important;text-align:left;}
152
+ #wassup-wrap .detail-data .time{padding-right:2px;text-align:right;}
153
+ #wassup-wrap .detail-data li .indent-li-agent{padding:3px 12px 0;display:block;float:left;}
154
+ @media (max-width: 768px) {
155
+ #wassup-wrap .detail-data li .request-time{width:115px;}
156
+ }
157
+ #wassup-wrap .box-log{margin:0;padding:0;background-color:#e7f1c8;border:1px #bbb solid;}
158
+ #wassup-wrap .box-aut{margin:0;padding:0;background-color:#fbf9d3;border:1px #ccc solid;}
159
+ #wassup-wrap .box-spider{margin:0;padding:0;background-color:#c98;border:1px #999 solid;}
160
+ #wassup-wrap #settings{width:100%;margin:0 auto;padding:4px 4px 6px;border-bottom:1px #ddd solid;border-top:2px #ddd solid;background:url("images/list-bg.png") repeat-x;}
161
+ #wassup-wrap #usage{width:100%;margin:0 auto;padding:10px 0 0;font-size:1.1em;color:#00284a;text-align:center;}
162
+ #wassup-wrap #usage strong{text-shadow:0 2px 1px rgba(155,199,199,0.5);}
163
+ #wassup-wrap #usage ul li{list-style-type:none;padding:4px;}
164
+ #wassup-wrap #usage li{display:inline;margin:10px;line-height:1.6em;}
165
+ #wassup-wrap #usage span{font-size:1.5em;font-weight:bold;text-shadow:0 2px 1px rgba(155,199,199,0.7);}
166
+ #wassup-wrap #usage small{color:#8e8e8e;}
167
+ #wassup-wrap ul.usage-title{list-style-type:none;width:120px;margin:0;padding:2px;text-align:center;color:#fff;font-size:7pt;font-weight:bold;background:#565656;}
168
+ #wassup-wrap ul.usage-title li{display:inline;list-style-type:none;}
169
+ #wassup-wrap #usage .spamtoggle,#wassup-wrap #usage .spamtoggle a{color:#be0000;}
170
+ #wassup-wrap #usage .spamtoggle .plaintext,#wassup-wrap #usage .spamtogle a .plaintext{font-size:.8em !important;text-shadow:none;}
171
+ #wassup-wrap #hiddenspam{width:440px;font-size:.9em;}
172
+ #wassup-wrap #CountDownPanel{font:1.2em Fixed,monospace;color:#555;}
173
+ #wassup-wrap #CountDownPanel:hover {color:#c64;}
174
+ #wassup-wrap .separator{padding:0 7px 0 5px;}
175
+ #wassup-wrap .raw{color:#542;padding-left:5px;}
176
+ #wassup-wrap ul.rownums{background-color:#e6e9ef !important;}
177
+ #wassup-wrap ul.varlist{list-style:none;margin:0;padding:5px 0 0 17px;}
178
+ #wassup-wrap .varlist li{display:block !important;clear:right !important;}
179
+ #wassup-wrap .no-top-border{border-top:0 none;}
180
+ /* ------------------------------------------------------------------
181
+ * Chart and Map */
182
+ #wassup-wrap .placeholder{width:100%;margin:0 -3px;padding:0 3px;text-align:center;overflow-x:auto;overflow-y:hidden;}
183
+ #wassup-wrap .placeholder img{margin:5px auto;padding:1px;box-shadow:none;}
184
+ #wassup-wrap #chart_placeholder img,#wassup-wrap #spia_map{padding-bottom:2px;background-color:#e9e9ea;border:1px solid #bbb;border-bottom-color:#777;border-top-color:#ccc;-webkit-box-shadow:0 1px 3px 0 rgba(110,110,100,0.7);box-shadow:0 1px 3px 0 rgba(110,110,100,0.7);}
185
+ #wassup-wrap #spia_map{margin:0 auto;}
186
+ #wassup-wrap #spia_map img,#wassup-wrap #spia_map *{padding:0;border:0 none !important;box-shadow:none !important;}
187
+ /* ------------------------------------------------------------------
188
+ * Rawdata View */
189
+ .wassup-raw {padding:7px 0 0 3px;}
190
+ .wassup-raw h2{font:25px/1.3em Georgia,"Times New Roman",Times,serif;margin:0.2em 0;}
191
+ .wassup-raw ul{padding:5px 0 0 20px;list-style-type:square;}
192
+ .wassup-raw ul li{padding-left:5px;line-height:1.4em;}
193
+ .wassup-raw span{padding-left:5px;}
194
+ .wassup-raw .indent-raw{margin:0;padding:5px 5px 0 10px;}
195
+ .wassup-raw .field{display:inline-block;width:100px;text-indent:-10px;}
196
+ .wassup-raw .raw{color:#542;}
197
+ /* ------------------------------------------------------------------
198
+ * Spy View */
199
+ #spyContainer{clear:both;padding:2px 2px 0 0;font-size:13px;}
200
+ #spyContainer .sum-rec{min-height:25px;margin:8px 0 0;padding:2px 0 0;clear:left;border-color:#b9b9bc;border-bottom:3px solid #778;}
201
+ #spyContainer .sum-spy{-webkit-box-shadow:0 2px 5px #779;box-shadow:0 2px 5px #779;}
202
+ #spyContainer .sum-nav,#onlineContainer .sum-nav{width:100%;min-height:45px;margin:0;padding:7px 0 3px 0;border:0 none;border-top:1px solid #fdfdff;}
203
+ #wassup-wrap .sum-nav-spy .sum-box,#onlineContainer .sum-nav .sum-box{margin:5px 0 0;min-height:35px;}
204
+ #wassup-wrap .bubble{margin:0 10px 0 0;padding:0;font-size:12px;line-height:1.5em;text-align:left;white-space:nowrap;overflow:visible;}
205
+ #wassup-wrap div .bubble{overflow-y:auto;}
206
+ #spy-pause,#spy-play{display:block;float:left;width:50px;height:18px;margin:5px 15px 0 0;padding:3px 5px;text-align:center;text-transform:uppercase;border:1px solid #c7c7c7;border-radius:5px;background-color:#eae9e9;}
207
+ #wassup-wrap input.navi{font-size:11px;}
208
+ #wassup-wrap .spy-opt-right{text-align:right;}
209
+ #wassup-wrap.wassup-spy .legend a{border-bottom:1px solid;}
210
+ #wassup-wrap.wassup-spy .legend a.icon{border:0 none;}
211
+ #wassup-wrap.wassup-spy .legend #spy-pause a,#wassup-wrap.wassup-spy .legend #spy-play a{text-decoration:none;border-bottom:0 none;}
212
+ /* ------------------------------------------------------------------
213
+ * Visitors Online View */
214
+ #onlineContainer.main-tabs{margin-top:5px;border:0 none;background-color:transparent;box-shadow:none;}
215
+ #wassup-wrap #onlineContainer .sum-rec{min-height:40px;margin:1px 0 0;padding:0;clear:left;border-color:#b9b9bc;border-bottom:5px solid #2e3e5e;}
216
+ #onlineContainer .legend a.toggle-all{line-height:2em;border-bottom:1px solid;}
217
+ /* ------------------------------------------------------------------
218
+ * Options View & jQueryUI */
219
+ #wassup-wrap #tabcontainer{padding:0 !important;font-size:14px;color:#445;list-style:none;border:1px solid #999;border-radius:3px;background-color:#d6d7d6;background-image:none !important;-webkit-box-shadow:0 2px 3px 0 rgba(69,69,60,0.7);box-shadow:0 2px 3px 0 rgba(69,69,60,0.7);}
220
+ .wassup-wp-legacy #tabcontainer{font-size:13px;}
221
+ #wassup_opt_frag-1,#wassup_opt_frag-2,#wassup_opt_frag-3,#wassup_opt_frag-4,#wassup_opt_frag-5,#wassup_opt_frag-6,#wassup_opt_frag-7{height:100%;min-height:300px;line-height:1.25em;border-top:1px solid #ccc;background-color:#f9f9f9;clear:both;}
222
+ #wassup_wrap #tabcontainer .optionspanel{display:none;position:relative;}
223
+ #wassup-wrap #tabcontainer .tabselected{display:block;}
224
+ .wassup-options h3{font-size:1.2em;}
225
+ .wassup-options form h3{margin-top:15px;margin-bottom:0;padding-bottom:5px;}
226
+ .wassup-options form p{margin-top:0;padding:0 7px 0 16px;}
227
+ #wassup-wrap .indent-opt{padding-left:15px;}
228
+ #wassup-wrap h3.indent-opt{color:#222;font-size:1.1em;}
229
+ #wassup-wrap p.indent-opt{margin-bottom:0;padding-bottom:0;}
230
+ #wassup-wrap p.noindent-opt{margin-left:3px;padding-left:0;text-indent:0;}
231
+ #wassup-wrap .opt-note{display:block;display:inline-block;padding-left:22px;color:#555;}
232
+ #wassup-wrap .checkbox-indent{padding-left:40px;}
233
+ #wassup-wrap #tabcontainer strong{color:#222;text-shadow:none;font-size:1em;}
234
+ #wassup-wrap #tabcontainer .topstats-opt{margin-top:0;padding-left:25px;padding-top:0;display:block;clear:left;}
235
+ #wassup-wrap #tabcontainer .topstats-col{width:225px;display:block;vertical-align:top;float:left;}
236
+ #wassup-wrap #tabcontainer .button{min-width:70px;}
237
+ #wassup-wrap #tabcontainer .button-left{margin-left:0;border:1px solid #bbb;}
238
+ #wassup-wrap #tabcontainer .button-primary,#wassup-wrap #tabcontainer .wassup-hot-button{min-width:140px;}
239
+ #wassup-wrap #tabcontainer p.submit{width:100%;padding:25px 0 5px 15px;clear:both;text-align:left;}
240
+ #wassup-wrap #tabcontainer em{color:#641;}
241
+ #wassup-wrap #delete-dialog{display:none;}
242
+ #wassup-wrap .alertstyle{color:red;background-color:#ffd;}
243
+ #wassup-wrap .opt-prev-next{position:absolute;bottom:0;right:0;width:220px;padding:5px 10px 10px 5px;text-align:right;}
244
+ #wassup-wrap .opt-prev-next a{color:#999;text-decoration:none;}
245
+ #wassup-wrap .opt-info{width:100%;clear:right;}
246
+ #wassup-wrap #delete-dialog{display:none;}
247
+ #wassup-wrap .sys-settings{margin-bottom:0;padding-top:10px;}
248
+ #wassup-wrap .donate-block{margin:10px auto;padding:0;text-align:center;display:block;display:table;}
249
+ #wassup-wrap .donate-box{width:370px;float:left;margin:15px 0;padding-right:15px;}
250
+ #wassup-wrap .bc-addr{min-width:300px;max-width:300px;width:300px;}
251
+ #wassup-overlay{position:fixed;width:100%;height:100%;z-index:999;top:0;left:0;background-color:#000;display:none;}
252
+ #wassup-wrap .faq-question,#wassup-wrap .faq-answer{display:inline-block;width:90%;margin-left:8px;text-indent:-3px;vertical-align:top;}
253
+ #wassup-wrap #tabcontainer .faq-question{font-style:italic;font-weight:600;}
254
+ /* changes some jqueryui-only style elements */
255
+ #wassup-wrap .ui-widget{font-family:"Open Sans","Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}
256
+ #wassup-wrap #tabcontainer .ui-tabs-nav{height:33px;border:0 none;border-bottom-left-radius:0 !important;border-bottom-right-radius:0 !important;list-style:none;}
257
+ #tabcontainer .ui-tabs-nav li{min-width:75px;height:33px;max-height:33px;margin-bottom:0;list-style:none;line-height:1em;font-size:1.2em;text-align:center;text-indent:-3px;float:left;border-color:#9f9f9f;border-bottom:0 none;background-color:#ece9ed;background-image:none !important;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;-webkit-box-shadow:0 3px 0 #efefef inset,0 -1px 3px rgba(0,0,0,0.15);box-shadow:0 3px 0 #efefef inset,0 -1px 3px rgba(0,0,0,0.15);}
258
+ #wassup-wrap #tabcontainer .ui-tabs-nav li a{padding:0.5em 0.7em;color:#999;}
259
+ #wassup-wrap #tabcontainer .ui-widget-header{background-image:none;background-color:#ddd;border-bottom:0 none;}
260
+ #wassup-wrap .ui-tabs-panel{background-color:#f9f9f9 !important;} /* removes wide color-stripe */
261
+ #wassup-wrap #tabcontainer li.ui-tabs-active,#wassup-wrap .ui-tabs-nav li.ui-tabs-active{height:34px;max-height:35px;margin-bottom:-2px;background-image:none;background-color:#f9f9f9 !important;-webkit-box-shadow:0 2px 0 #fff inset,0 -2px 2px rgba(0,0,0,0.25);box-shadow:0 2px 0 #fff inset,0 -2px 2px rgba(0,0,0,0.25);}
262
+ #wassup-wrap #tabcontainer li.ui-tabs-active a:focus,#wassup-wrap #tabcontainer li.ui-tabs-active a:active {outline:none;}
263
+ #wassup-wrap #tabcontainer .ui-state-active a,#wassup-wrap li.ui-tabs-active a{color:#212121 !important;}
264
+ #wassup-wrap #tabcontainer .ui-tabs-nav a:hover {color:#212121;}
265
+ @media (max-width: 640px) {
266
+ #wassup-wrap p.description,#wassup-wrap p.opt-note{display:none;}
267
+ #wassup-wrap #info-sysinfo{display:none;}
268
+ }
269
+ /* ------------------------------------------------------------------
270
+ * Dashboard Widget */
271
+ #wassup-dashwidget1{border-color:#ddd;}
272
+ .wassup-dashbox{position:relative;margin:-11px;padding:0;background-color:#fafafa;}
273
+ .admin-color-classic .wassup-dashbox{background-color:#f7fafa;}
274
+ .wassup-dashbox cite{position:absolute;right:28px;top:-20px;padding:0 5px;font-size:8pt;text-align:right;}
275
+ .wassup-dashitem{margin:0;padding:0 10px;text-align:left;border-top:1px solid #fcfefe;border-bottom:1px solid #e9ecec;}
276
+ .wassup-dashitem p{margin:5px 0;padding:0 5px 5px 25px;text-indent:-15px;font-weight:normal;line-height:1.4em;overflow:auto;}
277
+ .wassup-dashitem p img{margin:17px 0 15px;padding:3px 10px 2px 5px;-webkit-box-shadow:0 0 5px rgba(250,254,254,0.9);box-shadow:0 0 5px rgba(250,254,254,0.9);border:1px solid #efefef;background-color:#f3f5f5;}
278
+ .wassup-dashitem h5{margin:5px 0 0;padding:0;font-family:Georgia,"Times New Roman",serif;font-size:16px;font-weight:600;line-height:40px;text-shadow:1px 1px 0 #f9fafd;}
279
+ .wassup-dashitem h5 strong{display:block;float:left;display:inline-block;height:30px;min-width:30px;line-height:30px;font-size:26px;margin:0 7px 0 0;padding:0 3px 3px;text-align:center;background-color:#bbccff;border:1px solid #bbc9ee;border-radius:3px;}
280
+ .wassup-dashitem .loggedin{color:#008000;}
281
+ .wassup-dashitem .commentaut{color:#e66f00;}
282
+ .wassup-dashbox .no-bottom-border,#wassup-wrap .no-bottom-border{border-bottom:0 none;}
283
+ .wassup-dashbox .no-top-border{border-top:0 none;padding-top:2px;}
284
+ .wassup-marque{display:block;padding-right:5px;font-size:7pt;text-align:right;}
285
+ /* ------------------------------------------------------------------
286
+ * Top Stats View */
287
+ body.wassup-ajax{margin:0;padding:0;background-color:#fdfcf9;width:100%;}
288
+ #topstats-popup{overflow:scroll;}
289
+ #wassup-wrap.topstats{margin:0;padding:0;}
290
+ #wassup-wrap.topstats a{color:#449 !important;}
291
+ #wassup-wrap.topstats a:hover {color:#d54d22;}
292
+ #wassup-topstats{margin:0 auto;padding:0;color:#322;}
293
+ #wassup-topstats table{margin:0 auto;padding:0;border-collapse:collapse;border-spacing:0;border-bottom:1px solid #ccc;}
294
+ #wassup-topstats caption{padding:3px;font-size:14px;text-align:center;}
295
+ #wassup-topstats caption h4{margin:0;padding:0;color:#059;font-size:16px;}
296
+ #wassup-topstats table.popup caption h4{margin-right:100px;}
297
+ #wassup-topstats tr{border:1px solid #b9c9cf;}
298
+ #wassup-topstats th{color:#196991;line-height:1.5em;}
299
+ #wassup-topstats th span{font-weight:normal;}
300
+ #wassup-topstats td{padding:0;border-spacing:0;border-right:1px solid #b9c9cf;}
301
+ #wassup-topstats td.stat-rownum{min-width:8px;}
302
+ #wassup-topstats ul.charts{list-style-type:none;margin:0;padding:0;font:8pt sans-serif;line-height:1.1em;min-width:20px;max-width:600px;}
303
+ #wassup-topstats .charts li{height:27px;margin:0;padding:0 2px;list-style-type:none;line-height:22px;border-top:1px solid #c3ccdd;background:url("images/list-bg3.png") top left repeat-x;}
304
+ #wassup-topstats .charts li.chartsT{padding:6px 0 1px 5px;line-height:1.2em;color:#059;text-transform:uppercase;vertical-align:bottom;background-color:#cee1ef;background-image:none;border:1px solid #eee;border-bottom:2px solid #acd;border-left:0 none;}
305
+ #wassup-topstats .firstcol{}
306
+ #wassup-topstats .lastcol{}
307
+ #wassup-wrap.topstats .top10{color:#542;padding-left:1px;}
308
+ #wassup-wrap.topstats .fixed{font-size:12px;font-family:monospace;color:#667;}
309
+ #wassup-wrap.topstats .button{width:55px;height:25px;padding:2px 0;line-height:1.4em;text-align:center;text-transform:uppercase;display:block;}
310
+ #wassup-wrap .stats-print-btn{width:60px;margin:0;padding:5px 15px 0 0;float:right;}
311
+ /* ------------------------------------------------------------------
312
+ * Wassup Widget control styles */
313
+ .wassup-widget-ctrl{margin:1px -13px 5px;padding:0 !important;background-color:#ecefee;color:#201;border:0 none;}
314
+ .wp-customizer .wassup-widget-ctrl{margin:1px -9px 5px;}
315
+ .wassup-widget-ctrl .widget-items{list-style:none;margin:0;padding:0 0 4px 0;text-indent:0;line-height:1.1em;border-bottom:1px solid #e3e6e9;}
316
+ .wassup-widget-ctrl .widget-li{text-align:left;margin:0;padding:5px 0 5px 3px;border-top:1px solid #f9f9fc;border-bottom:1px solid #dddee0;margin-bottom:0 !important;}
317
+ .wassup-widget-ctrl .widget-li ul{margin:0;padding:0 0 0 2px;}
318
+ .wassup-widget-ctrl .widget-li li{margin-bottom:3px;padding:0 0 0 2px;text-indent:0;list-style-type:none;}
319
+ .wassup-widget-ctrl h4{margin:3px 0 2px 2px;padding:0;font-size:1.1em;color:#335963;}
320
+ .wassup-widget-ctrl strong{padding-top:2px;font-size:1em;color:#335963;}
321
+ .wassup-widget-ctrl input{margin:2px;padding:3px 5px 1px;vertical-align:middle;}
322
+ .wassup-widget-ctrl input.title{font-size:1.1em;}
323
+ .wassup-widget-ctrl input.wide-text{width:215px;}
324
+ .wassup-widget-ctrl input.medium-text{width:70px;padding:2px 2px !important;}
325
+ .wassup-widget-ctrl input.stats-number{width:45px !important;padding:1px 2px 0 0 !important;text-align:right;}
326
+ .wassup-widget-ctrl input.stats-limit{width:45px;height:22px;margin-right:3px;padding:2px 2px 0;text-align:right;}
327
+ .wassup-widget-ctrl table{width:100%;margin:0 0 5px 0;padding:0;border:0 none;}
328
+ .wassup-widget-ctrl th{padding-top:2px;text-align:left;font-size:1em;color:#335963;line-height:1.1em;}
329
+ .wassup-widget-ctrl td{padding:0 5px 0 0;line-height:1.2em;}
330
+ .wassup-widget-ctrl td.checkbox{width:30px;text-align:right;vertical-align:top;}
331
+ .wassup-widget-ctrl .note{margin:0 0 0 5px;padding:0 2px 5px;line-height:1.1em;color:#667;text-indent:-5px;text-align:left;}
332
+ .wassup-widget-ctrl .no-bottom-border{border-bottom:0 none;}
333
+ .wassup-widget-ctrl .no-top-border{border-top:0 none;}
334
+ .wassup-number{font-family:"Lucida Console",Monaco,monospace;color:#667;}
335
+ .wassup-info{padding-left:2px;display:inline;display:inline-block;vertical-align:top;}
336
+ .wassup-help-dashicon:before {content:"\f223";display:inline;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 16px/1 'dashicons';vertical-align:top;}
337
+ /* ------------------------------------------------------------------
338
+ * Print style */
339
+ @media print{
340
+ body{background:none !important;color:black;font-size:9pt;}
341
+ #adminmenuwrap,#adminmenuback,#wpadminbar,#wpwrap #footer{display:none;}
342
+ #wpcontent,#wpbody-content{margin:0;padding:0;}
343
+ #wassup-menu,#wassup-wrap .delbut,#wassup-wrap #pag{display:none;}
344
+ #wassup-wrap table.legend,#wassup-wrap table.toggle{display:none;}
345
+ a{text-decoration:none;}
346
+ #wassup-wrap .main-tabs{border:0 none;box-shadow:none;}
347
+ #wassup-wrap .scrolltop{display:none;}
348
+ li.chartsT{background:none !important;border-color:black;color:black;}
349
+ li.charts{background:none !important;border-color:#555;}
350
+ .stats-print-btn{display:none;}
351
+ .button,.wassup-button {background-image:none;}
352
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
img/btn_donateCC_LG.gif ADDED
Binary file
img/donate-button-sm.png ADDED
Binary file
img/donate_64.png ADDED
Binary file
img/map_add.png ADDED
Binary file
img/popup.png ADDED
Binary file
js/jquery-migrate.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
2
+ jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
js/jquery-ui/css/images/animated-overlay.gif ADDED
Binary file
js/jquery-ui/css/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
js/jquery-ui/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
js/jquery-ui/css/images/ui-icons_222222_256x240.png ADDED
Binary file
js/jquery-ui/css/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
js/jquery-ui/css/images/ui-icons_454545_256x240.png ADDED
Binary file
js/jquery-ui/css/images/ui-icons_888888_256x240.png ADDED
Binary file
js/jquery-ui/css/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
js/jquery-ui/css/jquery-ui.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery UI - v1.10.3 - 2013-05-03
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
4
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
js/jquery-ui/css/jquery.ui.core.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.3 - 2013-05-03
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
4
+
5
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}
js/jquery-ui/css/jquery.ui.tabs.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI Tabs 1.10.3
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright 2013 jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ *
9
+ * http://docs.jquery.com/UI/Tabs#theming
10
+ */
11
+ @import url("jquery.ui.core.css");
12
+
13
+ .ui-tabs {
14
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
15
+ padding: .2em;
16
+ }
17
+ .ui-tabs .ui-tabs-nav {
18
+ margin: 0;
19
+ padding: .2em .2em 0;
20
+ }
21
+ .ui-tabs .ui-tabs-nav li {
22
+ list-style: none;
23
+ float: left;
24
+ position: relative;
25
+ top: 0;
26
+ margin: 1px .2em 0 0;
27
+ border-bottom-width: 0;
28
+ padding: 0;
29
+ white-space: nowrap;
30
+ }
31
+ .ui-tabs .ui-tabs-nav li a {
32
+ float: left;
33
+ padding: .5em 1em;
34
+ text-decoration: none;
35
+ }
36
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
37
+ margin-bottom: -1px;
38
+ padding-bottom: 1px;
39
+ }
40
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active a,
41
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled a,
42
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
43
+ cursor: text;
44
+ }
45
+ .ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
46
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
47
+ cursor: pointer;
48
+ }
49
+ .ui-tabs .ui-tabs-panel {
50
+ display: block;
51
+ border-width: 0;
52
+ padding: 1em 1.4em;
53
+ background: none;
54
+ }
js/jquery-ui/css/jquery.ui.theme.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.3 - 2013-05-03
2
+ * http://jqueryui.com
3
+ * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
4
+
5
+ .ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
js/jquery-ui/js/jquery-ui.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.4 - 2014-04-02
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
4
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
5
+
6
+ (function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,s),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?"&#xa0;":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10);
7
+ return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":"&#xa0;")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);
js/jquery.js CHANGED
@@ -1,154 +1,3 @@
1
- /*!
2
- * jQuery JavaScript Library v1.4.2
3
- * http://jquery.com/
4
- *
5
- * Copyright 2010, John Resig
6
- * Dual licensed under the MIT or GPL Version 2 licenses.
7
- * http://jquery.org/license
8
- *
9
- * Includes Sizzle.js
10
- * http://sizzlejs.com/
11
- * Copyright 2010, The Dojo Foundation
12
- * Released under the MIT, BSD, and GPL Licenses.
13
- *
14
- * Date: Sat Feb 13 22:33:48 2010 -0500
15
- */
16
- (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
17
- e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
18
- j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
19
- "&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
20
- true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
21
- Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
22
- (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
23
- a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
24
- "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
25
- function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
26
- c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
27
- L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
28
- "isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
29
- a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
30
- d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
31
- a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
32
- !c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
33
- true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
34
- var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
35
- parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
36
- false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
37
- s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
38
- applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
39
- else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
40
- a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
41
- w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
42
- cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
43
- i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
44
- " ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
45
- this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
46
- e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
47
- c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
48
- a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
49
- function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
50
- k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
51
- C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
52
- null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
53
- e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
54
- f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
55
- if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
56
- fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
57
- d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
58
- "events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
59
- a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
60
- isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
61
- {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
62
- if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
63
- e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
64
- "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
65
- d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
66
- !a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
67
- toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
68
- u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
69
- function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
70
- if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
71
- e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
72
- t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
73
- g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
74
- for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
75
- 1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
76
- CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
77
- relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
78
- l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
79
- h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
80
- CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
81
- g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
82
- text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
83
- setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
84
- h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
85
- m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
86
- "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
87
- h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
88
- !h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
89
- h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
90
- q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
91
- if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
92
- (function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
93
- function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
94
- gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
95
- c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
96
- {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
97
- "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
98
- d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
99
- a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
100
- 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
101
- a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
102
- c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
103
- wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
104
- prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
105
- this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
106
- return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
107
- ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
108
- this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
109
- u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
110
- 1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
111
- return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
112
- ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
113
- c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
114
- c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
115
- function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
116
- Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
117
- "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
118
- a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
119
- a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
120
- "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
121
- serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
122
- function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
123
- global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
124
- e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
125
- "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
126
- false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
127
- false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
128
- c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
129
- d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
130
- g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
131
- 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
132
- "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
133
- if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
134
- this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
135
- "olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
136
- animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
137
- j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
138
- this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
139
- "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
140
- c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
141
- this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
142
- this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
143
- e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
144
- c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
145
- function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
146
- this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
147
- k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
148
- f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
149
- a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
150
- c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
151
- d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
152
- f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
153
- "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
154
- e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
1
+ /*! jQuery v1.8.3 jquery.com | jquery.org/license */
2
+ (function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
3
+ jQuery.noConflict();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/spia.js CHANGED
@@ -1,68 +1,45 @@
1
- /*
2
- jQuery Plugin spy (leftlogic.com/info/articles/jquery_spy2)
3
- (c) 2006 Remy Sharp (leftlogic.com)
4
- $Id: spy.js,v 1.4 2006/09/30 11:05:04 remy Exp $
 
5
  */
6
  var spyRunning = 1;
7
-
8
  (function($) {
9
-
10
  $.fn.spy = function(settings) {
11
- var spy = this;
12
- spy.epoch = new Date(1970, 0, 1);
13
- spy.last = '';
14
- spy.parsing = 0;
15
- spy.waitTimer = 0;
16
- spy.json = null;
17
-
18
- if (!settings.ajax) {
19
- alert("An AJAX/AJAH URL must be set for the spy to work.");
20
- return;
21
- }
22
-
23
  spy.attachHolder = function() {
24
  // not mad on this, but the only way to parse HTML collections
25
- if (o.method == 'html')
26
- $('body').append('<div style="display: none!important;" id="_spyTmp"></div>');
27
  }
28
-
29
  // returns true for 'no dupe', and false for 'dupe found'
30
  // latest = is latest ajax return value (raw)
31
  // last = is previous ajax return value (raw)
32
  // note that comparing latest and last if they're JSON objects
33
  // always returns false, so you need to implement it manually.
34
  spy.isDupe = function(latest, last) {
35
- if ((last.constructor == Object) && (o.method == 'html'))
36
- return (latest.html() == last.html());
37
- else if (last.constructor == String)
38
- return (latest == last);
39
- else
40
- return 0;
41
- }
42
-
43
- spy.timestamp = function() {
44
- var now = new Date();
45
- return Math.floor((now - spy.epoch) / 1000);
46
  }
47
-
48
  spy.parse = function(e, r) {
49
  spy.parsing = 1; // flag to stop pull via ajax
50
- if (o.method == 'html') {
51
- $('div#_spyTmp').html(r); // add contents to hidden div
52
- } else if (o.method == 'json') {
53
- eval('spy.json = ' + r); // convert text to json
54
- }
55
-
56
  if ((o.method == 'json' && spy.json.constructor == Array) || o.method == 'html') {
57
  if (spy.parseItem(e)) {
58
- spy.waitTimer = window.setInterval(function() {
59
- if (spyRunning) {
60
- if (!spy.parseItem(e)) {
61
- spy.parsing = 0;
62
- clearInterval(spy.waitTimer);
63
- }
64
- }
65
- }, o.pushTimeout);
66
  } else {
67
  spy.parsing = 0;
68
  }
@@ -72,27 +49,18 @@ $.fn.spy = function(settings) {
72
  spy.parsing = 0;
73
  }
74
  }
75
-
76
  // returns true if there's more to parse
77
  spy.parseItem = function(e) {
78
  if (o.method == 'html') {
79
  // note: pre jq-1.0 doesn't return the object
80
  var i = $('div#_spyTmp').find('div:first').remove();
81
- if (i.size() > 0) {
82
- i.hide();
83
- spy.addItem(e, i);
84
- }
85
  return ($('div#_spyTmp').find('div').size() != 0);
86
  } else {
87
- if (spy.json.length) {
88
- var i = spy.json.shift();
89
- spy.addItem(e, i);
90
- }
91
-
92
  return (spy.json.length != 0);
93
  }
94
  }
95
-
96
  spy.addItem = function(e, i) {
97
  if (! o.isDupe.call(this, i, spy.last)) {
98
  spy.last = i; // note i is a pointer - so when it gets modified, so does spy.last
@@ -102,11 +70,7 @@ $.fn.spy = function(settings) {
102
  $('#' + e.id + ' > div:first').fadeIn(o.fadeInSpeed);
103
  }
104
  }
105
-
106
- spy.push = function(r) {
107
- $('#' + this.id).prepend(r);
108
- }
109
-
110
  var o = {
111
  limit: (settings.limit || 10),
112
  fadeLast: (settings.fadeLast || 5),
@@ -119,41 +83,18 @@ $.fn.spy = function(settings) {
119
  timestamp: (settings.timestamp || spy.timestamp),
120
  isDupe: (settings.isDupe || spy.isDupe)
121
  };
122
-
123
  spy.attachHolder();
124
-
125
  return this.each(function() {
126
  var e = this;
127
- var timestamp = o.timestamp.call();
128
  var lr = ''; // last ajax return
129
- spy.ajaxTimer = window.setInterval(function() {
130
- if (spyRunning && (!spy.parsing)) {
131
- $.post(o.ajax, { 'timestamp': timestamp }, function(r) {
132
- spy.parse(e, r);
133
- });
134
- timestamp = o.timestamp.call();
135
- }
136
- }, o.timeout);
137
  });
138
  };
139
-
140
- $.fn.fadeEachDown = function() {
141
- var s = this.size();
142
- return this.each(function(i) {
143
- var o = 1 - (s == 1 ? 0.5 : 0.85/s*(i+1));
144
- var e = this.style;
145
- if (window.ActiveXObject)
146
- e.filter = "alpha(opacity=" + o*100 + ")";
147
- e.opacity = o;
148
- });
149
- };
150
-
151
  })(jQuery);
152
 
153
- function pauseSpy() {
154
- spyRunning = 0; return false;
155
- }
156
-
157
- function playSpy() {
158
- spyRunning = 1; return false;
159
- }
1
+ /**
2
+ * Javascripts for wassup-spy page.
3
+ * $Id: spia.js,v 1.4.1 Exp $
4
+ *
5
+ /* "spy" is a jQuery plugin by Remy Sharp (leftlogic.com/info/articles/jquery_spy2) v1.4 2006/09/30 11:05:04 remy Exp
6
  */
7
  var spyRunning = 1;
 
8
  (function($) {
 
9
  $.fn.spy = function(settings) {
10
+ var spy=this;
11
+ spy.epoch=new Date(1970, 0, 1);
12
+ spy.last='';
13
+ spy.parsing=0;
14
+ spy.waitTimer=0;
15
+ spy.json=null;
16
+ if (!settings.ajax) {alert("An AJAX/AJAH URL must be set for the spy to work."); return;}
 
 
 
 
 
17
  spy.attachHolder = function() {
18
  // not mad on this, but the only way to parse HTML collections
19
+ if (o.method == 'html') $('body').append('<div style="display: none!important;" id="_spyTmp"></div>');
 
20
  }
 
21
  // returns true for 'no dupe', and false for 'dupe found'
22
  // latest = is latest ajax return value (raw)
23
  // last = is previous ajax return value (raw)
24
  // note that comparing latest and last if they're JSON objects
25
  // always returns false, so you need to implement it manually.
26
  spy.isDupe = function(latest, last) {
27
+ if(last){ //Wassup v1.9 bugfix for undefined error
28
+ if((last.constructor == Object) && (o.method == 'html')) {return (String(latest.text()).substring(0,32) == String(last.text()).substring(0,32));}
29
+ else if(last.constructor == String){ return (latest == last);}
30
+ else{ return false; }
31
+ } else {
32
+ return false;
33
+ }
 
 
 
 
34
  }
35
+ spy.timestamp = function() {var now=new Date();return Math.floor((now - spy.epoch) / 1000);}
36
  spy.parse = function(e, r) {
37
  spy.parsing = 1; // flag to stop pull via ajax
38
+ if(o.method == 'html'){$('div#_spyTmp').html(r);
39
+ }else if(o.method == 'json'){ eval('spy.json = ' + r);}
 
 
 
 
40
  if ((o.method == 'json' && spy.json.constructor == Array) || o.method == 'html') {
41
  if (spy.parseItem(e)) {
42
+ spy.waitTimer = window.setInterval(function(){if(spyRunning){ if(!spy.parseItem(e)){ spy.parsing = 0;clearInterval(spy.waitTimer);}}},o.pushTimeout);
 
 
 
 
 
 
 
43
  } else {
44
  spy.parsing = 0;
45
  }
49
  spy.parsing = 0;
50
  }
51
  }
 
52
  // returns true if there's more to parse
53
  spy.parseItem = function(e) {
54
  if (o.method == 'html') {
55
  // note: pre jq-1.0 doesn't return the object
56
  var i = $('div#_spyTmp').find('div:first').remove();
57
+ if(i.size() > 0){ i.hide(); spy.addItem(e,i);}
 
 
 
58
  return ($('div#_spyTmp').find('div').size() != 0);
59
  } else {
60
+ if(spy.json.length){ var i = spy.json.shift(); spy.addItem(e,i);}
 
 
 
 
61
  return (spy.json.length != 0);
62
  }
63
  }
 
64
  spy.addItem = function(e, i) {
65
  if (! o.isDupe.call(this, i, spy.last)) {
66
  spy.last = i; // note i is a pointer - so when it gets modified, so does spy.last
70
  $('#' + e.id + ' > div:first').fadeIn(o.fadeInSpeed);
71
  }
72
  }
73
+ spy.push = function(r) { $('#' + this.id).prepend(r);}
 
 
 
 
74
  var o = {
75
  limit: (settings.limit || 10),
76
  fadeLast: (settings.fadeLast || 5),
83
  timestamp: (settings.timestamp || spy.timestamp),
84
  isDupe: (settings.isDupe || spy.isDupe)
85
  };
 
86
  spy.attachHolder();
 
87
  return this.each(function() {
88
  var e = this;
89
+ var timestamp = o.timestamp.call();
90
  var lr = ''; // last ajax return
91
+ spy.ajaxTimer = window.setInterval(function() { if (spyRunning && (!spy.parsing)){ $.post(o.ajax,{'timestamp': timestamp},function(r){ spy.parse(e,r);}); timestamp = o.timestamp.call();}}, o.timeout);
 
 
 
 
 
 
 
92
  });
93
  };
94
+ $.fn.fadeEachDown = function() {var s=this.size(); return this.each(function(i){ var o = 1 - (s == 1 ? 0.5 : 0.85/s*(i+1)); var e = this.style; if (window.ActiveXObject) e.filter = "alpha(opacity=" + o*100 + ")"; e.opacity = o; });};
 
 
 
 
 
 
 
 
 
 
 
95
  })(jQuery);
96
 
97
+ function pauseSpy(){spyRunning=0;return false;}
98
+ function playSpy(){spyRunning=1;return false;}
99
+ function pad(n){n=n.toString();return (n.length==1?'0'+n:n);}
100
+ function spiaTimestamp(){var d=new Date();var timestamp=d.getFullYear()+'-'+pad(d.getMonth())+'-'+pad(d.getDate());timestamp +=' ';timestamp +=pad(d.getHours())+':'+pad(d.getMinutes())+':'+pad(d.getSeconds());return timestamp;}
 
 
 
js/thickbox/thickbox.css CHANGED
@@ -1,164 +1,33 @@
1
- /* ----------------------------------------------------------------------------------------------------------------*/
2
- /* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/
3
- /* ----------------------------------------------------------------------------------------------------------------*/
4
- *{padding: 0; margin: 0;}
5
-
6
- /* ----------------------------------------------------------------------------------------------------------------*/
7
- /* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
8
- /* ----------------------------------------------------------------------------------------------------------------*/
9
- #TB_window {
10
- font: 12px Arial, Helvetica, sans-serif;
11
- color: #333333;
12
- }
13
-
14
- #TB_secondLine {
15
- font: 10px Arial, Helvetica, sans-serif;
16
- color:#666666;
17
- }
18
-
19
- #TB_window a:link {color: #666666;}
20
- #TB_window a:visited {color: #666666;}
21
- #TB_window a:hover {color: #000;}
22
- #TB_window a:active {color: #666666;}
23
- #TB_window a:focus{color: #666666;}
24
-
25
- /* ----------------------------------------------------------------------------------------------------------------*/
26
- /* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/
27
- /* ----------------------------------------------------------------------------------------------------------------*/
28
- #TB_overlay {
29
- position: fixed;
30
- z-index:100;
31
- top: 0px;
32
- left: 0px;
33
- height:100%;
34
- width:100%;
35
- }
36
-
37
- .TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;}
38
- .TB_overlayBG {
39
- background-color:#000;
40
- filter:alpha(opacity=75);
41
- -moz-opacity: 0.75;
42
- opacity: 0.75;
43
- }
44
-
45
- * html #TB_overlay { /* ie6 hack */
46
- position: absolute;
47
- height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
48
- }
49
-
50
- #TB_window {
51
- position: fixed;
52
- background: #ffffff;
53
- z-index: 102;
54
- color:#000000;
55
- display:none;
56
- border: 4px solid #525252;
57
- text-align:left;
58
- top:50%;
59
- left:50%;
60
- }
61
-
62
- * html #TB_window { /* ie6 hack */
63
- position: absolute;
64
- margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
65
- }
66
-
67
- #TB_window img#TB_Image {
68
- display:block;
69
- margin: 15px 0 0 15px;
70
- border-right: 1px solid #ccc;
71
- border-bottom: 1px solid #ccc;
72
- border-top: 1px solid #666;
73
- border-left: 1px solid #666;
74
- }
75
-
76
- #TB_caption{
77
- height:25px;
78
- padding:7px 30px 10px 25px;
79
- float:left;
80
- }
81
-
82
- #TB_closeWindow{
83
- height:25px;
84
- padding:11px 25px 10px 0;
85
- float:right;
86
- }
87
-
88
- #TB_closeAjaxWindow{
89
- padding:7px 10px 5px 0;
90
- margin-bottom:1px;
91
- text-align:right;
92
- float:right;
93
- }
94
-
95
- #TB_ajaxWindowTitle{
96
- float:left;
97
- padding:7px 0 5px 10px;
98
- margin-bottom:1px;
99
- }
100
-
101
- #TB_title{
102
- border-bottom: 3px #d54e21 solid;
103
- background-color:#e8e8e8;
104
- height:27px;
105
- }
106
-
107
- #TB_ajaxContent{
108
- clear:both;
109
- padding:2px 15px 15px 15px;
110
- overflow:auto;
111
- text-align:left;
112
- line-height:1.4em;
113
- }
114
-
115
- #TB_ajaxContent.TB_modal{
116
- padding:15px;
117
- }
118
-
119
- #TB_ajaxContent p{
120
- padding:5px 0px 5px 0px;
121
- }
122
-
123
- #TB_load{
124
- position: fixed;
125
- display:none;
126
- height:13px;
127
- width:208px;
128
- z-index:103;
129
- top: 50%;
130
- left: 50%;
131
- margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
132
- }
133
-
134
- * html #TB_load { /* ie6 hack */
135
- position: absolute;
136
- margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
137
- }
138
-
139
- #TB_HideSelect{
140
- z-index:99;
141
- position:fixed;
142
- top: 0;
143
- left: 0;
144
- background-color:#fff;
145
- border:none;
146
- filter:alpha(opacity=0);
147
- -moz-opacity: 0;
148
- opacity: 0;
149
- height:100%;
150
- width:100%;
151
- }
152
-
153
- * html #TB_HideSelect { /* ie6 hack */
154
- position: absolute;
155
- height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
156
- }
157
-
158
- #TB_iframeContent{
159
- clear:both;
160
- border:none;
161
- margin-bottom:-1px;
162
- margin-top:1px;
163
- _margin-bottom:1px;
164
- }
1
+ *{padding:0;margin:0;}
2
+ #TB_window{font:12px Arial,Helvetica,sans-serif;color:#333333;}
3
+ #TB_secondLine{font:10px Arial,Helvetica,sans-serif;color:#666666;}
4
+ #TB_window a:link {color:#666666;}
5
+ #TB_window a:visited {color:#666666;}
6
+ #TB_window a:hover {color:#000;}
7
+ #TB_window a:active {color:#666666;}
8
+ #TB_window a:focus {color:#666666;}
9
+ #TB_overlay{position:fixed;z-index:9999;top:0;left:0;height:100%;width:100%;}
10
+ .TB_overlayMacFFBGHack{background:url(macFFBgHack.png) repeat;}
11
+ .TB_overlayBG{background-color:#000;filter:alpha(opacity=75);-moz-opacity:0.75;opacity:0.75;}
12
+ #TB_window{position:fixed;background:#ffffff;z-index:10002;color:#000000;display:none;border:4px solid #525252;text-align:left;top:50%;left:50%;}
13
+ /* ie6 hacks */
14
+ * html #TB_overlay{position:absolute;height:expression(document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight+'px');}
15
+ * html #TB_window{position:absolute;margin-top:expression(0-parseInt(this.offsetHeight/2)+(TBWindowMargin=document.documentElement && document.documentElement.scrollTop || document.body.scrollTop)+'px');}
16
+
17
+ #TB_window img#TB_Image{display:block;margin:15px 0 0 15px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;border-top:1px solid #666;border-left:1px solid #666;}
18
+ #TB_caption{height:25px;padding:7px 30px 10px 25px;float:left;}
19
+ #TB_closeWindow{height:25px;padding:11px 25px 10px 0;float:right;}
20
+ #TB_closeAjaxWindow{padding:7px 10px 5px 0;margin-bottom:1px;text-align:right;float:right;}
21
+ #TB_ajaxWindowTitle{float:left;padding:7px 0 5px 10px;margin-bottom:1px;}
22
+ #TB_title{border-bottom:3px #d54e21 solid;background-color:#e8e8e8;height:27px;}
23
+ #TB_ajaxContent{clear:both;padding:2px 15px 15px 15px;overflow:auto;text-align:left;line-height:1.4em;}
24
+ #TB_ajaxContent.TB_modal{padding:15px;}
25
+ #TB_ajaxContent p{padding:5px 0px 5px 0px;}
26
+ #TB_load{position:fixed;display:none;height:13px;width:208px;z-index:10003;top:50%;left:50%;margin:-6px 0 0 -104px;}
27
+ #TB_HideSelect{z-index:9998;position:fixed;top:0;left:0;background-color:#fff;border:none;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;height:100%;width:100%;}
28
+
29
+ /* ie6 hacks */
30
+ * html #TB_load{position:absolute;margin-top:expression(0-parseInt(this.offsetHeight/2)+(TBWindowMargin=document.documentElement && document.documentElement.scrollTop || document.body.scrollTop)+'px');}
31
+ * html #TB_HideSelect{position:absolute;height:expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight+'px');}
32
+
33
+ #TB_iframeContent{clear:both;border:none;margin-bottom:-1px;margin-top:1px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/wassup.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * wassup.js - Javascripts for wassup
3
+ * version 0.1 2015-10-05
4
+ */
5
+ //for refresh countdown in wassup-detail and wassup-online
6
+ var _countDowncontainer="0";
7
+ var _currentSeconds=0;
8
+ var tickerID = 0;
9
+ function ActivateCountDown(strContainerID, initialValue){_countDowncontainer=document.getElementById(strContainerID);SetCountdownText(initialValue);tickerID=window.setInterval("CountDownTick()",1000);}
10
+ function CountDownTick(){if(_currentSeconds >0){SetCountdownText(_currentSeconds-1);}else{clearInterval(tickerID);tickerID=0;}}
11
+ function SetCountdownText(seconds){_currentSeconds=seconds;var strText=AddZero(seconds);if(_countDowncontainer){_countDowncontainer.innerHTML=strText;}}
12
+ function AddZero(num){return((num >= "0")&&(num < 10))?"0"+num:num+"";}
13
+ //common javascripts
14
+ function wScrollTop(){document.body.scrollTop=document.documentElement.scrollTop=0;}
language/wassup.pot CHANGED
@@ -1,1466 +1,2835 @@
 
 
 
 
 
1
  #, fuzzy
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: WassUp\n"
5
- "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2009-05-18 12:28+0100\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
- "Last-Translator: michele <michele@befree.it>\n"
9
- "Language-Team: <michele@befree.it>\n"
10
  "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Launchpad-Export-Date: 2014-01-12 09:52+0000\n"
14
- "X-Generator: Launchpad (build 16890)\n"
15
- "X-Poedit-Language: English\n"
16
- "X-Poedit-SearchPath-0: .\n"
17
- "X-Poedit-Basepath: /Users/michele/Desktop/wassup\n"
18
- "X-Poedit-KeywordsList: __;_e\n"
19
 
20
- #: wassup.php:45
21
- msgid "Sorry, Wassup requires WordPress 2.2 or higher to work"
22
  msgstr ""
23
 
24
- #: wassup.php:406
25
- msgid "Hide Search"
26
  msgstr ""
27
 
28
- #: wassup.php:409
29
- #: wassup.php:1209
30
- #: wassup.php:1290
31
- #: lib/action.php:183
32
- msgid "Search"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  msgstr ""
34
 
35
- #: wassup.php:414
36
- msgid "Hide TopTen"
37
  msgstr ""
38
 
39
- #: wassup.php:417
40
- msgid "Show TopTen"
 
41
  msgstr ""
42
 
43
- #: wassup.php:423
44
  msgid "Collapse All"
45
  msgstr ""
46
 
47
- #: wassup.php:426
48
- #: wassup.php:761
49
- #: wassup.php:857
50
- #: wassup.php:1165
51
  msgid "Expand All"
52
  msgstr ""
53
 
54
- #: wassup.php:431
55
- msgid "Expand Cronology"
56
  msgstr ""
57
 
58
- #: wassup.php:434
59
- msgid "Collapse Cronology"
60
  msgstr ""
61
 
62
- #: wassup.php:526
63
  msgid "Visitor Details"
64
  msgstr ""
65
 
66
- #: wassup.php:529
67
  msgid "Spy Visitors"
68
  msgstr ""
69
 
70
- #: wassup.php:529
71
- #: wassup.php:861
72
  msgid "SPY Visitors"
73
  msgstr ""
74
 
75
- #: wassup.php:530
76
- #: wassup.php:759
77
  msgid "Current Visitors Online"
78
  msgstr ""
79
 
80
- #: wassup.php:531
81
- #: wassup.php:917
 
 
 
 
82
  msgid "Options"
83
  msgstr ""
84
 
85
- #: wassup.php:629
86
- #: wassup.php:654
 
 
 
 
 
 
 
 
 
 
 
 
87
  msgid "Wassup options updated successfully"
88
  msgstr ""
89
 
90
- #: wassup.php:641
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  msgid "Wassup uninstall option updated successfully"
92
  msgstr ""
93
 
94
- #: wassup.php:649
95
- msgid "Wassup spam options updated successfully"
96
  msgstr ""
97
 
98
- #: wassup.php:750
99
- msgid "Warning"
100
  msgstr ""
101
 
102
- #: wassup.php:750
103
- msgid "is NOT recording new statistics"
104
  msgstr ""
105
 
106
- #: wassup.php:750
107
- msgid ""
108
- "To collect data you must check \"Enable/Disable recording\" in \"Options: "
109
- "Statistics Recording\" tab"
110
  msgstr ""
111
 
112
- #: wassup.php:760
113
- #: wassup.php:862
114
- msgid "Legend"
115
  msgstr ""
116
 
117
- #: wassup.php:760
118
- #: wassup.php:862
119
- msgid "Logged-in Users"
120
  msgstr ""
121
 
122
- #: wassup.php:760
123
- #: wassup.php:862
124
- msgid "Comments Authors"
 
125
  msgstr ""
126
 
127
- #: wassup.php:760
128
- #: wassup.php:862
129
- msgid "Spiders/bots"
130
  msgstr ""
131
 
132
- #: wassup.php:767
133
- msgid "Visitors online"
134
  msgstr ""
135
 
136
- #: wassup.php:791
137
- #: wassup.php:1319
138
- #: lib/main.php:641
139
- msgid "From your blog"
140
  msgstr ""
141
 
142
- #: wassup.php:794
143
- #: wassup.php:1322
144
- #: lib/main.php:644
145
- msgid "Direct hit"
146
  msgstr ""
147
 
148
- #: wassup.php:814
149
- #: wassup.php:1389
150
- msgid "LOGGED IN USER"
151
  msgstr ""
152
 
153
- #: wassup.php:815
154
- #: wassup.php:818
155
- #: wassup.php:1405
156
- msgid "COMMENT AUTHOR"
157
  msgstr ""
158
 
159
- #: wassup.php:864
160
- msgid "Pause"
161
  msgstr ""
162
 
163
- #: wassup.php:865
164
- msgid "Play"
165
  msgstr ""
166
 
167
- #: wassup.php:866
168
- msgid "Spy items by"
 
 
 
169
  msgstr ""
170
 
171
- #: wassup.php:918
172
- msgid ""
173
- "You can add a sidebar Widget with some useful statistics information by "
174
- "activating the"
175
  msgstr ""
176
 
177
- #: wassup.php:919
178
- msgid "Wassup Widget in the Widgets menu option"
179
  msgstr ""
180
 
181
- #: wassup.php:927
182
- msgid "Latest hits"
183
  msgstr ""
184
 
185
- #: wassup.php:929
186
- msgid "WassUp recording is disabled"
187
  msgstr ""
188
 
189
- #: wassup.php:1041
190
- msgid "records deleted"
 
191
  msgstr ""
192
 
193
- #: wassup.php:1102
194
- msgid "hide chart"
 
 
195
  msgstr ""
196
 
197
- #: wassup.php:1102
198
- msgid "Hide the chart"
 
 
 
 
 
 
 
 
199
  msgstr ""
200
 
201
- #: wassup.php:1105
202
- msgid "show chart"
203
  msgstr ""
204
 
205
- #: wassup.php:1105
206
- msgid "Show the chart"
207
  msgstr ""
208
 
209
- #: wassup.php:1115
210
- msgid "Summary for the last"
211
  msgstr ""
212
 
213
- #: wassup.php:1122
214
- msgid "Items per page"
215
  msgstr ""
216
 
217
- #: wassup.php:1132
218
- msgid "Show items by"
219
  msgstr ""
220
 
221
- #: wassup.php:1151
222
- msgid "Visits"
223
  msgstr ""
224
 
225
- #: wassup.php:1152
226
- msgid "Pageviews"
227
  msgstr ""
228
 
229
- #: wassup.php:1153
230
- msgid "Pages/Visits"
231
  msgstr ""
232
 
233
- #: wassup.php:1156
234
- msgid "Spams"
235
  msgstr ""
236
 
237
- #: wassup.php:1166
238
- msgid "Collapse Chronology"
239
  msgstr ""
240
 
241
- #: wassup.php:1185
242
- msgid "Spam Options"
243
  msgstr ""
244
 
245
- #: wassup.php:1187
246
- #: lib/settings.php:182
247
- msgid "Enable/Disable Spam Check on Records"
248
  msgstr ""
249
 
250
- #: wassup.php:1188
251
- #: lib/settings.php:185
252
- msgid "Record Akismet comment spam attempts"
253
  msgstr ""
254
 
255
- #: wassup.php:1189
256
- #: lib/settings.php:186
257
- msgid "Record referrer spam attempts"
258
  msgstr ""
259
 
260
- #: wassup.php:1190
261
- #: lib/settings.php:187
262
- msgid "Record admin break-in/hacker attempts"
263
  msgstr ""
264
 
265
- #: wassup.php:1191
266
- #: lib/settings.php:168
267
- #: lib/settings.php:203
268
- #: lib/settings.php:448
269
- #: lib/settings.php:462
270
- msgid "Save Settings"
271
  msgstr ""
272
 
273
- #: wassup.php:1200
274
- msgid "Filter by marked IP"
275
  msgstr ""
276
 
277
- #: wassup.php:1200
278
- msgid "show marked items"
279
  msgstr ""
280
 
281
- #: wassup.php:1203
282
- msgid "Searched for"
283
  msgstr ""
284
 
285
- #: wassup.php:1205
286
- msgid "Auto refresh in"
287
  msgstr ""
288
 
289
- #: wassup.php:1205
290
- #: lib/settings.php:334
291
- #: lib/settings.php:423
292
- msgid "seconds"
293
  msgstr ""
294
 
295
- #: wassup.php:1209
296
- msgid "Top Ten"
297
  msgstr ""
298
 
299
- #: wassup.php:1209
300
- msgid "Show Top Ten"
301
  msgstr ""
302
 
303
- #: wassup.php:1263
304
- #: lib/action.php:175
305
- msgid "Raw data"
306
  msgstr ""
307
 
308
- #: wassup.php:1266
309
- msgid "Visit type"
310
  msgstr ""
311
 
312
- #: wassup.php:1268
313
- msgid "Logged-in user"
314
  msgstr ""
315
 
316
- #: wassup.php:1270
317
- msgid "Spammer/Hacker"
 
318
  msgstr ""
319
 
320
- #: wassup.php:1272
321
- msgid "Spammer"
322
  msgstr ""
323
 
324
- #: wassup.php:1274
325
- msgid "Comment author"
 
326
  msgstr ""
327
 
328
- #: wassup.php:1276
329
- msgid "Feed"
330
  msgstr ""
331
 
332
- #: wassup.php:1278
333
- #: lib/wassup.class.php:232
334
- msgid "Spider"
335
  msgstr ""
336
 
337
- #: wassup.php:1280
338
- msgid "Regular visitor"
339
  msgstr ""
340
 
341
- #: wassup.php:1283
342
- #: lib/action.php:178
343
- msgid "IP"
344
  msgstr ""
345
 
346
- #: wassup.php:1284
347
- #: wassup.php:1356
348
- #: lib/action.php:179
349
- msgid "Hostname"
350
  msgstr ""
351
 
352
- #: wassup.php:1285
353
- msgid "Url Requested"
354
  msgstr ""
355
 
356
- #: wassup.php:1286
357
- #: wassup.php:1361
358
- #: lib/action.php:180
359
- msgid "User Agent"
360
  msgstr ""
361
 
362
- #: wassup.php:1287
363
- #: wassup.php:1356
364
- #: lib/action.php:181
365
- msgid "Referrer"
366
  msgstr ""
367
 
368
- #: wassup.php:1289
369
- msgid "Search Engine"
 
370
  msgstr ""
371
 
372
- #: wassup.php:1291
373
- msgid "Page"
 
374
  msgstr ""
375
 
376
- #: wassup.php:1294
377
- #: wassup.php:1450
378
- #: lib/action.php:186
379
- msgid "OS"
380
  msgstr ""
381
 
382
- #: wassup.php:1297
383
- #: lib/action.php:189
384
- msgid "Browser"
385
  msgstr ""
386
 
387
- #: wassup.php:1300
388
- msgid "Locale/Language"
389
  msgstr ""
390
 
391
- #: wassup.php:1303
392
- msgid "Screen Resolution"
393
  msgstr ""
394
 
395
- #: wassup.php:1306
396
- msgid "End timestamp"
397
  msgstr ""
398
 
399
- #: wassup.php:1332
400
- #: wassup.php:1337
401
  msgid "delete"
402
  msgstr ""
403
 
404
- #: wassup.php:1332
405
  msgid "Delete ALL marked records with this IP"
406
  msgstr ""
407
 
408
- #: wassup.php:1334
409
  msgid "unmark"
410
  msgstr ""
411
 
412
- #: wassup.php:1334
413
  msgid "UnMark IP"
414
  msgstr ""
415
 
416
- #: wassup.php:1337
417
  msgid "Delete this record"
418
  msgstr ""
419
 
420
- #: wassup.php:1339
421
  msgid "mark"
422
  msgstr ""
423
 
424
- #: wassup.php:1339
425
  msgid "Mark IP"
426
  msgstr ""
427
 
428
- #: wassup.php:1342
429
- msgid "show raw table"
 
430
  msgstr ""
431
 
432
- #: wassup.php:1342
433
- msgid "Show the items as raw table"
434
  msgstr ""
435
 
436
- #: wassup.php:1380
437
  msgid "SEARCH ENGINE"
438
  msgstr ""
439
 
440
- #: wassup.php:1380
441
  msgid "page"
442
  msgstr ""
443
 
444
- #: wassup.php:1381
445
  msgid "KEYWORDS"
446
  msgstr ""
447
 
448
- #: wassup.php:1399
449
- msgid "ADMINISTRATOR"
450
  msgstr ""
451
 
452
- #: wassup.php:1417
453
- msgid "FEEDREADER"
454
  msgstr ""
455
 
456
- #: wassup.php:1419
457
- msgid "SUBSCRIBER(S)"
458
  msgstr ""
459
 
460
- #: wassup.php:1424
461
- msgid "SPIDER"
 
 
462
  msgstr ""
463
 
464
- #: wassup.php:1432
465
- msgid "Probably SPAM!"
466
  msgstr ""
467
 
468
- #: wassup.php:1433
469
- msgid "Referer Spam"
470
  msgstr ""
471
 
472
- #: wassup.php:1434
473
- #: lib/wassup.class.php:234
474
- msgid "Spam"
475
  msgstr ""
476
 
477
- #: wassup.php:1440
478
- msgid "Probably hack attempt!"
479
  msgstr ""
480
 
481
- #: wassup.php:1448
482
- #: lib/action.php:192
483
- msgid "Language"
484
  msgstr ""
485
 
486
- #: wassup.php:1451
487
  msgid "BROWSER"
488
  msgstr ""
489
 
490
- #: wassup.php:1453
491
  msgid "RESOLUTION"
492
  msgstr ""
493
 
494
- #: wassup.php:1509
495
  msgid "Graph of visitor hits"
496
  msgstr ""
497
 
498
- #: wassup.php:1511
499
  msgid "Too few records to print chart"
500
  msgstr ""
501
 
502
- #: wassup.php:1527
503
- msgid "Check the official"
 
504
  msgstr ""
505
 
506
- #: wassup.php:1527
507
- msgid "page for updates, bug reports and your hints to improve it"
508
  msgstr ""
509
 
510
- #: wassup.php:1527
511
- msgid "User Guide documentation"
 
512
  msgstr ""
513
 
514
- #: wassup.php:1528
515
- msgid "Exec time"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
516
  msgstr ""
517
 
518
- #: wassup.php:2349
519
- msgid "WassUp Plugin table has reached maximum size!"
520
  msgstr ""
521
 
522
- #: wassup.php:2350
523
  msgid "Hi"
524
  msgstr ""
525
 
526
- #: wassup.php:2350
527
  msgid ""
528
  "you have received this email because your WassUp Database table at your "
529
  "Wordpress blog"
530
  msgstr ""
531
 
532
- #: wassup.php:2350
533
- msgid "has reached the maximum value you set in the options menu"
534
  msgstr ""
535
 
536
- #: wassup.php:2351
537
  msgid ""
538
  "This is only a reminder, please take the actions you want in the WassUp "
539
  "options menu"
540
  msgstr ""
541
 
542
- #: wassup.php:2351
543
  msgid "This alert now will be removed and you will be able to set a new one"
544
  msgstr ""
545
 
546
- #: wassup.php:2352
547
  msgid ""
548
  "Thank you for using WassUp plugin. Check if there is a new version available "
549
  "here:"
550
  msgstr ""
551
 
552
- #: wassup.php:2352
553
  msgid "Have a nice day!"
554
  msgstr ""
555
 
556
- #: wassup.php:2480
557
- msgid "Stats"
558
  msgstr ""
559
 
560
- #: wassup.php:2480
561
- msgid "More"
562
  msgstr ""
563
 
564
- #: wassup.php:2482
565
- #: wassup.php:3838
566
- msgid "visitor stats chart"
567
  msgstr ""
568
 
569
- #: wassup.php:2672
570
- msgid "encrypted search"
571
  msgstr ""
572
 
573
- #: wassup.php:3340
574
- msgid "Error getting table details"
575
  msgstr ""
576
 
577
- #: wassup.php:3348
578
- #, php-format
579
- msgid "Delete any existing table %s"
580
  msgstr ""
581
 
582
- #: wassup.php:3359
583
- #, php-format
584
- msgid "Table structure of table %s"
585
  msgstr ""
586
 
587
- #: wassup.php:3367
588
- #, php-format
589
- msgid "Error with SHOW CREATE TABLE for %s."
590
  msgstr ""
591
 
592
- #: wassup.php:3374
593
- #, php-format
594
- msgid "Error getting table structure of %s"
595
  msgstr ""
596
 
597
- #: wassup.php:3382
598
  #, php-format
599
- msgid "Data contents of table %s"
600
  msgstr ""
601
 
602
- #: wassup.php:3443
603
- #, php-format
604
- msgid "End of data contents of table %s"
605
  msgstr ""
606
 
607
- #: wassup.php:3455
608
- msgid "If above timestamp is not current time, this page is cached"
609
  msgstr ""
610
 
611
- #: wassup.php:3486
612
- #: wassup.php:3740
613
- msgid "No Data"
614
  msgstr ""
615
 
616
- #: wassup.php:3487
617
- #: wassup.php:3568
618
- #: wassup.php:3741
619
- #: wassup.php:3814
620
- msgid "powered by"
621
  msgstr ""
622
 
623
- #: wassup.php:3487
624
- #: wassup.php:3568
625
- #: wassup.php:3741
626
- msgid "Real Time Visitors Tracking"
627
  msgstr ""
628
 
629
- #: wassup.php:3497
630
- msgid "Last searched terms"
631
  msgstr ""
632
 
633
- #: wassup.php:3510
634
- msgid "Last referers"
635
  msgstr ""
636
 
637
- #: wassup.php:3525
638
- #: lib/settings.php:149
639
- msgid "Top Browsers"
640
  msgstr ""
641
 
642
- #: wassup.php:3540
643
- #: lib/settings.php:150
644
- msgid "Top OS"
645
  msgstr ""
646
 
647
- #: wassup.php:3559
648
- msgid "visitor(s) online"
649
  msgstr ""
650
 
651
- #: wassup.php:3562
652
- msgid "logged-in user(s)"
653
  msgstr ""
654
 
655
- #: wassup.php:3566
656
- msgid "comment author(s)"
 
657
  msgstr ""
658
 
659
- #: wassup.php:3632
660
- msgid "Title"
661
  msgstr ""
662
 
663
- #: wassup.php:3634
664
- msgid "default \"Visitors Online\""
 
665
  msgstr ""
666
 
667
- #: wassup.php:3637
668
- msgid "Stylesheet class for &lt;ul&gt; attribute"
 
669
  msgstr ""
670
 
671
- #: wassup.php:3639
672
- msgid "default \"links\""
673
  msgstr ""
674
 
675
- #: wassup.php:3642
676
- msgid "Number of characters to display from left"
677
  msgstr ""
678
 
679
- #: wassup.php:3644
680
- msgid "For template compatibility - default 18"
681
  msgstr ""
682
 
683
- #: wassup.php:3649
684
- msgid "Show number of logged-in users online"
685
  msgstr ""
686
 
687
- #: wassup.php:3650
688
- msgid "Stats recording must be enabled in WassUp options"
 
 
689
  msgstr ""
690
 
691
- #: wassup.php:3651
692
- #: wassup.php:3657
693
- #: wassup.php:3663
694
- #: wassup.php:3675
695
- msgid "default Yes"
696
  msgstr ""
697
 
698
- #: wassup.php:3656
699
- msgid "Show number of comment authors online"
 
700
  msgstr ""
701
 
702
- #: wassup.php:3662
703
- msgid "Show latest searches"
704
  msgstr ""
705
 
706
- #: wassup.php:3666
707
- msgid "How many searches?"
 
708
  msgstr ""
709
 
710
- #: wassup.php:3668
711
- #: wassup.php:3680
712
- #: wassup.php:3692
713
- #: wassup.php:3704
714
- msgid "default 5"
715
  msgstr ""
716
 
717
- #: wassup.php:3674
718
- msgid "Show latest external referrers"
719
  msgstr ""
720
 
721
- #: wassup.php:3678
722
- msgid "How many referrers?"
723
  msgstr ""
724
 
725
- #: wassup.php:3686
726
- msgid "Show top browsers"
727
  msgstr ""
728
 
729
- #: wassup.php:3686
730
- #: wassup.php:3698
731
- msgid "default No"
732
  msgstr ""
733
 
734
- #: wassup.php:3687
735
- #: wassup.php:3699
736
- msgid "Enabling it could slow down blog)"
737
  msgstr ""
738
 
739
- #: wassup.php:3690
740
- msgid "How many browsers?"
741
  msgstr ""
742
 
743
- #: wassup.php:3698
744
- msgid "Show top operating systems"
745
  msgstr ""
746
 
747
- #: wassup.php:3702
748
- msgid "How many operating systems?"
749
  msgstr ""
750
 
751
- #: wassup.php:3713
752
- msgid "Wassup Widget"
 
 
753
  msgstr ""
754
 
755
- #: wassup.php:3839
756
- msgid "More Stats"
757
  msgstr ""
758
 
759
- #: lib/action.php:125
760
- msgid "ERROR: file not found"
761
  msgstr ""
762
 
763
- #: lib/action.php:143
764
- msgid "ERROR: bad date"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  msgstr ""
766
 
767
- #: lib/action.php:257
768
  msgid "TOP QUERY"
769
  msgstr ""
770
 
771
- #: lib/action.php:276
772
- msgid "TOP REFERRER"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
773
  msgstr ""
774
 
775
- #: lib/action.php:302
776
- msgid "TOP REQUEST"
 
 
777
  msgstr ""
778
 
779
- #: lib/action.php:323
780
- msgid "TOP BROWSER"
 
 
 
781
  msgstr ""
782
 
783
- #: lib/action.php:343
784
- msgid "TOP OS"
 
785
  msgstr ""
786
 
787
- #: lib/action.php:364
788
- msgid "TOP LOCALE"
 
 
789
  msgstr ""
790
 
791
- #: lib/action.php:391
792
- msgid "TOP VISITOR"
793
  msgstr ""
794
 
795
- #: lib/action.php:409
796
- msgid "This top ten doesn't include Spam records"
797
  msgstr ""
798
 
799
- #: lib/action.php:414
800
- msgid "ERROR: Missing or unknown parameters"
 
 
 
 
801
  msgstr ""
802
 
803
- #: lib/action.php:423
804
- msgid "ERROR: Nothing to do here"
 
 
805
  msgstr ""
806
 
807
- #: lib/main.php:85
808
- msgid "Next"
 
 
 
809
  msgstr ""
810
 
811
- #: lib/main.php:87
812
- msgid "Previous"
 
 
 
 
813
  msgstr ""
814
 
815
- #: lib/main.php:120
816
- #: lib/main.php:124
817
- msgid "It is necessary to specify the"
 
818
  msgstr ""
819
 
820
- #: lib/main.php:120
821
- msgid "number of pages"
 
 
 
 
822
  msgstr ""
823
 
824
- #: lib/main.php:124
825
- msgid "limit of items"
826
  msgstr ""
827
 
828
- #: lib/main.php:124
829
- msgid "to show per page"
 
830
  msgstr ""
831
 
832
- #: lib/main.php:209
833
- msgid "Pages"
834
  msgstr ""
835
 
836
- #: lib/main.php:777
837
- msgid "No visitor activity"
 
 
 
838
  msgstr ""
839
 
840
- #: lib/main.php:1179
841
- msgid "Last 6 Hours"
 
 
842
  msgstr ""
843
 
844
- #: lib/main.php:1185
845
- msgid "Last 7 Days"
 
 
 
846
  msgstr ""
847
 
848
- #: lib/main.php:1192
849
- msgid "Last Month"
850
  msgstr ""
851
 
852
- #: lib/main.php:1199
853
- msgid "Last 3 Months"
 
 
 
854
  msgstr ""
855
 
856
- #: lib/main.php:1205
857
- msgid "Last 6 Months"
 
 
 
858
  msgstr ""
859
 
860
- #: lib/main.php:1211
861
- msgid "Last Year"
 
 
862
  msgstr ""
863
 
864
- #: lib/main.php:1217
865
- msgid "All Time"
 
 
 
 
 
866
  msgstr ""
867
 
868
- #: lib/main.php:1224
869
- msgid "Last 24 Hours"
870
  msgstr ""
871
 
872
- #: lib/settings.php:31
 
873
  msgid ""
874
- "ATTENTION! Your WassUp table have reached the maximum value you set, I "
875
- "disabled the alert, you can re-enable it here."
 
 
876
  msgstr ""
877
 
878
- #: lib/settings.php:55
879
- msgid "Select the options you want for the WassUp plugin"
880
  msgstr ""
881
 
882
- #: lib/settings.php:62
883
- msgid "General Setup"
 
 
 
 
 
 
884
  msgstr ""
885
 
886
- #: lib/settings.php:63
887
- msgid "Statistics Recording"
888
  msgstr ""
889
 
890
- #: lib/settings.php:64
891
- msgid "Manage Files & Database"
 
 
 
892
  msgstr ""
893
 
894
- #: lib/settings.php:65
895
- msgid "Uninstall"
 
 
 
 
 
 
 
896
  msgstr ""
897
 
898
- #: lib/settings.php:69
899
- msgid "Your default screen resolution (browser width)"
 
 
 
 
 
900
  msgstr ""
901
 
902
- #: lib/settings.php:70
903
- msgid "Default screen resolution (in pixels)"
 
 
 
 
 
 
 
 
904
  msgstr ""
905
 
906
- #: lib/settings.php:75
907
- msgid ""
908
- "Set minimum users level which can view and manage WassUp plugin (default "
909
- "Administrators)"
910
  msgstr ""
911
 
912
- #: lib/settings.php:80
913
- msgid "Dashboard Settings"
914
  msgstr ""
915
 
916
- #: lib/settings.php:81
917
- msgid "Display small chart in the dashboard"
918
  msgstr ""
919
 
920
- #: lib/settings.php:84
921
- msgid "GEO IP Map (Spy view)"
 
 
922
  msgstr ""
923
 
924
- #: lib/settings.php:89
925
- msgid "Display a GEO IP Map in the spy visitors view"
 
926
  msgstr ""
927
 
928
- #: lib/settings.php:97
929
- #: lib/settings.php:456
930
- msgid "WARNING"
931
  msgstr ""
932
 
933
- #: lib/settings.php:97
934
- msgid "Activation problem >> Error code"
935
  msgstr ""
936
 
937
- #: lib/settings.php:105
938
- msgid "key"
939
  msgstr ""
940
 
941
- #: lib/settings.php:105
942
- msgid "signup for your key"
943
  msgstr ""
944
 
945
- #: lib/settings.php:108
946
- msgid "Geo IP Map requires"
947
  msgstr ""
948
 
949
- #: lib/settings.php:108
950
- msgid "Please install it to be able to activate this feature"
 
 
951
  msgstr ""
952
 
953
- #: lib/settings.php:112
954
- msgid "Time format"
955
  msgstr ""
956
 
957
- #: lib/settings.php:113
958
- msgid "Time format 12/24 hour"
 
 
 
 
959
  msgstr ""
960
 
961
- #: lib/settings.php:116
962
- msgid "Visitor Detail Settings"
 
 
 
963
  msgstr ""
964
 
965
- #: lib/settings.php:117
966
- msgid "Show chart type - How many axes"
 
967
  msgstr ""
968
 
969
- #: lib/settings.php:123
970
- msgid "Set how many minutes wait for automatic page refresh"
971
  msgstr ""
972
 
973
- #: lib/settings.php:123
974
- msgid "Current Visitors Online and Visitors Details"
975
  msgstr ""
976
 
977
- #: lib/settings.php:124
978
- msgid "refresh minutes (default 3)"
 
979
  msgstr ""
980
 
981
- #: lib/settings.php:126
982
- msgid "Show visitor details for"
983
  msgstr ""
984
 
985
- #: lib/settings.php:131
986
- msgid "Number of items per page"
987
  msgstr ""
988
 
989
- #: lib/settings.php:140
990
- msgid "Customize Top Ten List"
991
  msgstr ""
992
 
993
- #: lib/settings.php:141
994
- msgid "Choose one or more items for your Top Ten list"
995
  msgstr ""
996
 
997
- #: lib/settings.php:141
998
- msgid "over 5 selections may cause horizontal scrolling"
999
  msgstr ""
1000
 
1001
- #: lib/settings.php:144
1002
- msgid "Top Searches"
1003
  msgstr ""
1004
 
1005
- #: lib/settings.php:145
1006
- msgid "Top Referrers"
1007
  msgstr ""
1008
 
1009
- #: lib/settings.php:146
1010
- msgid "Top Requests"
1011
  msgstr ""
1012
 
1013
- #: lib/settings.php:151
1014
- msgid "Top Locales"
1015
  msgstr ""
1016
 
1017
- #: lib/settings.php:154
1018
- msgid "Top Visitors"
1019
  msgstr ""
1020
 
1021
- #: lib/settings.php:156
1022
- msgid "Top Feeds"
1023
  msgstr ""
1024
 
1025
- #: lib/settings.php:157
1026
- msgid "Top Crawlers"
1027
  msgstr ""
1028
 
1029
- #: lib/settings.php:161
1030
- msgid "Websites/domains to exclude from top referrers"
1031
  msgstr ""
1032
 
1033
- #: lib/settings.php:164
1034
- msgid "Comma separated value"
1035
  msgstr ""
1036
 
1037
- #: lib/settings.php:165
1038
- msgid "Don't list your website domain defined in WordPress"
1039
  msgstr ""
1040
 
1041
- #: lib/settings.php:168
1042
- #: lib/settings.php:203
1043
- #: lib/settings.php:448
1044
- #: lib/settings.php:462
1045
- msgid "Reset"
1046
  msgstr ""
1047
 
1048
- #: lib/settings.php:168
1049
- #: lib/settings.php:203
1050
- #: lib/settings.php:448
1051
- #: lib/settings.php:462
1052
- msgid "Reset to Default Settings"
1053
  msgstr ""
1054
 
1055
- #: lib/settings.php:172
1056
- msgid "Statistics Recording Settings"
 
1057
  msgstr ""
1058
 
1059
- #: lib/settings.php:173
1060
- msgid "Enable/Disable Recording"
 
1061
  msgstr ""
1062
 
1063
- #: lib/settings.php:174
1064
- msgid "Checkbox to record statistics for each type of \"visitor\""
 
1065
  msgstr ""
1066
 
1067
- #: lib/settings.php:176
1068
- msgid "Record logged in users"
 
1069
  msgstr ""
1070
 
1071
- #: lib/settings.php:177
1072
- msgid "Record logged in administrators"
 
1073
  msgstr ""
1074
 
1075
- #: lib/settings.php:178
1076
- msgid "Record spiders and bots"
1077
  msgstr ""
1078
 
1079
- #: lib/settings.php:179
1080
- msgid "Record attack/exploit attempts (libwww-perl agent)"
1081
  msgstr ""
1082
 
1083
- #: lib/settings.php:183
1084
- msgid "Checkbox to record statistics for each type of \"spam\""
1085
  msgstr ""
1086
 
1087
- #: lib/settings.php:185
1088
- msgid "check if an IP has previous comments as spam"
1089
  msgstr ""
1090
 
1091
- #: lib/settings.php:191
1092
- msgid "Statistics Recording Exceptions"
1093
  msgstr ""
1094
 
1095
- #: lib/settings.php:193
1096
- msgid "Sites"
1097
  msgstr ""
1098
 
1099
- #: lib/settings.php:193
1100
- msgid "Enter source IPs to exclude from recording"
1101
  msgstr ""
1102
 
1103
- #: lib/settings.php:195
1104
- msgid "comma separated value (ex: 127.0.0.1, 10.0.0.1, etc...)"
1105
  msgstr ""
1106
 
1107
- #: lib/settings.php:197
1108
- msgid "Users"
1109
  msgstr ""
1110
 
1111
- #: lib/settings.php:197
1112
- msgid "Enter usernames to exclude from recording"
1113
  msgstr ""
1114
 
1115
- #: lib/settings.php:199
1116
- msgid ""
1117
- "comma separated value, enter a registered user's login name (ex: bobmarley, "
1118
- "enyabrennan, etc.)"
1119
  msgstr ""
1120
 
1121
- #: lib/settings.php:200
1122
- msgid "Posts/pages"
1123
  msgstr ""
1124
 
1125
- #: lib/settings.php:200
1126
- msgid "enter requested URLs to exclude from recording"
1127
  msgstr ""
1128
 
1129
- #: lib/settings.php:202
1130
- msgid ""
1131
- "comma separated value, don't enter entire url, only the last path or some "
1132
- "word to exclude (ex: /category/wordpress, 2007, etc...)"
1133
  msgstr ""
1134
 
1135
- #: lib/settings.php:231
1136
- #: lib/settings.php:233
1137
- msgid "Rescan Old Records"
1138
  msgstr ""
1139
 
1140
- #: lib/settings.php:232
1141
- msgid ""
1142
- "Statistical records collected by earlier versions of WassUp may not have the "
1143
- "latest spider, search engine, and spam data properly identified. Click the "
1144
- "\"Rescan\" button to retroactively scan and update old records"
1145
  msgstr ""
1146
 
1147
- #: lib/settings.php:236
1148
- msgid "Select actions for table growth"
1149
  msgstr ""
1150
 
1151
- #: lib/settings.php:237
1152
- msgid ""
1153
- "WassUp table grows very fast (especially if your blog is frequently "
1154
- "visited), I recommend you to delete old records sometimes. You can select "
1155
- "any option below to reset it, delete old records automatically or manually. "
1156
- "(If you haven't database space problems you can leave the table as is)"
1157
  msgstr ""
1158
 
1159
- #: lib/settings.php:238
1160
- msgid "Current WassUp table usage is"
 
1161
  msgstr ""
1162
 
1163
- #: lib/settings.php:244
1164
- msgid "records"
 
1165
  msgstr ""
1166
 
1167
- #: lib/settings.php:247
1168
- msgid "Alert me"
 
1169
  msgstr ""
1170
 
1171
- #: lib/settings.php:247
1172
- msgid "email to"
 
1173
  msgstr ""
1174
 
1175
- #: lib/settings.php:247
1176
- msgid "when table reaches"
 
1177
  msgstr ""
1178
 
1179
- #: lib/settings.php:249
1180
- msgid "Empty table"
 
1181
  msgstr ""
1182
 
1183
- #: lib/settings.php:250
1184
- msgid "export table in SQL format"
 
1185
  msgstr ""
1186
 
1187
- #: lib/settings.php:252
1188
- msgid "backup table to server file"
 
1189
  msgstr ""
1190
 
1191
- #: lib/settings.php:254
1192
- msgid "Automatically delete records older than:"
 
1193
  msgstr ""
1194
 
1195
- #: lib/settings.php:258
1196
- msgid "Delete NOW records older than:"
 
1197
  msgstr ""
1198
 
1199
- #: lib/settings.php:260
1200
- msgid "Action is NOT undoable"
 
1201
  msgstr ""
1202
 
1203
- #: lib/settings.php:261
1204
- #: lib/wassup.class.php:259
1205
- #: lib/wassup.class.php:269
1206
- msgid "24 hours"
1207
  msgstr ""
1208
 
1209
- #: lib/settings.php:262
1210
- #: lib/wassup.class.php:260
1211
- msgid "1 week"
 
1212
  msgstr ""
1213
 
1214
- #: lib/settings.php:263
1215
- #: lib/wassup.class.php:261
1216
- #: lib/wassup.class.php:271
1217
- msgid "1 month"
1218
  msgstr ""
1219
 
1220
- #: lib/settings.php:264
1221
- #: lib/wassup.class.php:262
1222
- #: lib/wassup.class.php:272
1223
- msgid "3 months"
1224
  msgstr ""
1225
 
1226
- #: lib/settings.php:265
1227
- #: lib/wassup.class.php:263
1228
- #: lib/wassup.class.php:273
1229
- msgid "6 months"
1230
  msgstr ""
1231
 
1232
- #: lib/settings.php:266
1233
- #: lib/wassup.class.php:264
1234
- #: lib/wassup.class.php:274
1235
- msgid "1 year"
1236
  msgstr ""
1237
 
1238
- #: lib/settings.php:270
1239
- msgid "Server Settings and Memory Resources"
1240
  msgstr ""
1241
 
1242
- #: lib/settings.php:271
1243
- msgid "For information only. Some values may be adjustable in startup files"
1244
  msgstr ""
1245
 
1246
- #: lib/settings.php:271
1247
- msgid "and"
 
1248
  msgstr ""
1249
 
1250
- #: lib/settings.php:271
1251
- msgid "or"
1252
  msgstr ""
1253
 
1254
- #: lib/settings.php:272
1255
- #: lib/settings.php:287
1256
- #: lib/settings.php:350
1257
- msgid "Version"
1258
  msgstr ""
1259
 
1260
- #: lib/settings.php:273
1261
- msgid "Host Server"
1262
  msgstr ""
1263
 
1264
- #: lib/settings.php:283
1265
- #: lib/settings.php:319
1266
- #: lib/settings.php:329
1267
- #: lib/settings.php:335
1268
- #: lib/settings.php:350
1269
- #: lib/settings.php:353
1270
- #: lib/settings.php:397
1271
- #: lib/settings.php:407
1272
- #: lib/settings.php:418
1273
- #: lib/settings.php:425
1274
- #: lib/settings.php:434
1275
- #: lib/settings.php:445
1276
- msgid "unknown"
1277
  msgstr ""
1278
 
1279
- #: lib/settings.php:285
1280
- msgid "Time Offset"
1281
  msgstr ""
1282
 
1283
- #: lib/settings.php:286
1284
- msgid "hours"
1285
  msgstr ""
1286
 
1287
- #: lib/settings.php:288
1288
- msgid "Safe Mode"
1289
  msgstr ""
1290
 
1291
- #: lib/settings.php:291
1292
- #: lib/settings.php:300
1293
- msgid "on"
1294
  msgstr ""
1295
 
1296
- #: lib/settings.php:293
1297
- #: lib/settings.php:298
1298
- msgid "off"
1299
  msgstr ""
1300
 
1301
- #: lib/settings.php:294
1302
- msgid "File Open Restrictions"
1303
  msgstr ""
1304
 
1305
- #: lib/settings.php:304
1306
- msgid "Memory Allocation"
1307
  msgstr ""
1308
 
1309
- #: lib/settings.php:322
1310
- msgid "Memory Usage"
1311
  msgstr ""
1312
 
1313
- #: lib/settings.php:332
1314
- msgid "Script Timeout Limit"
1315
  msgstr ""
1316
 
1317
- #: lib/settings.php:337
1318
- msgid "Browser Capabilities File"
1319
  msgstr ""
1320
 
1321
- #: lib/settings.php:339
1322
- msgid "not set"
1323
  msgstr ""
1324
 
1325
- #: lib/settings.php:343
1326
- msgid "not installed"
1327
  msgstr ""
1328
 
1329
- #: lib/settings.php:344
1330
- msgid "installed"
 
 
1331
  msgstr ""
1332
 
1333
- #: lib/settings.php:351
1334
- msgid "Engine"
1335
  msgstr ""
1336
 
1337
- #: lib/settings.php:389
1338
- msgid "Query Cache"
1339
  msgstr ""
1340
 
1341
- #: lib/settings.php:394
1342
- #: lib/settings.php:404
1343
- #: lib/settings.php:415
1344
- msgid "disabled"
1345
  msgstr ""
1346
 
1347
- #: lib/settings.php:399
1348
- msgid "Index (Key) Buffer"
1349
  msgstr ""
1350
 
1351
- #: lib/settings.php:410
1352
- msgid "Read Buffer"
1353
  msgstr ""
1354
 
1355
- #: lib/settings.php:421
1356
- msgid "Wait Timeout"
1357
  msgstr ""
1358
 
1359
- #: lib/settings.php:428
1360
- msgid "Char Set/Collation"
1361
  msgstr ""
1362
 
1363
- #: lib/settings.php:437
1364
- msgid "Timezone"
1365
  msgstr ""
1366
 
1367
- #: lib/settings.php:452
1368
- msgid "Want to uninstall WassUp?"
1369
  msgstr ""
1370
 
1371
- #: lib/settings.php:453
1372
- msgid ""
1373
- "No problem. Before you deactivate this plugin, check the box below to "
1374
- "cleanup any data that was collected by WassUp that could be left behind."
1375
  msgstr ""
1376
 
1377
- #: lib/settings.php:454
1378
- msgid "Permanently remove WassUp data and settings from Wordpress"
1379
  msgstr ""
1380
 
1381
- #: lib/settings.php:456
1382
- msgid ""
1383
- "All WassUp data and settings will be DELETED upon deactivation of this plugin"
1384
  msgstr ""
1385
 
1386
- #: lib/settings.php:458
1387
- msgid ""
1388
- "This action cannot be undone. Before uninstalling WassUp, you should backup "
1389
- "your Wordpress database first. WassUp data is stored in the table"
1390
  msgstr ""
1391
 
1392
- #: lib/settings.php:460
1393
- msgid "To help improve this plugin, we would appreciate your feedback at"
1394
  msgstr ""
1395
 
1396
- #: lib/wassup.class.php:208
1397
- msgid "Administrator"
1398
  msgstr ""
1399
 
1400
- #: lib/wassup.class.php:209
1401
- msgid "Editor"
1402
  msgstr ""
1403
 
1404
- #: lib/wassup.class.php:210
1405
- msgid "Author"
1406
  msgstr ""
1407
 
1408
- #: lib/wassup.class.php:215
1409
- msgid "None - don't show chart"
1410
  msgstr ""
1411
 
1412
- #: lib/wassup.class.php:216
1413
- msgid "One - 2 lines chart 1 axis"
1414
  msgstr ""
1415
 
1416
- #: lib/wassup.class.php:217
1417
- msgid "Two - 2 lines chart 2 axes"
 
1418
  msgstr ""
1419
 
1420
- #: lib/wassup.class.php:231
1421
- msgid "Everything"
1422
  msgstr ""
1423
 
1424
- #: lib/wassup.class.php:233
1425
- msgid "No spider"
1426
  msgstr ""
1427
 
1428
- #: lib/wassup.class.php:235
1429
- msgid "No Spam"
1430
  msgstr ""
1431
 
1432
- #: lib/wassup.class.php:236
1433
- msgid "No Spam, No Spider"
1434
  msgstr ""
1435
 
1436
- #: lib/wassup.class.php:237
1437
- msgid "Users logged in"
 
1438
  msgstr ""
1439
 
1440
- #: lib/wassup.class.php:238
1441
- msgid "Comment authors"
 
1442
  msgstr ""
1443
 
1444
- #: lib/wassup.class.php:239
1445
- msgid "Referrer from search engine"
 
1446
  msgstr ""
1447
 
1448
- #: lib/wassup.class.php:240
1449
- msgid "Referrer from ext link"
 
1450
  msgstr ""
1451
 
1452
- #: lib/wassup.class.php:258
1453
- msgid "Don't delete anything"
 
1454
  msgstr ""
1455
 
1456
- #: lib/wassup.class.php:268
1457
- msgid "6 hours"
 
1458
  msgstr ""
1459
 
1460
- #: lib/wassup.class.php:270
1461
- msgid "7 days"
 
1462
  msgstr ""
1463
 
1464
- #: lib/wassup.class.php:275
1465
- msgid "all time"
1466
  msgstr ""
1
+ # LANGUAGE translation for WassUp Real-time Analytics plugin
2
+ # Copyright (C) 2009-2015
3
+ # This file is distributed under the same license as WassUp plugin.
4
+ # Michele Marcucci <michele(at)befree.it>, 2009.
5
+ #
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
+ "Project-Id-Version: WassUp 1.9\n"
10
+ "Report-Msgid-Bugs-To: michele@befree.it\n"
11
+ "POT-Creation-Date: 2015-12-12 12:20-0700\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
  "MIME-Version: 1.0\n"
16
+ "Content-Type: text/plain; charset=CHARSET\n"
17
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
 
 
 
18
 
19
+ #: wassup.php:25
20
+ msgid "Sorry. Unable to display requested page."
21
  msgstr ""
22
 
23
+ #: wassup.php:95
24
+ msgid "Sorry, WassUp requires WordPress 2.2 or higher to work"
25
  msgstr ""
26
 
27
+ #: wassup.php:102
28
+ #, php-format
29
+ msgid "File %s does not exist!"
30
+ msgstr ""
31
+
32
+ #: wassup.php:111
33
+ msgid ""
34
+ "Sorry, WassUp requires WordPress 3.1 or higher to work in multisite setups"
35
+ msgstr ""
36
+
37
+ #: wassup.php:119
38
+ msgid ""
39
+ "Sorry! Network activation is DISABLED in subdomain networks. WassUp plugin "
40
+ "must be activated on each subdomain site separately."
41
+ msgstr ""
42
+
43
+ #: wassup.php:119
44
+ msgid ""
45
+ "Activate Wassup on your main site/parent domain to set default options for "
46
+ "network."
47
+ msgstr ""
48
+
49
+ #: wassup.php:165 lib/upgrade.php:632
50
+ msgid "Database created/upgraded successfully"
51
+ msgstr ""
52
+
53
+ #: wassup.php:167
54
+ msgid ""
55
+ "An error occurred during the upgrade. WassUp table structure may not have "
56
+ "been updated properly."
57
+ msgstr ""
58
+
59
+ #: wassup.php:172
60
+ msgid "activation successful. No upgrade necessary."
61
+ msgstr ""
62
+
63
+ #: wassup.php:174
64
+ msgid "activation successful"
65
+ msgstr ""
66
+
67
+ #: wassup.php:197
68
+ #, php-format
69
+ msgid "%s: database upgrade failed!"
70
+ msgstr ""
71
+
72
+ #: wassup.php:218
73
+ #, php-format
74
+ msgid "%s: plugin install/upgrade failed!"
75
+ msgstr ""
76
+
77
+ #: wassup.php:353 wassup.php:356 wassup.php:359
78
+ msgid "Bad request!"
79
+ msgstr ""
80
+
81
+ #: wassup.php:634
82
+ msgid "paused"
83
+ msgstr ""
84
+
85
+ #: wassup.php:664 wassup.php:667
86
+ msgid "Sorry, delete failed!"
87
  msgstr ""
88
 
89
+ #: wassup.php:675 wassup.php:676 wassup.php:1926
90
+ msgid "Hide Search"
91
  msgstr ""
92
 
93
+ #: wassup.php:675 wassup.php:676 wassup.php:1927 wassup.php:1955
94
+ #: lib/main.php:441
95
+ msgid "Search"
96
  msgstr ""
97
 
98
+ #: wassup.php:678 wassup.php:701
99
  msgid "Collapse All"
100
  msgstr ""
101
 
102
+ #: wassup.php:678 wassup.php:701 wassup.php:1363 wassup.php:1963
 
 
 
103
  msgid "Expand All"
104
  msgstr ""
105
 
106
+ #: wassup.php:679
107
+ msgid "Expand Chronology"
108
  msgstr ""
109
 
110
+ #: wassup.php:679 wassup.php:1964
111
+ msgid "Collapse Chronology"
112
  msgstr ""
113
 
114
+ #: wassup.php:882 wassup.php:976
115
  msgid "Visitor Details"
116
  msgstr ""
117
 
118
+ #: wassup.php:883
119
  msgid "Spy Visitors"
120
  msgstr ""
121
 
122
+ #: wassup.php:883 wassup.php:975 wassup.php:1275 lib/settings.php:951
 
123
  msgid "SPY Visitors"
124
  msgstr ""
125
 
126
+ #: wassup.php:884 wassup.php:956 wassup.php:974 wassup.php:1272
 
127
  msgid "Current Visitors Online"
128
  msgstr ""
129
 
130
+ #: wassup.php:886 wassup.php:1278 lib/settings.php:945 lib/settings.php:951
131
+ #: lib/settings.php:953 lib/settings.php:955 lib/settings.php:957
132
+ #: lib/settings.php:959 lib/settings.php:960 lib/settings.php:963
133
+ #: lib/settings.php:964 lib/settings.php:965 lib/settings.php:970
134
+ #: lib/settings.php:976 lib/settings.php:978 lib/settings.php:982
135
+ #: lib/settings.php:986 lib/settings.php:992 lib/settings.php:993
136
  msgid "Options"
137
  msgstr ""
138
 
139
+ #: wassup.php:892
140
+ msgid "WassUp Stats"
141
+ msgstr ""
142
+
143
+ #: wassup.php:913 wassup.php:915
144
+ msgid "Settings"
145
+ msgstr ""
146
+
147
+ #: wassup.php:990 wassup.php:1286 lib/settings.php:119
148
+ msgid "Donate"
149
+ msgstr ""
150
+
151
+ #: wassup.php:1087 lib/wassup.class.php:752
152
+ #: lib/compat-lib/wassup.class.php:752
153
  msgid "Wassup options updated successfully"
154
  msgstr ""
155
 
156
+ #: wassup.php:1132
157
+ msgid "Nothing to do! Check a \"Delete\" option and try again"
158
+ msgstr ""
159
+
160
+ #: wassup.php:1135
161
+ #, php-format
162
+ msgid "%d records DELETED permanently!"
163
+ msgstr ""
164
+
165
+ #: wassup.php:1148
166
+ msgid "0 records deleted!"
167
+ msgstr ""
168
+
169
+ #: wassup.php:1168
170
  msgid "Wassup uninstall option updated successfully"
171
  msgstr ""
172
 
173
+ #: wassup.php:1174
174
+ msgid "Wassup options reset successfully"
175
  msgstr ""
176
 
177
+ #: wassup.php:1180 wassup.php:1194
178
+ msgid "Sorry! You're not allowed to do that."
179
  msgstr ""
180
 
181
+ #: wassup.php:1191
182
+ msgid "Wassup spam options updated successfully"
183
  msgstr ""
184
 
185
+ #: wassup.php:1231
186
+ msgid "records deleted"
 
 
187
  msgstr ""
188
 
189
+ #: wassup.php:1233
190
+ msgid "Sorry! You're not allowed to delete records."
 
191
  msgstr ""
192
 
193
+ #: wassup.php:1246 wassup.php:1250
194
+ msgid "WARNING: WassUp is NOT recording new statistics."
 
195
  msgstr ""
196
 
197
+ #: wassup.php:1246
198
+ msgid ""
199
+ "To collect visitor data you must check \"Enable statistics recording\" in "
200
+ "\"WassUp-Options: General Setup\" tab"
201
  msgstr ""
202
 
203
+ #: wassup.php:1250
204
+ msgid "Contact your site administrator about enabling statistics recording."
 
205
  msgstr ""
206
 
207
+ #: wassup.php:1269
208
+ msgid "Latest hits"
209
  msgstr ""
210
 
211
+ #: wassup.php:1286
212
+ msgid "Donations are really welcome"
 
 
213
  msgstr ""
214
 
215
+ #: wassup.php:1286
216
+ msgid "Check the official"
 
 
217
  msgstr ""
218
 
219
+ #: wassup.php:1286
220
+ msgid "page for updates, bug reports and your hints to improve it"
 
221
  msgstr ""
222
 
223
+ #: wassup.php:1286
224
+ msgid "WassUp Support"
 
 
225
  msgstr ""
226
 
227
+ #: wassup.php:1286
228
+ msgid "Wassup Support"
229
  msgstr ""
230
 
231
+ #: wassup.php:1287
232
+ msgid "Exec time"
233
  msgstr ""
234
 
235
+ #: wassup.php:1365 lib/settings.php:274 lib/settings.php:328
236
+ #: lib/settings.php:920 lib/settings.php:921 lib/settings.php:937
237
+ #: lib/settings.php:997 lib/settings.php:1017 widgets/widgets.php:597
238
+ #: widgets/widget_functions.php:400
239
+ msgid "Top"
240
  msgstr ""
241
 
242
+ #: wassup.php:1386 wassup.php:1559
243
+ msgid "Legend"
 
 
244
  msgstr ""
245
 
246
+ #: wassup.php:1386 wassup.php:1415 wassup.php:1559
247
+ msgid "Logged-in Users"
248
  msgstr ""
249
 
250
+ #: wassup.php:1386
251
+ msgid "Comment Authors"
252
  msgstr ""
253
 
254
+ #: wassup.php:1386 wassup.php:1559
255
+ msgid "Spiders/bots"
256
  msgstr ""
257
 
258
+ #: wassup.php:1414 lib/admin.class.php:144 lib/compat-lib/admin.class.php:141
259
+ #: widgets/widget_functions.php:217
260
+ msgid "Visitors online"
261
  msgstr ""
262
 
263
+ #: wassup.php:1416 lib/admin.class.php:197 lib/wassup.class.php:467
264
+ #: lib/compat-lib/admin.class.php:194 lib/compat-lib/wassup.class.php:467
265
+ #: widgets/widgets.php:248 widgets/widget_functions.php:237
266
+ msgid "Comment authors"
267
  msgstr ""
268
 
269
+ #: wassup.php:1427 wassup.php:1997 lib/main.php:489 lib/main.php:562
270
+ #: lib/main.php:711 lib/main.php:713 lib/main.php:722 lib/main.php:724
271
+ #: lib/settings.php:480 lib/settings.php:484 lib/settings.php:564
272
+ #: lib/settings.php:582 lib/settings.php:593 lib/settings.php:647
273
+ #: lib/settings.php:655 lib/settings.php:660 lib/settings.php:768
274
+ #: lib/settings.php:777 lib/settings.php:785 lib/settings.php:798
275
+ #: lib/settings.php:833 lib/settings.php:843 lib/settings.php:851
276
+ #: lib/settings.php:861 lib/settings.php:880 lib/settings.php:888
277
+ #: lib/settings.php:894
278
+ msgid "unknown"
279
  msgstr ""
280
 
281
+ #: wassup.php:1435 lib/main.php:549
282
+ msgid "Direct hit"
283
  msgstr ""
284
 
285
+ #: wassup.php:1456 wassup.php:2015
286
+ msgid "LOGGED IN USER"
287
  msgstr ""
288
 
289
+ #: wassup.php:1461 wassup.php:2022
290
+ msgid "ADMINISTRATOR"
291
  msgstr ""
292
 
293
+ #: wassup.php:1473 wassup.php:2043
294
+ msgid "COMMENT AUTHOR"
295
  msgstr ""
296
 
297
+ #: wassup.php:1494 wassup.php:2098
298
+ msgid "show raw table"
299
  msgstr ""
300
 
301
+ #: wassup.php:1494 wassup.php:2098
302
+ msgid "Show the items as raw table"
303
  msgstr ""
304
 
305
+ #: wassup.php:1559
306
+ msgid "Comments Authors"
307
  msgstr ""
308
 
309
+ #: wassup.php:1563
310
+ msgid "Pause"
311
  msgstr ""
312
 
313
+ #: wassup.php:1564
314
+ msgid "Play"
315
  msgstr ""
316
 
317
+ #: wassup.php:1575
318
+ msgid "Show map"
319
  msgstr ""
320
 
321
+ #: wassup.php:1575
322
+ msgid "Show ip geo location on map"
323
  msgstr ""
324
 
325
+ #: wassup.php:1581
326
+ msgid "Spy items by"
 
327
  msgstr ""
328
 
329
+ #: wassup.php:1627
330
+ msgid "WassUp recording is disabled"
 
331
  msgstr ""
332
 
333
+ #: wassup.php:1825
334
+ msgid "Show details from the last"
 
335
  msgstr ""
336
 
337
+ #: wassup.php:1834
338
+ msgid "Items per page"
 
339
  msgstr ""
340
 
341
+ #: wassup.php:1844
342
+ msgid "Filter items for"
 
 
 
 
343
  msgstr ""
344
 
345
+ #: wassup.php:1858
346
+ msgid "Visits"
347
  msgstr ""
348
 
349
+ #: wassup.php:1858
350
+ msgid "Pageviews"
351
  msgstr ""
352
 
353
+ #: wassup.php:1858
354
+ msgid "Pages/Visits"
355
  msgstr ""
356
 
357
+ #: wassup.php:1867
358
+ msgid "Spams"
359
  msgstr ""
360
 
361
+ #: wassup.php:1888
362
+ msgid "Spam/Malware Options"
 
 
363
  msgstr ""
364
 
365
+ #: wassup.php:1894
366
+ msgid "Enable Spam and Malware Check on Records"
367
  msgstr ""
368
 
369
+ #: wassup.php:1895 lib/settings.php:293
370
+ msgid "Record Akismet comment spam attempts"
371
  msgstr ""
372
 
373
+ #: wassup.php:1896 lib/settings.php:294
374
+ msgid "Record referrer spam attempts"
 
375
  msgstr ""
376
 
377
+ #: wassup.php:1897 lib/settings.php:296
378
+ msgid "Record attack/exploit attempts (libwww-perl agent)"
379
  msgstr ""
380
 
381
+ #: wassup.php:1898 lib/settings.php:295
382
+ msgid "Record admin break-in/hacker attempts"
383
  msgstr ""
384
 
385
+ #: wassup.php:1899 lib/settings.php:273 lib/settings.php:327
386
+ #: lib/settings.php:469 lib/settings.php:936
387
+ msgid "Save Settings"
388
  msgstr ""
389
 
390
+ #: wassup.php:1906
391
+ msgid "refresh screen"
392
  msgstr ""
393
 
394
+ #: wassup.php:1908
395
+ #, php-format
396
+ msgid "Auto refresh in %s seconds"
397
  msgstr ""
398
 
399
+ #: wassup.php:1913
400
+ msgid "hide chart"
401
  msgstr ""
402
 
403
+ #: wassup.php:1913
404
+ msgid "Hide the chart"
 
405
  msgstr ""
406
 
407
+ #: wassup.php:1913
408
+ msgid "Hide chart"
409
  msgstr ""
410
 
411
+ #: wassup.php:1915
412
+ msgid "show chart"
 
413
  msgstr ""
414
 
415
+ #: wassup.php:1915
416
+ msgid "Show the chart"
 
 
417
  msgstr ""
418
 
419
+ #: wassup.php:1915
420
+ msgid "Show chart"
421
  msgstr ""
422
 
423
+ #: wassup.php:1922
424
+ #, php-format
425
+ msgid "Top Stats for %s"
 
426
  msgstr ""
427
 
428
+ #: wassup.php:1922
429
+ msgid "Show top stats"
 
 
430
  msgstr ""
431
 
432
+ #: wassup.php:1924
433
+ #, php-format
434
+ msgid "Top stats for %s in popup"
435
  msgstr ""
436
 
437
+ #: wassup.php:1932
438
+ #, php-format
439
+ msgid "%s matches found for search"
440
  msgstr ""
441
 
442
+ #: wassup.php:1936
443
+ #, php-format
444
+ msgid "%s items marked for IP"
 
445
  msgstr ""
446
 
447
+ #: wassup.php:1937
448
+ msgid "Filter by marked IP"
 
449
  msgstr ""
450
 
451
+ #: wassup.php:2049
452
+ msgid "FEEDREADER"
453
  msgstr ""
454
 
455
+ #: wassup.php:2051
456
+ msgid "SUBSCRIBER(S)"
457
  msgstr ""
458
 
459
+ #: wassup.php:2054
460
+ msgid "SPIDER"
461
  msgstr ""
462
 
463
+ #: wassup.php:2088 wassup.php:2093
 
464
  msgid "delete"
465
  msgstr ""
466
 
467
+ #: wassup.php:2088
468
  msgid "Delete ALL marked records with this IP"
469
  msgstr ""
470
 
471
+ #: wassup.php:2090
472
  msgid "unmark"
473
  msgstr ""
474
 
475
+ #: wassup.php:2090
476
  msgid "UnMark IP"
477
  msgstr ""
478
 
479
+ #: wassup.php:2093
480
  msgid "Delete this record"
481
  msgstr ""
482
 
483
+ #: wassup.php:2095
484
  msgid "mark"
485
  msgstr ""
486
 
487
+ #: wassup.php:2095
488
  msgid "Mark IP"
489
  msgstr ""
490
 
491
+ #: wassup.php:2104 lib/admin.class.php:181 lib/main.php:437
492
+ #: lib/compat-lib/admin.class.php:178
493
+ msgid "Referrer"
494
  msgstr ""
495
 
496
+ #: wassup.php:2107 lib/main.php:421
497
+ msgid "Hostname"
498
  msgstr ""
499
 
500
+ #: wassup.php:2126
501
  msgid "SEARCH ENGINE"
502
  msgstr ""
503
 
504
+ #: wassup.php:2126
505
  msgid "page"
506
  msgstr ""
507
 
508
+ #: wassup.php:2127
509
  msgid "KEYWORDS"
510
  msgstr ""
511
 
512
+ #: wassup.php:2127 lib/main.php:1025
513
+ msgid "not provided"
514
  msgstr ""
515
 
516
+ #: wassup.php:2150
517
+ msgid "Probably SPAM!"
518
  msgstr ""
519
 
520
+ #: wassup.php:2152
521
+ msgid "Referer Spam"
522
  msgstr ""
523
 
524
+ #: wassup.php:2154 lib/main.php:472 lib/wassup.class.php:463
525
+ #: lib/wassup.class.php:518 lib/compat-lib/wassup.class.php:463
526
+ #: lib/compat-lib/wassup.class.php:518
527
+ msgid "Spam"
528
  msgstr ""
529
 
530
+ #: wassup.php:2156
531
+ msgid "Comment Spam"
532
  msgstr ""
533
 
534
+ #: wassup.php:2164
535
+ msgid "Probably hack/malware attempt!"
536
  msgstr ""
537
 
538
+ #: wassup.php:2169 lib/main.php:444
539
+ msgid "User Agent"
 
540
  msgstr ""
541
 
542
+ #: wassup.php:2176 lib/main.php:624 lib/settings.php:502
543
+ msgid "Language"
544
  msgstr ""
545
 
546
+ #: wassup.php:2181 lib/main.php:449
547
+ msgid "OS"
 
548
  msgstr ""
549
 
550
+ #: wassup.php:2182
551
  msgid "BROWSER"
552
  msgstr ""
553
 
554
+ #: wassup.php:2185
555
  msgid "RESOLUTION"
556
  msgstr ""
557
 
558
+ #: wassup.php:2251
559
  msgid "Graph of visitor hits"
560
  msgstr ""
561
 
562
+ #: wassup.php:2253
563
  msgid "Too few records to print chart"
564
  msgstr ""
565
 
566
+ #: wassup.php:2262
567
+ #, php-format
568
+ msgid "Invalid page request %s"
569
  msgstr ""
570
 
571
+ #: wassup.php:2294
572
+ msgid "Export ERROR: nonce failure!"
573
  msgstr ""
574
 
575
+ #: wassup.php:2297 lib/wassup.class.php:1759
576
+ #: lib/compat-lib/wassup.class.php:1756
577
+ msgid "Export ERROR: login required!"
578
  msgstr ""
579
 
580
+ #: wassup.php:2332
581
+ msgid "Export failed due to script interruption or timeout error!"
582
+ msgstr ""
583
+
584
+ #: wassup.php:2346
585
+ msgid "ERROR: Nothing to Export."
586
+ msgstr ""
587
+
588
+ #: wassup.php:2581 wassup.php:4610 lib/uadetector.class.php:71
589
+ #: lib/uadetector.class.php:151
590
+ msgid "Unknown Spider"
591
+ msgstr ""
592
+
593
+ #: wassup.php:2582
594
+ msgid "Unknown Browser"
595
+ msgstr ""
596
+
597
+ #: wassup.php:3098
598
+ msgid "Spoofer bot"
599
+ msgstr ""
600
+
601
+ #: wassup.php:3484
602
+ #, php-format
603
+ msgid "%s WassUp Plugin table has reached maximum size!"
604
  msgstr ""
605
 
606
+ #: wassup.php:3484
607
+ msgid "ALERT"
608
  msgstr ""
609
 
610
+ #: wassup.php:3485
611
  msgid "Hi"
612
  msgstr ""
613
 
614
+ #: wassup.php:3485
615
  msgid ""
616
  "you have received this email because your WassUp Database table at your "
617
  "Wordpress blog"
618
  msgstr ""
619
 
620
+ #: wassup.php:3485
621
+ msgid "has reached the maximum value set in the options menu"
622
  msgstr ""
623
 
624
+ #: wassup.php:3486
625
  msgid ""
626
  "This is only a reminder, please take the actions you want in the WassUp "
627
  "options menu"
628
  msgstr ""
629
 
630
+ #: wassup.php:3486
631
  msgid "This alert now will be removed and you will be able to set a new one"
632
  msgstr ""
633
 
634
+ #: wassup.php:3487
635
  msgid ""
636
  "Thank you for using WassUp plugin. Check if there is a new version available "
637
  "here:"
638
  msgstr ""
639
 
640
+ #: wassup.php:3487
641
  msgid "Have a nice day!"
642
  msgstr ""
643
 
644
+ #: wassup.php:3651 wassup.php:4088
645
+ msgid "encrypted search"
646
  msgstr ""
647
 
648
+ #: wassup.php:4598 wassup.php:4605
649
+ msgid "Feed Reader"
650
  msgstr ""
651
 
652
+ #: wassup.php:4606
653
+ msgid "feed reader"
 
654
  msgstr ""
655
 
656
+ #: wassup.php:5212
657
+ msgid "timestamp"
658
  msgstr ""
659
 
660
+ #: wassup.php:5213
661
+ msgid "If above timestamp is not current time, this page is cached"
662
  msgstr ""
663
 
664
+ #: wassup.php:5317
665
+ msgid "Visitors Online"
 
666
  msgstr ""
667
 
668
+ #: wassup.php:5332 widgets/widgets.php:141 widgets/widgets.php:351
669
+ #: widgets/widgets.php:569
670
+ msgid "No Data"
671
  msgstr ""
672
 
673
+ #: lib/action.php:90
674
+ msgid "login required!"
 
675
  msgstr ""
676
 
677
+ #: lib/action.php:134
678
+ msgid "An error occurred during delete"
 
679
  msgstr ""
680
 
681
+ #: lib/action.php:139
682
  #, php-format
683
+ msgid "%d records deleted!"
684
  msgstr ""
685
 
686
+ #: lib/action.php:145
687
+ msgid "Error: invalid id parameter:"
 
688
  msgstr ""
689
 
690
+ #: lib/action.php:148
691
+ msgid "Error: missing id parameter"
692
  msgstr ""
693
 
694
+ #: lib/action.php:166
695
+ msgid "ERROR: file not found"
 
696
  msgstr ""
697
 
698
+ #: lib/action.php:219
699
+ msgid "ERROR: bad date"
 
 
 
700
  msgstr ""
701
 
702
+ #: lib/action.php:270
703
+ msgid "ERROR: Missing or unknown parameters"
 
 
704
  msgstr ""
705
 
706
+ #: lib/action.php:279
707
+ msgid "ERROR: Nothing to do here"
708
  msgstr ""
709
 
710
+ #: lib/admin.class.php:76 lib/compat-lib/admin.class.php:73
711
+ msgid "Stats"
712
  msgstr ""
713
 
714
+ #: lib/admin.class.php:76 lib/compat-lib/admin.class.php:73
715
+ msgid "More"
 
716
  msgstr ""
717
 
718
+ #: lib/admin.class.php:78 lib/admin.class.php:115
719
+ #: lib/compat-lib/admin.class.php:75 lib/compat-lib/admin.class.php:112
720
+ msgid "visitor stats chart"
721
  msgstr ""
722
 
723
+ #: lib/admin.class.php:110 lib/compat-lib/admin.class.php:107
724
+ msgid "More Stats"
725
  msgstr ""
726
 
727
+ #: lib/admin.class.php:191 lib/compat-lib/admin.class.php:188
728
+ msgid "Registered users"
729
  msgstr ""
730
 
731
+ #: lib/admin.class.php:201 lib/compat-lib/admin.class.php:198
732
+ #: widgets/widget_functions.php:216
733
+ msgid "Visitor online"
734
  msgstr ""
735
 
736
+ #: lib/admin.class.php:206 lib/compat-lib/admin.class.php:203
737
+ msgid "No online data!"
738
  msgstr ""
739
 
740
+ #: lib/admin.class.php:210 lib/compat-lib/admin.class.php:207
741
+ #: widgets/widget_functions.php:120
742
+ msgid "powered by"
743
  msgstr ""
744
 
745
+ #: lib/admin.class.php:210 lib/compat-lib/admin.class.php:207
746
+ #: widgets/widget_functions.php:120
747
+ msgid "Real Time Visitors Tracking"
748
  msgstr ""
749
 
750
+ #: lib/akismet.class.php:118
751
+ msgid "The response could not be retrieved."
752
  msgstr ""
753
 
754
+ #: lib/akismet.class.php:126
755
+ msgid "Could not connect to akismet server."
756
  msgstr ""
757
 
758
+ #: lib/akismet.class.php:180
759
+ msgid "Your Akismet API key is not valid."
760
  msgstr ""
761
 
762
+ #: lib/akismet.class.php:192 lib/akismet.class.php:198
763
+ msgid "Timed out waiting for server response."
764
  msgstr ""
765
 
766
+ #: lib/main.php:46 lib/settings.php:274 lib/settings.php:328
767
+ #: lib/settings.php:920 lib/settings.php:921 lib/settings.php:937
768
+ #: lib/settings.php:997 lib/settings.php:1017
769
+ msgid "Next"
770
  msgstr ""
771
 
772
+ #: lib/main.php:48
773
+ msgid "Previous"
 
 
 
774
  msgstr ""
775
 
776
+ #: lib/main.php:105
777
+ #, php-format
778
+ msgid "You must specify the %s"
779
  msgstr ""
780
 
781
+ #: lib/main.php:105
782
+ msgid "number of pages"
783
  msgstr ""
784
 
785
+ #: lib/main.php:109
786
+ #, php-format
787
+ msgid "You must specify the %s to show per page"
788
  msgstr ""
789
 
790
+ #: lib/main.php:109
791
+ msgid "limit of items"
 
 
 
792
  msgstr ""
793
 
794
+ #: lib/main.php:158
795
+ msgid "Pages"
796
  msgstr ""
797
 
798
+ #: lib/main.php:392
799
+ msgid "Raw data"
800
  msgstr ""
801
 
802
+ #: lib/main.php:393
803
+ msgid "Visitor type"
804
  msgstr ""
805
 
806
+ #: lib/main.php:405 widgets/widget_functions.php:226
807
+ msgid "Logged-in user"
 
808
  msgstr ""
809
 
810
+ #: lib/main.php:407
811
+ msgid "Spammer/Hacker"
 
812
  msgstr ""
813
 
814
+ #: lib/main.php:409 lib/main.php:569
815
+ msgid "Spammer"
816
  msgstr ""
817
 
818
+ #: lib/main.php:411 lib/main.php:589 widgets/widget_functions.php:236
819
+ msgid "Comment author"
820
  msgstr ""
821
 
822
+ #: lib/main.php:413 lib/main.php:464 lib/main.php:466
823
+ msgid "Feed"
824
  msgstr ""
825
 
826
+ #: lib/main.php:415 lib/main.php:469 lib/main.php:576 lib/wassup.class.php:461
827
+ #: lib/wassup.class.php:517 lib/compat-lib/wassup.class.php:461
828
+ #: lib/compat-lib/wassup.class.php:517
829
+ msgid "Spider"
830
  msgstr ""
831
 
832
+ #: lib/main.php:417 lib/main.php:548 widgets/widget_functions.php:246
833
+ msgid "Regular visitor"
834
  msgstr ""
835
 
836
+ #: lib/main.php:420
837
+ msgid "IP"
838
  msgstr ""
839
 
840
+ #: lib/main.php:422
841
+ msgid "Url Requested"
842
+ msgstr ""
843
+
844
+ #: lib/main.php:429
845
+ msgid "Post/page ID"
846
+ msgstr ""
847
+
848
+ #: lib/main.php:433
849
+ msgid "none or deleted post"
850
+ msgstr ""
851
+
852
+ #: lib/main.php:435
853
+ msgid "Post/page Title"
854
+ msgstr ""
855
+
856
+ #: lib/main.php:440
857
+ msgid "Search Engine"
858
+ msgstr ""
859
+
860
+ #: lib/main.php:442
861
+ msgid "Page"
862
+ msgstr ""
863
+
864
+ #: lib/main.php:447
865
+ msgid "Browser"
866
+ msgstr ""
867
+
868
+ #: lib/main.php:450
869
+ msgid "Locale/Language"
870
+ msgstr ""
871
+
872
+ #: lib/main.php:451
873
+ msgid "Screen Resolution"
874
+ msgstr ""
875
+
876
+ #: lib/main.php:454
877
+ msgid "Username"
878
+ msgstr ""
879
+
880
+ #: lib/main.php:458
881
+ msgid "Comment Author"
882
+ msgstr ""
883
+
884
+ #: lib/main.php:473
885
+ msgid "comment spam"
886
+ msgstr ""
887
+
888
+ #: lib/main.php:474
889
+ msgid "referrer spam"
890
+ msgstr ""
891
+
892
+ #: lib/main.php:475
893
+ msgid "hack/malware attempt"
894
+ msgstr ""
895
+
896
+ #: lib/main.php:476
897
+ msgid "not spam"
898
+ msgstr ""
899
+
900
+ #: lib/main.php:480
901
+ msgid "End timestamp"
902
+ msgstr ""
903
+
904
+ #: lib/main.php:481
905
+ msgid "Timestamp"
906
+ msgstr ""
907
+
908
+ #: lib/main.php:493
909
+ #, php-format
910
+ msgid "%d URLs visited in session"
911
+ msgstr ""
912
+
913
+ #: lib/main.php:571
914
+ msgid "Spam/Malware"
915
+ msgstr ""
916
+
917
+ #: lib/main.php:575
918
+ msgid "Feedreader"
919
+ msgstr ""
920
+
921
+ #: lib/main.php:584 lib/main.php:633 lib/main.php:634
922
+ msgid "Logged user"
923
+ msgstr ""
924
+
925
+ #: lib/main.php:613 lib/main.php:614
926
+ msgid "Country"
927
+ msgstr ""
928
+
929
+ #: lib/main.php:637
930
+ msgid "Country:"
931
+ msgstr ""
932
+
933
+ #: lib/main.php:637
934
+ msgid "URL Request:"
935
+ msgstr ""
936
+
937
+ #: lib/main.php:679
938
+ msgid "No visitor activity"
939
+ msgstr ""
940
+
941
+ #: lib/main.php:707 lib/main.php:711 lib/main.php:713 lib/main.php:718
942
+ #: lib/main.php:722 lib/main.php:724
943
+ #, php-format
944
+ msgid "City: %s"
945
+ msgstr ""
946
+
947
+ #: lib/main.php:727
948
+ msgid "Country: unknown, City: unknown"
949
+ msgstr ""
950
+
951
+ #: lib/main.php:985
952
+ msgid "Print"
953
+ msgstr ""
954
+
955
+ #: lib/main.php:987
956
+ #, php-format
957
+ msgid "Top Stats for Period: %s"
958
  msgstr ""
959
 
960
+ #: lib/main.php:1017
961
  msgid "TOP QUERY"
962
  msgstr ""
963
 
964
+ #: lib/main.php:1048
965
+ msgid "TOP REFERRER"
966
+ msgstr ""
967
+
968
+ #: lib/main.php:1077
969
+ msgid "TOP REQUEST"
970
+ msgstr ""
971
+
972
+ #: lib/main.php:1108
973
+ msgid "TOP BROWSER"
974
+ msgstr ""
975
+
976
+ #: lib/main.php:1135
977
+ msgid "TOP OS"
978
+ msgstr ""
979
+
980
+ #: lib/main.php:1161
981
+ msgid "TOP LOCALE"
982
+ msgstr ""
983
+
984
+ #: lib/main.php:1189
985
+ msgid "TOP VISITOR"
986
+ msgstr ""
987
+
988
+ #: lib/main.php:1221
989
+ msgid "TOP ARTICLE"
990
+ msgstr ""
991
+
992
+ #: lib/main.php:1244
993
+ msgid "This report excludes spam and spider records"
994
+ msgstr ""
995
+
996
+ #: lib/main.php:1246
997
+ msgid "This report excludes spider records"
998
+ msgstr ""
999
+
1000
+ #: lib/main.php:1248
1001
+ msgid "This report excludes spam records"
1002
+ msgstr ""
1003
+
1004
+ #: lib/main.php:1680
1005
+ msgid "Last 1 Hour"
1006
+ msgstr ""
1007
+
1008
+ #: lib/main.php:1689
1009
+ msgid "Last 6 Hours"
1010
+ msgstr ""
1011
+
1012
+ #: lib/main.php:1698
1013
+ msgid "Last 12 Hours"
1014
+ msgstr ""
1015
+
1016
+ #: lib/main.php:1707
1017
+ msgid "Last 7 Days"
1018
+ msgstr ""
1019
+
1020
+ #: lib/main.php:1721
1021
+ msgid "Last 2 Weeks"
1022
+ msgstr ""
1023
+
1024
+ #: lib/main.php:1740
1025
+ msgid "Last Month"
1026
+ msgstr ""
1027
+
1028
+ #: lib/main.php:1754
1029
+ msgid "Last 3 Months"
1030
+ msgstr ""
1031
+
1032
+ #: lib/main.php:1768
1033
+ msgid "Last 6 Months"
1034
+ msgstr ""
1035
+
1036
+ #: lib/main.php:1776
1037
+ msgid "Last Year"
1038
+ msgstr ""
1039
+
1040
+ #: lib/main.php:1784 lib/main.php:1800
1041
+ msgid "All Time"
1042
+ msgstr ""
1043
+
1044
+ #: lib/main.php:1791
1045
+ msgid "Last 24 Hours"
1046
+ msgstr ""
1047
+
1048
+ #: lib/settings.php:44
1049
+ msgid ""
1050
+ "ATTENTION! Your WassUp table have reached the maximum value you set, I "
1051
+ "disabled the alert, you can re-enable it here."
1052
+ msgstr ""
1053
+
1054
+ #: lib/settings.php:65
1055
+ msgid "IMPORTANT"
1056
+ msgstr ""
1057
+
1058
+ #: lib/settings.php:65
1059
+ msgid "table empty or does not exist!"
1060
+ msgstr ""
1061
+
1062
+ #: lib/settings.php:67
1063
+ msgid "Visitors Online or Top Stats"
1064
+ msgstr ""
1065
+
1066
+ #: lib/settings.php:68
1067
+ msgid "Widgets menu"
1068
+ msgstr ""
1069
+
1070
+ #: lib/settings.php:70
1071
+ #, php-format
1072
+ msgid ""
1073
+ "You can add a sidebar Widget with some useful statistics information by "
1074
+ "activating the %s widget from the %s."
1075
+ msgstr ""
1076
+
1077
+ #: lib/settings.php:71
1078
+ msgid "Select the options you want for WassUp plugin"
1079
+ msgstr ""
1080
+
1081
+ #: lib/settings.php:109 lib/settings.php:945 lib/settings.php:951
1082
+ #: lib/settings.php:953 lib/settings.php:957 lib/settings.php:959
1083
+ #: lib/settings.php:960 lib/settings.php:963 lib/settings.php:964
1084
+ #: lib/settings.php:982 lib/settings.php:986
1085
+ msgid "General Setup"
1086
+ msgstr ""
1087
+
1088
+ #: lib/settings.php:110 lib/settings.php:955 lib/settings.php:978
1089
+ msgid "Filters & Exclusions"
1090
+ msgstr ""
1091
+
1092
+ #: lib/settings.php:111
1093
+ msgid "Manage Files & Data"
1094
+ msgstr ""
1095
+
1096
+ #: lib/settings.php:114 lib/settings.php:992 lib/settings.php:993
1097
+ msgid "Uninstall"
1098
+ msgstr ""
1099
+
1100
+ #: lib/settings.php:128
1101
+ msgid "Networkwide Settings"
1102
+ msgstr ""
1103
+
1104
+ #: lib/settings.php:129
1105
+ msgid "Multisite settings that applies to all subsites in the network."
1106
+ msgstr ""
1107
+
1108
+ #: lib/settings.php:131
1109
+ msgid "Network Statistics Recording"
1110
+ msgstr ""
1111
+
1112
+ #: lib/settings.php:132
1113
+ msgid ""
1114
+ "Enables Wassup visitor tracking on all subsites in network. Do NOT disable "
1115
+ "unless upgrading plugin."
1116
+ msgstr ""
1117
+
1118
+ #: lib/settings.php:133
1119
+ msgid "Enable Statistics Recording for network."
1120
+ msgstr ""
1121
+
1122
+ #: lib/settings.php:134
1123
+ msgid ""
1124
+ "Can be overridden on individual subsites to disable statistics recording."
1125
+ msgstr ""
1126
+
1127
+ #: lib/settings.php:136
1128
+ msgid "Network Subsites Options"
1129
+ msgstr ""
1130
+
1131
+ #: lib/settings.php:137
1132
+ msgid "Show Wassup's main admin menu to subsite administrators."
1133
+ msgstr ""
1134
+
1135
+ #: lib/settings.php:138
1136
+ msgid ""
1137
+ "Uncheck to disable Wassup main menu and Wassup-options submenu for all users "
1138
+ "except Network administrator (super-admin). Dashboard submenu \"Wassup-stats"
1139
+ "\" and dashboard widget display are unaffected."
1140
+ msgstr ""
1141
+
1142
+ #: lib/settings.php:141
1143
+ msgid "Site Settings"
1144
+ msgstr ""
1145
+
1146
+ #: lib/settings.php:142
1147
+ msgid "Main site settings/default settings for network subsites."
1148
+ msgstr ""
1149
+
1150
+ #: lib/settings.php:145
1151
+ msgid "Statistics Recording"
1152
+ msgstr ""
1153
+
1154
+ #: lib/settings.php:146
1155
+ msgid ""
1156
+ "By default, Wassup collects, analyzes, and stores new visitor hits and "
1157
+ "checks each record for spam and malware activity."
1158
+ msgstr ""
1159
+
1160
+ #: lib/settings.php:147
1161
+ msgid "Enable statistics recording"
1162
+ msgstr ""
1163
+
1164
+ #: lib/settings.php:149
1165
+ msgid "Do NOT disable unless upgrading or troubleshooting plugin problems."
1166
+ msgstr ""
1167
+
1168
+ #: lib/settings.php:150
1169
+ msgid "Do NOT disable unless troubleshooting plugin problems."
1170
+ msgstr ""
1171
+
1172
+ #: lib/settings.php:153
1173
+ msgid "Enable spam and malware detection on records"
1174
+ msgstr ""
1175
+
1176
+ #: lib/settings.php:154
1177
+ msgid "For identification only. Does NOT stop attacks nor protect your site."
1178
+ msgstr ""
1179
+
1180
+ #: lib/settings.php:156
1181
+ msgid "User Permissions"
1182
+ msgstr ""
1183
+
1184
+ #: lib/settings.php:157
1185
+ msgid ""
1186
+ "Grants readonly access to Wassup-stats dashboard submenu and to the "
1187
+ "dashboard widget for users with the selected role or higher. Only "
1188
+ "administrators have access to Wassup main menu and Wassup Options panel to "
1189
+ "edit settings and delete data."
1190
+ msgstr ""
1191
+
1192
+ #: lib/settings.php:158
1193
+ msgid "Set minimum user level that can view WassUp stats"
1194
+ msgstr ""
1195
+
1196
+ #: lib/settings.php:162
1197
+ msgid "default administrator"
1198
+ msgstr ""
1199
+
1200
+ #: lib/settings.php:164
1201
+ msgid "Screen resolution"
1202
+ msgstr ""
1203
+
1204
+ #: lib/settings.php:165
1205
+ msgid ""
1206
+ "Adjusts chart size and resets the max-width/truncation point of long texts."
1207
+ msgstr ""
1208
+
1209
+ #: lib/settings.php:166
1210
+ msgid "Your default screen resolution (in pixels)"
1211
+ msgstr ""
1212
+
1213
+ #: lib/settings.php:171
1214
+ msgid "Dashboard Widget"
1215
+ msgstr ""
1216
+
1217
+ #: lib/settings.php:172
1218
+ msgid "Enable widget/small chart in admin dashboard"
1219
+ msgstr ""
1220
+
1221
+ #: lib/settings.php:174
1222
+ msgid "Spy Visitors Settings"
1223
+ msgstr ""
1224
+
1225
+ #: lib/settings.php:177 lib/wassup.class.php:661
1226
+ #: lib/compat-lib/wassup.class.php:661
1227
+ msgid "not required"
1228
+ msgstr ""
1229
+
1230
+ #: lib/settings.php:190
1231
+ msgid "Display a GEO IP Map in the spy visitors view"
1232
+ msgstr ""
1233
+
1234
+ #: lib/settings.php:192
1235
+ msgid "key"
1236
+ msgstr ""
1237
+
1238
+ #: lib/settings.php:192
1239
+ msgid "signup for your key"
1240
+ msgstr ""
1241
+
1242
+ #: lib/settings.php:193
1243
+ msgid "For usage exceeding 25000 daily map views per domain."
1244
+ msgstr ""
1245
+
1246
+ #: lib/settings.php:198
1247
+ msgid "Visitor Detail Settings"
1248
+ msgstr ""
1249
+
1250
+ #: lib/settings.php:199
1251
+ msgid "Show visitor details from the last"
1252
+ msgstr ""
1253
+
1254
+ #: lib/settings.php:204
1255
+ msgid "Time format 12/24 Hour"
1256
+ msgstr ""
1257
+
1258
+ #: lib/settings.php:208
1259
+ msgid "Filter visitor details for"
1260
+ msgstr ""
1261
+
1262
+ #: lib/settings.php:213
1263
+ msgid "Display line chart in detail view"
1264
+ msgstr ""
1265
+
1266
+ #: lib/settings.php:214
1267
+ msgid "Line chart type - how many axes?"
1268
+ msgstr ""
1269
+
1270
+ #: lib/settings.php:215
1271
+ msgid "Set how many minutes wait for automatic page refresh"
1272
+ msgstr ""
1273
+
1274
+ #: lib/settings.php:216 lib/settings.php:873 widgets/widgets.php:475
1275
+ msgid "minutes"
1276
+ msgstr ""
1277
+
1278
+ #: lib/settings.php:217
1279
+ msgid "default 3, 0=no refresh"
1280
+ msgstr ""
1281
+
1282
+ #: lib/settings.php:219
1283
+ msgid "Number of items per page"
1284
+ msgstr ""
1285
+
1286
+ #: lib/settings.php:224
1287
+ msgid "Top Stats Lists"
1288
+ msgstr ""
1289
+
1290
+ #: lib/settings.php:225
1291
+ msgid "Customize Top stats by selected criteria below."
1292
+ msgstr ""
1293
+
1294
+ #: lib/settings.php:225
1295
+ msgid ""
1296
+ "Stats are in descending order from highest count and known spam and malware "
1297
+ "attempts are excluded from counts."
1298
+ msgstr ""
1299
+
1300
+ #: lib/settings.php:232
1301
+ msgid "Length size limit of top lists"
1302
+ msgstr ""
1303
+
1304
+ #: lib/settings.php:234
1305
+ msgid "default 10"
1306
+ msgstr ""
1307
+
1308
+ #: lib/settings.php:236
1309
+ msgid "Choose one or more items to list in Top Stats"
1310
+ msgstr ""
1311
+
1312
+ #: lib/settings.php:236
1313
+ msgid "over 5 selections may cause horizontal scrolling"
1314
+ msgstr ""
1315
+
1316
+ #: lib/settings.php:239
1317
+ msgid "Top Searches"
1318
+ msgstr ""
1319
+
1320
+ #: lib/settings.php:240
1321
+ msgid "Top Referrers"
1322
+ msgstr ""
1323
+
1324
+ #: lib/settings.php:241
1325
+ msgid "Top Articles"
1326
+ msgstr ""
1327
+
1328
+ #: lib/settings.php:244
1329
+ msgid "Top Requests"
1330
+ msgstr ""
1331
+
1332
+ #: lib/settings.php:245
1333
+ msgid "Top Browsers"
1334
+ msgstr ""
1335
+
1336
+ #: lib/settings.php:246
1337
+ msgid "Top OS"
1338
+ msgstr ""
1339
+
1340
+ #: lib/settings.php:249
1341
+ msgid "Top Locales"
1342
+ msgstr ""
1343
+
1344
+ #: lib/settings.php:250
1345
+ msgid "Top Visitors"
1346
+ msgstr ""
1347
+
1348
+ #: lib/settings.php:255
1349
+ msgid "Exclude the following website domains from Top Referrers"
1350
+ msgstr ""
1351
+
1352
+ #: lib/settings.php:255 lib/settings.php:263
1353
+ msgid "applies to top stats view and widgets"
1354
+ msgstr ""
1355
+
1356
+ #: lib/settings.php:258
1357
+ msgid "comma separated value"
1358
+ msgstr ""
1359
+
1360
+ #: lib/settings.php:258
1361
+ msgid "List whole domains only. Wildcards and partial domains will be ignored."
1362
+ msgstr ""
1363
+
1364
+ #: lib/settings.php:259
1365
+ msgid "Don't list your website domain defined in WordPress"
1366
+ msgstr ""
1367
+
1368
+ #: lib/settings.php:263
1369
+ msgid "Exclude site front page from Top Articles"
1370
+ msgstr ""
1371
+
1372
+ #: lib/settings.php:270
1373
+ msgid "Exclude all spider records from Top Stats"
1374
+ msgstr ""
1375
+
1376
+ #: lib/settings.php:273 lib/settings.php:327 lib/settings.php:469
1377
+ #: lib/settings.php:936
1378
+ msgid "Reset"
1379
+ msgstr ""
1380
+
1381
+ #: lib/settings.php:273 lib/settings.php:327 lib/settings.php:469
1382
+ #: lib/settings.php:936
1383
+ msgid "Reset to Default"
1384
+ msgstr ""
1385
+
1386
+ #: lib/settings.php:278
1387
+ msgid "Recording Filters and Exclusions"
1388
+ msgstr ""
1389
+
1390
+ #: lib/settings.php:279
1391
+ msgid ""
1392
+ "Use the filter checkboxes and exclusion input fields below to customize "
1393
+ "Wassup's statistics recording so that only the data that you need for your "
1394
+ "site analyses are stored."
1395
+ msgstr ""
1396
+
1397
+ #: lib/settings.php:281
1398
+ msgid "Visitor Type Filters:"
1399
+ msgstr ""
1400
+
1401
+ #: lib/settings.php:282
1402
+ msgid "Checkbox to enable recording by type of \"visitor\""
1403
+ msgstr ""
1404
+
1405
+ #: lib/settings.php:284
1406
+ msgid "Record regular visitors"
1407
+ msgstr ""
1408
+
1409
+ #: lib/settings.php:285
1410
+ msgid "Record logged in users"
1411
+ msgstr ""
1412
+
1413
+ #: lib/settings.php:286
1414
+ msgid "Record logged in administrators"
1415
+ msgstr ""
1416
+
1417
+ #: lib/settings.php:287
1418
+ msgid "Record spiders and bots"
1419
+ msgstr ""
1420
+
1421
+ #: lib/settings.php:290
1422
+ msgid "Spam and Malware Filters:"
1423
+ msgstr ""
1424
+
1425
+ #: lib/settings.php:291
1426
+ msgid "Checkbox to enable recording of each type of \"spam\""
1427
+ msgstr ""
1428
+
1429
+ #: lib/settings.php:293
1430
+ msgid "check if an IP has previous comments as spam"
1431
+ msgstr ""
1432
+
1433
+ #: lib/settings.php:299
1434
+ msgid "Recording Exceptions"
1435
+ msgstr ""
1436
+
1437
+ #: lib/settings.php:300
1438
+ msgid ""
1439
+ "You can exclude a single visitor (by IP, hostname or username) or you can "
1440
+ "exclude a specific URL request from being stored in WassUp records."
1441
+ msgstr ""
1442
+
1443
+ #: lib/settings.php:301
1444
+ msgid ""
1445
+ "Note that recording exceptions lower overall statistics counts and excessive "
1446
+ "exclusions can affect page load speed on slow host servers."
1447
+ msgstr ""
1448
+
1449
+ #: lib/settings.php:303
1450
+ msgid "Exclude by IP"
1451
+ msgstr ""
1452
+
1453
+ #: lib/settings.php:304
1454
+ msgid "Enter source IPs to omit from recording"
1455
+ msgstr ""
1456
+
1457
+ #: lib/settings.php:307
1458
+ msgid "comma separated value (ex: 127.0.0.1, 10.0.0.1, etc...)."
1459
+ msgstr ""
1460
+
1461
+ #: lib/settings.php:307
1462
+ msgid ""
1463
+ "A single wildcard (*) can be placed after the last '.' or '::' position for "
1464
+ "range exclusions (ex: 10.10.100.*, 192.168.*)."
1465
+ msgstr ""
1466
+
1467
+ #: lib/settings.php:309
1468
+ msgid "Exclude by Hostname"
1469
+ msgstr ""
1470
+
1471
+ #: lib/settings.php:310
1472
+ msgid "Enter source hostnames to omit from recording"
1473
+ msgstr ""
1474
+
1475
+ #: lib/settings.php:313
1476
+ msgid "comma separated value (ex: host1.domain.com, host2.domain.net, etc...)."
1477
+ msgstr ""
1478
+
1479
+ #: lib/settings.php:313
1480
+ msgid ""
1481
+ "A single wildcard (*) can be placed before the first '.' for domain network "
1482
+ "exclusions (ex: *.spamdomain.com, *.hackers.malware.net)."
1483
+ msgstr ""
1484
+
1485
+ #: lib/settings.php:315
1486
+ msgid "Exclude by Username"
1487
+ msgstr ""
1488
+
1489
+ #: lib/settings.php:316
1490
+ msgid "Enter usernames to omit from recording"
1491
+ msgstr ""
1492
+
1493
+ #: lib/settings.php:319
1494
+ msgid ""
1495
+ "comma separated value, enter a registered user's login name (ex: bobmarley, "
1496
+ "enyabrennan, etc.)"
1497
+ msgstr ""
1498
+
1499
+ #: lib/settings.php:321
1500
+ msgid "Exclude by URL request"
1501
+ msgstr ""
1502
+
1503
+ #: lib/settings.php:322
1504
+ msgid "Enter URLs of page/post/feed to omit from recording"
1505
+ msgstr ""
1506
+
1507
+ #: lib/settings.php:325
1508
+ msgid ""
1509
+ "comma separated value, don't enter entire url, only the last path or some "
1510
+ "word to exclude (ex: /category/wordpress, 2007, etc...)"
1511
+ msgstr ""
1512
+
1513
+ #: lib/settings.php:328 lib/settings.php:920 lib/settings.php:921
1514
+ #: lib/settings.php:937 lib/settings.php:997 lib/settings.php:1017
1515
+ msgid "Prev"
1516
+ msgstr ""
1517
+
1518
+ #: lib/settings.php:332
1519
+ msgid "Table Management Options"
1520
+ msgstr ""
1521
+
1522
+ #: lib/settings.php:339
1523
+ msgid "Select actions for table growth"
1524
+ msgstr ""
1525
+
1526
+ #: lib/settings.php:340
1527
+ msgid ""
1528
+ "WassUp table grows very fast, especially if your site is frequently visited. "
1529
+ "I recommend you delete old records sometimes."
1530
+ msgstr ""
1531
+
1532
+ #: lib/settings.php:341
1533
+ msgid ""
1534
+ "You can delete all Wassup records now (Empty Table), you can set an "
1535
+ "automatic delete option to delete selected old records daily, and you can "
1536
+ "manually delete selected old records once (Delete NOW)."
1537
+ msgstr ""
1538
+
1539
+ #: lib/settings.php:342
1540
+ msgid "If you haven't database space problems, you can leave the table as is."
1541
+ msgstr ""
1542
+
1543
+ #: lib/settings.php:343
1544
+ msgid "Current WassUp table usage is"
1545
+ msgstr ""
1546
+
1547
+ #: lib/settings.php:346
1548
+ msgid "records"
1549
+ msgstr ""
1550
+
1551
+ #: lib/settings.php:349
1552
+ msgid "Alert me"
1553
+ msgstr ""
1554
+
1555
+ #: lib/settings.php:349
1556
+ msgid "email to"
1557
+ msgstr ""
1558
+
1559
+ #: lib/settings.php:349
1560
+ msgid "when table reaches"
1561
+ msgstr ""
1562
+
1563
+ #: lib/settings.php:352
1564
+ msgid "Delete old records"
1565
+ msgstr ""
1566
+
1567
+ #: lib/settings.php:355
1568
+ #, php-format
1569
+ msgid ""
1570
+ "Before deleting, you can save Wassup data in SQL 'export' format onto your "
1571
+ "local computer by clicking %s below."
1572
+ msgstr ""
1573
+
1574
+ #: lib/settings.php:355
1575
+ msgid "export table"
1576
+ msgstr ""
1577
+
1578
+ #: lib/settings.php:356
1579
+ msgid "Reload this screen after export to view export messages."
1580
+ msgstr ""
1581
+
1582
+ #: lib/settings.php:357
1583
+ msgid "Automatically delete"
1584
+ msgstr ""
1585
+
1586
+ #: lib/settings.php:359 lib/settings.php:364
1587
+ msgid "records older than"
1588
+ msgstr ""
1589
+
1590
+ #: lib/settings.php:360
1591
+ msgid "daily"
1592
+ msgstr ""
1593
+
1594
+ #: lib/settings.php:362
1595
+ msgid "Manually delete"
1596
+ msgstr ""
1597
+
1598
+ #: lib/settings.php:365
1599
+ msgid "once"
1600
+ msgstr ""
1601
+
1602
+ #: lib/settings.php:371
1603
+ msgid "Delete all records up to record ID#"
1604
+ msgstr ""
1605
+
1606
+ #: lib/settings.php:372
1607
+ msgid "Last exported record ID#:"
1608
+ msgstr ""
1609
+
1610
+ #: lib/settings.php:374
1611
+ msgid "Empty table"
1612
+ msgstr ""
1613
+
1614
+ #: lib/settings.php:375
1615
+ msgid "export table in SQL format"
1616
+ msgstr ""
1617
+
1618
+ #: lib/settings.php:378
1619
+ msgid "Delete NOW"
1620
+ msgstr ""
1621
+
1622
+ #: lib/settings.php:378
1623
+ msgid "Action is NOT undoable!"
1624
+ msgstr ""
1625
+
1626
+ #: lib/settings.php:381
1627
+ msgid "Table Optimization"
1628
+ msgstr ""
1629
+
1630
+ #: lib/settings.php:386
1631
+ msgid ""
1632
+ "By default, WassUp tables are automatically optimized weekly and after each "
1633
+ "bulk deletion. This helps keep WassUp running fast, but it can sometimes "
1634
+ "cause slowdowns especially when there is a corrupt record in the table."
1635
+ msgstr ""
1636
+
1637
+ #: lib/settings.php:387
1638
+ msgid "You can cancel automatic optimization by unchecking the box below."
1639
+ msgstr ""
1640
+
1641
+ #: lib/settings.php:394
1642
+ msgid "Your table engine does NOT support the \"optimize\" command."
1643
+ msgstr ""
1644
+
1645
+ #: lib/settings.php:401
1646
+ msgid "Enable automatic table optimization"
1647
+ msgstr ""
1648
+
1649
+ #: lib/settings.php:409
1650
+ msgid "is overdue"
1651
+ msgstr ""
1652
+
1653
+ #: lib/settings.php:411
1654
+ msgid "today"
1655
+ msgstr ""
1656
+
1657
+ #: lib/settings.php:414
1658
+ #, php-format
1659
+ msgid "%d days"
1660
+ msgstr ""
1661
+
1662
+ #: lib/settings.php:415
1663
+ msgid "1 week"
1664
+ msgstr ""
1665
+
1666
+ #: lib/settings.php:421
1667
+ #, php-format
1668
+ msgid "Next scheduled optimization is: %s (approximately)"
1669
+ msgstr ""
1670
+
1671
+ #: lib/settings.php:423
1672
+ #, php-format
1673
+ msgid "Next scheduled optimization is: %s"
1674
+ msgstr ""
1675
+
1676
+ #: lib/settings.php:423
1677
+ msgid "never"
1678
+ msgstr ""
1679
+
1680
+ #: lib/settings.php:427
1681
+ msgid "Data Storage Methods"
1682
+ msgstr ""
1683
+
1684
+ #: lib/settings.php:442 lib/settings.php:866 lib/settings.php:884
1685
+ #: lib/settings.php:886
1686
+ msgid "Delayed Insert"
1687
+ msgstr ""
1688
+
1689
+ #: lib/settings.php:444
1690
+ msgid ""
1691
+ "When possible, WassUp uses the \"Delayed insert\" method of saving records "
1692
+ "in MySQL to store new visitor records. This method helps keep Wassup running "
1693
+ "fast on high-volume sites and during volume spikes on all sites. However, it "
1694
+ "can be inefficient on low-volume sites and sometimes host administrators "
1695
+ "disable it on shared servers."
1696
+ msgstr ""
1697
+
1698
+ #: lib/settings.php:445
1699
+ msgid "You can turn off \"delayed insert\" by unchecking the box below."
1700
+ msgstr ""
1701
+
1702
+ #: lib/settings.php:449
1703
+ msgid "This method is unavailable for your storage engine type."
1704
+ msgstr ""
1705
+
1706
+ #: lib/settings.php:459
1707
+ msgid "This method is disabled on your host server."
1708
+ msgstr ""
1709
+
1710
+ #: lib/settings.php:466
1711
+ msgid "Store new visitor records with \"delayed insert\""
1712
+ msgstr ""
1713
+
1714
+ #: lib/settings.php:473
1715
+ msgid "Server Settings and Memory Resources"
1716
+ msgstr ""
1717
+
1718
+ #: lib/settings.php:474
1719
+ #, php-format
1720
+ msgid ""
1721
+ "For information only. Some values may be adjustable in startup files: %s"
1722
+ msgstr ""
1723
+
1724
+ #: lib/settings.php:474
1725
+ msgid "\"wp_config.php\", \"php.ini\" and \"my.ini\""
1726
+ msgstr ""
1727
+
1728
+ #: lib/settings.php:475 lib/settings.php:486 lib/settings.php:596
1729
+ #: lib/settings.php:768
1730
+ msgid "Version"
1731
+ msgstr ""
1732
+
1733
+ #: lib/settings.php:477
1734
+ msgid "Table name"
1735
+ msgstr ""
1736
+
1737
+ #: lib/settings.php:478
1738
+ msgid "Table Charset/collation"
1739
+ msgstr ""
1740
+
1741
+ #: lib/settings.php:482
1742
+ msgid "Table engine"
1743
+ msgstr ""
1744
+
1745
+ #: lib/settings.php:484
1746
+ msgid "Upgrade date"
1747
+ msgstr ""
1748
+
1749
+ #: lib/settings.php:492
1750
+ msgid "Multisite network"
1751
+ msgstr ""
1752
+
1753
+ #: lib/settings.php:495 lib/settings.php:508 lib/settings.php:604
1754
+ #: lib/settings.php:613 lib/settings.php:617
1755
+ msgid "on"
1756
+ msgstr ""
1757
+
1758
+ #: lib/settings.php:497 lib/settings.php:605 lib/settings.php:611
1759
+ #: lib/settings.php:618
1760
+ msgid "off"
1761
+ msgstr ""
1762
+
1763
+ #: lib/settings.php:501
1764
+ msgid "Character set"
1765
+ msgstr ""
1766
+
1767
+ #: lib/settings.php:505 lib/settings.php:664
1768
+ msgid "not set"
1769
+ msgstr ""
1770
+
1771
+ #: lib/settings.php:513 lib/settings.php:635
1772
+ msgid "Memory Allocation"
1773
+ msgstr ""
1774
+
1775
+ #: lib/settings.php:541 lib/settings.php:680 lib/settings.php:897
1776
+ msgid "Timezone"
1777
+ msgstr ""
1778
+
1779
+ #: lib/settings.php:542 lib/settings.php:683
1780
+ msgid "Time Offset"
1781
+ msgstr ""
1782
+
1783
+ #: lib/settings.php:554 lib/settings.php:686 lib/settings.php:688
1784
+ msgid "hours"
1785
+ msgstr ""
1786
+
1787
+ #: lib/settings.php:555
1788
+ msgid "Host Timezone"
1789
+ msgstr ""
1790
+
1791
+ #: lib/settings.php:566
1792
+ msgid "Host Server"
1793
+ msgstr ""
1794
+
1795
+ #: lib/settings.php:584
1796
+ msgid "Browser Client"
1797
+ msgstr ""
1798
+
1799
+ #: lib/settings.php:602
1800
+ msgid "Safe Mode"
1801
+ msgstr ""
1802
+
1803
+ #: lib/settings.php:608
1804
+ msgid "File Open Restrictions"
1805
+ msgstr ""
1806
+
1807
+ #: lib/settings.php:615
1808
+ msgid "URL File Open"
1809
+ msgstr ""
1810
+
1811
+ #: lib/settings.php:620
1812
+ msgid "Disabled functions"
1813
+ msgstr ""
1814
+
1815
+ #: lib/settings.php:632
1816
+ msgid "none"
1817
+ msgstr ""
1818
+
1819
+ #: lib/settings.php:650
1820
+ msgid "Memory Usage"
1821
+ msgstr ""
1822
+
1823
+ #: lib/settings.php:657
1824
+ msgid "Script Timeout Limit"
1825
+ msgstr ""
1826
+
1827
+ #: lib/settings.php:659 lib/settings.php:875 lib/settings.php:892
1828
+ msgid "seconds"
1829
+ msgstr ""
1830
+
1831
+ #: lib/settings.php:662
1832
+ msgid "Browser Capabilities File"
1833
+ msgstr ""
1834
+
1835
+ #: lib/settings.php:668
1836
+ msgid "not installed"
1837
+ msgstr ""
1838
+
1839
+ #: lib/settings.php:669
1840
+ msgid "installed"
1841
+ msgstr ""
1842
+
1843
+ #: lib/settings.php:691
1844
+ msgid "as modified in Wordpress"
1845
+ msgstr ""
1846
+
1847
+ #: lib/settings.php:770
1848
+ msgid "Storage Engine"
1849
+ msgstr ""
1850
+
1851
+ #: lib/settings.php:779
1852
+ msgid "Charset/collation"
1853
+ msgstr ""
1854
+
1855
+ #: lib/settings.php:788
1856
+ msgid "Max User Connections"
1857
+ msgstr ""
1858
+
1859
+ #: lib/settings.php:792
1860
+ msgid "possibly too small"
1861
+ msgstr ""
1862
+
1863
+ #: lib/settings.php:795
1864
+ msgid "unlimited/up to server maximum"
1865
+ msgstr ""
1866
+
1867
+ #: lib/settings.php:800
1868
+ msgid "Query Cache Allocation"
1869
+ msgstr ""
1870
+
1871
+ #: lib/settings.php:806
1872
+ msgid "possibly too big, reduces available RAM."
1873
+ msgstr ""
1874
+
1875
+ #: lib/settings.php:813
1876
+ msgid "on demand"
1877
+ msgstr ""
1878
+
1879
+ #: lib/settings.php:815
1880
+ msgid "Cached Query Limit"
1881
+ msgstr ""
1882
+
1883
+ #: lib/settings.php:818 lib/settings.php:821 lib/settings.php:831
1884
+ #: lib/settings.php:841 lib/settings.php:849 lib/settings.php:858
1885
+ #: lib/settings.php:866 lib/settings.php:886
1886
+ msgid "disabled"
1887
+ msgstr ""
1888
+
1889
+ #: lib/settings.php:823
1890
+ msgid "Index Buffer"
1891
+ msgstr ""
1892
+
1893
+ #: lib/settings.php:853
1894
+ msgid "Read Buffer"
1895
+ msgstr ""
1896
+
1897
+ #: lib/settings.php:868 lib/settings.php:880 lib/settings.php:888
1898
+ msgid "Delayed Insert Queue"
1899
+ msgstr ""
1900
+
1901
+ #: lib/settings.php:869
1902
+ msgid "rows"
1903
+ msgstr ""
1904
+
1905
+ #: lib/settings.php:871
1906
+ msgid "Delayed Handler Timeout"
1907
+ msgstr ""
1908
+
1909
+ #: lib/settings.php:884
1910
+ msgid "not supported"
1911
+ msgstr ""
1912
+
1913
+ #: lib/settings.php:890
1914
+ msgid "Wait Timeout"
1915
+ msgstr ""
1916
+
1917
+ #: lib/settings.php:915
1918
+ msgid "may be different from PHP offset"
1919
+ msgstr ""
1920
+
1921
+ #: lib/settings.php:926
1922
+ msgid "Want to uninstall WassUp?"
1923
+ msgstr ""
1924
+
1925
+ #: lib/settings.php:927
1926
+ msgid ""
1927
+ "No problem. Before you deactivate this plugin, check the box below to "
1928
+ "cleanup any data that was collected by WassUp that could be left behind."
1929
+ msgstr ""
1930
+
1931
+ #: lib/settings.php:928
1932
+ msgid "Permanently remove WassUp data and settings."
1933
+ msgstr ""
1934
+
1935
+ #: lib/settings.php:930
1936
+ msgid "WARNING"
1937
+ msgstr ""
1938
+
1939
+ #: lib/settings.php:930
1940
+ msgid ""
1941
+ "All WassUp data and settings will be DELETED upon deactivation of this "
1942
+ "plugin."
1943
+ msgstr ""
1944
+
1945
+ #: lib/settings.php:932
1946
+ #, php-format
1947
+ msgid ""
1948
+ "This action cannot be undone. Before uninstalling WassUp, you should backup "
1949
+ "your Wordpress database first. WassUp data is stored in the table %s."
1950
+ msgstr ""
1951
+
1952
+ #: lib/settings.php:934
1953
+ #, php-format
1954
+ msgid "To help improve this plugin, we would appreciate your feedback at %s."
1955
+ msgstr ""
1956
+
1957
+ #: lib/settings.php:942
1958
+ msgid "Frequently Asked Questions"
1959
+ msgstr ""
1960
+
1961
+ #: lib/settings.php:944
1962
+ msgid "How do I add WassUp's chart to my admin dashboard?"
1963
+ msgstr ""
1964
+
1965
+ #: lib/settings.php:945
1966
+ #, php-format
1967
+ msgid ""
1968
+ "Check the box for \"Enable widget/small chart in admin dashboard\" under %s "
1969
+ "tab."
1970
+ msgstr ""
1971
+
1972
+ #: lib/settings.php:946
1973
+ msgid "How do I display WassUp widgets on my site?"
1974
+ msgstr ""
1975
+
1976
+ #: lib/settings.php:947
1977
+ msgid ""
1978
+ "From Wordpress widgets panel, drag the \"WassUp Online\" widget or the "
1979
+ "\"Wassup Top Stats\" widget from the list of available widgets on the left "
1980
+ "into your theme's \"Sidebar\" or \"Footer\" area on the right or use the "
1981
+ "Customizer to add Wassup widgets interactively."
1982
+ msgstr ""
1983
+
1984
+ #: lib/settings.php:948
1985
+ msgid ""
1986
+ "My Wordpress theme is not widget ready. Is it possible to display WassUp "
1987
+ "widgets on my site?"
1988
+ msgstr ""
1989
+
1990
+ #: lib/settings.php:949
1991
+ msgid ""
1992
+ "Yes. Insert the template tag \"wassup_sidebar()\" into your theme's "
1993
+ "\"sidebar.php\" file to display Wassup widgets as a single combined widget "
1994
+ "on your site."
1995
+ msgstr ""
1996
+
1997
+ #: lib/settings.php:950
1998
+ msgid "How do I view the real-time visitor geolocation map in WassUp?"
1999
+ msgstr ""
2000
+
2001
+ #: lib/settings.php:951
2002
+ #, php-format
2003
+ msgid ""
2004
+ "Check the box for \"Display a GEO IP Map in spy visitors view\" in %s tab "
2005
+ "and save, then navigate to %s panel to see the map."
2006
+ msgstr ""
2007
+
2008
+ #: lib/settings.php:952
2009
+ msgid ""
2010
+ "The map has vanished and I get the message: \"Google has disabled use of the "
2011
+ "Maps API for this application\". How do I fix this?"
2012
+ msgstr ""
2013
+
2014
+ #: lib/settings.php:953
2015
+ #, php-format
2016
+ msgid ""
2017
+ "Erase the contents of \"Google Maps API Key\" field under %s tab. Since "
2018
+ "WassUp 1.8.4, an API key is not required for viewing Google!Maps API v3 maps "
2019
+ "in WassUp."
2020
+ msgstr ""
2021
+
2022
+ #: lib/settings.php:954
2023
+ msgid "How do I exclude a visitor from being recorded?"
2024
+ msgstr ""
2025
+
2026
+ #: lib/settings.php:955
2027
+ #, php-format
2028
+ msgid ""
2029
+ "Navigate to %s tab and enter a visitor's username, IP address, or hostname "
2030
+ "into the appropriate text area for that \"Recording Exclusion\" type."
2031
+ msgstr ""
2032
+
2033
+ #: lib/settings.php:956
2034
+ msgid ""
2035
+ "How do I stop (temporarily) WassUp from recording new visits on my site?"
2036
+ msgstr ""
2037
+
2038
+ #: lib/settings.php:957
2039
+ #, php-format
2040
+ msgid "Uncheck the box for \"Enable statistics recording\" under %s tab."
2041
+ msgstr ""
2042
+
2043
+ #: lib/settings.php:958
2044
+ msgid ""
2045
+ "In Wordpress multisite, how do I stop (temporarily) WassUp from recording "
2046
+ "new visits on all sites in the network?"
2047
+ msgstr ""
2048
+
2049
+ #: lib/settings.php:959
2050
+ #, php-format
2051
+ msgid ""
2052
+ "If plugin is \"network activated\", login as network admin, go to the "
2053
+ "Network admin dashboard, navigate to %s tab and Uncheck the box for \"Enable "
2054
+ "Statistics Recording for network\" and save."
2055
+ msgstr ""
2056
+
2057
+ #: lib/settings.php:960
2058
+ #, php-format
2059
+ msgid ""
2060
+ "If plugin is NOT \"network activated\", login as network admin, go to the "
2061
+ "main site/parent domain admin dashboard, navigate to %s tab, then Uncheck "
2062
+ "the box for \"Enable Statistics Recording for network\" and save."
2063
  msgstr ""
2064
 
2065
+ #: lib/settings.php:962
2066
+ msgid ""
2067
+ "No data is being displayed; or \"Visitor Details\" panel show 0 records for "
2068
+ "the last 24 hours. How do I fix this?"
2069
  msgstr ""
2070
 
2071
+ #: lib/settings.php:963
2072
+ #, php-format
2073
+ msgid ""
2074
+ "Check the box for \"Enable statistics recording\" setting under %s tab and "
2075
+ "save."
2076
  msgstr ""
2077
 
2078
+ #: lib/settings.php:964
2079
+ #, php-format
2080
+ msgid "Click the [Reset to Default] button under %s tab."
2081
  msgstr ""
2082
 
2083
+ #: lib/settings.php:965
2084
+ #, php-format
2085
+ msgid ""
2086
+ "Navigate to %s tab and uncheck the \"MySQL Delayed Insert\" setting and save."
2087
  msgstr ""
2088
 
2089
+ #: lib/settings.php:965 lib/settings.php:970 lib/settings.php:976
2090
+ msgid "Manage File & Data"
2091
  msgstr ""
2092
 
2093
+ #: lib/settings.php:966
2094
+ msgid "Deactivate and Re-activate Wassup from Wordpress Plugins panel."
2095
  msgstr ""
2096
 
2097
+ #: lib/settings.php:967
2098
+ #, php-format
2099
+ msgid ""
2100
+ "If you have access to MySql/phpMyAdmin on your host server, run the MySql "
2101
+ "command %s to repair and release any locks on wassup table. Note that wassup "
2102
+ "table name may be different in other Wordpress setups."
2103
  msgstr ""
2104
 
2105
+ #: lib/settings.php:968
2106
+ msgid ""
2107
+ "As a last resort, uninstall WassUp cleanly (delete data and files) and "
2108
+ "reinstall it."
2109
  msgstr ""
2110
 
2111
+ #: lib/settings.php:969
2112
+ msgid ""
2113
+ "My popular web site is hosted on a shared server with restrictive database "
2114
+ "size limits. How do I prevent WassUp's table from growing too big for my "
2115
+ "allocated quota?"
2116
  msgstr ""
2117
 
2118
+ #: lib/settings.php:970
2119
+ #, php-format
2120
+ msgid ""
2121
+ "Navigate to %s tab and enable the setting for \"Auto Delete\" of old records "
2122
+ "and/or check the box to receive an email alert when the table size limit is "
2123
+ "exceeded."
2124
  msgstr ""
2125
 
2126
+ #: lib/settings.php:971
2127
+ msgid ""
2128
+ "WassUp visitor counts are much lower than actual for my website. Why is "
2129
+ "there a discrepancy and how do I fix it?"
2130
  msgstr ""
2131
 
2132
+ #: lib/settings.php:972
2133
+ msgid ""
2134
+ "Low visitor count is likely caused by page caching on your website. WassUp "
2135
+ "is incompatible with static page caching plugins such as WP Supercache, WP "
2136
+ "Cache, and Hyper Cache. To fix, uninstall your cache plugin or switch to a "
2137
+ "different (javascript-based) statistics plugin."
2138
  msgstr ""
2139
 
2140
+ #: lib/settings.php:973
2141
+ msgid "Is there any caching plugin that works with WassUp?"
2142
  msgstr ""
2143
 
2144
+ #: lib/settings.php:974
2145
+ #, php-format
2146
+ msgid "%s is the only caching plugin verified to work with WassUp."
2147
  msgstr ""
2148
 
2149
+ #: lib/settings.php:975
2150
+ msgid "How can I make Wassup run faster?"
2151
  msgstr ""
2152
 
2153
+ #: lib/settings.php:976
2154
+ #, php-format
2155
+ msgid ""
2156
+ "Keep Wassup table size small with automatic deletions or periodic manual "
2157
+ "delete of old records under %s tab."
2158
  msgstr ""
2159
 
2160
+ #: lib/settings.php:977
2161
+ msgid ""
2162
+ "If using the \"Top Stats\" widget on your site, set refresh frequency to 15 "
2163
+ "minutes or higher."
2164
  msgstr ""
2165
 
2166
+ #: lib/settings.php:978
2167
+ #, php-format
2168
+ msgid ""
2169
+ "Reduce the number of recording exclusions (by ip/hostname/username/url) "
2170
+ "under %s tab."
2171
  msgstr ""
2172
 
2173
+ #: lib/settings.php:980
2174
+ msgid "and"
2175
  msgstr ""
2176
 
2177
+ #: lib/settings.php:981
2178
+ #, php-format
2179
+ msgid ""
2180
+ "Delete the files %s from Wassup plugin folder to force reduce I/O usage in "
2181
+ "spam/malware detection."
2182
  msgstr ""
2183
 
2184
+ #: lib/settings.php:982
2185
+ #, php-format
2186
+ msgid ""
2187
+ "Stop all spam/malware detection by unchecking \"Enable Spam and malware "
2188
+ "detection on records\" under %s tab."
2189
  msgstr ""
2190
 
2191
+ #: lib/settings.php:983
2192
+ msgid ""
2193
+ "Why does WassUp stats sometimes show more page views than actual pages "
2194
+ "clicked by a person?"
2195
  msgstr ""
2196
 
2197
+ #: lib/settings.php:984
2198
+ msgid ""
2199
+ "\"Phantom\" page views can occur when a user's browser does automatic feed "
2200
+ "retrieval, link pre-fetching, a page refresh, or automatically adds your "
2201
+ "website to it's \"Top sites\" window (Safari). WassUp tracks these because "
2202
+ "they are valid requests from the browser and are sometimes indistinguishable "
2203
+ "from user link clicks."
2204
  msgstr ""
2205
 
2206
+ #: lib/settings.php:985
2207
+ msgid "How do I upgrade WassUp safely when my site has frequent visitors?"
2208
  msgstr ""
2209
 
2210
+ #: lib/settings.php:986
2211
+ #, php-format
2212
  msgid ""
2213
+ "To upgrade WassUp when your site is busy, you must first disable statistics "
2214
+ "recording manually under %s tab, then do the plugin upgrade, and afterwards "
2215
+ "re-enable recording manually when the upgrade is complete and the plugin is "
2216
+ "active."
2217
  msgstr ""
2218
 
2219
+ #: lib/settings.php:987
2220
+ msgid "An unspecified error occurred during plugin upgrade. What do I do next?"
2221
  msgstr ""
2222
 
2223
+ #: lib/settings.php:988
2224
+ msgid ""
2225
+ "Wait a few minutes. Do NOT re-attempt to upgrade nor try to activate the "
2226
+ "plugin again! An activation error with no explanation is probably due to "
2227
+ "your browser timing out, not an upgrade failure. WassUp continues it's "
2228
+ "upgrade in the background and will activate automatically when it is done. "
2229
+ "After a few minutes (5-10) has passed, revisit Wordpress admin Plugins panel "
2230
+ "and verify that Wassup plugin has activated."
2231
  msgstr ""
2232
 
2233
+ #: lib/settings.php:989
2234
+ msgid "How do I uninstall WassUp cleanly?"
2235
  msgstr ""
2236
 
2237
+ #: lib/settings.php:990
2238
+ msgid ""
2239
+ "From a single Wordpress site: navigate to Wordpress Plugins panel and "
2240
+ "deactivate WassUp plugin. Then, on the same page, click the \"delete\" link "
2241
+ "below WassUp name. This deletes both data and files permanently."
2242
  msgstr ""
2243
 
2244
+ #: lib/settings.php:991
2245
+ msgid ""
2246
+ "From Wordpress multisite Network admin panel: navigate to Plugins panel and "
2247
+ "deactivate WassUp plugin. If the plugin is not \"network activated\", "
2248
+ "navigate to the main site/parent domain Plugins panel and deactivate Wassup "
2249
+ "plugin there, then return to Network admin Plugins panel. Click the \"delete"
2250
+ "\" link below WassUp name. This deletes both data and files permanently from "
2251
+ "the main site/parent domain and deletes Wassup data from all the subsites in "
2252
+ "the network."
2253
  msgstr ""
2254
 
2255
+ #: lib/settings.php:992
2256
+ #, php-format
2257
+ msgid ""
2258
+ "From a subsite in Wordpress multisite: navigate to %s tab and check the box "
2259
+ "for \"Permanently remove WassUp data and settings\" and save. Next, go to "
2260
+ "the subsite's Plugins panel and deactivate WassUp plugin. This deletes the "
2261
+ "subsite's data permanently. No files are deleted (not needed)."
2262
  msgstr ""
2263
 
2264
+ #: lib/settings.php:993
2265
+ #, php-format
2266
+ msgid ""
2267
+ "From a Wordpress 2.x site: navigate to %s tab and check the box for "
2268
+ "\"Permanently remove WassUp data and settings\" and save. Next, go to "
2269
+ "Wordpress Plugins panel and deactivate WassUp plugin. This deletes the data "
2270
+ "permanently. To delete the plugin files from Wordpress 2.x, use an ftp "
2271
+ "client software on your PC or login to your host server's \"cpanel\" and use "
2272
+ "\"File Manager\" to delete the folder \"wassup\" from the %s directory on "
2273
+ "your host server."
2274
  msgstr ""
2275
 
2276
+ #: lib/settings.php:995
2277
+ #, php-format
2278
+ msgid "Visit the %s to find more answers to your WassUp questions."
 
2279
  msgstr ""
2280
 
2281
+ #: lib/settings.php:995
2282
+ msgid "Plugin Forum"
2283
  msgstr ""
2284
 
2285
+ #: lib/settings.php:1000
2286
+ msgid "How you can donate"
2287
  msgstr ""
2288
 
2289
+ #: lib/settings.php:1001
2290
+ msgid ""
2291
+ "If you like this plugin, please consider making a donation to help keep it's "
2292
+ "development active."
2293
  msgstr ""
2294
 
2295
+ #: lib/settings.php:1003
2296
+ #, php-format
2297
+ msgid "Donate by %s"
2298
  msgstr ""
2299
 
2300
+ #: lib/settings.php:1004
2301
+ #, php-format
2302
+ msgid "Donate %s"
2303
  msgstr ""
2304
 
2305
+ #: lib/settings.php:1006
2306
+ msgid "Send your bitcoin donation to this address"
2307
  msgstr ""
2308
 
2309
+ #: lib/uadetector.class.php:62 lib/uadetector.class.php:101
2310
+ msgid "Script Injection Bot"
2311
  msgstr ""
2312
 
2313
+ #: lib/uadetector.class.php:71
2314
+ msgid "Unknown Feedreader"
2315
  msgstr ""
2316
 
2317
+ #: lib/upgrade.php:123
2318
+ msgid "COMPATIBILITY WARNING: non-MySQL database type detected!"
2319
  msgstr ""
2320
 
2321
+ #: lib/upgrade.php:123
2322
+ msgid ""
2323
+ "WassUp uses complex MySQL queries that may not run on a different database "
2324
+ "type."
2325
  msgstr ""
2326
 
2327
+ #: lib/upgrade.php:125
2328
+ msgid "WassUp cannot generate accurate statistics with page caching enabled."
2329
  msgstr ""
2330
 
2331
+ #: lib/upgrade.php:125
2332
+ msgid ""
2333
+ "If your cache plugin stores whole Wordpress pages/posts as static HTML, then "
2334
+ "WassUp won't run properly. Please deactivate your cache plugin and remove "
2335
+ "\"WP_CACHE\" from \"wp_config.php\" or switch to a different statistics "
2336
+ "plugin."
2337
  msgstr ""
2338
 
2339
+ #: lib/upgrade.php:132
2340
+ #, php-format
2341
+ msgid ""
2342
+ "WARNING: Insufficient memory: %s found! A minimum allocation of %s is "
2343
+ "recommended for WassUp and Wordpress."
2344
  msgstr ""
2345
 
2346
+ #: lib/upgrade.php:133
2347
+ #, php-format
2348
+ msgid "See %s for information about increasing Wordpress memory."
2349
  msgstr ""
2350
 
2351
+ #: lib/upgrade.php:140
2352
+ msgid "IMPORTANT: Wassup Widget has changed and must be re-installed."
2353
  msgstr ""
2354
 
2355
+ #: lib/upgrade.php:322
2356
+ msgid "Welcome to WassUP"
2357
  msgstr ""
2358
 
2359
+ #: lib/upgrade.php:345 lib/upgrade.php:388
2360
+ #, php-format
2361
+ msgid "An error occurred during the install of table %s."
2362
  msgstr ""
2363
 
2364
+ #: lib/wassup.class.php:429 lib/compat-lib/wassup.class.php:429
2365
+ msgid "Administrator"
2366
  msgstr ""
2367
 
2368
+ #: lib/wassup.class.php:430 lib/compat-lib/wassup.class.php:430
2369
+ msgid "Editor"
2370
  msgstr ""
2371
 
2372
+ #: lib/wassup.class.php:431 lib/compat-lib/wassup.class.php:431
2373
+ msgid "Author"
2374
  msgstr ""
2375
 
2376
+ #: lib/wassup.class.php:432 lib/compat-lib/wassup.class.php:432
2377
+ msgid "Contributor"
2378
  msgstr ""
2379
 
2380
+ #: lib/wassup.class.php:433 lib/compat-lib/wassup.class.php:433
2381
+ msgid "Subscriber"
2382
  msgstr ""
2383
 
2384
+ #: lib/wassup.class.php:439 lib/compat-lib/wassup.class.php:439
2385
+ msgid "One - 2 lines chart 1 axis"
2386
  msgstr ""
2387
 
2388
+ #: lib/wassup.class.php:440 lib/compat-lib/wassup.class.php:440
2389
+ msgid "Two - 2 lines chart 2 axes"
2390
  msgstr ""
2391
 
2392
+ #: lib/wassup.class.php:460 lib/compat-lib/wassup.class.php:460
2393
+ msgid "Everything"
2394
  msgstr ""
2395
 
2396
+ #: lib/wassup.class.php:462 lib/compat-lib/wassup.class.php:462
2397
+ msgid "No spider"
2398
  msgstr ""
2399
 
2400
+ #: lib/wassup.class.php:464 lib/compat-lib/wassup.class.php:464
2401
+ msgid "No Spam"
2402
  msgstr ""
2403
 
2404
+ #: lib/wassup.class.php:465 lib/compat-lib/wassup.class.php:465
2405
+ msgid "No Spam, No Spider"
2406
  msgstr ""
2407
 
2408
+ #: lib/wassup.class.php:466 lib/compat-lib/wassup.class.php:466
2409
+ msgid "Users logged in"
2410
  msgstr ""
2411
 
2412
+ #: lib/wassup.class.php:468 lib/compat-lib/wassup.class.php:468
2413
+ msgid "Referrer from search engine"
2414
  msgstr ""
2415
 
2416
+ #: lib/wassup.class.php:469 lib/compat-lib/wassup.class.php:469
2417
+ msgid "Referrer from ext link"
2418
  msgstr ""
2419
 
2420
+ #: lib/wassup.class.php:502 lib/compat-lib/wassup.class.php:502
2421
+ msgid "Don't delete anything"
2422
  msgstr ""
2423
 
2424
+ #: lib/wassup.class.php:503 lib/wassup.class.php:539
2425
+ #: lib/compat-lib/wassup.class.php:503 lib/compat-lib/wassup.class.php:539
2426
+ msgid "24 hours"
 
 
2427
  msgstr ""
2428
 
2429
+ #: lib/wassup.class.php:504 lib/wassup.class.php:540
2430
+ #: lib/compat-lib/wassup.class.php:504 lib/compat-lib/wassup.class.php:540
2431
+ msgid "7 days"
 
 
2432
  msgstr ""
2433
 
2434
+ #: lib/wassup.class.php:505 lib/wassup.class.php:541
2435
+ #: lib/compat-lib/wassup.class.php:505 lib/compat-lib/wassup.class.php:541
2436
+ msgid "2 weeks"
2437
  msgstr ""
2438
 
2439
+ #: lib/wassup.class.php:506 lib/wassup.class.php:542
2440
+ #: lib/compat-lib/wassup.class.php:506 lib/compat-lib/wassup.class.php:542
2441
+ msgid "1 month"
2442
  msgstr ""
2443
 
2444
+ #: lib/wassup.class.php:507 lib/wassup.class.php:543
2445
+ #: lib/compat-lib/wassup.class.php:507 lib/compat-lib/wassup.class.php:543
2446
+ msgid "3 months"
2447
  msgstr ""
2448
 
2449
+ #: lib/wassup.class.php:508 lib/wassup.class.php:544
2450
+ #: lib/compat-lib/wassup.class.php:508 lib/compat-lib/wassup.class.php:544
2451
+ msgid "6 months"
2452
  msgstr ""
2453
 
2454
+ #: lib/wassup.class.php:509 lib/wassup.class.php:545
2455
+ #: lib/compat-lib/wassup.class.php:509 lib/compat-lib/wassup.class.php:545
2456
+ msgid "1 year"
2457
  msgstr ""
2458
 
2459
+ #: lib/wassup.class.php:516 lib/compat-lib/wassup.class.php:516
2460
+ msgid "All"
2461
  msgstr ""
2462
 
2463
+ #: lib/wassup.class.php:519 lib/compat-lib/wassup.class.php:519
2464
+ msgid "Spider and spam"
2465
  msgstr ""
2466
 
2467
+ #: lib/wassup.class.php:529 lib/compat-lib/wassup.class.php:529
2468
+ msgid "IP Address"
2469
  msgstr ""
2470
 
2471
+ #: lib/wassup.class.php:530 lib/compat-lib/wassup.class.php:530
2472
+ msgid "URL Request"
2473
  msgstr ""
2474
 
2475
+ #: lib/wassup.class.php:536 lib/compat-lib/wassup.class.php:536
2476
+ msgid "1 hour"
2477
  msgstr ""
2478
 
2479
+ #: lib/wassup.class.php:537 lib/compat-lib/wassup.class.php:537
2480
+ msgid "6 hours"
2481
  msgstr ""
2482
 
2483
+ #: lib/wassup.class.php:538 lib/compat-lib/wassup.class.php:538
2484
+ msgid "12 hours"
2485
  msgstr ""
2486
 
2487
+ #: lib/wassup.class.php:546 lib/compat-lib/wassup.class.php:546
2488
+ msgid "all time"
2489
  msgstr ""
2490
 
2491
+ #: lib/wassup.class.php:641 lib/compat-lib/wassup.class.php:641
2492
+ msgid "Nothing to do!"
2493
  msgstr ""
2494
 
2495
+ #: lib/wassup.class.php:766 lib/compat-lib/wassup.class.php:766
2496
+ msgid "Unknown"
2497
  msgstr ""
2498
 
2499
+ #: lib/wassup.class.php:947 lib/compat-lib/wassup.class.php:947
2500
+ msgid "error"
 
 
2501
  msgstr ""
2502
 
2503
+ #: lib/wassup.class.php:948 lib/compat-lib/wassup.class.php:948
2504
+ msgid "warning"
2505
  msgstr ""
2506
 
2507
+ #: lib/wassup.class.php:949 lib/compat-lib/wassup.class.php:949
2508
+ msgid "updated"
2509
  msgstr ""
2510
 
2511
+ #: lib/wassup.class.php:950 lib/compat-lib/wassup.class.php:950
2512
+ msgid "upgraded"
 
 
2513
  msgstr ""
2514
 
2515
+ #: lib/wassup.class.php:951 lib/compat-lib/wassup.class.php:951
2516
+ msgid "deleted"
 
2517
  msgstr ""
2518
 
2519
+ #: lib/wassup.class.php:1630 lib/compat-lib/wassup.class.php:1627
2520
+ #, php-format
2521
+ msgid "%s Error!"
 
 
2522
  msgstr ""
2523
 
2524
+ #: lib/wassup.class.php:1731 lib/compat-lib/wassup.class.php:1728
2525
+ msgid "Wassup auto-delete notice"
2526
  msgstr ""
2527
 
2528
+ #: lib/wassup.class.php:1732 lib/compat-lib/wassup.class.php:1729
2529
+ #, php-format
2530
+ msgid "Auto-delete deleted %d old %s table records today."
 
 
 
2531
  msgstr ""
2532
 
2533
+ #: lib/wassup.class.php:1767 lib/compat-lib/wassup.class.php:1764
2534
+ #, php-format
2535
+ msgid "Error with TABLE %s: Not found"
2536
  msgstr ""
2537
 
2538
+ #: lib/wassup.class.php:1789 lib/compat-lib/wassup.class.php:1786
2539
+ #, php-format
2540
+ msgid "Error with \"SHOW CREATE TABLE\" for %s."
2541
  msgstr ""
2542
 
2543
+ #: lib/wassup.class.php:1796 lib/compat-lib/wassup.class.php:1793
2544
+ #, php-format
2545
+ msgid "Table structure of table %s"
2546
  msgstr ""
2547
 
2548
+ #: lib/wassup.class.php:1802 lib/compat-lib/wassup.class.php:1799
2549
+ #, php-format
2550
+ msgid "Data contents of table %s"
2551
  msgstr ""
2552
 
2553
+ #: lib/wassup.class.php:1810 lib/compat-lib/wassup.class.php:1807
2554
+ #, php-format
2555
+ msgid "Error getting table structure of %s: %s"
2556
  msgstr ""
2557
 
2558
+ #: lib/wassup.class.php:1813 lib/compat-lib/wassup.class.php:1810
2559
+ #, php-format
2560
+ msgid "Error getting table structure of %s"
2561
  msgstr ""
2562
 
2563
+ #: lib/wassup.class.php:1819 lib/compat-lib/wassup.class.php:1816
2564
+ #, php-format
2565
+ msgid "Error with table %s: %s"
2566
  msgstr ""
2567
 
2568
+ #: lib/wassup.class.php:1821 lib/compat-lib/wassup.class.php:1818
2569
+ #, php-format
2570
+ msgid "Error with table %s: No data"
2571
  msgstr ""
2572
 
2573
+ #: lib/wassup.class.php:1883 lib/compat-lib/wassup.class.php:1880
2574
+ #, php-format
2575
+ msgid "Error exporting data from table %s: %s"
2576
  msgstr ""
2577
 
2578
+ #: lib/wassup.class.php:1932 lib/compat-lib/wassup.class.php:1929
2579
+ #, php-format
2580
+ msgid "End of data contents of table %s"
2581
  msgstr ""
2582
 
2583
+ #: lib/wassup.class.php:1934 lib/compat-lib/wassup.class.php:1931
2584
+ #, php-format
2585
+ msgid "Interrupted data contents of table %s"
2586
  msgstr ""
2587
 
2588
+ #: lib/wassup.class.php:1943 lib/compat-lib/wassup.class.php:1940
2589
+ #, php-format
2590
+ msgid "End time: %d"
 
2591
  msgstr ""
2592
 
2593
+ #: lib/wassup.class.php:1944 lib/wassup.class.php:1949
2594
+ #: lib/compat-lib/wassup.class.php:1941 lib/compat-lib/wassup.class.php:1946
2595
+ #, php-format
2596
+ msgid "%d out of %d records exported."
2597
  msgstr ""
2598
 
2599
+ #: lib/wassup.class.php:1944 lib/wassup.class.php:1949
2600
+ #: lib/compat-lib/wassup.class.php:1941 lib/compat-lib/wassup.class.php:1946
2601
+ #, php-format
2602
+ msgid "Last record ID: %d"
2603
  msgstr ""
2604
 
2605
+ #: lib/wassup.class.php:2063 lib/wassup.class.php:2070
2606
+ #: lib/compat-lib/wassup.class.php:2058 lib/compat-lib/wassup.class.php:2065
2607
+ msgid "direct hit"
 
2608
  msgstr ""
2609
 
2610
+ #: lib/wassup.class.php:2067 lib/compat-lib/wassup.class.php:2062
2611
+ msgid "from your site"
 
 
2612
  msgstr ""
2613
 
2614
+ #: widgets/widgets.php:47
2615
+ msgid "base widget"
 
 
2616
  msgstr ""
2617
 
2618
+ #: widgets/widgets.php:90 widgets/widgets.php:241 widgets/widgets.php:419
2619
+ msgid "Title"
2620
  msgstr ""
2621
 
2622
+ #: widgets/widgets.php:93 widgets/widgets.php:261 widgets/widgets.php:479
2623
+ msgid "Widget style options"
2624
  msgstr ""
2625
 
2626
+ #: widgets/widgets.php:95 widgets/widgets.php:263 widgets/widgets.php:481
2627
+ #, php-format
2628
+ msgid "Class attribute for %s list:"
2629
  msgstr ""
2630
 
2631
+ #: widgets/widgets.php:97 widgets/widgets.php:265 widgets/widgets.php:483
2632
+ msgid "Max. chars to display from left"
2633
  msgstr ""
2634
 
2635
+ #: widgets/widgets.php:98 widgets/widgets.php:266 widgets/widgets.php:484
2636
+ msgid "enter \"0\" for theme default/line wrap of long texts"
 
 
2637
  msgstr ""
2638
 
2639
+ #: widgets/widgets.php:212
2640
+ msgid "Online"
2641
  msgstr ""
2642
 
2643
+ #: widgets/widgets.php:213
2644
+ msgid "Show counts of your site's visitors who are currently online."
 
 
 
 
 
 
 
 
 
 
 
2645
  msgstr ""
2646
 
2647
+ #: widgets/widgets.php:224
2648
+ msgid "Online Now"
2649
  msgstr ""
2650
 
2651
+ #: widgets/widgets.php:244
2652
+ msgid "Show online counts for:"
2653
  msgstr ""
2654
 
2655
+ #: widgets/widgets.php:246
2656
+ msgid "All current visitors"
2657
  msgstr ""
2658
 
2659
+ #: widgets/widgets.php:247 widgets/widget_functions.php:227
2660
+ msgid "Logged-in users"
 
2661
  msgstr ""
2662
 
2663
+ #: widgets/widgets.php:249 widgets/widget_functions.php:247
2664
+ msgid "Regular visitors"
 
2665
  msgstr ""
2666
 
2667
+ #: widgets/widgets.php:250 widgets/widget_functions.php:257
2668
+ msgid "Others"
2669
  msgstr ""
2670
 
2671
+ #: widgets/widgets.php:254
2672
+ msgid "Online Users Details"
2673
  msgstr ""
2674
 
2675
+ #: widgets/widgets.php:256
2676
+ msgid "Show online usernames to registered users"
2677
  msgstr ""
2678
 
2679
+ #: widgets/widgets.php:257
2680
+ msgid "Show country flags of users online"
2681
  msgstr ""
2682
 
2683
+ #: widgets/widgets.php:270
2684
+ msgid "online counts are automatically cached for 1 minute."
2685
  msgstr ""
2686
 
2687
+ #: widgets/widgets.php:271 widgets/widgets.php:489
2688
+ msgid "empty results are not displayed."
2689
  msgstr ""
2690
 
2691
+ #: widgets/widgets.php:386
2692
+ msgid "Top Stats"
2693
  msgstr ""
2694
 
2695
+ #: widgets/widgets.php:387
2696
+ msgid ""
2697
+ "List your site's most popular or trending items from Wassup's latest stats "
2698
+ "data."
2699
  msgstr ""
2700
 
2701
+ #: widgets/widgets.php:420
2702
+ msgid "of first checked item below"
2703
  msgstr ""
2704
 
2705
+ #: widgets/widgets.php:422
2706
+ msgid "List Top Results for"
2707
  msgstr ""
2708
 
2709
+ #: widgets/widgets.php:426
2710
+ msgid "Stat item"
 
 
2711
  msgstr ""
2712
 
2713
+ #: widgets/widgets.php:427
2714
+ msgid "max limit"
2715
  msgstr ""
2716
 
2717
+ #: widgets/widgets.php:429
2718
+ msgid "Titles of posts and pages"
2719
  msgstr ""
2720
 
2721
+ #: widgets/widgets.php:429
2722
+ msgid "Latest articles"
2723
  msgstr ""
2724
 
2725
+ #: widgets/widgets.php:435
2726
+ msgid "Search engine searches"
2727
  msgstr ""
2728
 
2729
+ #: widgets/widgets.php:435
2730
+ msgid "Latest searches"
2731
  msgstr ""
2732
 
2733
+ #: widgets/widgets.php:441
2734
+ msgid "External links that generated referrals to your site"
2735
  msgstr ""
2736
 
2737
+ #: widgets/widgets.php:441
2738
+ msgid "Latest referrers"
 
 
2739
  msgstr ""
2740
 
2741
+ #: widgets/widgets.php:447
2742
+ msgid "Latest URL requests"
2743
  msgstr ""
2744
 
2745
+ #: widgets/widgets.php:453
2746
+ msgid "Client browser software"
 
2747
  msgstr ""
2748
 
2749
+ #: widgets/widgets.php:453
2750
+ msgid "Latest browsers"
 
 
2751
  msgstr ""
2752
 
2753
+ #: widgets/widgets.php:459
2754
+ msgid "Client device/operating software"
2755
  msgstr ""
2756
 
2757
+ #: widgets/widgets.php:459
2758
+ msgid "Latest OS"
2759
  msgstr ""
2760
 
2761
+ #: widgets/widgets.php:465
2762
+ msgid "Visitors country/language"
2763
  msgstr ""
2764
 
2765
+ #: widgets/widgets.php:465
2766
+ msgid "Latest locale"
2767
  msgstr ""
2768
 
2769
+ #: widgets/widgets.php:472
2770
+ msgid "Show counts for each item"
2771
  msgstr ""
2772
 
2773
+ #: widgets/widgets.php:473
2774
+ msgid "Statistics timeframe"
2775
  msgstr ""
2776
 
2777
+ #: widgets/widgets.php:474
2778
+ msgid ""
2779
+ "select 1-30 days for latest top results, 1-12 hours for trending results"
2780
  msgstr ""
2781
 
2782
+ #: widgets/widgets.php:475
2783
+ msgid "Refresh statistics every:"
2784
  msgstr ""
2785
 
2786
+ #: widgets/widgets.php:488
2787
+ msgid "known spammers and spiders are excluded from results."
2788
  msgstr ""
2789
 
2790
+ #: widgets/widgets.php:596
2791
+ msgid "Trending"
2792
  msgstr ""
2793
 
2794
+ #: widgets/widget_functions.php:256
2795
+ msgid "Other"
2796
  msgstr ""
2797
 
2798
+ #: widgets/widget_functions.php:401
2799
+ #, php-format
2800
+ msgid "%s articles"
2801
  msgstr ""
2802
 
2803
+ #: widgets/widget_functions.php:402
2804
+ #, php-format
2805
+ msgid "%s searches"
2806
  msgstr ""
2807
 
2808
+ #: widgets/widget_functions.php:403
2809
+ #, php-format
2810
+ msgid "%s referrers"
2811
  msgstr ""
2812
 
2813
+ #: widgets/widget_functions.php:404
2814
+ #, php-format
2815
+ msgid "%s requests"
2816
  msgstr ""
2817
 
2818
+ #: widgets/widget_functions.php:405
2819
+ #, php-format
2820
+ msgid "%s browsers"
2821
  msgstr ""
2822
 
2823
+ #: widgets/widget_functions.php:406
2824
+ #, php-format
2825
+ msgid "%s OS"
2826
  msgstr ""
2827
 
2828
+ #: widgets/widget_functions.php:407
2829
+ #, php-format
2830
+ msgid "%s locale"
2831
  msgstr ""
2832
 
2833
+ #: widgets/widget_compat.php:40
2834
+ msgid "There are no options for this widget."
2835
  msgstr ""
lib/action.php CHANGED
@@ -1,151 +1,209 @@
1
  <?php
2
  /**
3
- * @package WassUP
4
- * @subpackage action.php module
 
 
 
 
 
 
5
  */
6
- /**
7
- * action.php -- perform an (ajax) action for WassUp admin and reports
8
- */
9
- //immediately block any attempt to hack WordPress via WassUp
10
- // -Helene D. 2009-04-04
11
  $is_attack=false;
12
- if (preg_match('/["\';<>\$\\\*]/',$_SERVER['REQUEST_URI'])>0) {
13
- $is_attack=true;
14
- } elseif (preg_match('/(\.+\/){3,}/',$_SERVER['REQUEST_URI'])>0) {
15
- $is_attack=true;
16
- } elseif (preg_match('/(&lt;|&#60;|%3C)/',$_SERVER['REQUEST_URI'])>0) {
17
- $is_attack=true;
18
- } elseif (preg_match('#[^a-z_/\-](select|delete|update|alter|drop|create|union|\-1|\-9+)[^a-z_/]#i',$_SERVER['REQUEST_URI'])>0) {
19
- $is_attack=true;
20
- } elseif (preg_match('/[^a-z_\-](dir|file|href|img|location|path|page|src|thisdir|document_root.?)\=/i',$_SERVER['REQUEST_URI'])>0) {
21
- $is_attack=true;
22
- } elseif (preg_match('/[\.\/](aspx?|bin|dll|cgi|cmd|etc|exe|ini|jsp)/i',$_SERVER['REQUEST_URI'])>0) {
23
- $is_attack=true;
24
- } elseif (preg_match('/(document|function|script|window|cookie)/i',$_SERVER['REQUEST_URI'])>0) {
25
- $is_attack=true;
26
- }
27
-
28
- if ($is_attack) {
29
- header("HTTP/1.1 403 Forbidden");
30
- die('Illegal request - Permission Denied!');
31
  }
32
-
33
- //security check#2: check that hash exists
34
- if (!isset($_GET['whash'])) { //hash required
35
- header("HTTP/1.1 403 Forbidden");
36
- die('Missing or invalid parameter - Permission Denied!');
37
- }
38
-
39
- //#check for required files and include them
40
- if (!function_exists('get_bloginfo')) {
41
- //IMPORTANT NOTE: As of WordPress 2.6+ "/wp-content/" can be in a
42
- // different location from the Wordpress install directory (i.e.
43
- // not a subdirectory). This configuration requires an additional
44
- // GET parameter "wpabspath=ABSPATH" for "action.php" to run.
45
- //-Helene D. 2009-04-04
46
- if (!empty($_GET['wpabspath'])) {
47
- $wpabspath=esc_attr(base64_decode(urldecode($_GET['wpabspath'])));
48
- } elseif (defined('ABSPATH')) {
49
- $wpabspath=ABSPATH;
 
 
 
 
 
 
 
 
 
 
50
  }
51
- if (empty($wpabspath) || !is_dir($wpabspath)) {
52
- $file = preg_replace('/\\\\/', '/', __FILE__);
53
- $wpabspath=substr($file,0,strpos($file, '/wp-content/')+1);
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
- if (file_exists($wpabspath. 'wp-config.php')) {
56
- include_once($wpabspath.'wp-config.php');
57
- } elseif (file_exists($wpabspath. '../wp-config.php')) { //since WP2.6
58
- include_once($wpabspath.'../wp-config.php');
59
- } else {
60
- //Note: localization functions, _e() and __(), are not used
61
- // here because they would not be defined if this error
62
- // occurred
63
- echo '<span style="color:red;">Action.php ERROR: path not found, '.$wpabspath.'</span>';
64
- die();
65
  }
 
 
 
 
 
 
 
 
66
  }
67
-
68
- //security check#3: check that user is logged in (can be faked)
69
- $logged_user = wp_get_current_user();
70
- $validuser = (!empty($logged_user->user_login)? true: false);
71
  //#only logged-in users are allowed to run this script -Helene D.
72
- if (!$validuser) {
73
- header("HTTP/1.1 403 Forbidden");
74
- $wassup_error=__('Login required. Permission denied!','wassup');
75
- wp_die($wassup_error);
 
76
  }
 
77
 
78
- //security check#4: check hash value
79
  $hashfail = true;
80
- if (isset($_GET['whash'])) {
81
- $wassup_settings = get_option('wassup_settings');
82
- if ($_GET['whash'] == $wassup_settings['whash'] || $_GET['whash'] == esc_attr($wassup_settings['whash'])) {
83
- $hashfail = false;
84
- }
85
  }
86
 
87
  //#perform an "action" and display the results, if any
88
  if (!$hashfail) {
89
- //#set required variables
90
- $wpurl = get_bloginfo('wpurl');
91
- $table_name = (!empty($wassup_settings['wassup_table']))? $wassup_settings['wassup_table'] : $wpdb->prefix . "wassup";
92
- $table_tmp_name = $table_name . "_tmp";
93
- if (!defined('WASSUPFOLDER')) {
94
- define('WASSUPFOLDER', dirname(dirname(__FILE__)));
95
- }
96
- if (!defined('WASSUPURL')) {
97
- //flexible "wp-content" paths since WordPress 2.6
98
- if (function_exists('plugins_url')) { //Wordpress 2.6+ function
99
- $wassupurl = plugins_url(WASSUPFOLDER);
100
- } elseif (defined('WP_CONTENT_URL') && defined('WP_CONTENT_DIR') && strpos(WP_CONTENT_DIR,ABSPATH)===FALSE) {
101
- $wassupurl = rtrim(WP_CONTENT_URL,"/")."/plugins/".WASSUPFOLDER;
102
- } else {
103
- $wassupurl = $wpurl."/wp-content/plugins/".WASSUPFOLDER;
104
  }
105
- define('WASSUPURL',$wassupurl);
106
- unset ($wassupurl); //to free memory
107
  }
108
-
 
 
109
  $wdebug_mode=false; //debug set below
110
- //echo "Debug: Starting action.php from directory ".dirname(__FILE__).". ABSPATH=".$wpabspath.".<br />\n"; //debug
111
 
112
- // ### Separate "delete" action because it has no output
113
  // ACTION: DELETE ON THE FLY FROM VISITOR DETAILS VIEW
114
  if ($_GET['action'] == "deleteID") {
115
  if (!empty($_GET['id'])) {
116
- if (method_exists($wpdb,'prepare')) {
117
- $wpdb->query($wpdb->prepare("DELETE FROM $table_name WHERE wassup_id='%s'", $_GET['id']));
118
- } else {
119
- $wpdb->query("DELETE FROM $table_name WHERE wassup_id='".esc_attr($_GET['id'])."'");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
121
  } else {
122
- echo "Error: Missing wassup_id parameter";
123
  }
124
- exit();
125
  } //end if action==deleteID
126
 
127
  // ### Begin actions that have output...
128
  if (!empty($_GET['debug_mode'])) {
129
  $wdebug_mode=true;
130
  $mode_reset=ini_get('display_errors');
131
- error_reporting(E_ALL); //debug, E_STRICT=php5 only
132
- ini_set('display_errors','On'); //debug
133
- echo "\n<!-- *WassUp DEBUG On-->\n";
134
- echo "<!-- *normal setting: display_errors=$mode_reset -->\n";
135
- if (function_exists('profiler_beginSection')) {
136
- profiler_beginSection('(Tot)Action.php');
137
- }
138
  }
139
- #load wassup core functions
140
  if (!function_exists('stringShortener')) {
141
- if (file_exists(dirname(__FILE__). '/main.php')) {
142
- include_once(dirname(__FILE__). '/main.php');
143
  } else {
144
- echo '<span style="font-color:red;">Action.php '.__("ERROR: file not found","wassup").', '.dirname(__FILE__).'/main.php</span>';
145
- exit();
146
  }
147
  }
148
- //#retrieve command-line arguments
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  if (isset($_GET['to_date']) && is_numeric($_GET['to_date'])) {
150
  $to_date = (int)$_GET['to_date'];
151
  } else {
@@ -156,85 +214,69 @@ if (!$hashfail) {
156
  } else {
157
  $from_date = ($to_date - 180); //3 minutes
158
  }
159
-
160
- if (isset($_GET['width']) && is_numeric($_GET['width'])) {
161
- $max_char_len = (int)($_GET['width'])/10;
162
- }
163
- if (isset($_GET['rows']) && is_numeric($_GET['rows'])) {
164
- $rows = (int)$_GET['rows'];
165
- }
166
  //#check that $to_date is a number
167
  if (!is_numeric($to_date)) { //bad date sent
168
- echo '<span style="color:red;">Action.php '.__("ERROR: bad date","wassup").', '.$to_date.'</span>';
169
- exit();
170
  }
171
-
172
- //force browser to disable caching so action.php works as an ajax request
173
- nocache_headers();
174
- //#perform an action and display output
175
- ?>
176
- <html>
177
- <head>
178
- <link rel="stylesheet" href="<?php echo WASSUPURL; ?>/css/wassup.css" type="text/css" />
179
- </head>
180
- <body>
181
- <?php
182
- // ACTION: RUN SPY VIEW
183
- if ($_GET['action'] == "spia") {
184
- if (empty($rows)) { $rows = 0; }
185
- if (!empty($_GET['spiatype'])) $spytype=esc_attr($_GET['spiatype']);
186
- else $spytype=$wassup_settings['wassup_default_spy_type'];
187
- $from_spydate=current_time('timestamp')-10;
188
- wassup_spiaView($from_spydate,$rows,$spytype);
189
-
190
  // ACTION: SUMMARY PIE CHART - TODO
191
- } elseif ($_GET['action'] == "piechart") {
192
  // Prepare Pie Chart
193
  $wTot = New WassupItems($table_name,$from_date,$to_date);
194
  $items_pie[] = $wTot->calc_tot("count", $search, "AND spam>0", "DISTINCT");
195
  $items_pie[] = $wTot->calc_tot("count", $search, "AND searchengine!='' AND spam=0", "DISTINCT");
196
  $items_pie[] = $wTot->calc_tot("count", $search, "AND searchengine='' AND referrer NOT LIKE '%".$this->WpUrl."%' AND referrer!='' AND spam=0", "DISTINCT");
197
- $items_pie[] = $wTot->calc_tot("count", $search, "AND searchengine='' AND (referrer LIKE '%".$this->WpUrl."%' OR referrer='') AND spam=0", "DISTINCT"); ?>
198
- <div style="text-align: center"><img src="http://chart.apis.google.com/chart?cht=p3&amp;chco=0000ff&amp;chs=600x300&amp;chl=Spam|Search%20Engine|Referrer|Direct&amp;chd=<?php Gchart_data($items_pie, null, null, null, 'pie'); ?>" /></div>
199
-
200
- <?php
201
- // ACTION: LINE CHART - TODO
202
- //} elseif ($_GET['action'] == "chart") {
203
- // $chart = WassupItems::theChart($from_date,$to_date,$search);
204
-
205
- // ACTION: DISPLAY RAW RECORDS - no longer used (deprecated)
206
- //} elseif ($_GET['action'] == "displayraw") {
207
 
208
  // ACTION: SHOW TOP TEN
209
- } elseif ($_GET['action'] == "topten") {
210
- $top_limit=0; //use default setting
211
- if ($wdebug_mode) {
212
- $title='WassUp '.__('Top Stats for Period','wassup');
213
- $wdformat = get_option("date_format");
214
- if (($to_date - $from_date) > 24*60*60) {
215
- $title .= ": ".gmdate("$wdformat",$from_date)." - ".gmdate("$wdformat",$to_date);
216
- } else {
217
- $title .= ": ".gmdate("$wdformat H:00",$from_date)." - ".gmdate("$wdformat H:00",$to_date);
 
 
 
 
 
 
 
 
 
 
 
 
218
  }
219
- } else {
 
 
220
  $title=false;
221
  }
222
- wassup_top10view($from_date, $to_date, $max_char_len, $top_limit,$title);
 
 
 
 
223
  // ACTION: DISPLAY GEOGRAPHIC AND WHOIS DETAILS - TODO
224
  } else {
 
225
  echo '<span style="color:red;">Action.php '.__("ERROR: Missing or unknown parameters","wassup").', action='.esc_attr($_GET["action"]).'</span>';
 
226
  }
227
  if ($wdebug_mode) {
228
- if (function_exists('profiler_endSection')) {
229
- profiler_endSection('(Tot)Action.php');
230
- profiler_printResults();
231
- }
232
  //$wpdb->print_error(); //debug
233
  ini_set('display_errors',$mode_reset); //turn off debug
234
- }?>
235
- </body></html>
236
- <?php
237
  } else {
 
238
  echo '<span style="color:red;">Action.php '.__("ERROR: Nothing to do here","wassup").'</span>';
 
239
  } //end if !$hashfail
240
  ?>
1
  <?php
2
  /**
3
+ * Performs an action and outputs result as html - for ajax tasks.
4
+ *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage action.php
7
+ *
8
+ * USAGE:
9
+ * action.php?action=dosomething&arg1=x&arg2=y (as ajax url)
10
+ * -'action' query parameter is required.
11
  */
12
+ //security check#1: wassup referrer required
 
 
 
 
13
  $is_attack=false;
14
+ if (!empty($_SERVER['HTTP_REFERER'])&& stristr($_SERVER['HTTP_REFERER'],"wassup")===false) {
15
+ die('Bad referer!');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
+ //security check#2: block obvious hack attempts on request and referer
18
+ if(empty($_SERVER['HTTP_REFERER'])) $targets=array($_SERVER['REQUEST_URI']);
19
+ else $targets=array($_SERVER['REQUEST_URI'],$_SERVER['HTTP_REFERER']);
20
+ foreach($targets AS $target){
21
+ if (preg_match('/["\';<>\$\\\*]/',$target)>0) {
22
+ $is_attack=true;
23
+ break;
24
+ } elseif (preg_match('/(\.+\/){3,}/',$target)>0) {
25
+ $is_attack=true;
26
+ break;
27
+ } elseif (preg_match('/(&lt;|&#60;|%3C)/',$target)>0) {
28
+ $is_attack=true;
29
+ break;
30
+ } elseif (preg_match('#[^a-z_/\-](select|delete|update|alter|drop|create|union|\-1|\-9+)[^a-z_/]#i',$target)>0) {
31
+ $is_attack=true;
32
+ break;
33
+ } elseif (preg_match('/[^a-z_\-](dir|file|href|img|location|path|src|thisdir|document_root.?)\=/i',$target)>0) {
34
+ $is_attack=true;
35
+ break;
36
+ } elseif(preg_match('/[\.\/](aspx?|bin|dll|cgi|cmd|etc|exe|ini|jsp)/i',$target)>0) {
37
+ $is_attack=true;
38
+ break;
39
+ } elseif(preg_match('/(document|function|script|window|cookie)[^a-z0-9\s]/i',$target)>0) {
40
+ $is_attack=true;
41
+ break;
42
+ } elseif(preg_match('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/',$target)>0){
43
+ $is_attack=true;
44
+ break;
45
  }
46
+ } //end foreach
47
+ if($is_attack){
48
+ if($target == $_SERVER['HTTP_REFERER']) die('#2:Bad referer!'.$_SERVER['HTTP_REFERER']);
49
+ else die('Bad request!');
50
+ }
51
+ //security check#3: check that hash exists
52
+ if(!isset($_GET['whash'])){
53
+ die('Missing or invalid parameter!');
54
+ }
55
+ //include required wordpress files
56
+ $thisfile=preg_replace('/\\\\/','/',__FILE__);
57
+ if ( !function_exists('get_bloginfo') ) {
58
+ //IMPORTANT NOTE: The additional GET parameter, "wpabspath=ABSPATH", is required whenever "/wp-content/" directory is in a different directory from Wordpress core files (WP v2.6+).
59
+ if ( !empty($_GET['wpabspath']) ) {
60
+ //esc_attr not used because it wouldn't be defined here
61
+ $wpabspath=htmlspecialchars((base64_decode(urldecode($_GET['wpabspath']))),ENT_QUOTES);
62
  }
63
+ if(empty($wpabspath)|| !is_dir($wpabspath)){
64
+ $wpabspath=substr($thisfile,0,strpos($thisfile,'/wp-content/')+1);
65
+ }
66
+ //clean up $wpabspath in case misconfigured
67
+ if(!empty($wpabspath)){
68
+ $cleanpath=preg_replace(array('/\\\\/','#[ /]+$#'),array('/',''),$wpabspath);
69
+ $wpabspath=$cleanpath;
 
 
 
70
  }
71
+ if(is_readable($wpabspath. '/wp-config.php')){
72
+ include_once($wpabspath.'/wp-config.php');
73
+ }elseif(is_readable($wpabspath. '/../wp-config.php')){
74
+ include_once($wpabspath.'/../wp-config.php');
75
+ }else{
76
+ die('wp-config.php not found!');
77
+ }
78
+ if(!defined('ABSPATH')) die('wp-config.php do not load!');
79
  }
80
+ //security check#4: check that user is logged in (can be faked)
81
+ $validuser=false;
82
+ $current_user = $GLOBALS['current_user'];
 
83
  //#only logged-in users are allowed to run this script -Helene D.
84
+ if(empty($current_user->user_login)) {
85
+ $logged_user = wp_get_current_user();
86
+ $validuser = (!empty($logged_user->user_login)? true: false);
87
+ }else{
88
+ $validuser=true;
89
  }
90
+ if (!$validuser) wp_die(__("login required!"));
91
 
92
+ //security check#5: check hash value
93
  $hashfail = true;
94
+ $wassup_options=$GLOBALS['wassup_options'];
95
+ if (isset($_GET['whash']) && !empty($wassup_options->whash)){
96
+ if ($_GET['whash'] == $wassup_options->whash || $_GET['whash'] == htmlspecialchars($wassup_options->whash,ENT_QUOTES))
97
+ $hashfail=false;
 
98
  }
99
 
100
  //#perform an "action" and display the results, if any
101
  if (!$hashfail) {
102
+ $wp_version=$GLOBALS['wp_version'];
103
+ $wpdb=$GLOBALS['wpdb'];
104
+
105
+ //define WassUp constants
106
+ if(!defined('WASSUPVERSION')) wassup_init();
107
+ //load wassupOptions class
108
+ if (empty($wassup_options)){
109
+ if(!class_exists('wassupOptions') && file_exists(WASSUPDIR.'/lib/wassup.class.php')){
110
+ if(defined('PHP_VERSION') && version_compare(PHP_VERSION,'5.1','<')) require_once(WASSUPDIR."/lib/compat-lib/wassup.class.php");
111
+ else require_once(WASSUPDIR.'/lib/wassup.class.php');
 
 
 
 
 
112
  }
113
+ $wassup_options = new wassupOptions;
 
114
  }
115
+ //#set required variables
116
+ $wassup_table = $wassup_options->wassup_table;
117
+ $wassup_tmp_table = $wassup_table . "_tmp";
118
  $wdebug_mode=false; //debug set below
 
119
 
120
+ // ### Separate "delete" action for non-html output
121
  // ACTION: DELETE ON THE FLY FROM VISITOR DETAILS VIEW
122
  if ($_GET['action'] == "deleteID") {
123
  if (!empty($_GET['id'])) {
124
+ //make sure there is no suspicious chars in id
125
+ $wassup_id=$wassup_options->cleanFormText($_GET['id']);
126
+ if($wassup_id == $_GET['id']){
127
+ if (method_exists($wpdb,'prepare'))
128
+ $deleted=$wpdb->query($wpdb->prepare("DELETE FROM $wassup_table WHERE `wassup_id`='%s'", $wassup_id));
129
+ else
130
+ $deleted=$wpdb->query(sprintf("DELETE FROM $wassup_table WHERE `wassup_id`='%s'",$wassup_id));
131
+ if(is_wp_error($deleted)){
132
+ $errno=$deleted->get_error_code();
133
+ if((int)$errno > 0){
134
+ $msg=__("An error occurred during delete","wassup")." id=".$wassup_id."\n<br/>";
135
+ $msg.="$errno: ".$deleted->get_error_message()."\n";
136
+ }
137
+ $deleted=0;
138
+ }else{
139
+ $msg=sprintf(__("%d records deleted!","wassup"),$deleted);
140
+ }
141
+ if(empty($deleted)) {
142
+ die($msg);
143
+ }
144
+ }else{
145
+ die(__("Error: invalid id parameter:".esc_attr($_GET['id'])));
146
  }
147
  } else {
148
+ die(__("Error: missing id parameter","wassup"));
149
  }
150
+ exit;
151
  } //end if action==deleteID
152
 
153
  // ### Begin actions that have output...
154
  if (!empty($_GET['debug_mode'])) {
155
  $wdebug_mode=true;
156
  $mode_reset=ini_get('display_errors');
157
+ if(defined('PHP_VERSION')&& version_compare(PHP_VERSION,5.4,'<'))@error_reporting(E_ALL);
158
+ else @error_reporting(E_ALL ^ E_STRICT);
159
+ ini_set('display_errors','On');
 
 
 
 
160
  }
161
+ //load wassup core functions
162
  if (!function_exists('stringShortener')) {
163
+ if (file_exists(WASSUPDIR .'/lib/main.php')) {
164
+ include_once(WASSUPDIR . '/lib/main.php');
165
  } else {
166
+ echo '<span style="font-color:red;">Action '.__("ERROR: file not found","wassup").' - main.php</span>';
167
+ exit;
168
  }
169
  }
170
+ //#perform an action and display output
171
+ //force browser to disable caching so action.php works as an ajax request
172
+ nocache_headers();
173
+ // ACTION: RUN SPY VIEW
174
+ if ($_GET['action'] == "spia") {
175
+ $rows=0;
176
+ $spytype="";
177
+ //cannot use 'get_user_option' for spy timestamp...causes query caching causes duplicates (needs SQL_NO_CACHE)
178
+ //$wassup_user_settings=get_user_option('_wassup_settings');
179
+ //$from_spydate=$wassup_user_settings['utimestamp'];
180
+ $from_spydate=wassupDb::get_wassupmeta($current_user->user_login,"_spytimestamp",true);
181
+ if(empty($from_spydate) || !is_numeric($from_spydate)) $from_spydate="";
182
+ if(!empty($_GET['rows']) && is_numeric($_GET['rows'])) $rows = (int)$_GET['rows'];
183
+ if(!empty($_GET['spiatype'])) $spytype=$wassup_options->cleanFormText($_GET['spiatype']);
184
+ wassup_spiaView($from_spydate,$rows,$spytype);
185
+ exit;
186
+ }
187
+ $vers='?ver='.WASSUPVERSION;
188
+ if($wdebug_mode)$vers.='b'.rand(0,9999);
189
+ $html_head= '
190
+ <!DOCTYPE html>
191
+ <html>
192
+ <head>
193
+ <title>WassUp '.esc_attr($_GET['action']).'</title>
194
+ <link rel="stylesheet" href="'.WASSUPURL.'/css/wassup.css'.$vers.'" type="text/css" />
195
+ </head>
196
+ <body class="wassup-ajax">'."\n";
197
+ if($wdebug_mode){
198
+ $html_head.="<!-- *WassUp DEBUG On-->\n";
199
+ $html_head.="<!-- *normal setting: display_errors=$mode_reset -->\n";
200
+ }
201
+ $html_foot='
202
+ </body>
203
+ </html>';
204
+ //#retrieve common command-line arguments
205
+ $to_date=0;
206
+ $from_date=0;
207
  if (isset($_GET['to_date']) && is_numeric($_GET['to_date'])) {
208
  $to_date = (int)$_GET['to_date'];
209
  } else {
214
  } else {
215
  $from_date = ($to_date - 180); //3 minutes
216
  }
 
 
 
 
 
 
 
217
  //#check that $to_date is a number
218
  if (!is_numeric($to_date)) { //bad date sent
219
+ echo '<span style="color:red;">Action '.__("ERROR: bad date","wassup").', '.$to_date.'</span>';
220
+ exit;
221
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  // ACTION: SUMMARY PIE CHART - TODO
223
+ if ($_GET['action'] == "piechart") {
224
  // Prepare Pie Chart
225
  $wTot = New WassupItems($table_name,$from_date,$to_date);
226
  $items_pie[] = $wTot->calc_tot("count", $search, "AND spam>0", "DISTINCT");
227
  $items_pie[] = $wTot->calc_tot("count", $search, "AND searchengine!='' AND spam=0", "DISTINCT");
228
  $items_pie[] = $wTot->calc_tot("count", $search, "AND searchengine='' AND referrer NOT LIKE '%".$this->WpUrl."%' AND referrer!='' AND spam=0", "DISTINCT");
229
+ $items_pie[] = $wTot->calc_tot("count", $search, "AND searchengine='' AND (referrer LIKE '%".$this->WpUrl."%' OR referrer='') AND spam=0", "DISTINCT");
230
+ echo $html_head;?>
231
+ <div style="text-align: center"><img src="http://chart.apis.google.com/chart?cht=p3&amp;chco=0000ff&amp;chs=600x300&amp;chl=Spam|Search%20Engine|Referrer|Direct&amp;chd=<?php Gchart_data($items_pie, null, null, null, 'pie'); ?>" /></div><?php
232
+ echo $html_foot;
 
 
 
 
 
 
233
 
234
  // ACTION: SHOW TOP TEN
235
+ } elseif ($_GET['action'] == "topten"|| $_GET['action']=="Topstats") {
236
+ $top_limit=0;
237
+ $title="";
238
+ $res=670;
239
+ if(isset($_GET['width']) && is_numeric($_GET['width'])){
240
+ $res = (int)$_GET['width'];
241
+ }
242
+ //show title and print button in popup window
243
+ if(!empty($_GET['popup'])){
244
+ $res=$wassup_options->wassup_screen_res;
245
+ echo '<html>
246
+ <head>
247
+ <title>'.$title.'</title>
248
+ <link rel="stylesheet" id="wassup-style-css" href="'.WASSUPURL.'/css/wassup.css?ver='.WASSUPVERSION.'" type="text/css" media="all" />
249
+ <script type="text/javascript">function printstat(){if(typeof(window.print)!="undefined")window.print();}</script>
250
+ </head>
251
+ <body class="wassup-ajax">
252
+ <div id="wassup-wrap" class="topstats topstats-print">'."\n";
253
+ if($wdebug_mode){
254
+ echo "<!-- *WassUp DEBUG On-->\n";
255
+ echo "<!-- *normal setting: display_errors=$mode_reset -->\n";
256
  }
257
+ }else{
258
+ echo $html_head;
259
+ echo '<div id="wassup-wrap" class="topstats">'."\n";
260
  $title=false;
261
  }
262
+ wassup_top10view($from_date,$to_date,$res,$top_limit,$title);
263
+ echo '</div><!-- /wassup-wrap -->'."\n";
264
+ echo $html_foot;
265
+ exit;
266
+
267
  // ACTION: DISPLAY GEOGRAPHIC AND WHOIS DETAILS - TODO
268
  } else {
269
+ echo $html_head;
270
  echo '<span style="color:red;">Action.php '.__("ERROR: Missing or unknown parameters","wassup").', action='.esc_attr($_GET["action"]).'</span>';
271
+ echo $html_foot;
272
  }
273
  if ($wdebug_mode) {
 
 
 
 
274
  //$wpdb->print_error(); //debug
275
  ini_set('display_errors',$mode_reset); //turn off debug
276
+ }
 
 
277
  } else {
278
+ echo '<html><head><title>WassUp Action Error</title></head><body>';
279
  echo '<span style="color:red;">Action.php '.__("ERROR: Nothing to do here","wassup").'</span>';
280
+ echo '</body></html>';
281
  } //end if !$hashfail
282
  ?>
lib/admin.class.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Defines admin dashboard widget and chart
4
+ *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage admin.class.php module
7
+ * @since: v1.9
8
+ * @author: Helene D. <http://helenesit.com>
9
+ */
10
+ //no direct request for this plugin module
11
+ $wfile=preg_replace('/\\\\/','/',__FILE__); //for windows
12
+ if(!defined('ABSPATH')|| empty($GLOBALS['wp_version'])|| preg_match('#'.preg_quote(basename($wfile)).'#',$_SERVER['PHP_SELF'])|| !empty($_SERVER['SCRIPT_FILENAME'])&& realpath($wfile)===realpath($_SERVER['SCRIPT_FILENAME'])){
13
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
14
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
15
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
16
+ exit;
17
+ }
18
+ unset($wfile);
19
+
20
+ if (!class_exists('wassup_Dashboard_Widgets')){
21
+ /**
22
+ * Static class container for WassUp dashboard widgets functions
23
+ * @since v1.9
24
+ * @author Helene D. - 2014-11-05
25
+ */
26
+ class wassup_Dashboard_Widgets{
27
+ //Private constructor for true static class - prevents direct creation of object
28
+ private function __construct(){}
29
+
30
+ static function init(){
31
+ global $wp_version,$wassup_options;
32
+ $dashwidget_access=$wassup_options->get_access_capability();
33
+ if(!empty($dashwidget_access)&& current_user_can($dashwidget_access)){
34
+ //load Wassup modules as needed
35
+ if(!class_exists('WassupItems')) require_once(WASSUPDIR."/lib/main.php");
36
+ if(version_compare($wp_version,'2.7','<')){
37
+ add_action('activity_box_end',array(__CLASS__,'dash_chart'));
38
+ }else{
39
+ add_action('admin_head',array(__CLASS__,'add_dash_css'),20);
40
+ if(is_network_admin()){
41
+ wp_add_dashboard_widget('wassup-dashwidget1','Visitors Summary',array(__CLASS__,'dash_widget1'));
42
+ }else{
43
+ add_meta_box('wassup-dashwidget1','Visitors Summary',array(__CLASS__,'dash_widget1'),'dashboard','side','high');
44
+ }
45
+ }
46
+ }
47
+ }
48
+ static function remove_dash_widget($widgetid="wassup-dashwidget1"){
49
+ remove_meta_box($widgetid,'dashboard','side');
50
+ }
51
+ static function add_dash_css(){
52
+ global $wdebug_mode;
53
+
54
+ $vers=WASSUPVERSION;
55
+ if($wdebug_mode)$vers.='b'.rand(0,9999);
56
+ echo "\n";?>
57
+ <link rel="stylesheet" href="<?php echo WASSUPURL.'/css/wassup.css?ver='.$vers;?>" type="text/css" /><?php
58
+ }
59
+ /**
60
+ * print a chart in the dashboard for WP < 2.7
61
+ */
62
+ static function dash_chart(){
63
+ global $wpdb,$wassup_options;
64
+ $wassup_table=$wassup_options->wassup_table;
65
+ $wassupfolder=plugin_basename(WASSUPDIR);
66
+ $chart_type = ($wassup_options->wassup_chart_type >0)? $wassup_options->wassup_chart_type: "2";
67
+ $to_date = current_time("timestamp");
68
+ $ctime = 1;
69
+ $date_from = $to_date - (int)(($ctime*24)*3600);
70
+ $whereis="";
71
+ $Chart = New WassupItems($wassup_table,$date_from,$to_date,$whereis);
72
+ $chart_url="";
73
+ if($Chart->totrecords >1){
74
+ $chart_url = $Chart->TheChart($ctime,"400","125","",$chart_type,"bg,s,efebef|c,lg,90,edffff,0,efebef,0.8","dashboard");
75
+ }?>
76
+ <h3>WassUp <?php _e('Stats','wassup'); ?> <cite><a href="admin.php?page=<?php echo $wassupfolder; ?>"><?php _e('More','wassup'); ?> &raquo;</a></cite></h3>
77
+ <div id="wassup-dashchart" class="placeholder" align="center">
78
+ <img src="<?php echo $chart_url; ?>" alt="WassUp <?php _e('visitor stats chart','wassup'); ?>"/>
79
+ </div>
80
+ <?php
81
+ } //end dash_chart
82
+
83
+ /**
84
+ * Output WassUp main dashboard widget
85
+ */
86
+ static function dash_widget1(){
87
+ global $wpdb,$wp_version,$wassup_options,$wdebug_mode;
88
+
89
+ $wassup_table=$wassup_options->wassup_table;
90
+ $wassup_tmp_table=$wassup_table."_tmp";
91
+ $chart_type=($wassup_options->wassup_chart_type >0)?$wassup_options->wassup_chart_type:"2";
92
+ $res=((int)$wassup_options->wassup_screen_res-160)/2;
93
+ $to_date=current_time("timestamp");
94
+ $ctime=1;
95
+ $date_from=$to_date - (int)(($ctime*24)*3600);
96
+ $whereis="";
97
+ if(is_multisite() && $wassup_options->network_activated_plugin()){
98
+ if(!is_network_admin() && !empty($GLOBALS['current_blog']->blog_id)) $whereis .=sprintf(" AND `subsite_id`=%d",(int)$GLOBALS['current_blog']->blog_id);
99
+ }
100
+ $Chart=New WassupItems($wassup_table,$date_from,$to_date,$whereis);
101
+ $chart_url="";
102
+ if($Chart->totrecords >1){
103
+ $chart_url=$Chart->TheChart($ctime,$res,"180","",$chart_type,"bg,s,f3f5f5|c,lg,90,edffff,0,f3f5f5,0.8","dashboard");
104
+ }
105
+ $max_char_len=40;
106
+ echo "\n";?>
107
+ <div class="wassup-dashbox"<?php
108
+ if(version_compare($wp_version,"3.5","<")) echo ' style="margin:-10px;"';
109
+ elseif(version_compare($wp_version,"3.8","<")) echo ' style="margin:-10px -12px -10px -10px;"';?>>
110
+ <cite><a href="<?php echo admin_url('index.php?page=wassup-stats');?>"><?php _e('More Stats','wassup');?> &raquo;</a></cite><?php
111
+ echo "\n";
112
+ //Show chart...
113
+ if(!empty($chart_url)){?>
114
+ <div class="wassup-dashitem no-bottom-border">
115
+ <p id="wassup-dashchart" class="placeholder" align="center" style="margin:0 auto;padding:0;"><img src="<?php echo$chart_url.'" alt="[img: WassUp '.__('visitor stats chart','wassup').']';?>"/></p>
116
+ </div><?php
117
+ echo "\n";
118
+ }
119
+ //Show online count...
120
+ $currenttot=0;
121
+ if(!empty($wassup_options->wassup_active)){
122
+ //New in v1.9: variable timeframes for online counts: spiders for 1 min, regular visitors for 3 minutes, logged-in users for 10 minutes
123
+ $to_date=current_time('timestamp');
124
+ $from_date=$to_date - 10*60; //-10 minutes
125
+ $sql=sprintf("SELECT wassup_id, max(timestamp) as max_timestamp, `ip`, urlrequested, `referrer`, searchengine, spider, `username`, comment_author, language, spam FROM $wassup_tmp_table WHERE `timestamp`>'%d' AND (`username`!='' OR `timestamp`>'%d' OR (`timestamp`>'%d' AND `spider`='')) %s GROUP BY wassup_id ORDER BY max_timestamp DESC",$from_date,$to_date - 1*60,$to_date - 3*60,$whereis);
126
+ $qryC=$wpdb->get_results($sql);
127
+ if(!empty($qryC)){
128
+ if(is_array($qryC)) $currenttot=count($qryC);
129
+ elseif(is_wp_error($qryC)) $error_msg=" error# ".$qryC->get_error_code().": ".$qryC->get_error_message()."\nSQL=".esc_attr($sql)."\n";
130
+ }
131
+ if($wdebug_mode){
132
+ echo "\n<!-- ";
133
+ if(!empty($error_msg)){
134
+ echo "wassup_Dashboard_Widgets ERROR: ".$error_msg;
135
+ }elseif($currenttot >0){
136
+ echo "&nbsp; &nbsp; qryC=";
137
+ print_r($qryC);
138
+ }
139
+ echo "\n-->";
140
+ }
141
+ }
142
+ if($currenttot > 0){ ?>
143
+ <div class="wassup-dashitem no-top-border">
144
+ <h5><?php echo '<strong>'.$currenttot."</strong>".__("Visitors online","wassup");?></h5><?php
145
+ echo "\n";?>
146
+ </div>
147
+ <div class="wassup-dashitem"><?php
148
+ $Ousername=array();
149
+ $Ocomment_author=array();
150
+ $prev_url="";
151
+ $prev_wassupid="";
152
+ $char_len=$max_char_len;
153
+ $siteurl=wassupURI::get_sitehome();
154
+ $wpurl=wassupURI::get_wphome();
155
+ foreach($qryC as $cv){
156
+ //don't show duplicates
157
+ if(($cv->urlrequested!=$prev_url || $cv->wassup_id!=$prev_wassupid)){
158
+ $prev_url=$cv->urlrequested;
159
+ $prev_wassupid=$cv->wassup_id;
160
+ if ($wassup_options->wassup_time_format == 24) $timed = gmdate("H:i:s", $cv->max_timestamp);
161
+ else $timed = gmdate("h:i:s a", $cv->max_timestamp);
162
+ $ip=wassup_clientIP($cv->ip);
163
+ $referrer="";
164
+ if($cv->referrer !='' && stristr($cv->referrer,$wpurl)!=$cv->referrer && stristr($cv->referrer,$siteurl)!=$cv->referrer){
165
+ if ($cv->searchengine !="")$referrer=wassupURI::se_link($cv->referrer,$char_len,$cv->spam);
166
+ else $referrer=wassupURI::referrer_link($cv->referrer,$cv->urlrequested,$char_len,$cv->spam);
167
+ }
168
+ $requrl=wassupURI::url_link($cv->urlrequested,$char_len,$cv->spam);
169
+ if($cv->username!="" || $cv->comment_author!=""){
170
+ if($cv->username!=""){
171
+ $Ousername[]=esc_attr($cv->username);
172
+ if(!empty($cv->comment_author))$Ocomment_author[]=esc_attr($cv->comment_author);
173
+ }elseif($cv->comment_author!=""){
174
+ $Ocomment_author[]=esc_attr($cv->comment_author);
175
+ }
176
+ }
177
+ //don't show admin requests to users
178
+ if(preg_match('#\/wp\-(admin|includes|content)\/#',$cv->urlrequested)==0 || current_user_can('manage_options')){
179
+ echo "\n";?>
180
+ <p><strong><?php echo esc_attr($timed);?></strong> &middot; <?php echo esc_attr($ip); ?> &rarr; <?php echo $requrl;
181
+ if(!empty($referrer)) echo '<br />'.__("Referrer","wassup").': <span class="widgetref">'.$referrer.'</span>';?></p><?php
182
+ }
183
+ } //end if cv->urlrequested
184
+ } //end foreach qryC
185
+ echo "\n";?>
186
+ </div><?php
187
+ if(count($Ousername)>0){
188
+ natcasesort($Ousername);
189
+ echo "\n";?>
190
+ <div class="wassup-dashitem<?php if(count($Ocomment_author)==0)echo ' no-bottom-border';?>"><p><?php
191
+ echo __('Registered users','wassup').': <span class="loggedin">'.implode('</span> &middot; <span class="loggedin">',array_unique($Ousername)).'</span>';?></p></div><?php
192
+ }
193
+ if(count($Ocomment_author)>0){
194
+ natcasesort($Ocomment_author);
195
+ echo "\n";?>
196
+ <div class="wassup-dashitem no-bottom-border"><p><?php
197
+ echo __('Comment authors','wassup').': <span class="commentaut">'.implode('</span> &middot; <span class="commentaut">',$Ocomment_author).'</span>';?></p></div><?php
198
+ }
199
+ }elseif(!empty($wassup_options->wassup_active)){ ?>
200
+ <div class="wassup-dashitem no-top-border no-bottom-border">
201
+ <h5><strong>1</strong> <?php _e("Visitor online","wassup");?></h5>
202
+ </div><?php
203
+
204
+ }else{ ?>
205
+ <div class="wassup-dashitem no-top-border no-bottom-border">
206
+ <p><?php echo "&nbsp; ".__("No online data!","wassup");?></p>
207
+ </div><?php
208
+ } //end if currentot>0
209
+ echo "\n";?>
210
+ <div class="wassup-dashitem no-top-border no-bottom-border"><span class="wassup-marque"><?php echo __("powered by","wassup").' <a href="http://www.wpwp.org/" title="WassUp - '.__("Real Time Visitors Tracking","wassup").'">WassUp</a>';?></span></div>
211
+ </div><!-- /wassup-dashbox --><?php
212
+ $wdebug_mode=false; //turn off debug after display of widget due to ajax conflict.
213
+ } //end dash_widget1
214
+ } //end Class wassup_Dashboard_Widgets
215
+ } //end if class_exists
lib/akismet.class.php CHANGED
@@ -1,6 +1,22 @@
1
  <?php
2
  /**
3
- * 01.07.2008 22:32:28est
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  *
5
  * Akismet PHP4 class
6
  *
@@ -27,172 +43,101 @@
27
  * }
28
  * </code>
29
  *
30
- * @author Bret Kuhns {@link www.miphp.net}
31
- * @link http://www.miphp.net/blog/view/new_akismet_class/
32
- * @version 0.3.4
33
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
34
  */
35
-
36
-
37
-
38
  // Error constants
39
- define("AKISMET_SERVER_NOT_FOUND", 0);
40
- define("AKISMET_RESPONSE_FAILED", 1);
41
- define("AKISMET_INVALID_KEY", 2);
42
-
43
-
44
 
45
  // Base class to assist in error handling between Akismet classes
46
- class AkismetObject {
47
  var $errors = array();
48
 
49
-
50
- /**
51
- * Add a new error to the errors array in the object
52
- *
53
- * @param String $name A name (array key) for the error
54
- * @param String $string The error message
55
- * @return void
56
- */
57
  // Set an error in the object
58
- function setError($name, $message) {
59
- $this->errors[$name] = $message;
60
- }
61
-
62
-
63
- /**
64
- * Return a specific error message from the errors array
65
- *
66
- * @param String $name The name of the error you want
67
- * @return mixed Returns a String if the error exists, a false boolean if it does not exist
68
- */
69
- function getError($name) {
70
- if($this->isError($name)) {
71
- return $this->errors[$name];
72
- } else {
73
- return false;
74
- }
75
- }
76
-
77
-
78
- /**
79
- * Return all errors in the object
80
- *
81
- * @return String[]
82
- */
83
- function getErrors() {
84
- return (array)$this->errors;
85
  }
86
 
 
 
87
 
88
- /**
89
- * Check if a certain error exists
90
- *
91
- * @param String $name The name of the error you want
92
- * @return boolean
93
- */
94
- function isError($name) {
95
- return isset($this->errors[$name]);
96
- }
97
-
98
 
99
- /**
100
- * Check if any errors exist
101
- *
102
- * @return boolean
103
- */
104
- function errorsExist() {
105
- return (count($this->errors) > 0);
106
  }
107
-
108
-
109
  }
110
 
111
-
112
-
113
-
114
-
115
- // Used by the Akismet class to communicate with the Akismet service
116
- class AkismetHttpClient extends AkismetObject {
117
- var $akismetVersion = '1.1';
118
  var $con;
119
  var $host;
120
  var $port;
121
  var $apiKey;
122
  var $blogUrl;
123
- var $errors = array();
124
-
125
 
126
  // Constructor
127
- function AkismetHttpClient($host, $blogUrl, $apiKey, $port = 80) {
128
- $this->host = $host;
129
- $this->port = $port;
130
- $this->blogUrl = $blogUrl;
131
- $this->apiKey = $apiKey;
132
  }
133
 
134
-
135
  // Use the connection active in $con to get a response from the server and return that response
136
- function getResponse($request, $path, $type = "post", $responseLength = 1160) {
137
  $this->_connect();
138
-
139
- if($this->con && !$this->isError(AKISMET_SERVER_NOT_FOUND)) {
140
- $request =
141
- strToUpper($type)." /{$this->akismetVersion}/$path HTTP/1.0\r\n" .
142
- "Host: ".((!empty($this->apiKey)) ? $this->apiKey."." : null)."{$this->host}\r\n" .
143
- "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" .
144
- "Content-Length: ".strlen($request)."\r\n" .
145
- "User-Agent: Akismet PHP4 Class\r\n" .
146
- "\r\n" .
147
- $request
148
- ;
149
- $response = "";
150
-
151
- @fwrite($this->con, $request);
152
-
153
- while(!feof($this->con)) {
154
- $response .= @fgets($this->con, $responseLength);
155
  }
156
-
157
- $response = explode("\r\n\r\n", $response, 2);
158
  return $response[1];
159
- } else {
160
- $this->setError(AKISMET_RESPONSE_FAILED, "The response could not be retrieved.");
161
  }
162
-
163
  $this->_disconnect();
164
  }
165
 
166
-
167
  // Connect to the Akismet server and store that connection in the instance variable $con
168
- function _connect() {
169
- if(!($this->con = @fsockopen($this->host, $this->port, $con_errornum, $con_errormsg, 1))) {
170
- $this->setError(AKISMET_SERVER_NOT_FOUND, "Could not connect to akismet server.");
171
  }
172
  }
173
 
174
-
175
  // Close the connection to the Akismet server
176
- function _disconnect() {
177
- @fclose($this->con);
178
- }
179
-
180
-
181
- }
182
-
183
 
184
-
185
-
186
-
187
- // The controlling class. This is the ONLY class the user should instantiate in
188
- // order to use the Akismet service!
189
- class Akismet extends AkismetObject {
190
- var $apiPort = 80;
191
- var $akismetServer = 'rest.akismet.com';
192
- var $akismetVersion = '1.1';
193
  var $http;
194
-
195
- var $ignore = array(
196
  'HTTP_COOKIE',
197
  'HTTP_X_FORWARDED_FOR',
198
  'HTTP_X_FORWARDED_HOST',
@@ -205,184 +150,131 @@ class Akismet extends AkismetObject {
205
  'SERVER_ADMIN',
206
  'QUERY_STRING',
207
  'PHP_SELF',
208
- 'argv'
209
- );
210
-
211
- var $blogUrl = "";
212
- var $apiKey = "";
213
- var $comment = array();
214
-
215
 
216
  /**
217
  * Constructor
 
218
  *
219
- * Set instance variables, connect to Akismet, and check API key
220
- *
221
- * @param String $blogUrl The URL to your own blog
222
- * @param String $apiKey Your wordpress API key
223
- * @param String[] $comment A formatted comment array to be examined by the Akismet service
224
- * @return Akismet
225
  */
226
- function Akismet($blogUrl, $apiKey, $comment = array()) {
227
- $this->blogUrl = $blogUrl;
228
- $this->apiKey = $apiKey;
229
  $this->setComment($comment);
230
 
231
  // Connect to the Akismet server and populate errors if they exist
232
- $this->http = new AkismetHttpClient($this->akismetServer, $blogUrl, $apiKey);
233
  if($this->http->errorsExist()) {
234
  $this->errors = array_merge($this->errors, $this->http->getErrors());
235
  }
236
 
237
  // Check if the API key is valid
238
- if(!$this->_isValidApiKey($apiKey)) {
239
- $this->setError(AKISMET_INVALID_KEY, "Your Akismet API key is not valid.");
240
  }
241
  }
242
 
243
-
244
- /**
245
- * Query the Akismet and determine if the comment is spam or not
246
- *
247
- * @return boolean
248
- */
249
  function isSpam() {
250
- $response = $this->http->getResponse($this->_getQueryString(), 'comment-check');
251
-
252
- return ($response == "true");
 
 
 
 
 
 
 
 
 
 
 
 
253
  }
254
 
255
-
256
- /**
257
- * Submit this comment as an unchecked spam to the Akismet server
258
- *
259
- * @return void
260
- */
261
- function submitSpam() {
262
- $this->http->getResponse($this->_getQueryString(), 'submit-spam');
263
  }
264
 
265
-
266
- /**
267
- * Submit a false-positive comment as "ham" to the Akismet server
268
- *
269
- * @return void
270
- */
271
- function submitHam() {
272
- $this->http->getResponse($this->_getQueryString(), 'submit-ham');
273
  }
274
 
275
-
276
- /**
277
- * Manually set the comment value of the instantiated object.
278
- *
279
- * @param Array $comment
280
- * @return void
281
- */
282
- function setComment($comment) {
283
  $this->comment = $comment;
284
- if(!empty($comment)) {
285
  $this->_formatCommentArray();
286
  $this->_fillCommentValues();
287
  }
288
  }
289
 
 
 
290
 
291
- /**
292
- * Returns the current value of the object's comment array.
293
- *
294
- * @return Array
295
- */
296
- function getComment() {
297
- return $this->comment;
298
- }
299
-
300
-
301
- /**
302
- * Check with the Akismet server to determine if the API key is valid
303
- *
304
- * @access Protected
305
- * @param String $key The Wordpress API key passed from the constructor argument
306
- * @return boolean
307
- */
308
- function _isValidApiKey($key) {
309
- $keyCheck = $this->http->getResponse("key=".$this->apiKey."&blog=".$this->blogUrl, 'verify-key');
310
-
311
- return ($keyCheck == "valid");
312
  }
313
 
314
-
315
- /**
316
- * Format the comment array in accordance to the Akismet API
317
- *
318
- * @access Protected
319
- * @return void
320
- */
321
- function _formatCommentArray() {
322
- $format = array(
323
- 'type' => 'comment_type',
324
- 'author' => 'comment_author',
325
- 'email' => 'comment_author_email',
326
- 'website' => 'comment_author_url',
327
- 'body' => 'comment_content'
328
- );
329
-
330
- foreach($format as $short => $long) {
331
- if(isset($this->comment[$short])) {
332
- $this->comment[$long] = $this->comment[$short];
333
  unset($this->comment[$short]);
334
  }
335
  }
336
  }
337
 
338
-
339
- /**
340
- * Fill any values not provided by the developer with available values.
341
- *
342
- * @return void
343
- */
344
- function _fillCommentValues() {
345
- if(!isset($this->comment['user_ip'])) {
346
- $this->comment['user_ip'] = ($_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) ? $_SERVER['REMOTE_ADDR'] : getenv('HTTP_X_FORWARDED_FOR');
347
  }
348
- if(!isset($this->comment['user_agent'])) {
349
- $this->comment['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
350
  }
351
- if(!isset($this->comment['referrer'])) {
352
- $this->comment['referrer'] = $_SERVER['HTTP_REFERER'];
353
  }
354
- if(!isset($this->comment['blog'])) {
355
- $this->comment['blog'] = $this->blogUrl;
356
  }
357
  }
358
 
359
-
360
- /**
361
- * Build a query string for use with HTTP requests
362
- *
363
- * @access Protected
364
- * @return String
365
- */
366
- function _getQueryString() {
367
- foreach($_SERVER as $key => $value) {
368
- if(!in_array($key, $this->ignore)) {
369
- if($key == 'REMOTE_ADDR') {
370
- $this->comment[$key] = $this->comment['user_ip'];
371
- } else {
372
- $this->comment[$key] = $value;
373
  }
374
  }
375
  }
376
-
377
- $query_string = '';
378
-
379
- foreach($this->comment as $key => $data) {
380
- $query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
381
  }
382
-
383
  return $query_string;
384
  }
385
-
386
-
387
- }
388
  ?>
1
  <?php
2
  /**
3
+ * For Akismet spam check on wassup visitor records
4
+ *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage akismet.class.php module
7
+ */
8
+ //no direct request for this plugin module
9
+ $wfile=preg_replace('/\\\\/','/',__FILE__); //for windows
10
+ if(!defined('ABSPATH')|| empty($GLOBALS['wp_version'])|| preg_match('#'.preg_quote(basename($wfile)).'#',$_SERVER['PHP_SELF'])|| !empty($_SERVER['SCRIPT_FILENAME'])&& realpath($wfile)===realpath($_SERVER['SCRIPT_FILENAME'])){
11
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
12
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
13
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
14
+ exit;
15
+ }
16
+ unset($wfile);
17
+ //New in Wassup v1.9: Classes and constants renamed for compatibility with Akismet v3.0.0 -Helene D. 2014-05-01
18
+ /**
19
+ * 08.11.2010 22:25:17est
20
  *
21
  * Akismet PHP4 class
22
  *
43
  * }
44
  * </code>
45
  *
46
+ * @author Bret Kuhns {@link www.bretkuhns.com}
47
+ * @link http://code.google.com/p/akismet-php4
48
+ * @version 0.3.5
49
  * @license http://www.opensource.org/licenses/mit-license.php MIT License
50
  */
 
 
 
51
  // Error constants
52
+ define("WASSUP_AKISMET_SERVER_NOT_FOUND", 0);
53
+ define("WASSUP_AKISMET_RESPONSE_FAILED", 1);
54
+ define("WASSUP_AKISMET_INVALID_KEY", 2);
 
 
55
 
56
  // Base class to assist in error handling between Akismet classes
57
+ class wassup_AkismetObject {
58
  var $errors = array();
59
 
 
 
 
 
 
 
 
 
60
  // Set an error in the object
61
+ function setError($name,$message){$this->errors[$name]=$message;}
62
+ function getError($name){
63
+ if($this->isError($name)){return $this->errors[$name];}
64
+ else {return false;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
+ //Return all errors in the object
68
+ function getErrors(){return (array)$this->errors;}
69
 
70
+ // Check if a certain error exists
71
+ function isError($name){return isset($this->errors[$name]);}
 
 
 
 
 
 
 
 
72
 
73
+ // Check if any errors exist
74
+ function errorsExist(){return (count($this->errors)>0);}
75
+
76
+ //New in Wassup v1.9: Remove timeout error
77
+ function removeError($name,$message){
78
+ if(!empty($this->errors[$name])&& $this->errors[$name]==$message)unset($this->errors[$name]);
 
79
  }
 
 
80
  }
81
 
82
+ // Used by the wassup_Akismet class to communicate with the Akismet service
83
+ class wassup_AkismetHttpClient extends wassup_AkismetObject {
84
+ var $akismetVersion='1.1';
 
 
 
 
85
  var $con;
86
  var $host;
87
  var $port;
88
  var $apiKey;
89
  var $blogUrl;
90
+ var $errors=array();
 
91
 
92
  // Constructor
93
+ function wassup_AkismetHttpClient($host,$blogUrl,$apiKey,$port=80){
94
+ $this->host=$host;
95
+ $this->port=$port;
96
+ $this->blogUrl=$blogUrl;
97
+ $this->apiKey=$apiKey;
98
  }
99
 
 
100
  // Use the connection active in $con to get a response from the server and return that response
101
+ function getResponse($request,$path,$type="post",$responseLength=1160){
102
  $this->_connect();
103
+ if($this->con && !$this->isError(WASSUP_AKISMET_SERVER_NOT_FOUND)){
104
+ $request=strToUpper($type)." /{$this->akismetVersion}/$path HTTP/1.0\r\n" .
105
+ "Host: ".((!empty($this->apiKey)) ? $this->apiKey."." : null)."{$this->host}\r\n" .
106
+ "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n" .
107
+ "Content-Length: ".strlen($request)."\r\n" .
108
+ "User-Agent: Wassup ".WASSUPVERSION." Akismet PHP4 Class\r\n" .
109
+ "\r\n".$request;
110
+ $response="";
111
+ @fwrite($this->con,$request);
112
+ while(!feof($this->con)){
113
+ $response .= @fgets($this->con,$responseLength);
 
 
 
 
 
 
114
  }
115
+ $response=explode("\r\n\r\n",$response,2);
 
116
  return $response[1];
117
+ }else{
118
+ $this->setError(WASSUP_AKISMET_RESPONSE_FAILED, __("The response could not be retrieved.","wassup"));
119
  }
 
120
  $this->_disconnect();
121
  }
122
 
 
123
  // Connect to the Akismet server and store that connection in the instance variable $con
124
+ function _connect(){
125
+ if(!($this->con=@fsockopen($this->host,$this->port))){
126
+ $this->setError(WASSUP_AKISMET_SERVER_NOT_FOUND,__("Could not connect to akismet server.","wassup"));
127
  }
128
  }
129
 
 
130
  // Close the connection to the Akismet server
131
+ function _disconnect(){@fclose($this->con);}
132
+ } //end Class
 
 
 
 
 
133
 
134
+ // The controlling class. This is the ONLY class the user should instantiate in order to use the Akismet service!
135
+ class wassup_Akismet extends wassup_AkismetObject {
136
+ var $apiPort=80;
137
+ var $akismetServer='rest.akismet.com';
138
+ var $akismetVersion='1.1';
 
 
 
 
139
  var $http;
140
+ var $ignore=array(
 
141
  'HTTP_COOKIE',
142
  'HTTP_X_FORWARDED_FOR',
143
  'HTTP_X_FORWARDED_HOST',
150
  'SERVER_ADMIN',
151
  'QUERY_STRING',
152
  'PHP_SELF',
153
+ 'argv');
154
+ var $blogUrl="";
155
+ var $apiKey ="";
156
+ var $comment=array();
 
 
 
157
 
158
  /**
159
  * Constructor
160
+ * Set instance variables, connect to Akismet, check API key
161
  *
162
+ * @param String $blogUrl - The URL to your own blog
163
+ * @param String $apiKey - Your wordpress API key
164
+ * @param String[] $comment - A formatted comment array to be examined by the Akismet service
165
+ * @return Akismet
 
 
166
  */
167
+ function wassup_Akismet($blogUrl,$apiKey,$comment=array()) {
168
+ $this->blogUrl=$blogUrl;
169
+ $this->apiKey =$apiKey;
170
  $this->setComment($comment);
171
 
172
  // Connect to the Akismet server and populate errors if they exist
173
+ $this->http=new wassup_AkismetHttpClient($this->akismetServer,$blogUrl,$apiKey);
174
  if($this->http->errorsExist()) {
175
  $this->errors = array_merge($this->errors, $this->http->getErrors());
176
  }
177
 
178
  // Check if the API key is valid
179
+ if(!$this->_isValidApiKey($apiKey)){
180
+ $this->setError(WASSUP_AKISMET_INVALID_KEY,__("Your Akismet API key is not valid.","wassup"));
181
  }
182
  }
183
 
184
+ //Query the Akismet and determine if the comment is spam or not
 
 
 
 
 
185
  function isSpam() {
186
+ //New in Wassup v1.9: shorten script timeout to prevent slowdowns due to slow server response
187
+ //lets not wait for slow server response //TODO - test
188
+ $stimeout=0;
189
+ if(!ini_get('safe_mode')){
190
+ $stimeout=ini_get("max_execution_time");
191
+ //set error in case of timeout
192
+ $this->setError(WASSUP_AKISMET_RESPONSE_FAILED,__("Timed out waiting for server response.","wassup"));
193
+ if((int)$stimeout>7)set_time_limit(7);
194
+ }
195
+ $response=$this->http->getResponse($this->_getQueryString(),'comment-check');
196
+ if(!empty($stimeout)){
197
+ set_time_limit($stimeout);
198
+ $this->removeError(WASSUP_AKISMET_RESPONSE_FAILED,__("Timed out waiting for server response.","wassup"));
199
+ }
200
+ return ($response=="true");
201
  }
202
 
203
+ // Submit this comment as an unchecked spam to the Akismet server
204
+ function submitSpam(){
205
+ $this->http->getResponse($this->_getQueryString(),'submit-spam');
 
 
 
 
 
206
  }
207
 
208
+ // Submit a false-positive comment as "ham" to the Akismet server
209
+ function submitHam(){
210
+ $this->http->getResponse($this->_getQueryString(),'submit-ham');
 
 
 
 
 
211
  }
212
 
213
+ // Manually set the comment value of the instantiated object.
214
+ function setComment($comment){
 
 
 
 
 
 
215
  $this->comment = $comment;
216
+ if(!empty($comment)){
217
  $this->_formatCommentArray();
218
  $this->_fillCommentValues();
219
  }
220
  }
221
 
222
+ // Returns the current value of the object's comment array.
223
+ function getComment(){return $this->comment;}
224
 
225
+ // Check with the Akismet server to determine if the API key is valid
226
+ function _isValidApiKey($key){
227
+ $keyCheck=$this->http->getResponse("key=".$this->apiKey."&blog=".$this->blogUrl,'verify-key');
228
+ return ($keyCheck=="valid");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  }
230
 
231
+ // Format the comment array in accordance to the Akismet API
232
+ function _formatCommentArray(){
233
+ $format=array( 'type' =>'comment_type',
234
+ 'author'=>'comment_author',
235
+ 'email' =>'comment_author_email',
236
+ 'website'=>'comment_author_url',
237
+ 'body' =>'comment_content');
238
+ foreach($format as $short=>$long){
239
+ if(isset($this->comment[$short])){
240
+ $this->comment[$long]=$this->comment[$short];
 
 
 
 
 
 
 
 
 
241
  unset($this->comment[$short]);
242
  }
243
  }
244
  }
245
 
246
+ // Fill any values not provided by the developer with available values.
247
+ function _fillCommentValues(){
248
+ if(!isset($this->comment['user_ip'])){
249
+ $this->comment['user_ip']=($_SERVER['REMOTE_ADDR']!=getenv('SERVER_ADDR')) ?$_SERVER['REMOTE_ADDR'] :getenv('HTTP_X_FORWARDED_FOR');
 
 
 
 
 
250
  }
251
+ if(!isset($this->comment['user_agent'])){
252
+ $this->comment['user_agent']=$_SERVER['HTTP_USER_AGENT'];
253
  }
254
+ if(!isset($this->comment['referrer'])){
255
+ $this->comment['referrer']=$_SERVER['HTTP_REFERER'];
256
  }
257
+ if(!isset($this->comment['blog'])){
258
+ $this->comment['blog']=$this->blogUrl;
259
  }
260
  }
261
 
262
+ // Build a query string for use with HTTP requests
263
+ function _getQueryString(){
264
+ foreach($_SERVER as $key=>$value){
265
+ if(!in_array($key,$this->ignore)){
266
+ if($key=='REMOTE_ADDR'){
267
+ $this->comment[$key]=$this->comment['user_ip'];
268
+ }else{
269
+ $this->comment[$key]=$value;
 
 
 
 
 
 
270
  }
271
  }
272
  }
273
+ $query_string='';
274
+ foreach($this->comment as $key=>$data){
275
+ $query_string .=$key.'='.urlencode(stripslashes($data)).'&';
 
 
276
  }
 
277
  return $query_string;
278
  }
279
+ } //end Class
 
 
280
  ?>
lib/compat-lib/admin.class.php ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Defines admin dashboard widget and chart...with PHP4/backward compatible code
4
+ *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage compat/admin.class.php module
7
+ * @since: v1.9
8
+ * @author: Helene D. <http://helenesit.com>
9
+ */
10
+ //no direct request for this plugin module
11
+ $wfile=preg_replace('/\\\\/','/',__FILE__); //for windows
12
+ if(!defined('ABSPATH')|| empty($GLOBALS['wp_version'])|| preg_match('#'.preg_quote(basename($wfile)).'#',$_SERVER['PHP_SELF'])|| !empty($_SERVER['SCRIPT_FILENAME'])&& realpath($wfile)===realpath($_SERVER['SCRIPT_FILENAME'])){
13
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
14
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
15
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
16
+ exit;
17
+ }
18
+ unset($wfile);
19
+
20
+ if (!class_exists('wassup_Dashboard_Widgets')){
21
+ /**
22
+ * Static class container for WassUp dashboard widgets functions
23
+ * @since v1.9
24
+ * @author Helene D. - 2014-11-05
25
+ */
26
+ class wassup_Dashboard_Widgets{
27
+ function init(){
28
+ global $wp_version,$wassup_options;
29
+ $dashwidget_access=$wassup_options->get_access_capability();
30
+ if(!empty($dashwidget_access)&& current_user_can($dashwidget_access)){
31
+ //load Wassup modules as needed
32
+ if(!class_exists('WassupItems')) require_once(WASSUPDIR."/lib/main.php");
33
+ if(version_compare($wp_version,'2.7','<')){
34
+ add_action('activity_box_end',array(__CLASS__,'dash_chart'));
35
+ }else{
36
+ add_action('admin_head',array(__CLASS__,'add_dash_css'),20);
37
+ if(is_network_admin()){
38
+ wp_add_dashboard_widget('wassup-dashwidget1','Visitors Summary',array(__CLASS__,'dash_widget1'));
39
+ }else{
40
+ add_meta_box('wassup-dashwidget1','Visitors Summary',array(__CLASS__,'dash_widget1'),'dashboard','side','high');
41
+ }
42
+ }
43
+ }
44
+ }
45
+ function remove_dash_widget($widgetid="wassup-dashwidget1"){
46
+ remove_meta_box($widgetid,'dashboard','side');
47
+ }
48
+ function add_dash_css(){
49
+ global $wdebug_mode;
50
+
51
+ $vers=WASSUPVERSION;
52
+ if($wdebug_mode)$vers.='b'.rand(0,9999);
53
+ echo "\n";?>
54
+ <link rel="stylesheet" href="<?php echo WASSUPURL.'/css/wassup.css?ver='.$vers;?>" type="text/css" /><?php
55
+ }
56
+ /**
57
+ * print a chart in the dashboard for WP < 2.7
58
+ */
59
+ function dash_chart(){
60
+ global $wpdb,$wassup_options;
61
+ $wassup_table=$wassup_options->wassup_table;
62
+ $wassupfolder=plugin_basename(WASSUPDIR);
63
+ $chart_type = ($wassup_options->wassup_chart_type >0)? $wassup_options->wassup_chart_type: "2";
64
+ $to_date = current_time("timestamp");
65
+ $ctime = 1;
66
+ $date_from = $to_date - (int)(($ctime*24)*3600);
67
+ $whereis="";
68
+ $Chart = New WassupItems($wassup_table,$date_from,$to_date,$whereis);
69
+ $chart_url="";
70
+ if($Chart->totrecords >1){
71
+ $chart_url = $Chart->TheChart($ctime,"400","125","",$chart_type,"bg,s,efebef|c,lg,90,edffff,0,efebef,0.8","dashboard");
72
+ }?>
73
+ <h3>WassUp <?php _e('Stats','wassup'); ?> <cite><a href="admin.php?page=<?php echo $wassupfolder; ?>"><?php _e('More','wassup'); ?> &raquo;</a></cite></h3>
74
+ <div id="wassup-dashchart" class="placeholder" align="center">
75
+ <img src="<?php echo $chart_url; ?>" alt="WassUp <?php _e('visitor stats chart','wassup'); ?>"/>
76
+ </div>
77
+ <?php
78
+ } //end dash_chart
79
+
80
+ /**
81
+ * Output WassUp main dashboard widget
82
+ */
83
+ function dash_widget1(){
84
+ global $wpdb,$wp_version,$wassup_options,$wdebug_mode;
85
+
86
+ $wassup_table=$wassup_options->wassup_table;
87
+ $wassup_tmp_table=$wassup_table."_tmp";
88
+ $chart_type=($wassup_options->wassup_chart_type >0)?$wassup_options->wassup_chart_type:"2";
89
+ $res=((int)$wassup_options->wassup_screen_res-160)/2;
90
+ $to_date=current_time("timestamp");
91
+ $ctime=1;
92
+ $date_from=$to_date - (int)(($ctime*24)*3600);
93
+ $whereis="";
94
+ if(is_multisite() && $wassup_options->network_activated_plugin()){
95
+ if(!is_network_admin() && !empty($GLOBALS['current_blog']->blog_id)) $whereis .=sprintf(" AND `subsite_id`=%d",(int)$GLOBALS['current_blog']->blog_id);
96
+ }
97
+ $Chart=New WassupItems($wassup_table,$date_from,$to_date,$whereis);
98
+ $chart_url="";
99
+ if($Chart->totrecords >1){
100
+ $chart_url=$Chart->TheChart($ctime,$res,"180","",$chart_type,"bg,s,f3f5f5|c,lg,90,edffff,0,f3f5f5,0.8","dashboard");
101
+ }
102
+ $max_char_len=40;
103
+ echo "\n";?>
104
+ <div class="wassup-dashbox"<?php
105
+ if(version_compare($wp_version,"3.5","<")) echo ' style="margin:-10px;"';
106
+ elseif(version_compare($wp_version,"3.8","<")) echo ' style="margin:-10px -12px -10px -10px;"';?>>
107
+ <cite><a href="<?php echo admin_url('index.php?page=wassup-stats');?>"><?php _e('More Stats','wassup');?> &raquo;</a></cite><?php
108
+ echo "\n";
109
+ //Show chart...
110
+ if(!empty($chart_url)){?>
111
+ <div class="wassup-dashitem no-bottom-border">
112
+ <p id="wassup-dashchart" class="placeholder" align="center" style="margin:0 auto;padding:0;"><img src="<?php echo$chart_url.'" alt="[img: WassUp '.__('visitor stats chart','wassup').']';?>"/></p>
113
+ </div><?php
114
+ echo "\n";
115
+ }
116
+ //Show online count...
117
+ $currenttot=0;
118
+ if(!empty($wassup_options->wassup_active)){
119
+ //New in v1.9: variable timeframes for online counts: spiders for 1 min, regular visitors for 3 minutes, logged-in users for 10 minutes
120
+ $to_date=current_time('timestamp');
121
+ $from_date=$to_date - 10*60; //-10 minutes
122
+ $sql=sprintf("SELECT wassup_id, max(timestamp) as max_timestamp, `ip`, urlrequested, `referrer`, searchengine, spider, `username`, comment_author, language, spam FROM $wassup_tmp_table WHERE `timestamp`>'%d' AND (`username`!='' OR `timestamp`>'%d' OR (`timestamp`>'%d' AND `spider`='')) %s GROUP BY wassup_id ORDER BY max_timestamp DESC",$from_date,$to_date - 1*60,$to_date - 3*60,$whereis);
123
+ $qryC=$wpdb->get_results($sql);
124
+ if(!empty($qryC)){
125
+ if(is_array($qryC)) $currenttot=count($qryC);
126
+ elseif(is_wp_error($qryC)) $error_msg=" error# ".$qryC->get_error_code().": ".$qryC->get_error_message()."\nSQL=".esc_attr($sql)."\n";
127
+ }
128
+ if($wdebug_mode){
129
+ echo "\n<!-- ";
130
+ if(!empty($error_msg)){
131
+ echo "wassup_Dashboard_Widgets ERROR: ".$error_msg;
132
+ }elseif($currenttot >0){
133
+ echo "&nbsp; &nbsp; qryC=";
134
+ print_r($qryC);
135
+ }
136
+ echo "\n-->";
137
+ }
138
+ }
139
+ if($currenttot > 0){ ?>
140
+ <div class="wassup-dashitem no-top-border">
141
+ <h5><?php echo '<strong>'.$currenttot."</strong>".__("Visitors online","wassup");?></h5><?php
142
+ echo "\n";?>
143
+ </div>
144
+ <div class="wassup-dashitem"><?php
145
+ $Ousername=array();
146
+ $Ocomment_author=array();
147
+ $prev_url="";
148
+ $prev_wassupid="";
149
+ $char_len=$max_char_len;
150
+ $siteurl=wassupURI::get_sitehome();
151
+ $wpurl=wassupURI::get_wphome();
152
+ foreach($qryC as $cv){
153
+ //don't show duplicates
154
+ if(($cv->urlrequested!=$prev_url || $cv->wassup_id!=$prev_wassupid)){
155
+ $prev_url=$cv->urlrequested;
156
+ $prev_wassupid=$cv->wassup_id;
157
+ if ($wassup_options->wassup_time_format == 24) $timed = gmdate("H:i:s", $cv->max_timestamp);
158
+ else $timed = gmdate("h:i:s a", $cv->max_timestamp);
159
+ $ip=wassup_clientIP($cv->ip);
160
+ $referrer="";
161
+ if($cv->referrer !='' && stristr($cv->referrer,$wpurl)!=$cv->referrer && stristr($cv->referrer,$siteurl)!=$cv->referrer){
162
+ if ($cv->searchengine !="")$referrer=wassupURI::se_link($cv->referrer,$char_len,$cv->spam);
163
+ else $referrer=wassupURI::referrer_link($cv->referrer,$cv->urlrequested,$char_len,$cv->spam);
164
+ }
165
+ $requrl=wassupURI::url_link($cv->urlrequested,$char_len,$cv->spam);
166
+ if($cv->username!="" || $cv->comment_author!=""){
167
+ if($cv->username!=""){
168
+ $Ousername[]=esc_attr($cv->username);
169
+ if(!empty($cv->comment_author))$Ocomment_author[]=esc_attr($cv->comment_author);
170
+ }elseif($cv->comment_author!=""){
171
+ $Ocomment_author[]=esc_attr($cv->comment_author);
172
+ }
173
+ }
174
+ //don't show admin requests to users
175
+ if(preg_match('#\/wp\-(admin|includes|content)\/#',$cv->urlrequested)==0 || current_user_can('manage_options')){
176
+ echo "\n";?>
177
+ <p><strong><?php echo esc_attr($timed);?></strong> &middot; <?php echo esc_attr($ip); ?> &rarr; <?php echo $requrl;
178
+ if(!empty($referrer)) echo '<br />'.__("Referrer","wassup").': <span class="widgetref">'.$referrer.'</span>';?></p><?php
179
+ }
180
+ } //end if cv->urlrequested
181
+ } //end foreach qryC
182
+ echo "\n";?>
183
+ </div><?php
184
+ if(count($Ousername)>0){
185
+ natcasesort($Ousername);
186
+ echo "\n";?>
187
+ <div class="wassup-dashitem<?php if(count($Ocomment_author)==0)echo ' no-bottom-border';?>"><p><?php
188
+ echo __('Registered users','wassup').': <span class="loggedin">'.implode('</span> &middot; <span class="loggedin">',array_unique($Ousername)).'</span>';?></p></div><?php
189
+ }
190
+ if(count($Ocomment_author)>0){
191
+ natcasesort($Ocomment_author);
192
+ echo "\n";?>
193
+ <div class="wassup-dashitem no-bottom-border"><p><?php
194
+ echo __('Comment authors','wassup').': <span class="commentaut">'.implode('</span> &middot; <span class="commentaut">',$Ocomment_author).'</span>';?></p></div><?php
195
+ }
196
+ }elseif(!empty($wassup_options->wassup_active)){ ?>
197
+ <div class="wassup-dashitem no-top-border no-bottom-border">
198
+ <h5><strong>1</strong> <?php _e("Visitor online","wassup");?></h5>
199
+ </div><?php
200
+
201
+ }else{ ?>
202
+ <div class="wassup-dashitem no-top-border no-bottom-border">
203
+ <p><?php echo "&nbsp; ".__("No online data!","wassup");?></p>
204
+ </div><?php
205
+ } //end if currentot>0
206
+ echo "\n";?>
207
+ <div class="wassup-dashitem no-top-border no-bottom-border"><span class="wassup-marque"><?php echo __("powered by","wassup").' <a href="http://www.wpwp.org/" title="WassUp - '.__("Real Time Visitors Tracking","wassup").'">WassUp</a>';?></span></div>
208
+ </div><!-- /wassup-dashbox --><?php
209
+ $wdebug_mode=false; //turn off debug after display of widget due to ajax conflict.
210
+ } //end dash_widget1
211
+ } //end Class wassup_Dashboard_Widgets
212
+ } //end if class_exists
lib/compat-lib/compat_functions.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Compatibility functions required for Wassup to run in PHP 4.3-5.1 and Wordpress 2.2-3.1
4
+ *
5
+ * Emulates functions from PHP 5.2+ and Wordpress 2.8+. for backwards compatibility with PHP 4.3-5.1 and Wordpress 2.2-3.1
6
+ *
7
+ * @package WassUp Real-time Analytics
8
+ * @subpackage /lib/compat-lib/compat_functions.php module
9
+ * @since: v1.8
10
+ * @author: Helene D. <http://helenesit.com>
11
+ */
12
+ //no direct request for this plugin module
13
+ $wfile=preg_replace('/\\\\/','/',__FILE__); //for windows
14
+ if(!defined('ABSPATH')|| !isset($GLOBALS['wp_version'])|| preg_match('#'.preg_quote(basename($wfile)).'#',$_SERVER['PHP_SELF'])>0|| !empty($_SERVER['SCRIPT_FILENAME'])&& realpath($wfile)===realpath($_SERVER['SCRIPT_FILENAME'])){
15
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
16
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
17
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
18
+ exit;
19
+ }
20
+ unset($wfile);
21
+ //-------------------------------------------------
22
+ //define PHP5+ functions used in Wassup
23
+ if(!function_exists('json_decode')){ //added in PHP 5.2
24
+ function json_decode($json,$to_array=false){
25
+ $x=false;
26
+ if(!empty($json)&& strpos($json,'{"')!==false){
27
+ $out='$x='.str_replace(array('{','":','}'),array('array(','"=>',')'),$json);
28
+ eval($out.';');
29
+ if(!$to_array)$x=(object)$x;
30
+ }
31
+ return $x;
32
+ }
33
+ }
34
+ //-------------------------------------------------
35
+ //define Wordpress 2.3-2.8 functions used in Wassup
36
+ if(!function_exists('wp_safe_redirect')){ //added in Wordpress 2.3
37
+ function wp_safe_redirect($location,$status="302"){
38
+ wp_redirect($location,$status);
39
+ exit;
40
+ }
41
+ }
42
+ if(!function_exists('like_escape')){ //added in Wordpress 2.5
43
+ function like_escape($text){ //deprecated in Wordpress 4.0
44
+ global $wpdb;
45
+ if(method_exists($wpdb,'esc_like'))$escaped_text=$wpdb->esc_like($text);
46
+ else $escaped_text=str_replace(array("%","_"),array("\\%","\\_"),trim($text));
47
+ return $escaped_text;
48
+ }
49
+ }
50
+ if(!function_exists('get_avatar')){ //added in Wordpress 2.5
51
+ function get_avatar($userid=0,$imgsize=18){return "";}
52
+ }
53
+ if(!function_exists('has_action')){ //added in Wordpress 2.5
54
+ function has_filter($tag,$function_to_check=false){
55
+ $wp_filter = $GLOBALS['wp_filter'];
56
+ $has=false;
57
+ if(!empty($wp_filter[$tag])){
58
+ foreach ($wp_filter[$tag] as $callbacks){if(!empty($callbacks)){$has=true;break;}}
59
+ if ($has && $function_to_check!==false){
60
+ $has=false;
61
+ if(is_string($function_to_check))$idx=$function_to_check;
62
+ elseif(function_exists('_wp_filter_build_unique_id'))$idx = _wp_filter_build_unique_id($tag,$function_to_check,10);
63
+ else $idx=false;
64
+ if($idx!==false){
65
+ foreach((array)array_keys($callbacks) as $priority){if(isset($callbacks[$priority][$idx])){$has=$priority;break;}}
66
+ }
67
+ }
68
+ }
69
+ return $has;
70
+ }
71
+ function has_action($tag,$function_to_check = false){
72
+ return has_filter($tag,$function_to_check);
73
+ }
74
+ }
75
+ if(!function_exists('admin_url')){ //added in Wordpress 2.6
76
+ function admin_url($admin_file=""){
77
+ $adminurl=get_bloginfo('wpurl')."/wp-admin/".$admin_file;
78
+ return $adminurl;
79
+ }
80
+ }
81
+ if(!function_exists('plugins_url')){ //added in Wordpress 2.6
82
+ function plugins_url($plugin_file=""){
83
+ if(defined('WP_CONTENT_URL')&& defined('WP_CONTENT_DIR')&& strpos(WP_CONTENT_DIR,ABSPATH)===FALSE)$pluginurl=rtrim(WP_CONTENT_URL,"/")."/plugins/".$plugin_file;
84
+ else $pluginurl=get_bloginfo('wpurl')."/wp-content/plugins/".$plugin_file;
85
+ return $pluginurl;
86
+ }
87
+ }
88
+ if(!function_exists('get_user_by')){ //added in Wordpress 2.8
89
+ function get_user_by($ufield,$uvalue){
90
+ $user=false;
91
+ if(!empty($uvalue)){
92
+ if($ufield=="login"){
93
+ if(function_exists('get_userdatabylogin')) $user=get_userdatabylogin($uvalue);
94
+ }elseif(is_numeric($uvalue)){
95
+ $user=get_userdata($uvalue); //ID is default
96
+ }
97
+ }
98
+ return $user;
99
+ }
100
+ }
101
+ if(!function_exists('esc_attr')){ //added in Wordpress 2.8
102
+ function esc_attr($text){return attribute_escape($text);}
103
+ function esc_html($html){return wp_specialchars($html, ENT_QUOTES);}
104
+ function esc_url($url,$protocol=null,$context='display'){
105
+ $newurl=clean_url($url,$protocol,$context);
106
+ if(empty($newurl) && !empty($url)){ //oops, clean_url chomp
107
+ $new_url = attribute_escape(strip_tags(html_entity_decode(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$url),array()))));
108
+ }
109
+ return $newurl;
110
+ }
111
+ function esc_sql($data){
112
+ global $wpdb;
113
+ if (empty($wpdb->use_mysqli)) return mysql_real_escape_string($data);
114
+ else return mysqli_real_escape_string();
115
+ }
116
+ }
117
+ //-------------------------------------------------
118
+ //define Wordpress 3+ functions used in Wassup
119
+ if(!function_exists('delete_user_option')){ //added in Wordpress 3.0
120
+ function delete_user_option($user_id,$option_name,$option_value=''){
121
+ if(function_exists('delete_user_meta')) return delete_user_meta($user_id,$option_name);
122
+ else return delete_usermeta($user_id,$option_name,$option_value);
123
+ }
124
+ }
125
+ if(!function_exists('is_multisite')){ //added in Wordpress 3.0
126
+ function is_multisite(){
127
+ if(defined('MULTISITE')) return MULTISITE;
128
+ if(defined('SUBDOMAIN_INSTALL') || defined('VHOST') || defined('SUNRISE')) return true;
129
+ return false;
130
+ }
131
+ function is_subdomain_install(){
132
+ if(defined('SUBDOMAIN_INSTALL')) return SUBDOMAIN_INSTALL;
133
+ if(defined('VHOST') && VHOST=='yes') return true;
134
+ return false;
135
+ }
136
+ function is_main_site($site_id=null) {
137
+ if(!is_multisite()) return true;
138
+ if(!$site_id) $site_id=get_current_blog_id();
139
+ return (int)$site_id === (int)$GLOBALS['current_site']->blog_id;
140
+ }
141
+ }
142
+ if(!function_exists('is_network_admin')){ //added in Wordpress 3.1
143
+ function is_network_admin() {
144
+ if(isset($GLOBALS['current_screen'])) return $GLOBALS['current_screen']->in_admin('network');
145
+ elseif(defined('WP_NETWORK_ADMIN')) return WP_NETWORK_ADMIN;
146
+ return false;
147
+ }
148
+ }
149
+ ?>
lib/compat-lib/wassup.class.php ADDED
@@ -0,0 +1,2157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Contains 3 PHP4 classes for managing settings, tables, and url links.
4
+ * wassupOptions: displays and update plugin settings,
5
+ * wassupDb: manages plugin tables,
6
+ * wassupURI: generates safe url links for display.
7
+ *
8
+ * @package WassUp Real-time Analytics
9
+ * @subpackage compat-lib/wassup.class.php module
10
+ * @author Helene D. <http://helenesit.com>
11
+ */
12
+ //no direct request for this plugin module
13
+ $wfile=preg_replace('/\\\\/','/',__FILE__); //for windows
14
+ if(!defined('ABSPATH')|| empty($GLOBALS['wp_version'])|| preg_match('#'.preg_quote(basename($wfile)).'#',$_SERVER['PHP_SELF'])|| !empty($_SERVER['SCRIPT_FILENAME'])&& realpath($wfile)===realpath($_SERVER['SCRIPT_FILENAME'])){
15
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
16
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
17
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
18
+ exit;
19
+ }
20
+ unset($wfile);
21
+ if (!class_exists('wassupOptions')) {
22
+ /**
23
+ * Class for display, update, and validation of settings form data.
24
+ * @author: Helene Duncker <http://helenesit.com>
25
+ */
26
+ class wassupOptions {
27
+ /* general/detail settings */
28
+ var $wassup_refresh = "3";
29
+ var $wassup_userlevel = "8";
30
+ var $wassup_screen_res = "800";
31
+ var $wassup_default_type = "everything";
32
+ var $wassup_default_spy_type = "everything";
33
+ var $wassup_default_limit = "10";
34
+ var $wassup_top10;
35
+ var $wassup_time_format = "24";
36
+ var $wassup_time_period = "1";
37
+
38
+ /* recording settings */
39
+ var $wassup_active = "1";
40
+ var $wassup_loggedin = "1";
41
+ var $wassup_admin = "1";
42
+ var $wassup_spider = "1";
43
+ var $wassup_exclude = "";
44
+ var $wassup_exclude_host = ""; //new in v1.9: for exclusion by hostname
45
+ var $wassup_exclude_url = "";
46
+ var $wassup_exclude_user = "";
47
+
48
+ /* spam and malware settings */
49
+ var $wassup_spamcheck = "1";
50
+ var $wassup_spam = "1";
51
+ var $wassup_refspam = "1";
52
+ var $wassup_attack = "1";
53
+ var $wassup_hack = "1";
54
+
55
+ /* table/file management settings */
56
+ var $wassup_table;
57
+ var $wassup_dbengine = "";
58
+ var $wassup_uninstall; //for uninstall of wassup tables
59
+ var $delete_auto = "never";
60
+ var $delete_filter = "";
61
+ var $wassup_optimize = "0"; //for scheduled optimization
62
+ var $wassup_remind_mb = "100";
63
+ var $wassup_remind_flag = "1";
64
+ var $delayed_insert = "1"; //New in v1.9: for use of "Delayed" option in MySQL INSERT command
65
+
66
+ /* chart/map display settings */
67
+ var $wassup_dashboard_chart = 0;
68
+ var $wassup_chart = "1";
69
+ var $wassup_chart_type = "2";
70
+ var $wassup_geoip_map = "1";
71
+ var $wassup_googlemaps_key;
72
+
73
+ /* widget settings */
74
+ //New in v1.9: removed widget settings because multi-widgets store their own settings in wordpress options table
75
+
76
+ /* temporary action settings */
77
+ //New in v1.9: dip,mark and other temp settings moved to new user option '_wassup_settings' so that multiple users can view wassup admin panel and customize their views
78
+ var $whash = "";
79
+ var $wassup_alert_message = ""; //to display alerts
80
+ var $wassup_version = "";
81
+ var $wassup_upgraded = 0; //New in v1.9: upgrade timestamp
82
+
83
+ /**
84
+ * PHP4 constructor.
85
+ *
86
+ * New in v1.9: optional argument to set default values for new/empty class vars.
87
+ * @param boolean $add_defaults
88
+ * @return void
89
+ *
90
+ */
91
+ function wassupoptions($add_defaults=false){
92
+ if($add_defaults)$this->_initSettings();
93
+ else $this->loadSettings();
94
+ }
95
+ /** loads current settings/initializes empty class vars. */
96
+ function _initSettings(){
97
+ $settings=$this->getSettings(true);
98
+ $this->loadSettings($settings);
99
+ }
100
+ /** loads default settings into class vars. */
101
+ function loadDefaults(){
102
+ $defaults = $this->defaultSettings();
103
+ $this->loadSettings($defaults);
104
+ }
105
+ /**
106
+ * Return array of default values or one default variable.
107
+ * @param string
108
+ * @return string|array
109
+ */
110
+ function defaultSettings($dsetting="") {
111
+ global $wpdb,$wdebug_mode;
112
+ $retvalue=false;
113
+ //New in v1.9: default settings for current user
114
+ if($dsetting=="user_settings" || $dsetting=="wassup_user_settings"){
115
+ $user_defaults=array(
116
+ 'detail_filter' =>$this->wassup_default_type,
117
+ 'detail_chart' =>$this->wassup_chart,
118
+ 'detail_limit' =>$this->wassup_default_limit,
119
+ 'detail_time_period'=>$this->wassup_time_period,
120
+ 'spy_filter' =>$this->wassup_default_spy_type,
121
+ 'spy_map' =>$this->wassup_geoip_map,
122
+ 'ualert_message'=>"",
123
+ 'unonce' =>rand(1,999999),
124
+ 'umark' =>"",
125
+ 'uip' =>"",
126
+ 'urecid' =>0,
127
+ 'utimestamp' =>0,
128
+ 'uwassupid' =>"",
129
+ 'uversion' =>WASSUPVERSION,
130
+ );
131
+ return $user_defaults;
132
+ }
133
+ //default top stats settings
134
+ $top10_defaults = array(
135
+ "toplimit"=>"10",
136
+ "topsearch"=>"1",
137
+ "topreferrer"=>"1",
138
+ "toppostid"=>"1",
139
+ "toprequest"=>"1",
140
+ "topbrowser"=>"1",
141
+ "topos"=>"1",
142
+ "toplocale"=>"0",
143
+ "topvisitor"=>"0",
144
+ "topreferrer_exclude"=>"",
145
+ "top_nofrontpage"=>"0",
146
+ "top_nospider"=>"0",
147
+ );
148
+ if($dsetting=="top10" || $dsetting=="wassup_top10" || $dsetting=="top_stats"){
149
+ return $top10_defaults;
150
+ }
151
+ //general default settings
152
+ $defaults = array(
153
+ 'wassup_active' =>"1",
154
+ 'wassup_loggedin' =>"1",
155
+ 'wassup_admin' =>"1",
156
+ 'wassup_spider' =>"1",
157
+ 'wassup_attack' =>"1",
158
+ 'wassup_hack' =>"1",
159
+ 'wassup_spamcheck' =>"1",
160
+ 'wassup_spam' =>"1",
161
+ 'wassup_refspam' =>"1",
162
+ 'wassup_exclude' =>"",
163
+ 'wassup_exclude_host' =>"",
164
+ 'wassup_exclude_url' =>"",
165
+ 'wassup_exclude_user' =>"",
166
+ 'wassup_chart' =>"1",
167
+ 'wassup_chart_type' =>"2",
168
+ 'delete_auto' =>"never",
169
+ 'delete_filter' =>"",
170
+ 'wassup_remind_mb' =>"100", //v1.9 new default setting
171
+ 'wassup_remind_flag' =>"1", //v1.9 new default setting
172
+ 'wassup_refresh' =>"3",
173
+ 'wassup_userlevel' =>"8",
174
+ 'wassup_screen_res' =>"800",
175
+ 'wassup_default_type' =>"everything",
176
+ 'wassup_default_spy_type'=>"everything",
177
+ 'wassup_default_limit' =>"10",
178
+ 'wassup_dashboard_chart'=>"0",
179
+ 'wassup_geoip_map' =>"1", //New in v1.9 - new default setting
180
+ 'wassup_googlemaps_key' =>"",
181
+ 'wassup_time_format' =>"24",
182
+ 'wassup_time_period' =>"1",
183
+ 'wassup_alert_message' =>"",
184
+ 'wassup_uninstall' =>"0",
185
+ 'wassup_optimize'=>"0",
186
+ 'wassup_top10' =>$top10_defaults,
187
+ 'whash' =>"",
188
+ 'wassup_table' =>$wpdb->prefix . "wassup",
189
+ 'wassup_dbengine'=>"",
190
+ 'delayed_insert'=>"1",
191
+ 'wassup_version'=>"",
192
+ 'wassup_upgraded'=>0,
193
+ );
194
+ //New in v1.9: for multisite, use main site settings as default, except for table name and engine
195
+ if(is_multisite() && !is_main_site() && !is_network_admin()){
196
+ $main_site_settings=get_blog_option($GLOBALS['current_site']->blog_id,'wassup_settings',$defaults);
197
+ if(!empty($main_site_settings) && $main_site_settings!=$defaults){
198
+ $defaults=$main_site_settings;
199
+ $defaults['wassup_table']=$wpdb->prefix . "wassup";
200
+ }
201
+ }
202
+ //never discard google maps api key with "reset-to-default"
203
+ if(!empty($this->wassup_googlemaps_key)) $defaults['wassup_googlemaps_key']= $this->wassup_googlemaps_key;
204
+ //never discard wassup_version' with "reset-to-default"
205
+ if(!empty($this->wassup_version)) $defaults['wassup_version']= $this->wassup_version;
206
+ $wassupdb_installed=false;
207
+ //never change 'wassup_table' with "reset-to-default" ..unless table doesn't exist
208
+ if(!empty($this->wassup_table) && wassupDb::table_exists($this->wassup_table)){
209
+ $defaults['wassup_table']= $this->wassup_table;
210
+ $defaults['wassup_dbengine']= $this->wassup_dbengine;
211
+ $defaults['wassup_optimize']= $this->wassup_optimize;
212
+ $wassupdb_installed=true;
213
+ }elseif(is_multisite() && !is_network_admin() && !is_main_site()){
214
+ $network_settings=get_site_option('wassup_network_settings');
215
+ if(!empty($network_settings['wassup_table'])){
216
+ $defaults['wassup_table']=$network_settings['wassup_table'];
217
+ $wassupdb_installed=true;
218
+ }elseif(wassupDb::table_exists($defaults['wassup_table'])){
219
+ $wassupdb_installed=true;
220
+ }
221
+ }elseif(wassupDb::table_exists($defaults['wassup_table'])){
222
+ $wassupdb_installed=true;
223
+ }
224
+ //reset table engine with reset-to-default ..after default wassup_table is set
225
+ if($dsetting=='wassup_dbengine' || empty($dsetting)){
226
+ if(empty($defaults['wassup_dbengine'])){
227
+ $tengine="";
228
+ if ($defaults['wassup_table']== $this->wassup_table){
229
+ $tengine=$this->wassup_dbengine;
230
+ }elseif(!$wassupdb_installed){
231
+ $result=$wpdb->get_results("SHOW VARIABLES LIKE 'storage_engine'",ARRAY_A);
232
+ if(!empty($result) && !is_wp_error($result) && !empty($result[0]->Value)) $tengine=$result[0]->Value;
233
+ }else{
234
+ //$tengine=wassupDb::get_db_setting('engine',$defaults['wassup_table']); //TODO: find cause of mysql timeout error
235
+ $result=$wpdb->get_results("SHOW VARIABLES LIKE 'storage_engine'",ARRAY_A);
236
+ if(!empty($result) && !is_wp_error($result) && !empty($result[0]->Value)) $tengine=$result[0]->Value;
237
+ }
238
+ $defaults['wassup_dbengine']=$tengine;
239
+ }
240
+ }
241
+ //never change optimize schedule with reset-to-default ..unless table engine has changed
242
+ if($dsetting=='wassup_optimize' || (empty($dbsetting) && $this->wassup_dbengine != $defaults['wassup_dbengine'])){
243
+ $tengine=$defaults['wassup_dbengine'];
244
+ //v1.9 bugfix: set optimization when for table engine's myisam, archive, or innodb with file-per-table option only
245
+ if($tengine=="myisam" || $tengine=="archive"){
246
+ $defaults['wassup_optimize']=strtotime("next Sunday 2:00am");
247
+ }elseif($wassupdb_installed && wassupDb::is_optimizable_table($defaults['wassup_table'])){
248
+ $defaults['wassup_optimize']=strtotime("next Sunday 2:00am");
249
+ }else{
250
+ $defaults['wassup_optimize']="0";
251
+ }
252
+ }else{
253
+ $defaults['wassup_optimize']=$this->wassup_optimize;
254
+ }
255
+ //reset hash with reset-to-default
256
+ $defaults['whash']=$this->whash;
257
+ if($dsetting=='whash' || empty($dsetting)){
258
+ $defaults['whash']=$this->get_wp_hash();
259
+ }
260
+ //serialize top10 array for insert into wp_options
261
+ if(empty($dsetting)) $defaults['wassup_top10']=maybe_serialize($top10_defaults);
262
+ //check that can use delayed insert
263
+ //$defaults['delayed_insert']=$this->delayed_insert;
264
+ if(empty($dsetting) || $dsetting=="delayed_insert"){
265
+ if (stristr($defaults['wassup_dbengine'],"isam")===false && stristr($defaults['wassup_dbengine'],"archive")===false){
266
+ $defaults['delayed_insert']="0";
267
+ }else{
268
+ $delayed_queue_size=wassupDb::get_db_setting("delayed_queue_size");
269
+ if(!is_numeric($delayed_queue_size) || (int)$delayed_queue_size==0){
270
+ $defaults['delayed_insert']="0";
271
+ }else{
272
+ $max_delayed_threads=wassupDb::get_db_setting("max_delayed_threads");
273
+ if((int)$max_delayed_threads==0) $defaults['delayed_insert']="0";
274
+ }
275
+ }
276
+ }
277
+ //Return default value for "dsetting" argument, if any
278
+ if(!empty($dsetting)){
279
+ if ($dsetting == "user_setting" || $dsetting == "wassup_user_settings"){
280
+ $retvalue = $user_defaults;
281
+ }elseif ($dsetting == "top10" || $dsetting == "wassup_top10" || $dsetting == "top_stats"){
282
+ $retvalue = $top10_defaults;
283
+ }elseif(isset($defaults[$dsetting])){
284
+ $retvalue = $defaults[$dsetting];
285
+ }else{
286
+ $retvalue = false;
287
+ }
288
+ }else{
289
+ $retvalue=$defaults;
290
+ }
291
+ return $retvalue;
292
+ } //end defaultSettings
293
+
294
+ /** Load up class variables with wp_option settings. */
295
+ function loadSettings($settings=array()){
296
+ if(empty($settings)){
297
+ $settings=get_option('wassup_settings');
298
+ }
299
+ if(!empty($settings) && is_array($settings)){
300
+ $this->_options2class($settings);
301
+ }else{
302
+ return false;
303
+ }
304
+ return true;
305
+ }
306
+
307
+ /**
308
+ * Retrieve wassup settings from 'wp_options' in an array.
309
+ * - includes optional flag argument to add new settings and omit deprecated settings.
310
+ * @since version 1.8
311
+ * @param boolean $add_defaults
312
+ * @return array $settings
313
+ */
314
+ function getSettings($add_defaults=false){
315
+ global $wpdb;
316
+ $current_opts=get_option('wassup_settings');
317
+ if($add_defaults || empty($current_opts)){
318
+ //in multisite, use main site as defaults
319
+ if(is_multisite() && !is_network_admin() && !is_main_site()){
320
+ $default_opts=get_blog_option($GLOBALS['current_site']->blog_id,'wassup_settings');
321
+ if(empty($default_opts)) $default_opts=$this->defaultSettings();
322
+ else $default_opts['wassup_table']=$this->defaultSettings('wassup_table');
323
+ }else{
324
+ $default_opts=$this->defaultSettings();
325
+ }
326
+ if(!empty($current_opts)){
327
+ foreach($default_opts as $skey=>$defaultvalue){
328
+ if(array_key_exists($skey,$current_opts))$settings[$skey]=$current_opts[$skey];
329
+ else $settings[$skey]=$defaultvalue;
330
+ }
331
+ }else{
332
+ $settings=$default_opts;
333
+ }
334
+ }else{
335
+ $settings=$current_opts;
336
+ }
337
+ return $settings;
338
+ } //end getSettings
339
+
340
+ /** Save class vars as 'wassup_settings' in wp_options. */
341
+ function saveSettings() {
342
+ global $wpdb;
343
+ $settings_array = array();
344
+ $obj = $this;
345
+ //convert class vars into array
346
+ foreach (array_keys(get_class_vars(get_class($obj))) as $k){
347
+ if (is_array($obj->$k)) {
348
+ //serialize any arrays within $obj
349
+ if (count($obj->$k)>0) {
350
+ $settings_array[$k] = maybe_serialize($obj->$k);
351
+ } else {
352
+ $settings_array[$k] = "";
353
+ }
354
+ } else {
355
+ $settings_array[$k] = "{$obj->$k}";
356
+ }
357
+ }
358
+ //save array to wp_options
359
+ /* if(is_multisite() && function_exists('is_network_admin') && is_network_admin()){
360
+ $subsite_id=$GLOBALS['current_site']->blog_id;
361
+ update_blog_option($subsite_id,'wassup_settings', $settings_array);
362
+ }else{
363
+ update_option('wassup_settings', $settings_array);
364
+ } */
365
+ update_option('wassup_settings', $settings_array);
366
+ return true;
367
+ } //end saveSettings
368
+
369
+ /** delete 'wassup_settings' from wp_options table and reset class vars to defaults. */
370
+ function deleteSettings(){
371
+ global $wpdb;
372
+ $this->loadDefaults();
373
+ if(!is_multisite()){
374
+ delete_option('wassup_settings');
375
+ }else{
376
+ if(function_exists('is_network_admin') && is_network_admin()) $subsite_id=$GLOBALS['current_site']->blog_id;
377
+ else $subsite_id=$GLOBALS['current_blog']->blog_id;
378
+ delete_blog_option($subsite_id,'wassup_settings');
379
+ }
380
+ }
381
+ /**
382
+ * Reset wassup user option '_wassup_settings' to defaults
383
+ * - runs when a user logs in, after upgrade/install, and with reset-to-default
384
+ * - contains 2 user arguments required by 'wp_login' hook.
385
+ *
386
+ * @since v1.9
387
+ * @param (2) string $user_login, object(WP_User) $user
388
+ * @return array $wassup_user_settings
389
+ */
390
+ function resetUserSettings($user_login="",$user=false){
391
+ global $current_user;
392
+ if(!defined('WASSUPVERSION')) wassup_init();
393
+ if(empty($user)) $user=$current_user;
394
+ if(empty($user->ID)) $user=wp_get_current_user();
395
+ $wassup_user_settings=get_user_option('_wassup_settings',$user->ID);
396
+ if(!empty($wassup_user_settings)){
397
+ $wassup_user_defaults=$this->defaultSettings('wassup_user_settings');
398
+ $wassup_user_settings=$wassup_user_defaults;
399
+ update_user_option($user->ID,'_wassup_settings',$wassup_user_settings);
400
+ }
401
+ return $wassup_user_settings;
402
+ }
403
+ /**
404
+ * Return an array of valid input field values or a single default value for a field in wassup settings form.
405
+ * - value returned could be field value, field name, or the sql associated with the field, depending on the $meta param
406
+ * @param string(3) ($field,$meta,$selected)
407
+ * @return array
408
+ */
409
+ function getFieldOptions($field,$meta="",$selected="") {
410
+ $field_options = array();
411
+ $field_options_meta = array();
412
+ $field_options_sql = array();
413
+ $default_key = ""; //default value
414
+ switch ($field) {
415
+ case "wassup_screen_res":
416
+ //"Options" setting
417
+ $field_options = array("640","800","1024","1200",1600);
418
+ $field_options_meta = array("&nbsp;640",
419
+ "&nbsp;800",
420
+ "1024",
421
+ "1200",
422
+ "1600");
423
+ $default_key=1;
424
+ break;
425
+ case "wassup_userlevel":
426
+ //"Options" setting
427
+ $field_options = array("8","6","2","1","0");
428
+ $field_options_meta = array(
429
+ __("Administrator"),
430
+ '&nbsp;'.__("Editor"),
431
+ '&nbsp;'.__("Author"),
432
+ '&nbsp;'.__("Contributor"),
433
+ '&nbsp;'.__("Subscriber"));
434
+ break;
435
+ case "wassup_chart_type":
436
+ //"Options" setting
437
+ $field_options = array("1","2");
438
+ $field_options_meta = array(
439
+ __("One - 2 lines chart 1 axis","wassup"),
440
+ __("Two - 2 lines chart 2 axes","wassup"));
441
+ $default_key = "1";
442
+ break;
443
+ case "wassup_default_type":
444
+ case "wassup_default_spy_type":
445
+ $sitehome = wassupURI::get_sitehome();
446
+ $wurl = parse_url(strtolower($sitehome));
447
+ $sitehome = $wurl['host'];
448
+ if(is_multisite() && !is_subdomain_install() && !empty($wurl['path'])) $sitehome=$wurl['host'].$wurl['path'];
449
+ $sitedomain=rtrim(str_replace('.','\\.',$sitehome),'/ ');
450
+ $field_options = array("everything",
451
+ "spider",
452
+ "nospider",
453
+ "spam",
454
+ "nospam",
455
+ "nospamspider",
456
+ "loggedin",
457
+ "comauthor",
458
+ "searchengine",
459
+ "referrer");
460
+ $field_options_meta = array(__("Everything","wassup"),
461
+ __("Spider","wassup"),
462
+ __("No spider","wassup"),
463
+ __("Spam","wassup"),
464
+ __("No Spam","wassup"),
465
+ __("No Spam, No Spider","wassup"),
466
+ __("Users logged in","wassup"),
467
+ __("Comment authors","wassup"),
468
+ __("Referrer from search engine","wassup"),
469
+ __("Referrer from ext link","wassup"));
470
+ $field_options_sql = array("",
471
+ " AND spider!=''",
472
+ " AND spider=''",
473
+ " AND spam>0",
474
+ " AND spam=0",
475
+ " AND spam=0 AND spider=''",
476
+ " AND username!=''",
477
+ " AND comment_author!=''",
478
+ " AND searchengine!=''",
479
+ " AND referrer!='' AND searchengine='' AND TRIM(LEADING 'http://' FROM TRIM(LEADING 'https://' FROM `referrer`)) NOT RLIKE '^(www".'\\.'.")?(".$sitedomain."/)'",
480
+ //" AND referrer!='' AND referrer NOT LIKE 'http://".$sitedomain."%' AND referrer NOT LIKE 'https://".$sitedomain."%' AND referrer NOT LIKE 'http://www.".$sitedomain."%'",
481
+ );
482
+ break;
483
+ case "wassup_default_limit":
484
+ //"Options" setting, report and chart option
485
+ $field_options = array("10","20","50","100");
486
+ $field_options_meta = array("&nbsp;10",
487
+ "&nbsp;20",
488
+ "&nbsp;50",
489
+ "100");
490
+ break;
491
+ case "delete_auto":
492
+ //"Options" settings
493
+ $field_options = array("never",
494
+ "-1 day",
495
+ "-1 week",
496
+ "-2 weeks",
497
+ "-1 month",
498
+ "-3 months",
499
+ "-6 months",
500
+ "-1 year");
501
+ $field_options_meta = array(
502
+ __("Don't delete anything","wassup"),
503
+ __("24 hours","wassup"),
504
+ __("7 days","wassup"),
505
+ __("2 weeks","wassup"),
506
+ __("1 month","wassup"),
507
+ __("3 months","wassup"),
508
+ __("6 months","wassup"),
509
+ __("1 year","wassup"));
510
+ break;
511
+ case "delete_filter":
512
+ $field_options = array("all",
513
+ "spider",
514
+ "spam",
515
+ "spider_spam");
516
+ $field_options_meta = array(__("All"),
517
+ __("Spider"),
518
+ __("Spam"),
519
+ __("Spider and spam","wassup"));
520
+ $field_options_sql=array("",
521
+ " AND `spider`!=''",
522
+ " AND `spam`!='0' AND `spam`!=''",
523
+ " AND (`spider`!='' OR (`spam`!='0' AND `spam`!=''))");
524
+ break;
525
+ case "sort_group":
526
+ //TODO add to dislay options in Main/details screen
527
+ $field_options = array("IP","URL");
528
+ $field_options_meta = array(
529
+ __("IP Address","wassup"),
530
+ __("URL Request","wassup"));
531
+ break;
532
+ case "wassup_time_period":
533
+ //"Details" report and chart option
534
+ $field_options = array(".05",".25","0.5","1","7","14","30","90","180","365","0");
535
+ $field_options_meta = array(
536
+ __("1 hour"),
537
+ __("6 hours"),
538
+ __("12 hours"),
539
+ __("24 hours"),
540
+ __("7 days"),
541
+ __("2 weeks"),
542
+ __("1 month"),
543
+ __("3 months"),
544
+ __("6 months"),
545
+ __("1 year"),
546
+ __("all time","wassup"),
547
+ );
548
+ $default_key=3; //default:meta[3]=24 hours
549
+ break;
550
+ default: //enable/disable is default
551
+ $field_options = array("1","0");
552
+ $field_options_meta = array("Enable","Disable");
553
+ } //end switch
554
+ if (empty($default_key)) $default_key=0;
555
+ $retval = "";
556
+ if ($meta == "meta") {
557
+ //return 1 item
558
+ if ($selected!="") {
559
+ $key = array_search($selected,$field_options);
560
+ if ($key) {
561
+ $retval=$field_options_meta[$key];
562
+ } elseif (!is_numeric($default_key)) {
563
+ $key = array_search($default_key,$field_options);
564
+ $retval=$field_options_meta[$key];
565
+ } else {
566
+ $retval=$field_options_meta[$default_key];
567
+ }
568
+ //return array of items
569
+ } else {
570
+ $retval=$field_options_meta;
571
+ }
572
+ } elseif ($meta == "default") {
573
+ $retval = $default_key;
574
+ } elseif ($meta == "sql") {
575
+ if (!empty($field_options_sql)) {
576
+ if ($selected!="") { //return 1 item
577
+ $key = array_search($selected,$field_options);
578
+ if($key) $retval=$field_options_sql[$key];
579
+ else $retval=$field_options_sql[$default_key];
580
+ } else { $retval=$field_options_sql; }
581
+ }
582
+ }else{
583
+ $retval=$field_options;
584
+ }
585
+ return $retval;
586
+ } //end getFieldOptions
587
+
588
+ /**
589
+ * Generates <options> tags for use in a <select> form field.
590
+ * - 1st argument $itemkey must an input field name from the "wassup-options" form or from 'getFieldOptions' above.
591
+ * @param mixed(3) (string $itemkey,integer $selected, string $optionargs)
592
+ * @return string (html)
593
+ */
594
+ function showFieldOptions($itemkey,$selected="",$optionargs=""){
595
+ $form_items =$this->getFieldOptions($itemkey);
596
+ if(count($form_items) > 0){
597
+ $form_items_meta=$this->getFieldOptions($itemkey,"meta");
598
+ if($selected == ""){
599
+ if(isset($this->$itemkey)){
600
+ $selected=$this->$itemkey;
601
+ }else{
602
+ $default=$this->getFieldOptions($itemkey,"default");
603
+ if(!empty($default) && is_numeric($default)) $selected=$form_items[$default];
604
+ else $selected=$form_items[0];
605
+ }
606
+ }
607
+ foreach($form_items as $k => $option_item){
608
+ echo "\n\t\t".'<option value="'.$optionargs.$option_item.'"';
609
+ if($selected==$option_item) echo ' SELECTED>';
610
+ else echo '>';
611
+ echo $form_items_meta[$k].'&nbsp;&nbsp;</option>';
612
+ }
613
+ }
614
+ } //end showFieldOptions
615
+
616
+ /**
617
+ * strip bad characters from a text or textarea input string
618
+ * @since v1.9
619
+ * @param string
620
+ * @return string
621
+ */
622
+ function cleanFormText($input){
623
+ $text=wp_kses($input,array());
624
+ return preg_replace('/([^0-9a-z\-_\.,\:*#\'" ]+)/i','',strip_tags(html_entity_decode($text)));
625
+ }
626
+ /** strip bad characters from a text or textarea input for URLs. @since v1.9 */
627
+ function cleanFormURL($input){
628
+ $loc=wp_kses_bad_protocol($input,array('http','https','feed'));
629
+ $loc=preg_replace('/([^0-9a-z\-_\.,\:\*#\/&\?=;% ]+)/i','',strip_tags(html_entity_decode(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$loc))));
630
+ return $loc;
631
+ }
632
+ /**
633
+ * Save settings form changes stored in $_POST global.
634
+ * @since v1.9
635
+ * @param none
636
+ * @return string
637
+ */
638
+ function saveFormChanges(){
639
+ global $current_user;
640
+ if(!is_object($current_user) || empty($current_user->ID)) wp_get_current_user();
641
+ $admin_message=__("Nothing to do!","wassup");
642
+ if(!empty($_POST) && current_user_can('manage_options') && !empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],'page=wassup-options')!==false){
643
+ $sitehome=wassupURI::get_sitehome();
644
+ //New in v1.9: save multisite network settings
645
+ $network_settings=array();
646
+ if(is_multisite() && !empty($_POST['_network_settings'])){
647
+ $network_settings=get_site_option('wassup_network_settings');
648
+ $network_settings['wassup_active']=(!empty($_POST['network_active'])?"1":"0");
649
+ if($this->network_activated_plugin()){
650
+ $network_settings['wassup_menu']=(!empty($_POST['wassup_menu'])?"1":"0");
651
+ }
652
+ update_site_option('wassup_network_settings',$network_settings);
653
+ }
654
+ $this->wassup_active=(!empty($_POST['wassup_active'])?"1":"0");
655
+ $this->wassup_spamcheck=(!empty($_POST['wassup_spamcheck'])?"1":"0");
656
+ $this->wassup_screen_res=(int)$_POST['wassup_screen_res'];
657
+ $this->wassup_userlevel=(int)$_POST['wassup_userlevel'];
658
+ $this->wassup_dashboard_chart=(!empty($_POST['wassup_dashboard_chart'])?"1":"0");
659
+ $this->wassup_geoip_map=(!empty($_POST['wassup_geoip_map'])?"1":"0");
660
+ if(!empty($_POST['wassup_googlemaps_key'])){
661
+ $not_required=__("not required","wassup");
662
+ if(strpos($_POST['wassup_googlemaps_key'],$not_required)===false)$this->wassup_googlemaps_key=$this->cleanFormText($_POST['wassup_googlemaps_key']);
663
+ else $this->wassup_googlemaps_key="";
664
+ }else{
665
+ $this->wassup_googlemaps_key="";
666
+ }
667
+ $this->wassup_chart=(!empty($_POST['wassup_chart'])?"1":"0");
668
+ if(!empty($_POST['wassup_chart_type'])) $this->wassup_chart_type=(int)$_POST['wassup_chart_type'];
669
+ else $this->wassup_chart_type="2";
670
+ $this->wassup_time_format=$this->cleanFormText($_POST['wassup_time_format']);
671
+ $this->wassup_time_period=$this->cleanFormText($_POST['wassup_time_period']);
672
+ if(!empty($_POST['wassup_refresh'])){
673
+ if(is_numeric($_POST['wassup_refresh'])&& $_POST['wassup_refresh']>0 && $_POST['wassup_refresh']<=180)
674
+ $this->wassup_refresh=(int)$_POST['wassup_refresh'];
675
+ }else{
676
+ $this->wassup_refresh="0";
677
+ }
678
+ $this->wassup_default_type=$this->cleanFormText($_POST['wassup_default_type']);
679
+ $this->wassup_default_limit=$this->cleanFormText($_POST['wassup_default_limit']);
680
+ $top_ten=array(
681
+ "toplimit"=>(isset($_POST['toplimit'])?(int)$_POST['toplimit']:"10"),
682
+ "topsearch"=>(isset($_POST['topsearch'])?$_POST['topsearch']:"0"),
683
+ "topreferrer"=>(!empty($_POST['topreferrer'])?"1":"0"),
684
+ "toppostid"=>(!empty($_POST['toppostid'])?"1":"0"),
685
+ "toprequest"=>(!empty($_POST['toprequest'])?"1":"0"),
686
+ "topbrowser"=>(!empty($_POST['topbrowser'])?"1":"0"),
687
+ "topos"=>(!empty($_POST['topos'])?"1":"0"),
688
+ "toplocale"=>(!empty($_POST['toplocale'])?"1":"0"),
689
+ "topvisitor"=>(!empty($_POST['topvisitor'])?"1":"0"),
690
+ "topreferrer_exclude"=>$this->cleanFormURL($_POST['topreferrer_exclude'],'*'),
691
+ "top_nofrontpage"=>(!empty($_POST['top_nofrontpage'])?"1":"0"),
692
+ "top_nospider"=>(!empty($_POST['top_nospider'])?"1":"0"),
693
+ );
694
+ $this->wassup_top10=maybe_serialize($top_ten);
695
+ $this->wassup_loggedin=(!empty($_POST['wassup_loggedin'])?"1":"0");
696
+ $this->wassup_admin=(!empty($_POST['wassup_admin'])?"1":"0");
697
+ $this->wassup_spider=(!empty($_POST['wassup_spider'])?"1":"0");
698
+ $this->wassup_spam=(!empty($_POST['wassup_spam'])?"1":"0");
699
+ $this->wassup_refspam=(!empty($_POST['wassup_refspam'])?"1":"0");
700
+ $this->wassup_hack=(!empty($_POST['wassup_hack'])?"1":"0");
701
+ $this->wassup_attack=(!empty($_POST['wassup_attack'])?"1":"0");
702
+ if($_POST['wassup_exclude'] != $this->wassup_exclude)
703
+ $this->wassup_exclude=$this->cleanFormText($_POST['wassup_exclude']);
704
+ if ($_POST['wassup_exclude_host'] != $this->wassup_exclude_host)
705
+ $this->wassup_exclude_host=$this->cleanFormText($_POST['wassup_exclude_host']);
706
+ if ($_POST['wassup_exclude_user'] != $this->wassup_exclude_user)
707
+ $this->wassup_exclude_user=$this->cleanFormText($_POST['wassup_exclude_user']);
708
+ if ($_POST['wassup_exclude_url'] != $this->wassup_exclude_url){
709
+ if(wassupURI::is_root_url($sitehome))
710
+ $this->wassup_exclude_url=str_replace($sitehome,'',$this->cleanFormURL($_POST['wassup_exclude_url']));
711
+ else
712
+ $this->wassup_exclude_url=str_replace(rtrim($sitehome,'/'),'/',$this->cleanFormURL($_POST['wassup_exclude_url']));
713
+ }
714
+ if(!empty($_POST['wassup_remind_mb'])&& is_numeric($_POST['wassup_remind_mb'])){
715
+ $this->wassup_remind_mb=(int)$_POST['wassup_remind_mb'];
716
+ }elseif(!isset($_POST['wassup_remind_mb'])){
717
+ $this->wassup_remind_mb=100;
718
+ }else{
719
+ $this->wassup_remind_mb=0;
720
+ }
721
+ if(!empty($_POST['wassup_remind_flag'])){
722
+ $this->wassup_remind_flag=(int)$_POST['wassup_remind_flag'];
723
+ if(empty($_POST['wassup_remind_mb']))$this->wassup_remind_mb=100;
724
+ }
725
+ if(isset($_POST['delete_auto'])){
726
+ $this->delete_auto=$this->cleanFormText($_POST['delete_auto']);
727
+ if(isset($_POST['delete_filter']))$this->delete_filter=$this->cleanFormText($_POST['delete_filter']);
728
+ //schedule daily delete auto
729
+ if(!empty($this->delete_auto) && $this->delete_auto!="never"){
730
+ $starttime=wp_next_scheduled('wassup_scheduled_purge');
731
+ if(empty($starttime)){
732
+ //start purge at 2am
733
+ $starttime=strtotime("tomorrow 2:00am");
734
+ wp_schedule_event($starttime,'daily','wassup_scheduled_purge');
735
+ }
736
+ }else{
737
+ wp_clear_scheduled_hook('wassup_scheduled_purge');
738
+ }
739
+ }else{
740
+ wp_clear_scheduled_hook('wassup_scheduled_purge');
741
+ }
742
+ //New in v1.9: optimization and delayed_insert options
743
+ if(isset($_POST['wassup_optimize_on'])){
744
+ if($this->wassup_optimize=="0")
745
+ $this->wassup_optimize=$this->defaultSettings('wassup_optimize');
746
+ }else{
747
+ $this->wassup_optimize="0";
748
+ }
749
+ $this->delayed_insert=(!empty($_POST['delayed_insert'])?"1":"0");
750
+ if (!empty($_POST['wassup_dbengine'])) $this->wassup_dbengine=$this->cleanFormText($_POST['wassup_dbengine']);
751
+ if($this->saveSettings()){
752
+ $admin_message=__("Wassup options updated successfully","wassup")."." ;
753
+ $this->resetUserSettings($current_user->user_login,$current_user);
754
+ }
755
+ }
756
+ return $admin_message;
757
+ } //end saveFormChanges
758
+
759
+ /**
760
+ * get timezone (and offset) directly from the host server.
761
+ * @since 1.8
762
+ * @param none
763
+ * @return array (*string $timezone, *string $offset)
764
+ */
765
+ function getHostTimezone($getoffset=false) {
766
+ $hostTimezone = __("Unknown");
767
+ $nix_server="";
768
+ //run *nix 'date' command to get offset from host server system
769
+ //'date' function for timezone not supported on Windows
770
+ if (defined('PHP_OS') && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
771
+ $nix_server = PHP_OS;
772
+ } else {
773
+ if (!empty($_SERVER['SERVER_SOFTWARE'])) {
774
+ $php_os = $_SERVER['SERVER_SOFTWARE'];
775
+ } elseif (function_exists('apache_get_version')) {
776
+ $php_os = apache_get_version();
777
+ }
778
+ if (preg_match('/(nix|bsd|os\s?x|ux|darwin|sun)/i',$php_os)>0) {
779
+ $nix_server = $php_os;
780
+ }
781
+ }
782
+ if (!empty($nix_server) && function_exists('shell_exec')) {
783
+ //check that 'shell_exec' is enabled (no safe_mode)
784
+ $safe_mode="off";
785
+ if (version_compare(PHP_VERSION,'5.4','<')) {
786
+ $safe_mode = @ini_get('safe_mode');
787
+ if ($safe_mode!= "on" && $safe_mode!= "1")
788
+ $safe_mode="off";
789
+ }
790
+ if ($safe_mode=='off' && !in_array('shell_exec',array_map('trim',explode(',', @ini_get('disable_functions'))))) {
791
+ if ($getoffset) {
792
+ $hostTZ = @shell_exec('date +"%Z|%z"');
793
+ //in case shell_exec is disabled
794
+ if (strpos($hostTZ,'|')!==false) {
795
+ $hostTimezone = explode('|',$hostTZ);
796
+ $hostTimezone[1] = substr($hostTimezone[1],0,3);
797
+ }
798
+ } else {
799
+ $hostTZ = @shell_exec('date +"%Z"');
800
+ //in case shell_exec is disabled
801
+ if (!empty($hostTZ)) {
802
+ $hostTimezone = $hostTZ;
803
+ }
804
+ }
805
+ } //end if safe_mode
806
+ }
807
+ return $hostTimezone;
808
+ } //end getHostTimezone
809
+
810
+ /**
811
+ * Return true if site uses American English format for dates and numbers
812
+ * @since v1.9
813
+ * @param string
814
+ * @return boolean
815
+ */
816
+ function is_USAdate($ftype="date"){
817
+ $is_usaformat=false;
818
+ //check for US|Euro date format in wordpress options
819
+ $wp_dateformat=get_option('date_format');
820
+ $i=strpos($wp_dateformat,'j');
821
+ if($i===false)$i=strpos($wp_dateformat,'d');
822
+ if($i>1 && strpos($wp_dateformat,'Y')!==0)$is_usaformat=true;
823
+ return $is_usaformat;
824
+ }
825
+
826
+ /**
827
+ * Verify that a user has administrator role.
828
+ * - "username" param can be empty, string, or WPUser object
829
+ * @since v1.9
830
+ * @param string $username
831
+ * @return boolean
832
+ */
833
+ function is_admin_login($username=""){
834
+ global $current_user;
835
+ $is_admin_login=false;
836
+ if($username===false)return false;
837
+ if(empty($username))$username=$current_user;
838
+ if(is_object($username)){
839
+ if($username == $current_user && function_exists('is_super_admin') && is_super_admin()) $is_admin_login=true;
840
+ elseif(!empty($username->roles)&& in_array("administrator",$username->roles)) $is_admin_login=true;
841
+ elseif(!empty($username->user_level)&& $username->user_level>7)$is_admin_login=true;
842
+ }elseif(is_string($username)){
843
+ if($current_user->user_login == $username) $udata=$current_user;
844
+ else $udata=get_user_by("login",$username);
845
+ if($udata == $current_user && function_exists('is_super_admin') && is_super_admin()) $is_admin_login=true;
846
+ elseif(!empty($udata->roles)&& in_array("administrator",$udata->roles)) $is_admin_login=true;
847
+ elseif(!empty($udata->user_level)&& $udata->user_level>7) $is_admin_login=true;
848
+ }
849
+ return $is_admin_login;
850
+ } //end is_admin_login
851
+
852
+ /**
853
+ * Verify that wassup is network-activated in Wordpress multisite.
854
+ * @since v1.9
855
+ * @param none
856
+ * @return boolean
857
+ */
858
+ function network_activated_plugin($plugin_file=""){
859
+ global $wpdb;
860
+ $is_network_activated=false;
861
+ $wassupplugin=plugin_basename(WASSUPDIR."/wassup.php");
862
+ if(empty($plugin_file)) $plugin_file=$wassupplugin;
863
+ if(is_multisite()){
864
+ $plugins=get_site_option('active_sitewide_plugins');
865
+ if(isset($plugins[$plugin_file])){
866
+ $is_network_activated=true;
867
+ }elseif($plugin_file == $wassupplugin){
868
+ $network_settings=get_site_option('wassup_network_settings');
869
+ if(!empty($network_settings['wassup_table']) && $network_settings['wassup_table']==$wpdb->base_prefix."wassup") $is_network_activated=true;
870
+ }
871
+ }
872
+ return $is_network_activated;
873
+ }
874
+ /**
875
+ * Return the user capabilities string equivalent of a user level number.
876
+ * @since v1.9
877
+ * @param integer $userlevel
878
+ * @return string
879
+ */
880
+ function get_access_capability($userlevel=""){
881
+ if($userlevel=="" || !is_numeric($userlevel)){
882
+ $userlevel=$this->wassup_userlevel;
883
+ }
884
+ $access='read'; //default
885
+ if(is_numeric($userlevel)){
886
+ if($userlevel >=8) $access='manage_options'; //Admin
887
+ elseif($userlevel >=6) $access='publish_pages'; //Editor
888
+ elseif($userlevel >=2) $access='publish_posts'; //Author
889
+ elseif($userlevel >=1) $access='edit_posts'; //Contributor
890
+ else $access='read';
891
+ }
892
+ return $access;
893
+ }
894
+
895
+ /** Set hash value for wassup ajax requests and cookies */
896
+ function get_wp_hash($hashkey="") {
897
+ $wassuphash="";
898
+ if (empty($hashkey)) {
899
+ //v1.9 bugfix: 'secret_key' obsolete, replaced with 'auth_key'
900
+ if(defined('AUTH_KEY'))$hashkey=AUTH_KEY; //in WP 3.X
901
+ elseif(defined('SECRET_KEY'))$hashkey=SECRET_KEY; //in WP 2.X
902
+ else $hashkey="wassup-".sprintf('%03d',rand(0,999));
903
+ //for multisite, append subsite_id to hashkey
904
+ if(is_multisite() && !is_network_admin()) $hashkey .= $GLOBALS['current_blog']->blog_id;
905
+ }
906
+ $wassuphash=wp_hash($hashkey);
907
+ return $wassuphash;
908
+ }
909
+ /**
910
+ * Convert associative array to this class object
911
+ * @since 1.8
912
+ * @param array (assoc)
913
+ * @return boolean
914
+ */
915
+ function _options2class($options_array) {
916
+ if(!empty($options_array) && is_array($options_array)){
917
+ foreach ($options_array as $o_key => $o_value){
918
+ if(isset($this->$o_key)){ //returns false for null values
919
+ $this->$o_key = $o_value;
920
+ }elseif(function_exists('property_exists')){ //PHP 5.1+ function
921
+ if(property_exists($this,$o_key)){
922
+ $this->$o_key = $o_value;
923
+ }
924
+ }elseif(array_key_exists($o_key,$this)){ //valid for objects in PHP 4.0.7 thru 5.2 only
925
+ $this->$o_key = $o_value;
926
+ }
927
+ } //end foreach
928
+ }else{
929
+ return false;
930
+ }
931
+ return true;
932
+ } //end _options2class
933
+
934
+ /** display a system notice or message in admin panel. */
935
+ function showMessage($message="") {
936
+ global $wp_version,$current_user;
937
+ if(empty($message) && (empty($_GET['page'])|| stristr($_GET['page'],'wassup')!==false) && !empty($this->wassup_alert_message)) $message=$this->wassup_alert_message;
938
+ //New in v1.9: show user-specific alert messages
939
+ if(empty($message)){
940
+ if(!is_object($current_user) || empty($current_user->ID)) wp_get_current_user();
941
+ $wassup_user_settings = get_user_option('_wassup_settings',$current_user->ID);
942
+ if(!empty($wassup_user_settings['ualert_message'])) $message=$wassup_user_settings['ualert_message'];
943
+ $wassup_user_settings['ualert_message']="";
944
+ update_user_option($current_user->ID,'_wassup_settings',$wassup_user_settings);
945
+ }
946
+ if(!empty($message)){
947
+ $error=__("error","wassup");
948
+ $warning=__("warning","wassup");
949
+ $updated=__("updated","wassup");
950
+ $upgraded=__("upgraded","wassup");
951
+ $deleted=__("deleted","wassup");
952
+ $mclass="fade updated";
953
+ if(stristr($message,$error)!==false){
954
+ if(version_compare($wp_version,'4.1','>=')) $mclass="notice error";
955
+ else $mclass="fade error";
956
+ }elseif(version_compare($wp_version,'4.1','>=')){
957
+ if(stristr($message,$warning)!==false) $mclass="notice notice-warning";
958
+ elseif(stristr($message,$updated)!==false || stristr($message,$upgraded)!==false || stristr($message,$deleted)!==false) $mclass="notice updated";
959
+ else $mclass="notice notice-info";
960
+ }
961
+ //display message prefaced with version #
962
+ echo '<div id="wassup-message" class="'.$mclass.'">WassUp '.WASSUPVERSION.': '.esc_attr($message);
963
+ echo '</div>'."\n";
964
+ if($message == $this->wassup_alert_message){
965
+ $this->clearMessage();
966
+ }
967
+ }
968
+ }
969
+ /** displays an alert (error) message. */
970
+ function showError($message="") {
971
+ $this->showMessage($message);
972
+ }
973
+ /** remove a notice from wassup_alert_message. @since v1.9 */
974
+ function clearMessage($message_text=""){
975
+ if(!empty($message_text)){
976
+ if($this->wassup_alert_message==$message_text){
977
+ $this->wassup_alert_message="";
978
+ $this->saveSettings();
979
+ }elseif(stristr($this->wassup_alert_message,$message_text)!==false){
980
+ $this->wassup_alert_message="";
981
+ $this->saveSettings();
982
+ }
983
+ }else{
984
+ $this->wassup_alert_message="";
985
+ $this->saveSettings();
986
+ }
987
+ }
988
+ } //end class wassupOptions
989
+ } //end if !class_exists
990
+
991
+ //New in v1.9: wassupDb static class for WassUp table operations
992
+ if(!class_exists('wassupDb')){
993
+ /**
994
+ * Static class for WassUp table operations and data caching.
995
+ *
996
+ * @since v1.9
997
+ * @author Helene D. <http://helenesit.com>
998
+ */
999
+ class wassupDb{
1000
+ /** Verify that a table exists in wordpress db */
1001
+ function table_exists($table){
1002
+ global $wpdb;
1003
+ $is_table=false;
1004
+ if(!empty($table)&& preg_match('/^([a-z0-9\-_\.]+)$/i',$table)>0){
1005
+ if(method_exists($wpdb,'esc_like')) $sql=sprintf("SHOW TABLES LIKE '%s'",$wpdb->esc_like($table));
1006
+ else $sql=sprintf("SHOW TABLES LIKE '%s'",like_escape($table));
1007
+ $result=$wpdb->get_var($sql);
1008
+ if(!empty($result) && !is_wp_error($result)){
1009
+ if($result == $table) $is_table=true;
1010
+ }
1011
+ }
1012
+ return $is_table;
1013
+ } //table_exists
1014
+
1015
+ /**
1016
+ * Perform a "table status" query and cache the result.
1017
+ *
1018
+ * - table_status is cached for up to 1 hour to avoid overusing this costly mysql operation
1019
+ * @param string
1020
+ * @return object
1021
+ */
1022
+ function table_status($table){
1023
+ global $wpdb,$wdebug_mode;
1024
+ $table_status=false;
1025
+ if(empty($table) || !wassupDb::table_exists($table)){
1026
+ $error_msg= __FUNCTION__." failed - missing table name";
1027
+ }else{
1028
+ $meta_key='_table_status';
1029
+ $table_status=wassupDb::get_wassupmeta($table,$meta_key);
1030
+ if(empty($table_status)){
1031
+ $table_status=$wpdb->get_row(sprintf("SHOW TABLE STATUS LIKE '%s'",wassupDb::esc_like($table)));
1032
+ if(is_wp_error($table_status)){
1033
+ $error_msg=" table_status error# ".$table_status->get_error_code().": ".$table_status->get_error_message();
1034
+ $table_status=false;
1035
+ }elseif(!empty($table_status)){
1036
+ $expire=time()+3602;
1037
+ $cache_id=wassupDb::update_wassupmeta(esc_attr($table),$meta_key,$table_status,$expire);
1038
+ }else{
1039
+ $table_status=false;
1040
+ }
1041
+ }
1042
+ }
1043
+ if(!empty($error_msg)){
1044
+ if($wdebug_mode) echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1045
+ }
1046
+ //always return an object
1047
+ if(empty($table_status) || !is_object($table_status)){
1048
+ if(empty($table_status['Data_length'])) $tstatus=array('Rows'=>0,'Data_length'=>0,'Index_length'=>0,'Engine'=>"",'Type'=>"");
1049
+ else $tstatus=$table_status;
1050
+ $table_status=(object)$tstatus;
1051
+ }
1052
+ return $table_status;
1053
+ } //table_status
1054
+
1055
+ /**
1056
+ * Insert a record into a wassup table.
1057
+ *
1058
+ * - insert record is an associative array
1059
+ * - a record id number is returned on success.
1060
+ * @param string $table, array $new_record, boolean $delayed
1061
+ * @return string
1062
+ */
1063
+ function table_insert($table,$new_record,$delayed=false){
1064
+ global $wpdb,$wassup_options,$wdebug_mode;
1065
+ $rec_id=false;
1066
+ $error_msg="";
1067
+ if(empty($wassup_options->delayed_insert)) $delayed=false;
1068
+ //table and record must be specfied
1069
+ if(empty($table)|| empty($new_record)){
1070
+ $error_msg=__FUNCTION__." failed - missing table or record parameter";
1071
+ }elseif(!is_array($new_record)){
1072
+ //record must be array
1073
+ $error_msg=__FUNCTION__." failed - insert record NOT an array $new_record";
1074
+ }
1075
+ if(!empty($error_msg)){
1076
+ $error=new WP_Error('1',$error_msg);
1077
+ return $error;
1078
+ }
1079
+ //insert the record
1080
+ if(!$delayed && method_exists($wpdb,'insert')){
1081
+ //insert with 'wpdb::insert' method
1082
+ $rec_id=$wpdb->insert($table,$new_record);
1083
+ }else{
1084
+ //insert with 'wpdb::query' for delayed insert
1085
+ $cols="";
1086
+ $vals="";
1087
+ $i=0;
1088
+ foreach($new_record AS $field=>$val){
1089
+ if(is_numeric($val))$value=$val;
1090
+ else $value=wassupDb::sanitize($val,true);
1091
+ if($i==0){
1092
+ $cols="`$field`";
1093
+ $vals="$value";
1094
+ }else{
1095
+ $cols .=", `$field`";
1096
+ $vals .=", $value";
1097
+ }
1098
+ $i++;
1099
+ } //end foreach
1100
+ //delayed insert option for myISAM and ISAM tables
1101
+ if($delayed) $delayed="DELAYED";
1102
+ else $delayed="";
1103
+ $rec_id=$wpdb->query(sprintf("INSERT $delayed INTO $table (%s) VALUES (%s)",$cols,$vals));
1104
+ }
1105
+ return $rec_id;
1106
+ } //end table_insert
1107
+
1108
+ /**
1109
+ * perform a delete operation on a table
1110
+ * @param string, string
1111
+ * @return integer (no. deleted)
1112
+ */
1113
+ function table_delete($wtable="",$where_condition){
1114
+ global $wpdb,$wassup_options,$wdebug_mode;
1115
+ $deleted=false;
1116
+ if(!empty($where_condition)){
1117
+ if(empty($table))$table=$wassup_options->wassup_table;
1118
+ if(wassupDb::table_exists($table) && stristr($where_condition,'where')!==false){
1119
+ $sql=sprintf("DELETE FROM %s %s",$table,$where_condition);
1120
+ $deleted=$wpdb->query($sql);
1121
+ if(is_wp_error($deleted)){
1122
+ $error_msg=' &nbsp; WP_Error in '.__FUNCTION__.' '.$deleted->get_error_message()." \n<br/>SQL=\$wpdb->query($sql)";
1123
+ $deleted=0;
1124
+ }
1125
+ }else{
1126
+ $error_msg=' &nbsp; Error in '.__FUNCTION__.' missing table or bad where condition';
1127
+ }
1128
+ }else{
1129
+ $error_msg=' &nbsp; Error in '.__FUNCTION__.' missing where condition';
1130
+ }
1131
+ if(!empty($error_msg)){
1132
+ if($wdebug_mode) echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1133
+ }
1134
+ return $deleted;
1135
+ }
1136
+
1137
+ /**
1138
+ * Deletes "cached" records from 'wp_wassup_meta' table.
1139
+ * - deletes records matching meta_key==parameter or
1140
+ * - deletes all records starting with "_" (underscore) when empty parameter
1141
+ * @param string $meta_key
1142
+ * @return boolean
1143
+ */
1144
+ function clear_cache($meta_key=""){
1145
+ global $wpdb,$wassup_options,$wdebug_mode;
1146
+ $cleared=false;
1147
+ $cache_table=$wassup_options->wassup_table ."_meta";
1148
+ // deletes all records starting with "_" (underscore)
1149
+ if(empty($meta_key)){
1150
+ $sql=sprintf("DELETE FROM %s WHERE `meta_key` LIKE '\\_%%' AND `meta_expire`>0",$cache_table); //TODO: verify that escaped '_' requires 2 backslashes, not 1
1151
+ $deleted=$wpdb->query($sql);
1152
+ if(is_wp_error($deleted)){
1153
+ $error_msg=' &nbsp; clear_cache error# '.$deleted->get_error_code()." ".$deleted->get_error_message()." \n<br/>SQL=\$wpdb->query($sql)";
1154
+ $deleted=0;
1155
+ }
1156
+ //delete records matching meta_key==parameter
1157
+ }elseif(preg_match('/^([0-9a-z_\-\.]+)$/',$meta_key)>0){
1158
+ $deleted=wassupDb::delete_wassupmeta('','*',$meta_key);
1159
+ }
1160
+ if(!empty($deleted)&& is_numeric($deleted))$cleared=true;
1161
+ if(!empty($error_msg)){
1162
+ if($wdebug_mode) echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1163
+ }
1164
+ return $cleared;
1165
+ } //end clear_cache
1166
+
1167
+ /**
1168
+ * verify that a table can be optimized.
1169
+ * - table engines: MyISAM, ARCHIVE, or InnoDb with "innodb_file_per_table" option enabled can be optimized.
1170
+ * @param string (table_name)
1171
+ * @return boolean
1172
+ */
1173
+ function is_optimizable_table($table_name=""){
1174
+ global $wpdb,$wassup_options;
1175
+ $is_optimizable=false;
1176
+ $tengine="";
1177
+ if(empty($table_name))$table_name=$wassup_options->wassup_table;
1178
+ if(!empty($table_name)){
1179
+ $tstatus = wassupDb::table_status($table_name);
1180
+ if(is_object($tstatus) && isset($tstatus->Engine)){
1181
+ $tengine=strtolower($tstatus->Engine);
1182
+ if(empty($tengine)|| $tengine=="myisam" || $tengine=="archive" || $tengine=="isam"){
1183
+ $is_optimizable=true;
1184
+ }elseif($tengine=="innodb"){
1185
+ $innodb_optimizable=$wpdb->get_var("SELECT @@global.innodb_file_per_table AS innodb_optimizable FROM DUAL");
1186
+ if(!empty($innodb_optimizable)&& !is_wp_error($innodb_optimizable) && ($innodb_optimizable=="1" || strtolower($innodb_optimizable)=="on")) $is_optimizable=true;
1187
+ }
1188
+ }
1189
+ }
1190
+ return $is_optimizable;
1191
+ } //end is_optimizable_table
1192
+
1193
+ /**
1194
+ * method for PHP5.5 and Mysqli compatibility.
1195
+ * @todo - remove all references to old mysql_client_encoding and delete this method
1196
+ */
1197
+ function mysql_client_encoding(){
1198
+ global $wpdb;
1199
+ if (empty($wpdb->use_mysqli)) return mysql_client_encoding();
1200
+ else return mysqli_character_set_name();
1201
+ }
1202
+
1203
+ /**
1204
+ * Save wassup data to wp_wassup_meta table for caching.
1205
+ * - records are cached with a default expiration of 24 hours, if none is given as argument
1206
+ * @param mixed(4): string(2) $wassup_key $meta_key, string/array $metavalue, integer $expire (as time)
1207
+ * @return string $meta_id
1208
+ */
1209
+ function save_wassupmeta($wassup_key,$meta_key,$metavalue,$expire=false){
1210
+ global $wpdb,$wassup_options,$wdebug_mode;
1211
+ $table=$wassup_options->wassup_table.'_meta';
1212
+ $meta_id=false;
1213
+ //wassup_key or meta_key must be specified
1214
+ if(empty($wassup_key)&& empty($meta_key)){
1215
+ $error_msg=__FUNCTION__." failed! - missing both 'wassup_key' and 'meta_key' parameters";
1216
+ if($wdebug_mode)echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1217
+ return false;
1218
+ }
1219
+ //24-hour expire default... rounded to minute
1220
+ if($expire===false || !is_numeric($expire))$expire= (ceil(time()/60))*60+24*3600;
1221
+ //serialize $metavalue array
1222
+ if(is_array($metavalue)|| is_object($metavalue))$meta_value=maybe_serialize($metavalue);
1223
+ else $meta_value=$metavalue;
1224
+ $meta_record=array('wassup_key'=>$wassup_key,
1225
+ 'meta_key'=>$meta_key,
1226
+ 'meta_value'=>"$meta_value",
1227
+ 'meta_expire'=>(int)$expire);
1228
+ //save to table
1229
+ $meta_id=wassupDb::table_insert($table,$meta_record);
1230
+ return $meta_id;
1231
+ } //end save_wassupmeta
1232
+
1233
+ /**
1234
+ * Update existing cache data in 'wp_wassup_meta' table.
1235
+ * @param mixed(4): string(2) $wassup_key $meta_key, string/array $metavalue, integer $expire (as time)
1236
+ * @return string $meta_id
1237
+ */
1238
+ function update_wassupmeta($wassup_key,$meta_key,$metavalue,$expire=false){
1239
+ global $wpdb,$wassup_options,$wdebug_mode;
1240
+ $table=$wassup_options->wassup_table.'_meta';
1241
+ $meta_id=false;
1242
+ $error_msg="";
1243
+ //both wassup_key and meta_key must be specified for update
1244
+ if(empty($wassup_key)|| empty($meta_key)){
1245
+ $error_msg=__FUNCTION__." failed! - missing either 'wassup_key' or 'meta_key' parameter";
1246
+ }else{
1247
+ //get meta_id of existing record, if any
1248
+ $result=$wpdb->get_var(sprintf("SELECT `meta_id` FROM $table WHERE `wassup_key`='%s' AND `meta_key`='%s' LIMIT 1",esc_attr($wassup_key),esc_attr($meta_key)));
1249
+ //update the record (or insert new)
1250
+ if(!empty($result) && !is_wp_error($result)) $meta_id=$result;
1251
+ if(empty($meta_id)){
1252
+ $meta_id=wassupDb::save_wassupmeta($wassup_key,$meta_key,$metavalue,$expire);
1253
+ }else{
1254
+ //24-hour expire default... rounded to minute
1255
+ if($expire===false || !is_numeric($expire))$expire=(ceil(time()/60))*60+24*3600;
1256
+ //serialize $metavalue array
1257
+ if(is_array($metavalue)|| is_object($metavalue))$meta_value=maybe_serialize($metavalue);
1258
+ else $meta_value=$metavalue;
1259
+ $qry=sprintf("UPDATE `$table` SET `meta_value`='%s', `meta_expire`=%d WHERE `meta_id`=%d",$meta_value,$expire, $meta_id);
1260
+ if(!empty($qry)){
1261
+ $result=$wpdb->query($qry);
1262
+ if(is_wp_error($result)) $error_msg=' &nbsp; update_wassupmeta Error#'.$result->get_error_code().': '.$result->get_error_message()." \n<br/>SQL=\$wpdb->query($qry)";
1263
+ }
1264
+ }
1265
+ }
1266
+ if(!empty($error_msg)){
1267
+ if($wdebug_mode)echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1268
+ }
1269
+ return $meta_id;
1270
+ } //end update_wassupmeta
1271
+
1272
+ /**
1273
+ * Retrieve an unexpired 'meta_value' from wassup_meta table or an array of 'meta_value's for multiple matching records.
1274
+ * -records with 'meta_expire' timestamp older than the current time are not returned.
1275
+ * -optional parameter to use 'SQL_NO_CACHE' to force mySQL to lookup data instead of using internal query cache
1276
+ * @param string (2), boolean
1277
+ * @return mixed (string or array)
1278
+ */
1279
+ function get_wassupmeta($wassup_key,$meta_key="",$sql_nocache=false){
1280
+ global $wpdb,$wassup_options,$wdebug_mode;
1281
+ if(empty($wassup_options))$wassup_options=new wassupOptions;
1282
+ $meta_table=$wassup_options->wassup_table.'_meta';
1283
+ $meta_value=false;
1284
+ $sql_no_cache="";
1285
+ $expired=time()-30;
1286
+ $sql="";
1287
+ $result=false;
1288
+ if(!empty($sql_nocache)) $sql_nocache="SQL_NO_CACHE";
1289
+ else $sql_nocache="";
1290
+ //check that we have a wassup_meta table
1291
+ if(!wassupDb::table_exists($meta_table)){
1292
+ $error_msg=__FUNCTION__." failed - table $meta_table not found!";
1293
+ //check for matching wassup_key
1294
+ }elseif(!empty($wassup_key)){
1295
+ if(!empty($meta_key)){
1296
+ $sql=sprintf("SELECT $sql_nocache `meta_value` FROM `$meta_table` WHERE `wassup_key`='%s' AND `meta_key`='%s' AND (`meta_expire`=0 OR `meta_expire`>%d) ORDER BY `meta_expire` DESC LIMIT 1",$wassup_key,$meta_key,$expired);
1297
+ //$result=$wpdb->get_var($sql);
1298
+ $result=$wpdb->get_results($sql);
1299
+ if(!empty($result) && !is_wp_error($result) && !empty($result[0]->meta_value)) $meta_value=$result[0]->meta_value;
1300
+ }else{
1301
+ //return an array of all results with same wassup_key
1302
+ $sql=sprintf("SELECT $sql_nocache `meta_value` FROM `$meta_table` WHERE `wassup_key`='%s' AND (`meta_expire`=0 OR `meta_expire`>%d)",$wassup_key,$expired);
1303
+ $result=$wpdb->get_col($sql);
1304
+ if(!empty($result) && !is_wp_error($result)) $meta_value=$result;
1305
+ }
1306
+ //check for matching meta_key
1307
+ }elseif(!empty($meta_key)){
1308
+ //return an array of all results with same meta_key
1309
+ $sql=sprintf("SELECT $sql_nocache `meta_value` FROM `$meta_table` WHERE `meta_key`='%s' AND (`meta_expire`=0 OR `meta_expire`>%d)",$meta_key,$expired);
1310
+ $result=$wpdb->get_col($sql);
1311
+ if(!empty($result) && !is_wp_error($result)) $meta_value=$result;
1312
+ }
1313
+ //unserialize arrays/objects before output
1314
+ if(!empty($meta_value) && !is_array($meta_value)&& !is_object($meta_value)){
1315
+ $results=maybe_unserialize(html_entity_decode($meta_value));
1316
+ if(is_array($results)|| is_object($results))$meta_value=$results;
1317
+ }
1318
+ if($wdebug_mode){
1319
+ if(!empty($result) && is_wp_error($result)){
1320
+ $errno=$result->get_error_code();
1321
+ if($errno >0) $error_msg=__FUNCTION__.' query failed - MySQL error#'.$errno.' '.$result->get_error_message()." \n<br/>SQL=$sql";
1322
+ echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1323
+ }
1324
+ }
1325
+ return $meta_value;
1326
+ } //end get_wassupmeta
1327
+
1328
+ /**
1329
+ * Delete a 'wp_wassup_meta' record.
1330
+ * - single or multiple records may be deleted by 'meta_id', or 'wassup_key', or 'meta_key' regardless of expire timestamp
1331
+ * - 'wassup_key' and 'meta_key' arguments are both required when 'meta_id'=null
1332
+ * - wildcards (*) character can be used for bulk delete by either 'meta_key' or 'wassup_key', but not both.
1333
+ * USAGE: meta_id|"", [(wassup_key|*),(meta_key|*))].
1334
+ *
1335
+ * @param mixed (integer $meta_id, string $wassup_key, string $meta_key)
1336
+ * @return integer
1337
+ */
1338
+ function delete_wassupmeta($meta_id,$wassup_key="",$meta_key=""){
1339
+ global $wpdb,$wassup_options,$wdebug_mode;
1340
+ $meta_table=$wassup_options->wassup_table.'_meta';
1341
+ $rows_affected=0;
1342
+ $deleted=0;
1343
+ $sql="";
1344
+ //prepare the sql delete statement from function parameters
1345
+ if(wassupDb::table_exists($meta_table)){
1346
+ if(!empty($meta_id)){
1347
+ $sql=sprintf("DELETE FROM $meta_table WHERE `meta_id`=%d",$meta_id);
1348
+ }elseif(!empty($wassup_key)&& !empty($meta_key)){
1349
+ if($wassup_key !="*" && $meta_key !="*"){
1350
+ $sql=sprintf("DELETE FROM $meta_table WHERE `meta_key`='%s' AND `wassup_key`='%s'",esc_attr($meta_key),esc_attr($wassup_key));
1351
+ }elseif($meta_key !="*"){
1352
+ $sql=sprintf("DELETE FROM $meta_table WHERE `meta_key`='%s'",esc_attr($meta_key));
1353
+ }elseif($wassup_key !="*"){
1354
+ $sql=sprintf("DELETE FROM $meta_table WHERE `wassup_key`='%s'",esc_attr($wassup_key));
1355
+ }
1356
+ }else{
1357
+ $error_msg=__FUNCTION__.' failed - bad or missing arguments!'."&nbsp; (meta_id=".esc_attr($meta_id)." , &nbsp;wassup_key=".esc_attr($wassup_key)." , &nbsp;meta_key=".esc_attr($meta_key).")";
1358
+ }
1359
+ }else{
1360
+ $error_msg=__FUNCTION__.' failed - table '.$meta_table.' does not exist!';
1361
+ }
1362
+ //do the delete
1363
+ if(!empty($sql)){
1364
+ $deleted=$wpdb->query($sql);
1365
+ $errno=0;
1366
+ if(is_wp_error($deleted)){
1367
+ $errno=$deleted->get_error_code();
1368
+ if($errno >0)$error_msg=' delete_wassupmeta failed with MySQL error#'.$errno.' '.$deleted->get_error_message(). " \n<br/>SQL=$sql";
1369
+ }
1370
+ $deleted=$wpdb->rows_affected+0;
1371
+ }
1372
+ if(!empty($error_msg)){
1373
+ if($wdebug_mode) echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1374
+ }
1375
+ return $deleted;
1376
+ } //end delete_wassupmeta
1377
+
1378
+ /**
1379
+ * clean data for insertion into mySQL.
1380
+ * - to prevent SQL injection - renamed from wSanitizeData
1381
+ * - an alternative to "wpdb::prepare" for older WP versions.
1382
+ * @since WassUp 1.7 (as wSanitizeData)
1383
+ * @param string $var, boolean $quotes
1384
+ * @return string
1385
+ */
1386
+ function sanitize($var,$quotes=false){
1387
+ global $wpdb;
1388
+ //clean strings and add quotes
1389
+ if(is_string($var)){
1390
+ $varstr=stripslashes($var);
1391
+ //sanitize urls separately
1392
+ if(strpos($varstr,'://')!==false){
1393
+ if(function_exists('esc_url_raw'))$varstr=esc_url_raw($varstr);
1394
+ else $varstr=esc_url($varstr,null,'db');
1395
+ //oops, clean_url chomp
1396
+ if(empty($varstr))$varstr=esc_attr(stripslashes($var));
1397
+ }else{
1398
+ $varstr=esc_sql($varstr);
1399
+ }
1400
+ if($quotes)$var="'". $varstr ."'";
1401
+ else $var=$varstr;
1402
+ //convert boolean variables to binary boolean
1403
+ }elseif(is_bool($var)&& $quotes){
1404
+ $var=($var)?1:0;
1405
+ //convert null variables to SQL NULL
1406
+ }elseif(is_null($var)&& $quotes){
1407
+ $var="NULL";
1408
+ }
1409
+ //note numeric values do not need to be sanitized
1410
+ return "$var";
1411
+ } //end sanitize
1412
+
1413
+ /**
1414
+ * Escape special characters for use in an SQL 'like' query.
1415
+ * - uses 'like_escape' or 'wpdb::esc_like' depending on Wordpress version
1416
+ * @param string $sqlstring
1417
+ * @return string
1418
+ */
1419
+ function esc_like($sqlstring){
1420
+ global $wpdb;
1421
+ $escaped_string=$sqlstring;
1422
+ if(!empty($sqlstring)){
1423
+ if(method_exists($wpdb,'esc_like')) $escaped_string= $wpdb->esc_like($sqlstring);
1424
+ else $escaped_string=like_escape($sqlstring);
1425
+ }
1426
+ return $escaped_string;
1427
+ }
1428
+
1429
+ /**
1430
+ * Return an MySQL system variable value.
1431
+ * @todo find cause of mysql timeout error when looking up dbengine for wp_wassup table
1432
+ * @since 1.7.2 (as wassupOptions::getMySQLsetting)
1433
+ * @param string
1434
+ * @return string
1435
+ */
1436
+ function get_db_setting($mysql_var,$mysql_table="") {
1437
+ global $wpdb,$wassup_options,$wdebug_mode;
1438
+ $mysql_value=false;
1439
+ $error_msg="";
1440
+ if(empty($mysql_table)) $mysql_table=$wassup_options->wassup_table;
1441
+ //get the table storage engine
1442
+ if($mysql_var=="engine" || $mysql_var=="dbengine"){
1443
+ if(!empty($mysql_table)){
1444
+ //New in v1.9: replaced cpu-intensive "show table status" query with "show create table" for faster table engine lookup
1445
+ $sql="SHOW CREATE TABLE $mysql_table";
1446
+ $result=$wpdb->get_results($sql,ARRAY_N);
1447
+ if(!empty($result)){
1448
+ if(!is_wp_error($result)){
1449
+ if(!empty($result[0][1]) && preg_match('/\sENGINE\=(\w+)\s/',$result[0][1],$pcs)>0) $mysql_value=$pcs[1];
1450
+ }else{
1451
+ $errno=$result->get_error_code();
1452
+ if($errno >0) $error_msg=' get_db_setting('.$mysql_var.') failed with MySQL error#'.$errno.' '.$myresult->get_error_message()."\n";
1453
+ }
1454
+ }
1455
+ }
1456
+ //default to db storage engine when no table
1457
+ if(empty($mysql_value)) {
1458
+ $result=$wpdb->get_results("SHOW VARIABLES LIKE 'storage_engine'",ARRAY_A);
1459
+ if(!empty($result) && !is_wp_error($result) && !empty($result[0]->Value)) $mysql_value=$result[0]->Value;
1460
+ }
1461
+ //get the timezone
1462
+ }elseif ($mysql_var == "timezone") {
1463
+ $sql_timezone=false;
1464
+ $sql_sys_timezone="";
1465
+ $result=$wpdb->get_results("SHOW VARIABLES LIKE '%zone'");
1466
+ if(!is_wp_error($result)){
1467
+ foreach ($result as $col) {
1468
+ if ($col->Variable_name == "system_time_zone") {
1469
+ $sql_sys_timezone=$col->Value;
1470
+ } elseif ($col->Variable_name == "time_zone") {
1471
+ $sql_timezone=$col->Value;
1472
+ } elseif ($col->Variable_name == "timezone") {
1473
+ $sql_timezone=$col->Value;
1474
+ }
1475
+ }
1476
+ if ($sql_timezone == "SYSTEM" || empty($sql_timezone)) {
1477
+ $host_timezone=$wassup_options->getHostTimezone();
1478
+ if (!empty($host_timezone)) {
1479
+ $sql_timezone=$host_timezone;
1480
+ } else {
1481
+ $sql_timezone=$sql_sys_timezone;
1482
+ }
1483
+ }
1484
+ }
1485
+ if (!empty($sql_timezone)) $mysql_value=$sql_timezone;
1486
+ //get timezone offset for today's date.
1487
+ } elseif ($mysql_var == "tzoffset") {
1488
+ $tzoffset=false;
1489
+ $result=$wpdb->get_var("SELECT NOW() AS tnow FROM DUAL");
1490
+ //calculate mysql timezone offset by converting MySQL's NOW() to a timestamp and subtracting UTC current time from it.
1491
+ // Note: conversion to timestamp is affected by PHP TZ setting, so remove that offset from calculation
1492
+ if(!empty($result) && !is_wp_error($result)){
1493
+ $now=((int)(time()/1800))*1800; //truncate to 1/2 hour
1494
+ if(function_exists('date_timestamp_get')){
1495
+ $mysql_dt=new DateTime($result);
1496
+ $mysql_time=$mysql_dt->getTimestamp();
1497
+ $adjust=$mysql_dt->getOffset();
1498
+ }else{
1499
+ $mysql_time=strtotime($result);
1500
+ $adjust=(int)date('Z');
1501
+ }
1502
+ $tzoffset=((int)($mysql_time/1800))*1800 - $now;
1503
+ if(is_numeric($adjust)) $tzoffset +=$adjust;
1504
+ //change offset to MySQL "[+-]hh:mm" format
1505
+ $mysql_value=wassupDb::format_tzoffset($tzoffset);
1506
+ }
1507
+ //get a mysql variable with parameter name
1508
+ } elseif(!empty($mysql_var)) {
1509
+ $result=$wpdb->get_results(sprintf("SHOW VARIABLES LIKE '%s'",wassupDb::esc_like(esc_attr($mysql_var))));
1510
+ if (!is_wp_error($result) && !empty($result)) {
1511
+ foreach ($result as $col) {
1512
+ if ($col->Variable_name == $mysql_var) {
1513
+ $mysql_value=$col->Value;
1514
+ break 1;
1515
+ }
1516
+ }
1517
+ }
1518
+ }
1519
+ if($wdebug_mode){
1520
+ if(!empty($result) && is_wp_error($result)){
1521
+ $errno=$result->get_error_code();
1522
+ if($errno >0) $error_msg .=' get_db_setting('.$mysql_var.') failed with MySQL error#'.$errno.' '.$result->get_error_message();
1523
+ }
1524
+ if(!empty($error_msg)) echo "\n<!-- ".__CLASS__." ERROR: ".$error_msg." -->";
1525
+ }
1526
+ return $mysql_value;
1527
+ } //end get_db_setting
1528
+
1529
+ /**
1530
+ * Convert an offset to MySQL "[+-]hh:mm" format.
1531
+ * - offset is converted from seconds or hours to MySQL "[+-]hh:mm" format.
1532
+ * @since 1.8 (as wassupOptions::formatTimezoneOffset)
1533
+ * @param string
1534
+ * @return string
1535
+ */
1536
+ function format_tzoffset($offset=false) {
1537
+ $tzoffset=false;
1538
+ if(preg_match('/^[\-+]?[0-9\.]+$/',$offset)>0){ //must be a number
1539
+ //convert seconds to hours:minutes
1540
+ $n=false;
1541
+ if($offset > 12 || $offset < -12) $noffset=$offset/3600;
1542
+ else $noffset=$offset;
1543
+ $n = strpos($noffset,'.');
1544
+ if($n !== false){
1545
+ $offset_hrs=substr($noffset,0,$n);
1546
+ $offset_min=(int)substr($noffset,$n+1)*6;
1547
+ }else{
1548
+ $offset_hrs=$noffset;
1549
+ $offset_min=0;
1550
+ }
1551
+ if($offset < 0) $tzoffset=sprintf("%d:%02d",$offset_hrs,$offset_min);
1552
+ else $tzoffset="+".sprintf("%d:%02d",$offset_hrs,$offset_min);
1553
+ }elseif(preg_match('/^([\-+])?(\d{1,2})?\:(\d{2})/',$offset,$match)>0){
1554
+ if(empty($match[2])) $match[2]="0";
1555
+ if(!empty($match[1]) && $match[1]=="-") $tzoffset="-".sprintf("%d:%02d",$match[2],$match[3]);
1556
+ else $tzoffset="+".sprintf("%d:%02d",$match[2], $match[3]);
1557
+ }
1558
+ return $tzoffset;
1559
+ } //end format_tzoffset
1560
+
1561
+ /**
1562
+ * Perform scheduled/delayed db operations on wassup tables.
1563
+ * - for use with 'wp_schedule_event' hook.
1564
+ * @param array
1565
+ * @return void
1566
+ */
1567
+ function scheduled_dbtask($args=array()){
1568
+ global $wpdb,$wdebug_mode;
1569
+ //get dbtasks argument
1570
+ $dbtasks=array();
1571
+ if(!empty($args)){
1572
+ if(!is_array($args)) $args=maybe_unserialize($args);
1573
+ if(isset($args['dbtasks'])){
1574
+ extract($args);
1575
+ }elseif(is_array($args)){
1576
+ $dbtasks=$args;
1577
+ }else{
1578
+ $dbtasks[]=$args;
1579
+ }
1580
+ }
1581
+ if(!empty($dbtasks) && !is_array($dbtasks)){
1582
+ $args=maybe_unserialize($dbtasks);
1583
+ if(is_array($args)) $dbtasks=$args;
1584
+ }
1585
+ $wassup_settings=get_option('wassup_settings');
1586
+ $table_prefix=$wassup_settings['wassup_table'];
1587
+ $affected_recs=0;
1588
+ $dbtask_errors=array();
1589
+ if(!empty($dbtasks) && is_array($dbtasks)){
1590
+ //some db operations can be slow on large tables, so extend script execution time up to 30 minutes
1591
+ if(!ini_get('safe_mode')) @set_time_limit(1800);
1592
+ //increase mysql session timeout to 15 minutes
1593
+ $mtimeout=$wpdb->get_var("SELECT @@session.wait_timeout AS mtimeout FROM DUAL");
1594
+ if(!empty($mtimeout) && !is_wp_error($mtimeout) && is_numeric($mtimeout) && $mtimeout< 900){
1595
+ $result=$wpdb->query("SET wait_timeout=900");
1596
+ }
1597
+ foreach($dbtasks as $db_sql){
1598
+ $results=false;
1599
+ $error_msg="";
1600
+ //limit allowed sql to certain tasks and to Wassup tables only
1601
+ if(strpos($db_sql,"DELETE FROM `$table_prefix")!==false){
1602
+ $results=$wpdb->query($db_sql);
1603
+ }elseif(strpos($db_sql,"UPDATE LOW_PRIORITY `$table_prefix")!==false){
1604
+ $results=$wpdb->query($db_sql);
1605
+ }elseif(strpos($db_sql,"UPDATE `$table_prefix")!==false){
1606
+ $results=$wpdb->query($db_sql);
1607
+ }elseif(strpos($db_sql,"OPTIMIZE TABLE `$table_prefix")!==false){
1608
+ $results=$wpdb->query($db_sql);
1609
+ }else{
1610
+ //bad dbtask, create an error record
1611
+ $error_msg =" ERROR: Unknown task ".esc_attr($db_sql);
1612
+ }
1613
+ //check for errors in mysql results
1614
+ if(!empty($results) && is_wp_error($results)){
1615
+ $dbtask_errors[]=" ERROR: wpdb error#".$results->get_error_code().": ".$results->get_error_message()." for sql=$db_sql";
1616
+ }elseif(!empty($error_msg)){
1617
+ $dbtask_errors[]=$error_msg;
1618
+ }else{
1619
+ $affected_recs += $wpdb->rows_affected + 0;
1620
+ }
1621
+ } //end foreach
1622
+ } //end if dbtasks
1623
+ if(!empty($wdebug_mode)){
1624
+ //email error output from cron
1625
+ $message="";
1626
+ if(!empty($dbtask_errors)){
1627
+ $subject=sprintf(__("%s Error!","wassup"),'Wassup wp-cron');
1628
+ $message ="scheduled dbtask encountered an error:\n";
1629
+ foreach($dbtask_errors AS $error_msg){
1630
+ $message .=$error_msg."\n";
1631
+ }
1632
+ //}else{
1633
+ // $message ="scheduled dbtask completed successfully. Records affected=$affected_recs";
1634
+ }
1635
+ if(!empty($message)){
1636
+ $blogurl = wassupURI::get_sitehome();
1637
+ $recipient=get_bloginfo('admin_email');
1638
+ $sender='From: '.get_bloginfo('name').' <wassup_noreply@'.parse_url($blogurl,PHP_URL_HOST).'>';
1639
+ wp_mail($recipient,$subject,$message,$sender);
1640
+ }
1641
+ }
1642
+ //return $affected_recs; //don't return anything
1643
+ } //end scheduled_dbtask
1644
+
1645
+ /**
1646
+ * cleanup wassup temporary records (hourly via wp-cron):
1647
+ * - delete inactive records from wassup_tmp
1648
+ * - delete expired cache records from wassup_meta
1649
+ *
1650
+ * Inactive wassup_tmp records vary by visitor type:
1651
+ * - logged-in users are inactive after 10 minutes
1652
+ * - anonymous users are inactive after 3 minutes
1653
+ * - spiders are inactive after 1 minute
1654
+ * @since v1.9
1655
+ * @return void
1656
+ */
1657
+ function temp_cleanup(){
1658
+ global $wpdb,$wassup_options;
1659
+ $wassup_table=$wassup_options->wassup_table;
1660
+ $wassup_tmp_table=$wassup_table . "_tmp";
1661
+ $wassup_meta_table=$wassup_table . "_meta";
1662
+ $timestamp=current_time('timestamp');
1663
+ $timenow=(int)time();
1664
+ //delete inactive records from wassup_tmp table
1665
+ $result=$wpdb->query(sprintf("DELETE FROM `%s` WHERE `timestamp`<'%d' OR (`timestamp`<'%d' AND `username`='') OR (`timestamp`<'%d' AND `spider`!='')",$wassup_tmp_table,(int)$timestamp - 10*60,(int)$timestamp - 3*60,(int)$timestamp - 60));
1666
+ //delete expired cache records from wassup_meta
1667
+ $result=$wpdb->query(sprintf("DELETE FROM `%s` WHERE `meta_expire`>'0' AND `meta_expire`<'%d'",$wassup_meta_table,$timenow - 3600));
1668
+ }
1669
+ /**
1670
+ * Do automatic purge of old records from wassup table (daily via wp-cron)
1671
+ * @since v1.9
1672
+ */
1673
+ function auto_cleanup(){
1674
+ global $wpdb,$wassup_options;
1675
+ $deleted=0;
1676
+ //do purge of old records
1677
+ if(!empty($wassup_options->delete_auto) && $wassup_options->delete_auto!="never"){
1678
+ $wassup_table=$wassup_options->wassup_table;
1679
+ $wassup_meta_table=$wassup_table . "_meta";
1680
+ $timestamp=current_time('timestamp');
1681
+ $timenow=(int)time();
1682
+ //use visit timestamp not current time for delete
1683
+ $delete_from= @strtotime($wassup_options->delete_auto,$timestamp);
1684
+ $delete_filter="";
1685
+ $rows=0;
1686
+ if(is_numeric($delete_from) && $delete_from < $timestamp){
1687
+ $delete_condition="`timestamp`<'$delete_from'";
1688
+ //check for delete filters
1689
+ if(!empty($wassup_options->delete_filter)){
1690
+ if($wassup_options->delete_filter!="all"){
1691
+ $delete_filter=$wassup_options->getFieldOptions("delete_filter","sql",$wassup_options->delete_filter);
1692
+ if(!is_string($delete_filter)) $delete_filter="";
1693
+ }else{
1694
+ $delete_filter="";
1695
+ }
1696
+ }
1697
+ $multisite_whereis="";
1698
+ if($wassup_options->network_activated_plugin() && !empty($GLOBALS['current_blog']->blog_id)){
1699
+ $multisite_whereis = sprintf(" AND `subsite_id`=%d",(int)$GLOBALS['current_blog']->blog_id);
1700
+ }
1701
+ $delete_filter .= $multisite_whereis;
1702
+ $result=$wpdb->get_var(sprintf("SELECT COUNT(`id`) FROM `%s` WHERE `timestamp`<'%d' %s",$wassup_table,$delete_from,$delete_filter));
1703
+ if(!empty($result) && !is_wp_error($result) && is_numeric($result)) $rows=$result;
1704
+
1705
+ } //end if delete_from
1706
+ //do delete only when there are 50+ records
1707
+ if($rows >50){
1708
+ $deleted=$wpdb->query(sprintf("DELETE FROM `%s` WHERE `timestamp`<'%d' %s",$wassup_table,$delete_from,$delete_filter));
1709
+ //save delete_auto timestamp to prevent multiple auto deletes in 1 day
1710
+ if(!empty($deleted) && !is_wp_error($deleted)){
1711
+ $expire=time()+24*3600;
1712
+ $cache_id=wassupDb::update_wassupmeta($wassup_table,'_delete_auto',$timestamp,$expire);
1713
+ //clear table_status from wassup_meta cache after auto delete
1714
+ $result=$wpdb->query(sprintf("DELETE FROM `%s` WHERE `wassup_key`='%s' AND `meta_key`='_table_status'",$wassup_table."_meta",$wassup_table));
1715
+ //reschedule optimize to run today when bulk delete larger than 1000 records
1716
+ if($deleted >1000 && !empty($wassup_optimize)){
1717
+ $wassup_optimize=$timenow - 24*60*60;
1718
+ }
1719
+ }else{
1720
+ $deleted=0;
1721
+ }
1722
+ }
1723
+ } //end if delete_auto
1724
+ if(!empty($wdebug_mode)){
1725
+ //email delete message from cron
1726
+ $message="";
1727
+ if($deleted > 0){
1728
+ $subject=__("Wassup auto-delete notice","wassup");
1729
+ $message =sprintf(__("Auto-delete deleted %d old %s table records today.","wassup"),$deleted,$wassup_options->wassup_table);
1730
+ $blogurl = wassupURI::get_sitehome();
1731
+ $recipient=get_bloginfo('admin_email');
1732
+ $sender='From: '.get_bloginfo('name').' <wassup_noreply@'.parse_url($blogurl,PHP_URL_HOST).'>';
1733
+ wp_mail($recipient,$subject,$message,$sender);
1734
+ }
1735
+ }
1736
+ } //end auto_cleanup
1737
+
1738
+ /**
1739
+ * Retrieve raw data from wassup table in SQL format for export.
1740
+ * - taken partially from wp-db-backup plugin by Alain Wolf, Zurich, SW - http://www.ilfilosofo.com/blog/wp-db-backup/
1741
+ * - a partial export is returned if script execution timelimit of 15 minutes is exceeded
1742
+ * - the record id of last record exported (last_recid) is cached to 'wassup_meta' table.
1743
+ *
1744
+ * @param string(3) $table, $condition, $segment
1745
+ * @return string ($sql)
1746
+ */
1747
+ function backup_table($table,$condition="",$segment='none'){
1748
+ global $wpdb,$current_user,$wassup_options,$wdebug_mode;
1749
+ define('ROWS_PER_SEGMENT', 600);
1750
+ if(!is_object($current_user) || empty($current_user->ID)){
1751
+ $user=wp_get_current_user();
1752
+ }
1753
+ if(!empty($current_user->ID)){
1754
+ $wassup_user_settings=get_user_option('_wassup_settings',$current_user->ID);
1755
+ }else{
1756
+ $err_msg=__("Export ERROR: login required!","wassup");
1757
+ $wassup_options->wassup_alert_message=$err_msg;
1758
+ $wassup_options->saveSettings();
1759
+ return false;
1760
+ }
1761
+ if(empty($table))$table=$wassup_options->wassup_table;
1762
+ $sql_table_name=$wpdb->get_var(sprintf("SHOW TABLES LIKE '%s'",wassupDb::esc_like(esc_attr($table))));
1763
+ if(empty($sql_table_name) || $sql_table_name!=$table || is_wp_error($sql_table_name)){
1764
+ $err_msg=sprintf(__('Error with TABLE %s: Not found','wassup'), esc_attr($table));
1765
+ $wassup_user_settings['ualert_message']=$err_msg;
1766
+ update_user_option($current_user->ID,'_wassup_settings',$wassup_user_settings);
1767
+ return FALSE;
1768
+ }
1769
+ $sql="";
1770
+ $err_msg=false;
1771
+ $did_export=false;
1772
+ $timelimit=15*60;
1773
+ $mtimeout=60;
1774
+ $stimeout=ini_get('max_execution_time');
1775
+ $stimer_start=time();
1776
+ $row_count=0;
1777
+ $last_recid=0;
1778
+ $exclude_id=false;
1779
+ if(isset($_REQUEST['omit_recid']))$exclude_id=true;
1780
+ if(!empty($_REQUEST['expid'])&& is_numeric($_REQUEST['expid']))$backup_id=(int)$_REQUEST['expid'];
1781
+ else $backup_id=date('YmdH',current_time('timestamp'));
1782
+ //Add comments to each section of export file
1783
+ if($segment=='none' || $segment==0){
1784
+ $result=$wpdb->get_results(sprintf("SHOW CREATE TABLE `%s`",esc_attr($table)),ARRAY_N);
1785
+ if(empty($result[0][1]) || is_wp_error($result)) {
1786
+ $err_msg=sprintf(__('Error with "SHOW CREATE TABLE" for %s.','wassup'), esc_attr($table));
1787
+ }else{
1788
+ $table_create=$result[0][1];
1789
+ $first_recid=$wpdb->get_var(sprintf("SELECT MIN(`id`) FROM %s %s",esc_attr($table),$condition));
1790
+ if(!is_numeric($first_recid)) $first_recid=0;
1791
+ //add comments for table structure section
1792
+ $sql .="\n#\n";
1793
+ $sql .="# " . sprintf(__('Table structure of table %s','wassup'),esc_attr($table))."\n#\n";
1794
+ //replace "CREATE TABLE" with "CREATE TABLE IF NOT EXISTS" and remove AUTO_INCREMENT=NNN value from $table_create
1795
+ $sql .=preg_replace(array('/^CREATE\sTABLE\s(IF\sNOT\sEXISTS\s)?/i', '/AUTO_INCREMENT\=\d+\s/i'),array('CREATE TABLE IF NOT EXISTS ',''),$table_create).' ;';
1796
+ $sql .="\n#\n";
1797
+ //add comments for data section
1798
+ $sql .="# Start time: ".date('r',current_time('timestamp'))." 1st exported ID: $first_recid \n";
1799
+ $sql .='# ' . sprintf(__('Data contents of table %s','wassup'),esc_attr($table))."\n#\n";
1800
+ }
1801
+ }
1802
+ //Check for table records
1803
+ if(empty($err_msg)){
1804
+ $table_structure=$wpdb->get_results(sprintf("SHOW COLUMNS FROM %s",esc_attr($table)));
1805
+ if(is_wp_error($table_structure)){
1806
+ $errno=$table_structure->get_error_code();
1807
+ $err_msg=sprintf(__('Error getting table structure of %s: %s','wassup'), esc_attr($table),$errno.' '.$table_structure->get_error_message());
1808
+ $table_structure=false;
1809
+ }elseif(false == $table_structure){
1810
+ $err_msg=sprintf(__('Error getting table structure of %s','wassup'), esc_attr($table));
1811
+ }
1812
+ $numrecords=$wpdb->get_var(sprintf("SELECT COUNT(*) FROM %s %s",esc_attr($table), $condition));
1813
+ if(empty($numrecords)|| !is_numeric($numrecords)){
1814
+ if(is_wp_error($numrecords)){
1815
+ $errno=$numrecords->get_error_code();
1816
+ $err_msg=sprintf(__('Error with table %s: %s','wassup'), esc_attr($table),$errno.' '.$numrecords->get_error_message());
1817
+ }else{
1818
+ $err_msg=sprintf(__('Error with table %s: No data','wassup'), esc_attr($table));
1819
+ }
1820
+ $numrecords=0;
1821
+ }
1822
+ }
1823
+ //ABORT due to table error
1824
+ if(!empty($err_msg)){
1825
+ $wassup_user_settings['ualert_message']=$err_msg;
1826
+ update_user_option($current_user->ID,'_wassup_settings',$wassup_user_settings);
1827
+ return FALSE;
1828
+ }
1829
+ //Extend php script timeout to 10 minutes
1830
+ //TODO: 'safe_mode' deprecated
1831
+ if(!@ini_get('safe_mode')){if(empty($stimeout)|| $stimeout < (10*60))@set_time_limit(10*60);}
1832
+ $stimeout=10*60;
1833
+ //set mysql wait timeout to 15 minutes
1834
+ $mtimeout=$wpdb->get_var("SELECT @@session.wait_timeout AS mtimeout FROM DUAL");
1835
+ if(!empty($mtimeout) && !is_wp_error($mtimeout)){
1836
+ if(!is_numeric($mtimeout)|| $mtimeout<$timelimit) $results=$wpdb->query(sprintf("SET wait_timeout = %d",($timelimit+60)));
1837
+ elseif($mtimeout >3600)$timelimit=3600; //up to 1 hour
1838
+ else $timelimit=$mtimeout;
1839
+ }else{
1840
+ $results=$wpdb->query(sprintf("SET wait_timeout = %d",($timelimit+60)));
1841
+ }
1842
+ $defs=array();
1843
+ $ints=array();
1844
+ $cols="";
1845
+ $i=0;
1846
+ foreach($table_structure as $col){
1847
+ //omit ID field from export
1848
+ if($exclude_id && $col->Field=="id" && $col->Extra=="auto_increment")continue;
1849
+ //differentiate numeric fields from char fields
1850
+ if((0===strpos(strtolower($col->Type),'tinyint'))||
1851
+ (0===strpos(strtolower($col->Type),'smallint'))||
1852
+ (0===strpos(strtolower($col->Type),'mediumint'))||
1853
+ (0===strpos(strtolower($col->Type),'int'))||
1854
+ (0===strpos(strtolower($col->Type),'bigint'))||
1855
+ (0===strpos(strtolower($col->Type),'timestamp'))){
1856
+ $defs[$col->Field]=$col->Default;
1857
+ $ints[$col->Field]="1";
1858
+ }
1859
+ if($i==0)$cols .='`'.$col->Field.'`';
1860
+ else $cols .=', `'.$col->Field.'`';
1861
+ $i++;
1862
+ } //end foreach $table_structure
1863
+
1864
+ // Batch by $row_inc
1865
+ if($segment=='none'){$row_start=0;$row_inc=ROWS_PER_SEGMENT;}
1866
+ else{$row_start=$segment*ROWS_PER_SEGMENT;$row_inc=ROWS_PER_SEGMENT; }
1867
+ $i=1;
1868
+ $entries="INSERT INTO `".esc_attr($table)."` ($cols) VALUES ";
1869
+ $search=array("\x00", "\x0a", "\x0d", "\x1a");
1870
+ $replace=array('\0','\n','\r','\Z');
1871
+ $last_recid=0;
1872
+ $export_count=0;
1873
+ $err_msg="";
1874
+ do{
1875
+ $row_count=0;
1876
+ $qry=sprintf("SELECT SQL_BUFFER_RESULT $cols FROM %s %s ORDER BY `id` LIMIT %d, %d",esc_attr($table),$condition,$row_start,$row_inc);
1877
+ $table_data=$wpdb->get_results($qry);
1878
+ if(is_wp_error($table_data)) {
1879
+ $errno=$table_data->get_error_code();
1880
+ $err_msg=sprintf(__('Error exporting data from table %s: %s','wassup'), esc_attr($table),$errno.' '.$table_data->get_error_message());
1881
+ }elseif(is_array($table_data)){
1882
+ $row_count=count($table_data);
1883
+ }
1884
+ if($row_count>0){
1885
+ $j=0;
1886
+ foreach($table_data AS $row){
1887
+ $values="";$row_sql="";$n=0;
1888
+ foreach($row AS $key=>$value){
1889
+ //track last id exported
1890
+ if($key=='id'){
1891
+ $last_recid=$value;
1892
+ //omit 'id' from export
1893
+ if($exclude_id)continue;
1894
+ }
1895
+ if(isset($ints[$key])){$val=(''===$value)?"''":$value;}
1896
+ elseif(function_exists('esc_sql')){$val="'".str_replace($search,$replace,esc_sql($value))."'";}
1897
+ else{$val="'".str_replace($search,$replace,addslashes($value))."'";}
1898
+ if($n==0)$values=$val;
1899
+ else $values .=','.$val;
1900
+ $n++;
1901
+ } //end foreach row
1902
+ //new "insert" statement every 50 rows
1903
+ if($j==0){$row_sql="\n".$entries."\n";}
1904
+ elseif($j%50==0){$row_sql .=";\n".$entries."\n";}
1905
+ else{$row_sql .=",\n";}
1906
+ $row_sql .='('.$values.')';
1907
+ $sql .=$row_sql;
1908
+ $j++;
1909
+ } //end foreach table_data
1910
+ if(!empty($sql))$sql .=";\n"; //ending semicolon
1911
+ $row_start +=$row_count; //$row_start += $row_inc;
1912
+ $export_count=$export_count+$row_count;
1913
+ $did_export=true;
1914
+ } //end if row_count >0
1915
+ $i++;
1916
+ //stop export if near script timeout limit
1917
+ if((time()-$stimer_start)>$stimeout-10 || !empty($err_msg)){
1918
+ $did_export=false;
1919
+ break;
1920
+ }
1921
+ }while($row_count >0 &&($segment=='none'));
1922
+ //reset mysql wait timeout to default
1923
+ if(empty($mtimeout)|| !is_numeric($mtimeout))$mtimeout=60;
1924
+ $wpdb->query("SET wait_timeout=$mtimeout");
1925
+ // Create footer/closing comment in SQL-file
1926
+ if($segment=='none' || $segment<0){
1927
+ $sql .="\n";
1928
+ if($did_export){
1929
+ $sql .="# ".sprintf(__('End of data contents of table %s','wassup'),$table)."\n";
1930
+ }else{
1931
+ $sql .="# ".sprintf(__('Interrupted data contents of table %s','wassup'),$table)."\n";
1932
+ if(!empty($err_msg)) $sql .="# $errmsg\n";
1933
+ }
1934
+ $sql .="# --------------------------------------------------------\n";
1935
+ if($wdebug_mode){
1936
+ $elapsed_time=time()-$stimer_start;
1937
+ $sql .="# Timeout length=$timelimit seconds. Elapsed time=$elapsed_time seconds\n";
1938
+ $sql .="# --------------------------------------------------------\n";
1939
+ }
1940
+ $sql .="#\n# ".sprintf(__("End time: %d","wassup"),date('r',current_time('timestamp')))." \n";
1941
+ $sql .="# ".sprintf(__("%d out of %d records exported.","wassup"),$export_count,$numrecords)." ".sprintf(__("Last record ID: %d","wassup"),$last_recid)." \n";
1942
+ $sql .="\n";
1943
+ }
1944
+ //save export success message for admin alert notice
1945
+ if(!empty($sql)){
1946
+ $wassup_user_settings['ualert_message']=sprintf(__("%d out of %d records exported.","wassup"),$export_count,$numrecords)." ".sprintf(__("Last record ID: %d","wassup"),$last_recid);
1947
+ update_user_option($current_user->ID,'_wassup_settings',$wassup_user_settings);
1948
+ $saved=wassupDb::update_wassupmeta($table,'_export_recid-'.$current_user->ID,$last_recid,0);
1949
+ }
1950
+ return $sql;
1951
+ } // end backup_table
1952
+
1953
+ } //end class wassupDb
1954
+ } //end if !class_exists
1955
+
1956
+ if(!class_exists('wassupURI')){
1957
+ /**
1958
+ * Static class containing methods to format and clean urls/links for safe output.
1959
+ * @since v1.9
1960
+ * @author Helene D. <http://helenesit.com>
1961
+ */
1962
+ class wassupURI {
1963
+ /**
1964
+ * Return a value of true if url argument is a root url and false when url constains a subdirectory path or query parameters.
1965
+ * - renamed from url_rootcheck() function.
1966
+ */
1967
+ function is_root_url($url){
1968
+ $isroot=false;
1969
+ if(strpos($url,'.')>0){
1970
+ $urlparts=parse_url($url);
1971
+ if(!empty($urlparts['host']))$isroot=true;
1972
+ if(!empty($urlparts['path'])&& $urlparts['path'] !="/")$isroot=false;
1973
+ elseif(!empty($urlparts['query']))$isroot=false;
1974
+ }
1975
+ return $isroot;
1976
+ }
1977
+ /**
1978
+ * Return a url with "$blogurl" prepended for sites that have wordpress installed in a separate folder.
1979
+ * - renamed from wAddSiteurl() function.
1980
+ */
1981
+ function add_siteurl($inputurl){
1982
+ if(preg_match('/^https?\:/',$inputurl)===false){
1983
+ if(function_exists('get_site_url')){
1984
+ $outputurl=get_site_url($inputurl);
1985
+ }else{
1986
+ $siteurl=rtrim(wassupURI::get_sitehome(),"/");
1987
+ $wpurl=rtrim(wassupURI::get_wphome(),"/");
1988
+ if(strcasecmp($siteurl,$wpurl)==0)$outputurl=$inputurl;
1989
+ elseif(stristr($inputurl,$siteurl)===FALSE && wassupURI::is_root_url($siteurl))$outputurl=$siteurl."/".ltrim($inputurl,"/");
1990
+ else $outputurl=$inputurl;
1991
+ $outputurl=rawurldecode(html_entity_decode($outputurl)); //dangerous
1992
+ $outputurl=wassupURI::cleanURL($outputurl); //safe
1993
+ }
1994
+ return $outputurl;
1995
+ }else{
1996
+ return $inputurl;
1997
+ }
1998
+ }
1999
+ /** Return the url and "path" for wordpress site's "home". */
2000
+ function get_sitehome(){
2001
+ $sitehome=get_option('siteurl');
2002
+ if(is_multisite() && is_network_admin()){
2003
+ $sitehome=network_home_url();
2004
+ }elseif(empty($sitehome)){
2005
+ $sitehome=get_option('home');
2006
+ }
2007
+ return $sitehome;
2008
+ } //end get_homeurl
2009
+
2010
+ //** Return the url and "path" for wordpress admin. */
2011
+ function get_wphome(){
2012
+ $wphome=admin_url();
2013
+ if(is_multisite() && is_network_admin()){
2014
+ $wphome=network_admin_url();
2015
+ }elseif(empty($wphome)){
2016
+ $wphome=get_option('wpurl');
2017
+ }
2018
+ return $wphome;
2019
+ } //end get_wphome
2020
+
2021
+ /** Return a request url or a text string if url is malware/hack attempt or 404. @since v1.9 */
2022
+ function url_link($urlrequested,$chars=0,$spam=0){
2023
+ global $wassup_options;
2024
+ $urllink=false;
2025
+ if(empty($chars)|| !is_numeric($chars))$chars=(int)$wassup_options->wassup_screen_res/10;
2026
+ $request=strtolower($urlrequested);
2027
+ if(strlen($request)>60)$tooltip=' title="'.wassupURI::disarm_attack($request).'" ';
2028
+ else $tooltip="";
2029
+ //no link for spam or 404 or wordpress admin
2030
+ if(preg_match('/^(\[|\%5B)\d{3}(\]|\%5D)/',$urlrequested)>0 || !empty($spam)) $urllink="<span{$tooltip}>".stringShortener("$urlrequested",round($chars*.9,0))."</span>";
2031
+ else $urllink='<a href="'.wassupURI::add_siteurl("$urlrequested").'" target="_BLANK">'.stringShortener("$urlrequested",$chars).'</a>';
2032
+ return $urllink;
2033
+ }
2034
+ /** Return an external referrer link or a text string if link is internal, or is spam or 404. @since v1.9 */
2035
+ function referrer_link($referer,$requesturl,$chars=0,$spam=0){
2036
+ global $wassup_options;
2037
+ $referrerlink=false;
2038
+ if(!empty($referer)){
2039
+ $wpurl=wassupURI::get_wphome();
2040
+ $siteurl=wassupURI::get_sitehome();
2041
+ $adminurl=admin_url("");
2042
+ if(empty($chars)|| !is_numeric($chars))$chars=(int)($wassup_options->wassup_screen_res/10);
2043
+ $tooltip="";
2044
+ $ref=strtolower($referer);
2045
+ if(strlen($ref)>60)$tooltip=' title="'.wassupURI::disarm_attack($ref).'" ';
2046
+ if($spam==0 && stristr($referer,$adminurl)!=$referer && stristr($ref,$siteurl)!=$referer){
2047
+ $favicon_img="";
2048
+ $rurl=parse_url($referer);
2049
+ if(!empty($rurl['host']) && preg_match('/\.[a-z]{2,4}$/',$rurl['host'])>0) $favicon_img='<img src="http://www.google.com/s2/favicons?domain='.$rurl['host'].'" class="favicon"> ';
2050
+ //no link for spam
2051
+ if(strpos($ref,'http')===false || strpos($ref,'http')>0) $referrerlink=$favicon_img."<span{$tooltip}>".stringShortener($referer,round($chars*.9,0))."</span>";
2052
+ else $referrerlink=$favicon_img.'<a href="'.wassupURI::disarm_attack($referer).'" target=_"BLANK"'.$tooltip.'>'.stringShortener($referer,round($chars*.9,0)).'</a>';
2053
+ }elseif($spam >0){
2054
+ //no link for spam
2055
+ $referrerlink="<span{$tooltip}>".stringShortener("$referer",round($chars*.9,0))."</span>";
2056
+ }elseif(!empty($requesturl) && $ref == wassupURI::add_siteurl($requesturl)){
2057
+ //when request and referrer are same, this is disguised direct hit
2058
+ $referrerlink='<span>'.__("direct hit","wassup").'</span>';
2059
+ }elseif(strpos($ref,'/wp-includes/')>0 || strpos($ref,'/wp-content/')>0){
2060
+ $referrerlink='<a href="'.wassupURI::disarm_attack($referer).'" target=_"BLANK"'.$tooltip.'>'.stringShortener($referer,round($chars*.9,0)).'</a>';
2061
+ }else{
2062
+ $referrerlink="<span{$tooltip}>".__("from your site","wassup")."</span>";
2063
+ }
2064
+ }else{
2065
+ $referrerlink='<span>'.__("direct hit","wassup").'</span>';
2066
+ }
2067
+ return $referrerlink;
2068
+ } //end referrer_link
2069
+
2070
+ /** Return a referrer link for search engines. @since v1.9 */
2071
+ function se_link($referer,$chars=0,$spam=0){
2072
+ global $wassup_options;
2073
+ if(empty($chars)|| !is_numeric($chars))$chars=(int)($wassup_options->wassup_screen_res/10);
2074
+ $selink=false;
2075
+ if(!empty($referer)){
2076
+ $tooltip="";
2077
+ $ref=strtolower($referer);
2078
+ if(strlen($ref)>60)$tooltip=' title="'.wassupURI::disarm_attack($referer).'" ';
2079
+ if(empty($spam))$selink='<a href="'.wassupURI::disarm_attack($referer).'" target=_"BLANK"'.$tooltip.'><span>'.stringShortener($referer,round($chars*.8,0)).'</span></a>';
2080
+ else $selink="<span{$tooltip}>".stringShortener($referer,round($chars*.8,0))."</span>";
2081
+ }
2082
+ return $selink;
2083
+ }
2084
+
2085
+ /** Remove all ascii codes and replace with '---' in url. Can be used before saving to database */
2086
+ function neutralize($url){
2087
+ $newurl=wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','---',$url),array());
2088
+ return $newurl;
2089
+ }
2090
+ /**
2091
+ * Return a url with some chars replaced with safer html-encoded versions and ascii codes removed.
2092
+ * - for displaying questionable data in requesturl, referrer and user agent.
2093
+ * @since v1.9
2094
+ */
2095
+ function disarm_attack($url=false){
2096
+ if(!empty($url)&& !is_numeric($url)){
2097
+ $newurl=str_replace(array(' ','!','$','"','&&','\'','(',')','*',',','.','<','=','>','?','\\','^','`','{','|','~'),array('&#32;','&#33;','&#36;','&#34;','&#38;&#38;','&#39;','&#40;','&#41;','&#42;','&#44;','&#46;','&#60;','&#61;','&#62;','&#63;','&#92;','&#94;','&#96;','&#123;','&#124;','&#126;'),htmlentities(stripslashes(html_entity_decode(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','---',$url)))));
2098
+ }else{
2099
+ $newurl=$url;
2100
+ }
2101
+ return $newurl;
2102
+ }
2103
+ /** Return a url that is sanitized of all potentially dangerous code. */
2104
+ function cleanURL($url=""){
2105
+ if(!empty($url)&& !is_numeric($url)){
2106
+ $loc=wassupURI::disarm_attack($url);
2107
+ $allowed=array('http','https','ftp','ftps','mailto','news','irc','gopher','nntp','feed','telnet','mms','rtsp','svn','tel','fax','xmpp','webcal');
2108
+ $loc=wp_kses_bad_protocol($loc,$allowed);
2109
+ $cleaned_url=preg_replace(array('/([^a-df-wyz])\-/i','/\-([^a-df-wyz])/i','#\:([^/]{2})#','/([^0-9]{2,3})\;/','/([^&])#/'),array('\1&#45;','&#45;\1','&#58;\1','\1&#59;','\1&#35;'),esc_attr($loc));
2110
+ }else{
2111
+ $cleaned_url=$url;
2112
+ }
2113
+ return $cleaned_url;
2114
+ } //end cleanURL
2115
+
2116
+ /**
2117
+ * Return the 'page' query parameter or the menu link query parameter 'ml' for a wassup-stats page from the URI
2118
+ * @param none
2119
+ * @return string
2120
+ */
2121
+ function get_menu_arg(){
2122
+ $menuarg=false;
2123
+ if(isset($_GET['page'])) $menuarg=$_GET['page'];
2124
+ if(stristr($menuarg,"wassup")!==false){
2125
+ $wassupfolder=basename(WASSUPDIR);
2126
+ if($menuarg=="wassup-stats"){
2127
+ if(!empty($_GET['ml'])) $menuarg=$_GET['ml'];
2128
+ else $menuarg="wassup";
2129
+ }elseif($menuarg=="wassup-spia"){
2130
+ $menuarg="wassup-spy";
2131
+ }elseif($menuarg==$wassupfolder){
2132
+ $menuarg="wassup";
2133
+ }
2134
+ }
2135
+ return $menuarg;
2136
+ }
2137
+ /** check for admin uri with valid referrer via _wpnonce */
2138
+ function is_valid_admin_referer($action="-1",$wpage=""){
2139
+ global $wp_version;
2140
+ $is_valid_referer=false;
2141
+ if(version_compare($wp_version,'2.8','>=') || $action=="-1"){
2142
+ $is_valid_referer=check_admin_referer($action);
2143
+ }elseif(is_admin() && !empty($_SERVER['HTTP_REFERER'])){
2144
+ if(isset($_REQUEST['_wpnonce']) && wp_verify_nonce($_REQUEST['_wpnonce'],$action)){
2145
+ if(isset($_REQUEST['_wp_http_referer'])){
2146
+ if(strpos($_SERVER['HTTP_REFERER'],$_REQUEST['_wp_http_referer'])!==false) $is_valid_referer=true;
2147
+ }else{
2148
+ if(empty($wpage)) $wpage=wassupURI::get_menu_arg();
2149
+ if(!empty($wpage) && strpos($_SERVER['HTTP_REFERER'],"page=$wpage")!==false) $is_valid_referer=true;
2150
+ }
2151
+ }
2152
+ }
2153
+ return $is_valid_referer;
2154
+ }
2155
+ } //end Class wassupURI
2156
+ } //end if !class_exists
2157
+ ?>
lib/main.php CHANGED
@@ -1,513 +1,351 @@
1
  <?php
2
- if (!class_exists('wassup_pagination')) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  class wassup_pagination{
4
- /*
5
- Script Name: *Digg Style Paginator Class
6
- Script URI: http://www.mis-algoritmos.com/2007/05/27/digg-style-pagination-class/
7
- Description: Class in PHP that allows to use a pagination like a digg or sabrosus style.
8
- Script Version: 0.3.2
9
- Author: Victor De la Rocha
10
- Author URI: http://www.mis-algoritmos.com
11
- Revised for Wassup by Helene D.
12
- */
13
- /*Default values*/
14
- var $total_pages;
15
- var $limit;
16
- var $target;
17
- var $page;
18
- var $adjacents;
19
- var $showCounter;
20
- var $className;
21
- var $parameterName;
22
- var $urlF ;
23
-
24
- /*Buttons next and previous*/
25
- var $nextT;
26
- var $nextI;
27
- var $prevT;
28
- var $prevI;
29
-
30
- /*****/
31
- var $calculate;
32
-
33
- #Total items
34
- function items($value){$this->total_pages = intval($value);}
35
-
36
- #how many items to show per page
37
- function limit($value){$this->limit = intval($value);}
38
-
39
- #Page to sent the page value
40
- function target($value){$this->target = $value;}
41
-
42
- #Current page
43
- function currentPage($value){$this->page = intval($value);}
44
-
45
- #How many adjacent pages should be shown on each side of the current page?
46
- function adjacents($value){$this->adjacents = intval($value);}
47
-
48
- #show counter?
49
  function showCounter($value=""){$this->showCounter=($value===true)?true:false;}
50
-
51
- #to change the class name of the pagination div
52
  function changeClass($value=""){$this->className=$value;}
53
-
54
  function nextLabel($value){$this->nextT = $value;}
55
  function nextIcon($value){$this->nextI = $value;}
56
  function prevLabel($value){$this->prevT = $value;}
57
  function prevIcon($value){$this->prevI = $value;}
58
-
59
- #to change the class name of the pagination div
60
  function parameterName($value=""){$this->parameterName=$value;}
61
-
62
- #to change urlFriendly
63
  function urlFriendly($value="%"){
64
- if(eregi('^ *$',$value)){
65
- $this->urlF=false;
66
- return false;
67
- }
68
- $this->urlF=$value;
69
  }
70
-
71
- var $pagination;
72
-
73
- function wassup_pagination(){
74
- /*Set Default values*/
75
- $this->total_pages = null;
76
- $this->limit = null;
77
- $this->target = "";
78
- $this->page = 1;
79
- $this->adjacents = 2;
80
- $this->showCounter = false;
81
- $this->className = "pagination";
82
- $this->parameterName = "pages";
83
- $this->urlF = false;//urlFriendly
84
-
85
- /*Buttons next and previous*/
86
- $this->nextT = __("Next","wassup");
87
- $this->nextI = "&#187;"; //&#9658;
88
- $this->prevT = __("Previous","wassup");
89
- $this->prevI = "&#171;"; //&#9668;
90
-
91
- $this->calculate = false;
92
  }
93
  function show(){
94
- if(!$this->calculate)
95
- if($this->calculate())
96
- echo "<div class=\"$this->className\">$this->pagination</div>";
 
97
  }
 
98
  function get_pagenum_link($id){
99
- if(strpos($this->target,'?')===false)
100
- if($this->urlF)
101
- return str_replace($this->urlF,$id,$this->target);
102
- else
103
- return "$this->target?$this->parameterName=$id";
104
- else
105
- return "$this->target&$this->parameterName=$id";
106
- }
107
-
108
  function calculate(){
109
- $this->pagination = "";
110
- $this->calculate == true;
111
- $error = false;
112
- if($this->urlF and $this->urlF != '%' and strpos($this->target,$this->urlF)===false){
113
- //Es necesario especificar el comodin para sustituir
114
- echo 'Especificaste un wildcard para sustituir, pero no existe en el target<br />';
115
- $error = true;
116
- }elseif($this->urlF and $this->urlF == '%' and strpos($this->target,$this->urlF)===false){
117
- echo 'Es necesario especificar en el target el comodin';
118
- $error = true;
119
- }
120
- if($this->total_pages == null){
121
- echo __("It is necessary to specify the","wassup")." <strong>".__("number of pages","wassup")."</strong> (\$class->items(1000))<br />";
122
- $error = true;
123
- }
124
- if($this->limit == null){
125
- echo __("It is necessary to specify the","wassup")." <strong>".__("limit of items","wassup")."</strong> ".__("to show per page","wassup")." (\$class->limit(10))<br />";
126
- $error = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  }
128
- if($error)return false;
129
-
130
- $n = trim($this->nextT.' '.$this->nextI);
131
- $p = trim($this->prevI.' '.$this->prevT);
132
-
133
- /* Setup vars for query. */
134
- if($this->page)
135
- $start = ($this->page - 1) * $this->limit; //first item to display on this page
136
- else
137
- $start = 0; //if no page var is given, set start to 0
138
-
139
- /* Setup page vars for display. */
140
- if ($this->page == 0) $this->page = 1; //if no page var is given, default to 1.
141
- $prev = $this->page - 1; //previous page is page - 1
142
- $next = $this->page + 1; //next page is page + 1
143
- $lastpage = ceil($this->total_pages/$this->limit); //lastpage is = total pages / items per page, rounded up.
144
- $lpm1 = $lastpage - 1; //last page minus 1
145
-
146
- /*
147
- Now we apply our rules and draw the pagination object.
148
- We're actually saving the code to a variable in case we want to draw it more than once.
149
- */
150
-
151
- if($lastpage > 1){
152
- //anterior button
153
- if($this->page > 1)
154
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($prev)."\">$p</a>";
155
- else
156
- $this->pagination .= "<span class=\"disabled\">$p</span>";
157
- //pages
158
- if ($lastpage < 7 + ($this->adjacents * 2)){//not enough pages to bother breaking it up
159
- for ($counter = 1; $counter <= $lastpage; $counter++){
160
- if ($counter == $this->page)
161
- $this->pagination .= "<span class=\"current\">$counter</span>";
162
- else
163
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
164
- }
165
- }
166
- elseif($lastpage > 5 + ($this->adjacents * 2)){//enough pages to hide some
167
- //close to beginning; only hide later pages
168
- if($this->page < 1 + ($this->adjacents * 2)){
169
- for ($counter = 1; $counter < 4 + ($this->adjacents * 2); $counter++){
170
- if ($counter == $this->page)
171
- $this->pagination .= "<span class=\"current\">$counter</span>";
172
- else
173
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
174
- }
175
- $this->pagination .= "...";
176
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
177
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
178
- }
179
- //in middle; hide some front and some back
180
- elseif($lastpage - ($this->adjacents * 2) > $this->page && $this->page > ($this->adjacents * 2)){
181
- $this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
182
- $this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
183
- $this->pagination .= "...";
184
- for ($counter = $this->page - $this->adjacents; $counter <= $this->page + $this->adjacents; $counter++)
185
- if ($counter == $this->page)
186
- $this->pagination .= "<span class=\"current\">$counter</span>";
187
- else
188
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
189
- $this->pagination .= "...";
190
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
191
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
192
- }
193
- //close to end; only hide early pages
194
- else{
195
- $this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
196
- $this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
197
- $this->pagination .= "...";
198
- for ($counter = $lastpage - (2 + ($this->adjacents * 2)); $counter <= $lastpage; $counter++)
199
- if ($counter == $this->page)
200
- $this->pagination .= "<span class=\"current\">$counter</span>";
201
- else
202
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
203
- }
204
- }
205
- //siguiente button
206
- if ($this->page < $counter - 1)
207
- $this->pagination .= "<a href=\"".$this->get_pagenum_link($next)."\">$n</a>";
208
- else
209
- $this->pagination .= "<span class=\"disabled\">$n</span>";
210
- if($this->showCounter)$this->pagination .= "<div class=\"pagination_data\">($this->total_pages ".__("Pages","wassup").")</div>";
211
  }
212
-
213
- return true;
 
 
214
  }
215
- } //end class wassup_pagination
216
- } //end if !class_exists('wassup_pagination')
217
-
218
- if (!class_exists('Detector')) { //in case another app uses this class...
219
- //
220
- // Detector class (c) Mohammad Hafiz bin Ismail 2006
221
- // detect location by ipaddress
222
- // detect browser type and operating system
223
- //
224
- // November 27, 2006
225
- //
226
- // by : Mohammad Hafiz bin Ismail (info@mypapit.net)
227
- //
228
- // You are allowed to use this work under the terms of
229
- // Creative Commons Attribution-Share Alike 3.0 License
230
- //
231
- // Reference : http://creativecommons.org/licenses/by-sa/3.0/
232
- //
233
- class Detector {
234
- //var $town;
235
- //var $state;
236
- //var $country;
237
- //var $Ctimeformatode;
238
- //var $longitude;
239
- //var $latitude;
240
- //var $ipaddress;
241
- //var $txt;
242
 
 
 
 
 
 
 
 
243
  var $browser;
244
  var $browser_version;
245
  var $os_version;
246
  var $os;
247
  var $useragent;
248
-
249
- function Detector($ip="", $ua="")
250
- {
251
- // - not used
252
- //$apiserver="http://showip.fakap.net/txt/";
253
- //if ($ip != "") {
254
- //if (preg_match('/\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/',$ip,$matches))
255
- // {
256
- // $this->ipaddress=$ip;
257
- // }
258
-
259
- //else { $this->ipaddress = "0.0.0.0"; }
260
-
261
- //uncomment this below if CURL doesnt work
262
-
263
- //$this->txt=file_get_contents($apiserver . "$ip");
264
-
265
- //$wtf=$this->txt;
266
- //$this->processTxt($wtf);
267
- //}
268
-
269
  $this->useragent=$ua;
270
  $this->check_os($ua);
271
  $this->check_browser($ua);
272
  }
273
-
274
- //function processTxt($wtf) //not used
275
-
276
- //{
277
- // $tok = strtok($txt, ',');
278
- // $this->town = strtok($wtf,',');
279
- // $this->state = strtok(',');
280
- // $this->country=strtok(',');
281
- // $this->ccode = strtok(',');
282
- // $this->latitude=strtok(',');
283
- // $this->longitude=strtok(',');
284
- //}
285
-
286
- function check_os($useragent) {
287
- $os = "N/A";
288
- $version = "";
289
- if (preg_match("/Windows NT 5.1/",$useragent,$match)) {
290
- $os = "WinXP"; $version = "";
291
- } elseif (preg_match("/Windows NT 5.2/",$useragent,$match)) {
292
- $os = "Win2003"; $version = "";
293
- } elseif (preg_match("/Windows NT 6.0/",$useragent,$match)) {
294
- $os = "WinVista"; $version = "";
295
- } elseif (preg_match("/(?:Windows NT 5.0|Windows 2000)/",$useragent,$match)) {
296
- $os = "Win2000"; $version = "";
297
- } elseif (preg_match("/Windows ME/",$useragent,$match)) {
298
- $os = "WinME"; $version = "";
299
- } elseif (preg_match("/(?:WinNT|Windows\s?NT)\s?([0-9\.]+)?/",$useragent,$match)) {
300
- $os = "WinNT"; $version = $match[1];
301
- } elseif (preg_match("/Mac OS X/",$useragent,$match)) {
302
- $os = "MacOSX"; $version = "";
303
- } elseif (preg_match("/(Mac_PowerPC|Macintosh)/",$useragent,$match)) {
304
- $os = "MacPPC"; $version = "";
305
- } elseif (preg_match("/(?:Windows95|Windows 95|Win95|Win 95)/",$useragent,$match)) {
306
- $os = "Win95"; $version = "";
307
- } elseif (preg_match("/(?:Windows98|Windows 98|Win98|Win 98|Win 9x)/",$useragent,$match)) {
308
- $os = "Win98"; $version = "";
309
- } elseif (preg_match("/(?:WindowsCE|Windows CE|WinCE|Win CE)/",$useragent,$match)) {
310
- $os = "WinCE"; $version = "";
311
- } elseif (preg_match("/PalmOS/",$useragent,$match)) {
312
- $os = "PalmOS";
313
- } elseif (preg_match("/\(PDA(?:.*)\)(.*)Zaurus/",$useragent,$match)) {
314
- $os = "Sharp Zaurus";
315
- } elseif (preg_match("/Linux\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)) {
316
- $os = "Linux"; $version = $match[1];
317
- } elseif (preg_match("/NetBSD\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)) {
318
- $os = "NetBSD"; $version = $match[1];
319
- } elseif (preg_match("/OpenBSD\s*([0-9\.]+)?/",$useragent,$match)) {
320
- $os = "OpenBSD"; $version = $match[1];
321
- } elseif (preg_match("/CYGWIN\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)) {
322
- $os = "CYGWIN"; $version = $match[1];
323
- } elseif (preg_match("/SunOS\s*([0-9\.]+)?/",$useragent,$match)) {
324
- $os = "SunOS"; $version = $match[1];
325
- } elseif (preg_match("/IRIX\s*([0-9\.]+)?/",$useragent,$match)) {
326
- $os = "SGI IRIX"; $version = $match[1];
327
- } elseif (preg_match("/FreeBSD\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)) {
328
- $os = "FreeBSD"; $version = $match[1];
329
- } elseif (preg_match("/SymbianOS\/([0-9.]+)/i",$useragent,$match)) {
330
- $os = "SymbianOS"; $version = $match[1];
331
- } elseif (preg_match("/Symbian\/([0-9.]+)/i",$useragent,$match)) {
332
- $os = "Symbian"; $version = $match[1];
333
- } elseif (preg_match("/PLAYSTATION 3/",$useragent,$match)) {
334
- $os = "Playstation"; $version = 3;
335
- }
336
-
337
- $this->os = $os;
338
- $this->os_version = $version;
339
- }
340
-
341
- function check_browser($useragent) {
342
-
343
- $browser = "";
344
-
345
- if (preg_match("/^Mozilla(?:.*)compatible;\sMSIE\s(?:.*)Opera\s([0-9\.]+)/",$useragent,$match)) {
346
- $browser = "Opera";
347
- } elseif (preg_match("/^Opera\/([0-9\.]+)/",$useragent,$match)) {
348
- $browser = "Opera";
349
- } elseif (preg_match("/^Mozilla(?:.*)compatible;\siCab\s([0-9\.]+)/",$useragent,$match)) {
350
- $browser = "iCab";
351
- } elseif (preg_match("/^iCab\/([0-9\.]+)/",$useragent,$match)) {
352
- $browser = "iCab";
353
- } elseif (preg_match("/^Mozilla(?:.*)compatible;\sMSIE\s([0-9\.]+)/",$useragent,$match)) {
354
- $browser = "IE";
355
- } elseif (preg_match("/^(?:.*)compatible;\sMSIE\s([0-9\.]+)/",$useragent,$match)) {
356
- $browser = "IE";
357
- } elseif (preg_match("/^Mozilla(?:.*)(?:.*)Chrome/",$useragent,$match)) {
358
- $browser = "Google Chrome";
359
- } elseif (preg_match("/^Mozilla(?:.*)(?:.*)Safari\/([0-9\.]+)/",$useragent,$match)) {
360
- $browser = "Safari";
361
- } elseif (preg_match("/^Mozilla(?:.*)\(Macintosh(?:.*)OmniWeb\/v([0-9\.]+)/",$useragent,$match)) {
362
- $browser = "Omniweb";
363
- } elseif (preg_match("/^Mozilla(?:.*)\(compatible; Google Desktop/",$useragent,$match)) {
364
- $browser = "Google Desktop";
365
- } elseif (preg_match("/^Mozilla(?:.*)\(compatible;\sOmniWeb\/([0-9\.v-]+)/",$useragent,$match)) {
366
- $browser = "Omniweb";
367
- } elseif (preg_match("/^Mozilla(?:.*)Gecko(?:.*?)(?:Camino|Chimera)\/([0-9\.]+)/",$useragent,$match)) {
368
- $browser = "Camino";
369
- } elseif (preg_match("/^Mozilla(?:.*)Gecko(?:.*?)Netscape\/([0-9\.]+)/",$useragent,$match)) {
370
- $browser = "Netscape";
371
- } elseif (preg_match("/^Mozilla(?:.*)Gecko(?:.*?)(?:Fire(?:fox|bird)|Phoenix)\/([0-9\.]+)/",$useragent,$match)) {
372
- $browser = "Firefox";
373
- } elseif (preg_match("/^Mozilla(?:.*)Gecko(?:.*?)Minefield\/([0-9\.]+)/",$useragent,$match)) {
374
- $browser = "Minefield";
375
- } elseif (preg_match("/^Mozilla(?:.*)Gecko(?:.*?)Epiphany\/([0-9\.]+)/",$useragent,$match)) {
376
- $browser = "Epiphany";
377
- } elseif (preg_match("/^Mozilla(?:.*)Galeon\/([0-9\.]+)\s(?:.*)Gecko/",$useragent,$match)) {
378
- $browser = "Galeon";
379
- } elseif (preg_match("/^Mozilla(?:.*)Gecko(?:.*?)K-Meleon\/([0-9\.]+)/",$useragent,$match)) {
380
- $browser = "K-Meleon";
381
- } elseif (preg_match("/^Mozilla(?:.*)rv:([0-9\.]+)\)\sGecko/",$useragent,$match)) {
382
- $browser = "Mozilla";
383
- } elseif (preg_match("/^Mozilla(?:.*)compatible;\sKonqueror\/([0-9\.]+);/",$useragent,$match)) {
384
- $browser = "Konqueror";
385
- } elseif (preg_match("/^Mozilla\/(?:[34]\.[0-9]+)(?:.*)AvantGo\s([0-9\.]+)/",$useragent,$match)) {
386
- $browser = "AvantGo";
387
- } elseif (preg_match("/^Mozilla(?:.*)NetFront\/([34]\.[0-9]+)/",$useragent,$match)) {
388
- $browser = "NetFront";
389
- } elseif (preg_match("/^Mozilla\/([34]\.[0-9]+)/",$useragent,$match)) {
390
- $browser = "Netscape";
391
- } elseif (preg_match("/^Liferea\/([0-9\.]+)/",$useragent,$match)) {
392
- $browser = "Liferea";
393
- } elseif (preg_match("/^curl\/([0-9\.]+)/",$useragent,$match)) {
394
- $browser = "curl";
395
- } elseif (preg_match("/^links\/([0-9\.]+)/i",$useragent,$match)) {
396
- $browser = "Links";
397
- } elseif (preg_match("/^links\s?\(([0-9\.]+)/i",$useragent,$match)) {
398
- $browser = "Links";
399
- } elseif (preg_match("/^lynx\/([0-9a-z\.]+)/i",$useragent,$match)) {
400
- $browser = "Lynx";
401
- } elseif (preg_match("/^Wget\/([0-9\.]+)/i",$useragent,$match)) {
402
- $browser = "Wget";
403
- } elseif (preg_match("/^Xiino\/([0-9\.]+)/i",$useragent,$match)) {
404
- $browser = "Xiino";
405
- } elseif (preg_match("/^W3C_Validator\/([0-9\.]+)/i",$useragent,$match)) {
406
- $browser = "W3C Validator";
407
- } elseif (preg_match("/^Jigsaw(?:.*) W3C_CSS_Validator_(?:[A-Z]+)\/([0-9\.]+)/i",$useragent,$match)) {
408
- $browser = "W3C CSS Validator";
409
- } elseif (preg_match("/^Dillo\/([0-9\.]+)/i",$useragent,$match)) {
410
- $browser = "Dillo";
411
- } elseif (preg_match("/^amaya\/([0-9\.]+)/i",$useragent,$match)) {
412
- $browser = "Amaya";
413
- } elseif (preg_match("/^DocZilla\/([0-9\.]+)/i",$useragent,$match)) {
414
- $browser = "DocZilla";
415
- } elseif (preg_match("/^fetch\slibfetch\/([0-9\.]+)/i",$useragent,$match)) {
416
- $browser = "FreeBSD libfetch";
417
- } elseif (preg_match("/^Nokia([0-9a-zA-Z\-.]+)\/([0-9\.]+)/i",$useragent,$match)) {
418
- $browser="Nokia";
419
- } elseif (preg_match("/^SonyEricsson([0-9a-zA-Z\-.]+)\/([a-zA-Z0-9\.]+)/i",$useragent,$match)) {
420
- $browser="SonyEricsson";
421
- }
422
-
423
- //$version = $match[1];
424
- //restrict version to major and minor version #'s
425
- preg_match("/^\d+(\.\d+)?/",$match[1],$majorvers);
426
- $version = $majorvers[0];
427
-
428
- $this->browser = $browser;
429
- $this->browser_version = $version;
430
  }
431
- } //end class Detector
432
- } //end if !class_exists('Detector')
433
-
434
- //wassup_get_time is redundant to current_time('timestamp') wordpress function
435
- /*
436
- function wassup_get_time() {
437
- $timeright = gmdate("U");
438
- $offset = (get_option("gmt_offset")*60*60);
439
- $timeright = ($timeright + $offset) ;
440
- return $timeright;
441
- } */
442
-
443
- /*
444
- # PHP Calendar (version 2.3), written by Keith Devens
445
- # http://keithdevens.com/software/php_calendar
446
- # see example at http://keithdevens.com/weblog
447
- # License: http://keithdevens.com/software/license
448
- */
449
- // Currently not used in WassUp it's a next implementation idea
450
- /*
451
- function generate_calendar($year, $month, $days = array(), $day_name_length = 3, $month_href = NULL, $first_day = 0, $pn = array()){
452
- $first_of_month = gmmktime(0,0,0,$month,1,$year);
453
- //remember that mktime will automatically correct if invalid dates are entered
454
- // for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
455
- // this provides a built in "rounding" feature to generate_calendar()
456
-
457
- $day_names = array(); #generate all the day names according to the current locale
458
- for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday
459
- $day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name
460
-
461
- list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));
462
- $weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day
463
- $title = htmlentities(ucfirst($month_name)).'&nbsp;'.$year; #note that some locales don't capitalize month and day names
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
- //Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
466
- @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable
467
- if($p) $p = '<span class="calendar-prev">'.($pl ? '<a href="'.htmlspecialchars($pl).'">'.$p.'</a>' : $p).'</span>&nbsp;';
468
- if($n) $n = '&nbsp;<span class="calendar-next">'.($nl ? '<a href="'.htmlspecialchars($nl).'">'.$n.'</a>' : $n).'</span>';
469
- $calendar = '<table class="calendar">'."\n".
470
- '<caption class="calendar-month">'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";
471
-
472
- if($day_name_length){ #if the day names should be shown ($day_name_length > 0)
473
- //if day_name_length is >3, the full name of the day will be printed
474
- foreach($day_names as $d)
475
- $calendar .= '<th abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';
476
- $calendar .= "</tr>\n<tr>";
 
 
 
477
  }
478
-
479
- if($weekday > 0) $calendar .= '<td colspan="'.$weekday.'">&nbsp;</td>'; //initial 'empty' days
480
- for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
481
- if($weekday == 7){
482
- $weekday = 0; #start a new week
483
- $calendar .= "</tr>\n<tr>";
484
- }
485
- if(isset($days[$day]) and is_array($days[$day])){
486
- @list($link, $classes, $content) = $days[$day];
487
- if(is_null($content)) $content = $day;
488
- $calendar .= '<td'.($classes ? ' class="'.htmlspecialchars($classes).'">' : '>').
489
- ($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'</a>' : $content).'</td>';
490
- }
491
- else $calendar .= "<td>$day</td>";
492
  }
493
- if($weekday != 7) $calendar .= '<td colspan="'.(7-$weekday).'">&nbsp;</td>'; #remaining "empty" days
 
494
 
495
- return $calendar."</tr>\n</table>\n";
496
- }
497
- */
498
  //Truncate $input string to a length of $max
499
  function stringShortener($input, $max=0, $separator="(...)", $exceedFromEnd=0){
500
  if(!$input || !is_string($input)){return false;};
501
-
502
  //Replace all %-hex chars with literals and trim the input string
503
  // of whitespaces ...because it's shorter and more legible.
504
  // -Helene D. 11/18/07
505
- $instring = trim(stripslashes(rawurldecode(html_entity_decode($input)))," +\t"); //insecure
506
 
507
  $inputlen=strlen($instring);
508
  $max=(is_numeric($max))?(integer)$max:$inputlen;
509
- //if($max>=$inputlen){return $input;}; //caused security loophole ...only $outstring should be returned
510
- if ($max < $inputlen) {
511
  $separator=($separator)?$separator:"(...)";
512
  $modulus=(($max%2));
513
  $halfMax=floor($max/2);
@@ -522,445 +360,470 @@ function stringShortener($input, $max=0, $separator="(...)", $exceedFromEnd=0){
522
  if (strlen($outstring) >= $inputlen) { //Because "Fir(...)fox" is longer than "Firefox"
523
  $outstring = $instring;
524
  }
525
- //# use WordPress 2.x function esc_attr and 1.2.x
526
- // function wp_specialchars to make malicious code
527
- // harmless when echoed to the screen
528
- $outstring=esc_attr(wp_specialchars($outstring,ENT_QUOTES));
529
  } else {
530
- $outstring = esc_attr(wp_specialchars($instring,ENT_QUOTES));
531
  }
532
  return $outstring;
533
  } //end function stringShortener
534
 
535
- //# Return a value of true if url argument is a root url and false when
536
- //# url constains a subdirectory path or query parameters...
537
- //# - Helene D. 2007
538
- function url_rootcheck($urltocheck) {
539
- $isroot = false;
540
- //url must begin with 'http://'
541
- if (strncasecmp($urltocheck,'http://',7) == 0) {
542
- $isroot = true;
543
- $urlparts=parse_url($urltocheck);
544
- if (!empty($urlparts['path']) && $urlparts['path'] != "/") {
545
- $isroot=false;
546
- } elseif (!empty($urlparts['query'])) {
547
- $isroot=false;
548
- }
549
- }
550
- return $isroot;
551
- }
552
 
553
- //#from a page/post url input, output a url with "$blogurl" prepended for
554
- //# blogs that have wordpress installed in a separate folder
555
- //# -Helene D. 1/22/08
556
- function wAddSiteurl($inputurl) {
557
- $wpurl = rtrim(get_bloginfo('wpurl'),"/");
558
- $blogurl = rtrim(get_bloginfo('home'),"/");
559
- if (strcasecmp($blogurl, $wpurl) == 0) {
560
- $outputurl=$inputurl;
561
- } elseif (stristr($inputurl,$blogurl) === FALSE && url_rootcheck($blogurl)) {
562
- $outputurl=$blogurl."/".ltrim($inputurl,"/");
563
- } else {
564
- $outputurl=$inputurl;
565
- }
566
- $outputurl = rawurldecode(html_entity_decode($outputurl)); //dangerous
567
- $outputurl = wCleanURL($outputurl); //safe
568
- return $outputurl;
569
- }
570
 
571
- //sanitize url of potentially dangerous code before display
572
- function wCleanURL($url="") {
573
- if (empty($url)) {
574
- return;
575
- }
576
- //$urlstring = stripslashes($url);
577
- if (function_exists('esc_url')) { //#WP 2.8+
578
- $cleaned_url = esc_url(stripslashes($url));
579
- } else {
580
- $cleaned_url = clean_url(stripslashes($url));
581
- }
582
- if (empty($cleaned_url)) { //oops, clean_url chomp
583
- $cleaned_url = esc_attr(stripslashes($url));
584
- }
585
- return $cleaned_url;
586
- } //end function
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
587
 
588
  //Output wassup records in the old Digg spy style...
589
  function wassup_spiaView ($from_date="",$rows=0,$spytype="",$spy_datasource="") {
590
- global $wpdb, $wp_version, $wassup_options, $wdebug_mode;
591
-
592
- if (!class_exists('wassupOptions') && file_exists(dirname(__FILE__). '/wassup.class.php')) {
593
- include_once(dirname(__FILE__). '/wassup.class.php');
594
- }
595
- $wassup_options = new wassupOptions;
596
- if (empty($spytype)) $spytype=$wassup_options->wassup_default_spy_type;
597
- $whereis=$wassup_options->getKeyOptions("wassup_default_spy_type","sql",$spytype);
 
598
  //check for arguments...
599
- $to_date = current_time("timestamp");
600
- if (empty($from_date)) {
601
- $from_date = (int)($to_date - 7);
602
- }
603
- if (empty($spy_datasource)) {
604
- //temp table is default data source unless not exists
605
- $spy_datasource = $wassup_options->wassup_table . "_tmp";
606
- }
607
- if ($wpdb->get_var("SHOW TABLES LIKE '$spy_datasource'") != $spy_datasource) {
608
- $spy_datasource = (!empty($wassup_options->wassup_table)?$wassup_options->wassup_table:$wpdb->prefix ."wassup");
609
- }
610
- if ($rows == 0 || !is_numeric($rows)) {
611
- $rows = 12;
612
- }
613
-
614
- if (!empty($wassup_options->wassup_screen_res)) {
615
- $screen_res_size = (int) $wassup_options->wassup_screen_res;
616
- } else {
617
- $screen_res_size = 670;
618
  }
619
- $max_char_len = ($screen_res_size)/10;
620
- //set smaller screen_res_size to make room for sidebar in WP2.7+
621
- if (version_compare($wp_version, '2.7', '>=')) {
622
- $screen_res_size = $screen_res_size-160;
623
- $max_char_len = $max_char_len-16;
 
624
  }
625
- $wpurl = get_bloginfo('wpurl');
626
- $blogurl = get_bloginfo('home');
627
- $unclass = "ip";
 
 
 
 
 
628
  //define google geoip record and create javascript marker icon
629
- $geoip_rec = array('ip'=>"",'latitude'=>"",'longitude'=>"",'city'=>"",'country_code'=>"");
630
  $geo_markers=0;
631
-
632
- $qryC = $wpdb->get_results("SELECT id, wassup_id, `timestamp`, ip, hostname, searchengine, urlrequested, agent, referrer, spider, feed, username, comment_author, spam FROM $spy_datasource WHERE `timestamp` > $from_date $whereis ORDER BY `timestamp` DESC LIMIT $rows");
633
- if (!empty($qryC)) {
634
- //restrict # of rows to display when needed...
635
- $row_count = 0;
 
 
636
  //display the rows...
637
- foreach ($qryC as $cv) {
638
- $unclass = "";
639
  $ulclass="users";
640
- $referrer = __('Direct hit','wassup');
 
641
  $requesturl="";
 
642
  if ($wassup_options->wassup_time_format == "12") {
643
- $timef = gmdate('h:i:s A', $cv->timestamp);
644
- } else {
645
- $timef = gmdate('H:i:s', $cv->timestamp);
646
- }
647
- $ip = @explode(",", $cv->ip);
648
- if ($cv->referrer != '') {
649
- if ($cv->searchengine != "" || stristr($cv->referrer,$wpurl)!=$cv->referrer) {
650
- if ($cv->searchengine == "") {
651
- $referrer = '<a href="'.wCleanURL($cv->referrer).'" target=_"BLANK"><span style="font-weight: bold;">'.stringShortener("{$cv->referrer}", round($max_char_len*.8,0)).'</span></a>';
652
- } else {
653
- $referrer = '<a href="'.wCleanURL($cv->referrer).'" target=_"BLANK">'.stringShortener("{$cv->referrer}", round($max_char_len*.9,0)).'</a>';
654
- }
655
- } else {
656
- $referrer = __('From your blog','wassup');
657
- }
658
- }
659
- if (strstr($cv->urlrequested,'[404]')) { //no link for 404 page
660
- $requesturl=stringShortener($cv->urlrequested, round($max_char_len*.9,0)+5);
661
  } else {
662
- $requesturl='<a href="'.wAddSiteurl("{$cv->urlrequested}").'" target="_BLANK">'.stringShortener("{$cv->urlrequested}", round($max_char_len*.9,0)).'</a>';
663
- }
664
- $map_icon = "marker_user.png";
665
- $visitor = __("Regular visitor","wassup");
666
- $ulclass="regular";
667
- if ($cv->spam == "3") {
668
- $unclass = "sum-spy-spam";
669
- $ulclass="spider";
670
- $visitor = __("Spammer","wassup").": $cv->hostname";
671
- } elseif (!empty($rk->spam)) {
672
- $unclass = "sum-spy-spam";
673
  $ulclass="spider";
674
- $visitor = __("Spammer","wassup").": $cv->hostname";
675
- } elseif ($cv->spider != "") {
676
- if ($cv->feed != "") {
677
- $visitor = __("Feedreader","wassup").": $cv->spider";
678
- } else {
679
- $visitor = __("Spider","wassup").": $cv->spider";
680
  }
681
- $unclass = "sum-spy-spider";
 
 
 
 
682
  $ulclass="spider";
683
- $map_icon = "marker_bot.png";
684
- } elseif ($cv->username != "") {
685
  // User is logged in or is a comment's author
686
- $unclass = "sum-spy-log";
687
  $ulclass="userslogged";
688
- $map_icon = "marker_loggedin.png";
689
- $visitor = __("Logged user","wassup").": $cv->username";
690
- } elseif ($cv->comment_author != "") {
691
- $unclass = "sum-spy-aut";
692
  $ulclass="users";
693
- $map_icon = "marker_author.png";
694
- $visitor = __("Comment author","wassup").": $cv->comment_author";
695
  } //end if cv->spam
696
- ?>
697
- <div class="sum-spy"><?php
698
  // Start getting GEOIP info
699
  $location="";
700
  $lat = "";
701
  $lon = "";
702
  $flag = "";
703
- if ($ip[0] != $geoip_rec['ip'] && preg_match('/^(127\.0\.0\.1|192\.168\.|10\.10\.)/',$ip[0])==0) {
704
- //geolocate a new visitor IP...
705
- $geoip_rec = wGeolocateIP($ip[0]);
 
706
  echo "\n\t<!-- heartbeat -->";
707
  $lat = $geoip_rec['latitude'];
708
  $lon = $geoip_rec['longitude'];
709
  $location = wGetLocationname($geoip_rec);
710
- } elseif ($ip[0] == $geoip_rec['ip']) {
711
- //previous visit was from same IP, so reuse data
712
  $lat = $geoip_rec['latitude'];
713
  $lon = $geoip_rec['longitude'];
714
  $location = wGetLocationname($geoip_rec);
715
  }
716
- if (!empty($geoip_rec['country_code']) && file_exists(WASSUPDIR."/img/flags/".$geoip_rec['country_code'].".png")) {
717
- $flag = '<img src="'.WASSUPURL.'/img/flags/'.$geoip_rec['country_code'].'.png" />';
 
 
 
 
 
 
 
 
 
718
  }
719
-
720
- // Print the JS code to add marker on the map
721
- if ($wassup_options->wassup_geoip_map == 1 && !empty($lon) && !empty($lat)) {
722
- $markerHtml='<div style="white-space:nowrap"><div class="bubble">'.$visitor.'<br />'.__("IP").": $ip[0]<br />".__("Location","wassup").": $flag $location<br />".__("Request","wassup").": $timef $requesturl".'<br /></div></div>';
723
- $pan=false;
724
- $geo_markers=$geo_markers+1;
725
- if ($geo_markers == 1) { //pan to 1st marker only (last visitor)
726
- $pan=true;
 
 
 
 
 
727
  }
728
- wAdd_GeoMarker($cv->id,$lat,$lon,"$markerHtml",$map_icon,$pan);
729
- } //end if wassup_geoip_map
730
- ?>
731
- <div class="sum-nav-spy">
732
- <div class="sum-box">
733
- <span class="sum-spy-ip <?php print $unclass; ?>"><?php echo $ip[0]; ?></span>
734
- </div>
735
- <div class="sum-det-spy">
736
- <span class="det1"><?php echo $requesturl; ?></span>
737
- <span class="det2"><strong><?php echo $timef; ?> - </strong> <?php
738
- print $referrer;
739
- if (!empty($location)) echo "<br />$flag $location\n"; ?>
740
- </span>
741
- </div>
742
  </div>
 
743
  </div><!-- /sum-spy --><?php
 
 
744
  } //end foreach
745
- } else {
746
- //display visual indicators that Wassup-spy is running
747
- if (empty($wassup_options->wassup_geoip_map) && (int)$to_date%79 == 0 ) {
748
- //display "no activity" message occasionally in visitor list
749
- echo "\n"; ?>
750
- <div class="sum-rec sum-nav-spy" style="width:auto; padding:3px;">
751
- <span class="det3"><?php
752
- if ($wassup_options->wassup_time_format == "12") {
753
- echo gmdate('h:i:s A', $to_date);
754
- } else {
755
- echo gmdate('H:i:s', $to_date);
756
  }
757
- echo ' - '.__("No visitor activity","wassup");?> &nbsp; &nbsp; :-( &nbsp; </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  </div><?php
759
- echo "\n";
760
- } //end if empty
761
  } //end if !empty($qryC)
 
762
  } //end function wassup_spiaView
763
 
764
  /**
765
- * print javascript to add a marker to a google map
766
  * @since v1.8
767
  */
768
- function wAdd_GeoMarker($item_id, $lat, $lon, $markerHtml, $marker_icon, $pan=true) {
769
- $img_dir = WASSUPURL.'/img';
770
-
771
- echo "\n<script type=\"text/javascript\">\n//<![CDATA[
772
-
773
- var point = new google.maps.LatLng($lat,$lon);
774
- var pinImage = new google.maps.MarkerImage('$img_dir/$marker_icon');
775
-
776
- var marker$item_id = new google.maps.Marker({
777
- position: point,
778
- icon: pinImage,
779
- animation: google.maps.Animation.DROP,
780
- map: map
781
- });
782
-
783
- infowindow$item_id = new google.maps.InfoWindow({
784
- content: '$markerHtml'
785
- });
786
-
787
- google.maps.event.addListener(marker$item_id, 'click', function() {
788
- infowindow$item_id.open(map, this);
789
- });
790
- ";
791
-
792
- if ($pan) {
793
- echo "\n
794
- map.panTo(point);";
795
- }
796
- echo "
797
- //]]>\n</script>";
798
- } //end function wAdd_GeoMarker
799
 
800
  //return a location name formatted for wassup_spiaView from array argument
801
  //@since v1.8
802
  function wGetLocationname($geoip_rec=array()) {
 
 
803
  if (!empty($geoip_rec['country'])) {
804
- $location = $geoip_rec['country'].' ('.strtoupper($geoip_rec['country_code']).') City: '.$geoip_rec['city'];
805
- if ($geoip_rec['country_code'] == "us" && !empty($geoip_rec['region'])) {
806
- $location .= ', '.$geoip_rec['region'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
807
  }
808
  } else {
809
- $location = "Country: unknown, City: unknown";
810
  }
811
- return $location;
812
  }
813
 
814
- // Geocoding location with Google Maps
815
- function geocodeWassUp($location, $key) {
816
- global $wdebug_mode;
817
- //Three parts to querystring: q= address, output= format, and key
818
- $address = urlencode($location);
819
- $api_url = "http://maps.google.com/maps/geo?q=".$address."&output=csv&key=".$key;
820
-
821
- /*
822
- //$ch = curl_init();
823
- //curl_setopt($ch, CURLOPT_URL, $api_url);
824
- //curl_setopt($ch, CURLOPT_HEADER,0);
825
- //curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
826
- //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
827
- //curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
828
-
829
- //$data = curl_exec($ch);
830
- //curl_close($ch);
831
- */
832
- $apidata = wFetchAPIData($api_url);
833
- $data = explode(',',$apidata);
834
- if ($wdebug_mode) {
835
- echo "\n<!--geocodeWassup data: ";
836
- print_r($data);
837
- echo "-->" ;
838
- }
839
- return $data;
840
- } //end geocodeWassup
841
-
842
  /**
843
- * get geographic location and coordinates for an IP address via
844
- * freegeoip.net and save data in 'wassup_meta' table.
845
  * Since version 1.8
 
846
  * @return array (ip, location, latitude, longitude, country)
847
  */
848
  function wGeolocateIP($ip) {
849
  global $wpdb, $wdebug_mode;
850
-
851
- $wassup_settings=get_option('wassup_settings');
852
- $wassup_agent = apply_filters('http_headers_useragent',"WassUp/".$wassup_settings['wassup_version']." - www.wpwp.org");
853
- //$geourl = "http://freegeoip.net/json/$ip";
854
- $geourl = "http://www.telize.com/geoip/$ip";
855
  $geoip = array('ip'=>$ip,'latitude'=>"",'longitude'=>"",'city'=>"",'country_code'=>"");
856
- $cache_table = (isset($wassup_settings['wassup_table'])?$wassup_settings['wassup_table']."_meta":$wpdb->prefix."_wassup_meta");
857
- if (!empty($ip)) {
858
- $geodata="";
859
  //1st check for cached copy of geoip in wassup_meta
860
- if (!empty($wassup_settings['wassup_cache'])) {
861
- $cache_id = 0;
862
- $cache_timestamp = 0;
863
- $wassup_cache = $wpdb->get_results("SELECT * from $cache_table WHERE `wassup_key`='$ip' && `meta_key`='geoip'");
864
- if (count($wassup_cache)>0 && !empty($wassup_cache[0]->meta_value)) {
865
- $geodata = unserialize(html_entity_decode($wassup_cache[0]->meta_value));
866
- $cache_id = $wassup_cache[0]->meta_id;
867
- $cache_timestamp = $wassup_cache[0]->meta_expire;
868
- }
869
- //check for valid data in cache and >1 day for expiration
870
- if (empty($geodata['city']) || ($cache_timestamp - time()) < 86400) {
871
- $geodata = "";
872
- $cache_timestamp = 0;
873
- }
874
- }
875
- //#Local lookup of geoip: //TODO
876
- //try PHP geoip extension function 'geoip_record_by_name'
877
- /* if ((empty($geodata) && function_exists('geoip_record_by_name')) {
878
- $geodata = geoip_record_by_name($ip);
879
- if (!empty($geodata)) {
880
- //TODO assign geoip array fields
881
- //$geodata['city'] = ;
 
 
 
882
  }
883
- } */
884
- //#Remote lookups of geoip:
885
- //try Wordpress 'wp_remote_get' or 'cURL' for geoip
886
- if (empty($geodata['city']) && empty($geoip['city'])) {
887
- $geodata=wFetchAPIData($geourl);
888
- }
889
- if (!empty($geodata) && !is_array($geodata)) {
890
- $geodata = xjson_decode($geodata,true);
891
  }
892
- //fill geoip record with remote data
893
- if (!empty($geodata['country_code']) && empty($geoip['city'])){
894
  $geoip = $geodata;
895
- $geoip['country_code'] = strtolower($geodata['country_code']);
896
- }
897
- //cache record in 'wassup_meta' table with 7-day expire
898
- if (!empty($geoip['city']) && !empty($geoip['country_code']) && !empty($wassup_settings['wassup_cache'])) {
899
- $wassup_cache = array( 'meta_id'=>$cache_id,
900
- 'wassup_key'=>$ip,
901
- 'meta_key'=>'geoip',
902
- 'meta_value'=>esc_attr(serialize($geoip)),
903
- 'meta_expire'=>time()+7*86400);
904
- if (empty($cache_id)) {
905
- if (method_exists($wpdb,'insert')) { //WP 2.5+
906
- $result = $wpdb->insert($cache_table,$wassup_cache);
907
- }
908
- } elseif ($cache_timestamp == 0 && method_exists($wpdb,'update')) {
909
- $result = $wpdb->update($cache_table,$wassup_cache,array("meta_id"=>$cache_id));
910
  }
 
911
  } //end if !empty(geoip['city'])
912
  } //end if !empty(ip)
913
-
914
  return $geoip;
915
  } //end function wGeolocateIP
916
 
917
- /** wGetStats-
918
- * Return an associative array containing the top statistics numbers of
919
- * "stat_type" from wassup table. Associative array fields are
920
- * 'top_count', 'top_item', and optionally, 'top_link', when data is url.
921
- * Results are sorted in descending count order and known spam is
922
- * automatically excluded when spam check is enabled in 'Wassup Options'.
923
- * Input parameters are 'stat_type'=[name of any column in wassup table],
924
- * and 2 optional parameters:
925
- * stat_limit=N-- limits results to the top N values. Default=10.
926
- * stat_condition='mysql where clause'-- usually a date range clause on
927
- * `timestamp`. Defaults to 24 hours.
928
- * Used by action.php TopTen and wassup_widget to retrieve statistics data.
929
- * - Helene D. 2009-03-04
930
  */
931
- function wGetStats($stat_type, $stat_limit=10, $stat_condition="") {
932
- global $wpdb, $wdebug_mode;
933
-
934
- $wassup_settings = get_option('wassup_settings');
935
- $top_ten = unserialize(html_entity_decode($wassup_settings['wassup_top10']));
936
- $wpurl = get_bloginfo('wpurl');
937
- $blogurl = get_option('home');
938
- $wtable_name = (!empty($wassup_settings['wassup_table'])?$wassup_settings['wassup_table'] : $wpdb->prefix . "wassup");
939
- $wtable_tmp_name = $wtable_name . "_tmp";
940
-
941
- if (empty($stat_limit) || !(is_numeric($stat_limit))) {
942
- $stat_limit=10;
943
  }
 
 
 
 
 
 
 
944
  if (empty($stat_condition)) {
945
  $to_date = current_time('timestamp');
946
  $from_date = ((int)$to_date - 24*(60*60)); //24 hours
947
- $stat_condition = " `timestamp` >= $from_date ";
948
- }
949
- //exclude spam if it is being recorded
950
- if ($wassup_settings['wassup_spamcheck'] == 1) {
951
- $spam_condition = " AND spam=0";
952
- } else {
953
- $spam_condition = "";
954
  }
955
- $stat_condition .= $spam_condition;
956
-
957
- //get the stats data
958
  //top search phrases...
959
- if ($stat_type == "searches") {
960
- $stat_results = $wpdb->get_results("SELECT count(search) AS top_count, search AS top_item, referrer AS top_link, max(`timestamp`) AS visit_timestamp FROM $wtable_name WHERE $stat_condition AND search!='' AND spider='' GROUP BY search ORDER BY top_count DESC, visit_timestamp DESC LIMIT $stat_limit");
961
 
962
- //top external referrers...
963
- } elseif ($stat_type == "referrers") {
964
  //exclude internal referrals
965
  $wurl = parse_url($blogurl);
966
  $sitedomain = $wurl['host'];
@@ -976,58 +839,86 @@ function wGetStats($stat_type, $stat_limit=10, $stat_condition="") {
976
  }
977
  //create mysql conditional statement to exclude referrers
978
  $exclude_referrers = "";
979
- $exclude_array = array_unique(explode(",", $exclude_list));
 
980
  foreach ($exclude_array as $exclude_domain) {
981
- $exclude_domain = preg_replace('/^(https?\:\/\/|www\.)(www\.)?/','',trim($exclude_domain));
982
- if ($exclude_domain != "" ) {
983
- if (strstr($exclude_domain,'//:')===false) {
984
- $exclude_referrers .= " AND referrer NOT LIKE 'http://".$exclude_domain."%' AND referrer NOT LIKE 'http://www.".$exclude_domain."%' AND referrer NOT LIKE '%:".$exclude_domain."%' AND referrer NOT LIKE '%=http://".$exclude_domain."%'";
985
- } else {
986
- $exclude_referrers .= " AND referrer NOT LIKE '%".$exclude_domain."%'";
987
- }
988
  }
 
 
 
 
 
 
989
  }
990
- $stat_results = $wpdb->get_results("SELECT count(*) AS top_count, LOWER(referrer) AS top_item, referrer AS top_link, max(`timestamp`) AS visit_timestamp FROM $wtable_name WHERE $stat_condition AND referrer!='' AND search='' AND spider='' $exclude_referrers GROUP BY top_item ORDER BY top_count DESC, visit_timestamp DESC LIMIT $stat_limit");
991
- if ($wdebug_mode) {
992
- echo "\n<pre>exclude_referrers = $exclude_referrers </pre>\n";
993
- }
994
 
995
  //top url requests...
996
- } elseif ($stat_type == "urlrequested") {
997
- $stat_results = $wpdb->get_results("SELECT count(*) AS top_count, LOWER(REPLACE(urlrequested, '/', '')) AS top_group, LOWER(urlrequested) AS top_item, urlrequested AS top_link, max(`timestamp`) AS visit_timestamp FROM $wtable_name WHERE $stat_condition GROUP BY top_group ORDER BY top_count DESC, visit_timestamp DESC LIMIT $stat_limit");
998
-
 
 
999
  //top browser...
1000
- } elseif ($stat_type == "browser") {
1001
- $stat_results = $wpdb->get_results("SELECT count(*) AS top_count, SUBSTRING_INDEX(SUBSTRING_INDEX(browser, ' 0.', 1), '.', 1) AS top_item FROM $wtable_name WHERE $stat_condition AND `browser`!='' AND `browser` NOT LIKE 'N/A%' AND `spider`='' GROUP BY top_item ORDER BY top_count DESC LIMIT $stat_limit");
1002
-
1003
  //top os...
1004
  } elseif ($stat_type == "os") {
1005
- $stat_results = $wpdb->get_results("SELECT count(os) as top_count, `os` AS top_item FROM $wtable_name WHERE $stat_condition AND `os`!='' AND `os` NOT LIKE 'N/A%' AND spider='' GROUP BY top_item ORDER BY top_count DESC LIMIT $stat_limit");
1006
-
1007
  //top language/locale..
1008
- } elseif ($stat_type == "language" || $stat_type == "locale") {
1009
- $stat_results = $wpdb->get_results("SELECT count(LOWER(language)) as top_count, LOWER(language) as top_item FROM $wtable_name WHERE $stat_condition AND language!='' AND spider='' GROUP BY top_item ORDER BY top_count DESC LIMIT $stat_limit");
1010
-
1011
  //top visitors...
1012
- } elseif ($stat_type == "visitor" || $stat_type == "visitors") {
1013
- $stat_results = $wpdb->get_results("SELECT count(username) as top_count, username as top_item, '1loggedin_user' as visitor_type, max(`timestamp`) as visit_timestamp FROM $wtable_name WHERE $stat_condition AND username!='' GROUP BY 2 UNION SELECT count(comment_author) as top_count, comment_author as top_item, '2comment_author' as visitor_type, max(`timestamp`) as visit_timestamp FROM $wtable_name WHERE $stat_condition AND username='' AND comment_author!='' GROUP BY 2 UNION SELECT count(hostname) as top_count, hostname as top_item, '3hostname' as visitor_type, max(`timestamp`) as visit_timestamp FROM $wtable_name WHERE $stat_condition AND username='' AND comment_author='' AND spider='' GROUP BY 2 ORDER BY 1 DESC, 3, 2 LIMIT $stat_limit");
1014
-
1015
  //top postid (post|page)
1016
- } elseif ($stat_type == "postid" || $stat_type == "article") {
1017
- $stat_results = $wpdb->get_results("SELECT count(*) AS top_count, url_wpid AS top_group, post_title AS top_item, urlrequested AS top_link, max(`timestamp`) as visit_timestamp FROM $wtable_name, {$wpdb->prefix}posts WHERE $stat_condition AND url_wpid!='' AND url_wpid!='0' AND url_wpid = {$wpdb->prefix}posts.ID GROUP BY top_group ORDER BY top_count DESC, visit_timestamp DESC LIMIT $stat_limit");
1018
-
1019
- } else {
1020
- //TODO: check that wp_wassup.$stat_type column exist and is char
1021
- if (!empty($stat_type)) {
1022
- $stat_results = $wpdb->get_results("SELECT count($stat_type) AS top_count, `$stat_type` AS top_item FROM $wtable_name WHERE $stat_condition AND `$stat_type`!='' AND `$stat_type` NOT LIKE 'N/A%' GROUP BY `$stat_type` ORDER BY top_count DESC LIMIT $stat_limit");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1023
  }
1024
  }
1025
-
1026
- if (!empty($stat_results[0]->top_count)) {
1027
- return $stat_results;
1028
- } else {
1029
- return array();
1030
  }
 
1031
  } //end function wGetStats
1032
 
1033
  /**
@@ -1036,18 +927,22 @@ function wGetStats($stat_type, $stat_limit=10, $stat_condition="") {
1036
  * @param string(4)
1037
  * @return none
1038
  */
1039
- function wassup_top10view ($from_date="",$to_date="",$max_char_len="",$top_limit=0,$title=false) {
1040
- global $wpdb, $wassup_options;
1041
- if (!class_exists('wassupOptions') && file_exists(dirname(__FILE__). '/wassup.class.php')) {
1042
- include_once(dirname(__FILE__). '/wassup.class.php');
 
 
 
 
 
1043
  }
1044
- $wassup_options = new wassupOptions;
1045
- $top_ten = unserialize(html_entity_decode($wassup_options->wassup_top10));
1046
- if (!is_array($top_ten)) $top_ten = $wassup_options->defaultSettings("top10");
1047
- //$table_name = (!empty($wassup_options->wassup_table)? $wassup_options->wassup_table: $wpdb->prefix . "wassup");
1048
- //$table_tmp_name = $table_name . "_tmp";
1049
-
1050
- $blogurl = get_bloginfo('home');
1051
  $url = parse_url($blogurl);
1052
  $sitedomain = preg_replace('/^www\./i','',$url['host']);
1053
 
@@ -1058,221 +953,243 @@ function wassup_top10view ($from_date="",$to_date="",$max_char_len="",$top_limit
1058
  @set_time_limit(2*60); // ...to 2 minutes
1059
  }
1060
  }
1061
-
1062
- if (empty($max_char_len)) {
1063
- $max_char_len = (int)($wassup_options->wassup_screen_res/10);
1064
- //make room for WordPress 2.7+ sidebar
1065
- if (version_compare($wp_version, '2.7', '>=')) {
1066
- $max_char_len = $max_char_len-16;
1067
- }
1068
- }
1069
- //#add an extra width offset when columns count < 6
1070
- $col_count = array_sum($top_ten);
1071
- if ($col_count > 0 && $col_count < 6 ) {
1072
- $widthoffset = (($max_char_len*(6 - $col_count))/$col_count)*.4; //just a guess
1073
- } else {
1074
- $widthoffset = 0;
1075
- }
1076
  //extend page width to make room for more than 5 columns
1077
- $pagewidth = $wassup_options->wassup_screen_res;
1078
- if ($col_count > 6) {
1079
- $pagewidth = $pagewidth+17*($col_count-6);
1080
- }
1081
- //New in v1.8.3: top_limit in top10 array
1082
  if (empty($top_limit) || !is_numeric($top_limit)) {
1083
- if (!empty($top_ten['toplimit'])) {
1084
- $top_limit = (int) $top_ten['toplimit'];
1085
- } else {
1086
- $top_limit = 10; //default
1087
- }
1088
  }
1089
-
1090
- //mysql conditional query...
1091
- $top_condition = '`timestamp` BETWEEN '.$from_date.' AND '.$to_date;
1092
- if (!empty($top_ten['top_nospider'])) {
1093
- $top_condition .= " AND spider=''";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1094
  }
1095
  echo "\n"; ?>
1096
- <div id="toptenchart" style="width:auto;">
1097
- <table width="100%">
1098
- <tr valign="top"><?php
1099
- if (!empty($title)) { ?>
1100
- <th colspan="<?php echo $col_count; ?>"><span style="centered"><?php echo $title; ?></span></th></tr><tr><?php
 
 
 
 
 
 
 
1101
  }
 
 
 
 
 
1102
  //show a line# column for long data columns
1103
  if ($top_limit > 10) wPrintRowNums($top_limit);
1104
 
1105
  //#output top 10 searches
1106
  if ($top_ten['topsearch'] == 1) {
1107
  $top_results = wGetStats("searches",$top_limit,$top_condition);
1108
- $char_len = round(($max_char_len*.30)+$widthoffset,0); ?>
1109
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
1110
  <ul class="charts">
1111
- <li class="chartsT"><?php echo _e("TOP QUERY", "wassup"); ?></li> <?php
1112
  $i=0;
1113
  $ndigits=1;
1114
- if (count($top_results) >0) {
1115
  $ndigits = strlen("{$top_results[0]->top_count}");
1116
  foreach ($top_results as $top10) {
1117
  echo "\n"; ?>
1118
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count, $ndigits).' <a href="'.$top10->top_link.'" target="_BLANK" title="'.substr($top10->top_item,0,$wassup_options->wassup_screen_res-100).'">'.stringShortener(preg_replace('/'.preg_quote($blogurl,'/').'/i', '', $top10->top_item),$char_len).'</a>'; ?></nobr></li><?php
1119
- $i++;
 
 
 
1120
  }
1121
  }
1122
  //finish list with empty <li> for style consistency
1123
- wListFiller($i,$top_limit,"charts"); ?>
1124
  </ul>
1125
- </td> <?php
 
1126
  } // end if topsearch
1127
 
1128
- //#output top 10 referrers
 
 
1129
  if ($top_ten['topreferrer'] == 1) {
1130
  //to prevent browser timeouts, send <!--heartbeat--> output
1131
  echo "\n<!--heartbeat-->";
1132
  $top_results = wGetStats("referrers",$top_limit,$top_condition);
1133
- $char_len = round(($max_char_len*.22)+$widthoffset,0); ?>
1134
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
1135
  <ul class="charts">
1136
  <li class="chartsT"><?php _e("TOP REFERRER", "wassup"); ?></li><?php
1137
  $i=0;
1138
  $ndigits=1;
1139
- if (count($top_results) >0) {
1140
  $ndigits = strlen("{$top_results[0]->top_count}");
1141
  foreach ($top_results as $top10) {
1142
  echo "\n"; ?>
1143
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1144
- echo ' <a href="'.clean_url($top10->top_link,'','url').'" title="'.esc_attr($top10->top_link).'" target="_BLANK">';
1145
- //#cut http:// from displayed url and truncate
1146
- //# instead of using stringShortener
1147
- echo substr(str_replace("http://", "", esc_attr($top10->top_item)),0,$char_len);
1148
- if (strlen($top10->top_item) > ($char_len + 7)) {
1149
- echo '...';
1150
- }
1151
- echo '</a>'; ?></nobr></li><?php
1152
  $i++;
1153
  }
1154
  }
1155
- //finish list with empty <li> for styling consistency
1156
- wListFiller($i,$top_limit,"charts"); ?>
1157
- </ul>
1158
- </td> <?php
1159
  } //end if topreferrer
1160
 
1161
  //#output top 10 url requests
1162
- if ($top_ten['toprequest'] == 1) {
1163
- echo "\n<!--heartbeat-->";
1164
- $top_results = wGetStats("urlrequested",$top_limit,$top_condition);
1165
- $char_len = round(($max_char_len*.28)+$widthoffset,0); ?>
1166
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
 
 
1167
  <ul class="charts">
1168
  <li class="chartsT"><?php _e("TOP REQUEST", "wassup"); ?></li><?php
1169
  $i=0;
1170
  $ndigits=1;
1171
- if (count($top_results) >0) {
1172
  $ndigits = strlen("{$top_results[0]->top_count}");
1173
  foreach ($top_results as $top10) {
1174
  echo "\n"; ?>
1175
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1176
- if (strstr($top10->top_item,'[404]')) { //no link for 404 pages
1177
- echo ' <span class="top10" title="'.substr($top10->top_item,0,$wassup_options->wassup_screen_res-100).'">'.stringShortener(preg_replace('/'.preg_quote($blogurl,'/').'/i', '', $top10->top_item),$char_len).'</span>';
1178
  } else {
1179
- echo ' <a href="'.wAddSiteurl($top10->top_link).'" target="_BLANK" title="'.substr($top10->top_item,0,$wassup_options->wassup_screen_res-100).'">'.stringShortener(preg_replace('/'.preg_quote($blogurl,'/').'/i', '', $top10->top_item),$char_len).'</a>';
1180
  } ?></nobr></li><?php
1181
  $i++;
1182
  }
1183
  }
1184
- //finish list with empty <li> for styling consistency
1185
- wListFiller($i,$top_limit,"charts"); ?>
1186
  </ul>
1187
- </td><?php
 
1188
  } //end if toprequest
1189
 
1190
  //#get top 10 browsers...
1191
- if ($top_ten['topbrowser'] == 1) {
1192
- echo "\n<!--heartbeat-->";
1193
- $top_results = wGetStats("browser",$top_limit,$top_condition);
1194
- $char_len = round(($max_char_len*.17)+$widthoffset,0); ?>
1195
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
 
 
1196
  <ul class="charts">
1197
  <li class="chartsT"><?php _e("TOP BROWSER", "wassup") ?></li><?php
1198
  $i=0;
1199
  $ndigits=1;
1200
- if (count($top_results) >0) {
1201
  $ndigits = strlen("{$top_results[0]->top_count}");
1202
  foreach ($top_results as $top10) {
1203
  echo "\n"; ?>
1204
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1205
  echo ' <span class="top10" title="'.$top10->top_item.'">'.stringShortener($top10->top_item, $char_len).'</span>'; ?></nobr></li><?php
1206
  $i++;
1207
  }
1208
  }
1209
- //finish list with empty <li> for styling consistency
1210
- wListFiller($i,$top_limit,"charts"); ?>
1211
  </ul>
1212
- </td><?php
1213
- } //end if topbrowser
 
1214
 
1215
  //#output top 10 operating systems...
1216
- if ($top_ten['topos'] == 1) {
1217
- echo "\n<!--heartbeat-->";
1218
- $top_results = wGetStats("os",$top_limit,$top_condition);
1219
- $char_len = round(($max_char_len*.15)+$widthoffset,0); ?>
1220
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
 
 
1221
  <ul class="charts">
1222
  <li class="chartsT"><?php _e("TOP OS", "wassup") ?></li><?php
1223
  $i=0;
1224
  $ndigits=1;
1225
- if (count($top_results) >0) {
1226
  $ndigits = strlen("{$top_results[0]->top_count}");
1227
  foreach ($top_results as $top10) {
1228
  echo "\n"; ?>
1229
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits); ?> <span class="top10" title="<?php echo $top10->top_item; ?>"><?php echo stringShortener($top10->top_item, $char_len); ?></span></nobr></li><?php
1230
  $i++;
1231
  }
1232
  }
1233
- //finish list with empty <li> for styling consistency
1234
- wListFiller($i,$top_limit,"charts"); ?>
1235
  </ul>
1236
- </td><?php
 
1237
  } // end if topos
1238
-
1239
  //#output top 10 locales/geographic regions...
1240
- if ($top_ten['toplocale'] == 1) {
1241
- echo "\n<!--heartbeat-->";
1242
- $top_results = wGetStats("language",$top_limit,$top_condition);
1243
- $char_len = round(($max_char_len*.15)+$widthoffset,0); ?>
1244
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
 
 
1245
  <ul class="charts">
1246
  <li class="chartsT"><?php _e("TOP LOCALE", "wassup"); ?></li><?php
1247
  $i=0;
1248
  $ndigits=1;
1249
- if (count($top_results) >0) {
1250
- $ndigits = strlen("{$top_results[0]->top_count}");
1251
- foreach ($top_results as $top10) {
1252
- echo "\n"; ?>
1253
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1254
- echo ' <img src="'.WASSUPURL.'/img/flags/'.strtolower($top10->top_item).'.png" alt="" />'; ?>
1255
- <span class="top10" title="<?php echo $top10->top_item; ?>"><?php echo $top10->top_item; ?></span></nobr></li><?php
1256
  $i++;
1257
  }
1258
  }
1259
- //finish list with empty <li> for styling consistency
1260
- wListFiller($i,$top_limit,"charts"); ?>
1261
  </ul>
1262
- </td><?php
1263
- } // end if toplocale
 
1264
 
1265
  //#output top visitors
1266
- if ($top_ten['topvisitor'] == 1) {
1267
- echo "\n<!--heartbeat-->";
1268
- $top_results = wGetStats("visitor",$top_limit,$top_condition);
1269
- $char_len = round(($max_char_len*.17)+$widthoffset,0); ?>
1270
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
 
 
1271
  <ul class="charts">
1272
  <li class="chartsT"><?php _e("TOP VISITOR", "wassup"); ?></li><?php
1273
  $i=0;
1274
  $ndigits=1;
1275
- if (count($top_results)>0) {
1276
  $ndigits = strlen("{$top_results[0]->top_count}");
1277
  foreach ($top_results as $top10) {
1278
  if ($top10->visitor_type == "1loggedin_user")
@@ -1282,46 +1199,45 @@ function wassup_top10view ($from_date="",$to_date="",$max_char_len="",$top_limit
1282
  else
1283
  $uclass="";
1284
  echo "\n"; ?>
1285
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits).' <span class="top10'.$uclass.'" title="'.$top10->top_item.'">'.stringShortener($top10->top_item, $char_len).'</span>'; ?></nobr></li><?php
1286
  $i++;
1287
  } //end loop
1288
  }
1289
- //finish list with empty <li> for styling consistency
1290
- wListFiller($i,$top_limit,"charts"); ?>
1291
  </ul>
1292
- </td>
1293
- <?php } // end if topvisitor
 
1294
 
1295
  //#output top article (post|page by id)
1296
- if ($top_ten['toppostid'] == 1) {
1297
- echo "\n<!--heartbeat-->";
1298
- $top_results = wGetStats("postid",$top_limit,$top_condition);
1299
- $char_len = round(($max_char_len*.28)+$widthoffset,0); ?>
1300
- <td style="min-width:<?php echo ($char_len-5); ?>px;">
 
 
1301
  <ul class="charts">
1302
  <li class="chartsT"><?php _e("TOP ARTICLE", "wassup"); ?></li><?php
1303
  $i=0;
1304
  $ndigits=1;
1305
- if (count($top_results) >0) {
1306
  $ndigits = strlen("{$top_results[0]->top_count}");
1307
  foreach ($top_results as $top10) {
1308
  echo "\n"; ?>
1309
- <li class="charts"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1310
- echo ' <a href="'.wAddSiteurl($top10->top_link).'" target="_BLANK" title="'.$top10->top_item.'">'.stringShortener($top10->top_item,$char_len).'</a>'; ?> </nobr></li><?php
1311
  $i++;
1312
  }
1313
  }
1314
- //finish list with empty <li> for styling consistency
1315
- wListFiller($i,$top_limit,"charts"); ?>
1316
  </ul>
1317
- </td><?php
1318
- } // end if toppost
1319
- //show a line# column for long data columns
1320
- if ($top_limit > 10 && $col_count > 6) {
1321
- wPrintRowNums($top_limit);
1322
  }
1323
- ?></tr>
1324
- </table>
 
1325
  <span style="font-size:7pt;"> <?php
1326
  if ($wassup_options->wassup_spamcheck == 1 || !empty($top_ten['top_nospider'])) { ?><br/>*<?php
1327
  if ($wassup_options->wassup_spamcheck == 1 && !empty($top_ten['top_nospider'])) {
@@ -1331,7 +1247,9 @@ function wassup_top10view ($from_date="",$to_date="",$max_char_len="",$top_limit
1331
  } else {
1332
  _e("This report excludes spam records","wassup");
1333
  }
1334
- } ?> </span>
 
 
1335
  </div> <?php
1336
  } //end wassup_top10view
1337
 
@@ -1380,19 +1298,6 @@ function wPadNum($li_number, $li_width=1) {
1380
  return ($padhtml);
1381
  }
1382
 
1383
- // How many digits have an integer -- quicker to use 'strlen' function
1384
- // function digit_count($n, $base=10) {
1385
- // if($n == 0) return 1;
1386
- // if($base == 10) {
1387
- // # using the built-in log10(x)
1388
- // # might be more accurate than log(x)/log(10).
1389
- // return 1 + floor(log10(abs($n)));
1390
- // }else{
1391
- // # here logB(x) = log(x)/log(B) will have to do.
1392
- // return 1 + floor(log(abs($n))/ log($base));
1393
- // }
1394
- //}
1395
-
1396
  //Round the integer to the next near 10
1397
  function roundup($value) {
1398
  //$dg = digit_count($value);
@@ -1423,12 +1328,9 @@ function Gchart_data($Wvisits, $pages=null, $atime=null, $type, $charttype=null,
1423
  $maxPage = roundup(max($pages));
1424
  $halfPage = ($maxPage/2);
1425
  }
1426
-
1427
  // A list of encoding characters to help later, as per Google's example
1428
  $simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
1429
-
1430
  $chartData = "s:";
1431
-
1432
  // Chart type has two datasets
1433
  if ($charttype == "main") {
1434
  $label_time = "";
@@ -1452,7 +1354,6 @@ function Gchart_data($Wvisits, $pages=null, $atime=null, $type, $charttype=null,
1452
  for ($i = 0; $i < count($pages); $i++) {
1453
  $currentPage = $pages[$i];
1454
  $currentTime = $atime[$i];
1455
-
1456
  if ($currentPage > -1) {
1457
  $chartData.=substr($simpleEncoding,61*($currentPage/$maxPage),1);
1458
  } else {
@@ -1466,7 +1367,6 @@ function Gchart_data($Wvisits, $pages=null, $atime=null, $type, $charttype=null,
1466
  } else {
1467
  $chartAPIdata=$chartData."&chxt=x,y,r&chxl=0:|".$label_time."1:|0|".$halfValue."|".$maxValue."|2:|0|".$halfPage."|".$maxPage."&chxs=0,6b6b6b,9";
1468
  }
1469
-
1470
  // Chart type has one one dataset
1471
  // It's unused now
1472
  } else {
@@ -1474,7 +1374,6 @@ function Gchart_data($Wvisits, $pages=null, $atime=null, $type, $charttype=null,
1474
  $currentValue = $Wvisits[$i];
1475
  $currentTime = $atime[$i];
1476
  $label_time.=str_replace(' ', '+', $currentTime)."|";
1477
-
1478
  if ($currentValue > -1) {
1479
  $chartData.=substr($simpleEncoding,61*($currentValue/$maxValue),1);
1480
  } else {
@@ -1484,209 +1383,260 @@ function Gchart_data($Wvisits, $pages=null, $atime=null, $type, $charttype=null,
1484
  $chartAPIdata=$chartData."&chxt=x,y&chxl=0:|".$label_time."|1:|0|".$halfValue."|".$maxValue."&chxs=0,6b6b6b,9";
1485
  }
1486
  return $chartAPIdata;
1487
-
1488
- } //end function
1489
 
1490
  // Used to show main visitors details query, to count items and to extract data for main chart
1491
  class WassupItems {
1492
- // declare variables
1493
  var $tableName;
1494
  var $from_date;
1495
  var $to_date;
1496
  var $searchString;
1497
- var $whereis;
1498
  var $ItemsType;
1499
  var $Limit;
1500
  var $Last;
1501
  var $WpUrl;
1502
-
1503
- /* Constructor */
1504
  function wassupitems($table_name,$date_from,$date_to,$whereis=null,$limit=null) {
1505
- global $wpdb, $wassup_options, $wdebug_mode;
1506
- if (empty($wassup_options->wassup_table)) {
1507
- $wassup_options = new wassupOptions;
1508
- }
1509
- if (empty($table_name)) {
1510
- $table_name = $wassup_options->wassup_table;
1511
- }
1512
- if (empty($date_to) || !is_numeric($date_to)) {
1513
- $date_to = current_time('timestamp');
1514
- }
1515
- if ($date_from == "" || !is_numeric($date_from)) {
1516
- //$date_from = strtotime('-24 hours', $date_to);
1517
- if ($table_name == $wassup_options->wassup_table) {
1518
- //use default range from wassup_options
1519
- if (!empty($wassup_options->wassup_time_period)) {
1520
- $last = $wassup_options->wassup_time_period;
1521
- } else {
1522
- $last = 1;
 
 
1523
  }
1524
- $date_from = $date_to - (int)(($last*24)*3600);
1525
- } else {
1526
- $date_from = $date_to - 3*60; //3 minutes
 
1527
  }
 
 
1528
  }
1529
  $this->tableName = $table_name;
1530
- $this->from_date = $date_from;
1531
- $this->to_date = $date_to;
1532
- $this->whereis = $whereis;
1533
- $this->limit = $limit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1534
  }
1535
- /* Methods */
1536
  // Function to show main query and count items
1537
- function calc_tot($Type, $Search="", $specific_where_clause=null, $distinct_type=null) {
1538
- global $wpdb, $wassup_options, $wdebug_mode;
1539
-
1540
- $this->ItemsType = $Type;
1541
- $this->searchString = $Search;
1542
- $ss = "";
1543
- if (!empty($Search) || !empty($specific_where_clause)) {
1544
- $ss = $this->buildSearch($Search,$specific_where_clause);
1545
- }
1546
-
 
 
 
 
 
1547
  // Switch by every (global) items type (visits, pageviews, spams, etc...)
1548
- switch ($Type) {
1549
- // This is the MAIN query to show the chronology
1550
  case "main":
1551
- //## Extend mysql wait timeout to 2.5 minutes and extend
1552
- //# php script timeout to 3 minutes to prevent script
1553
- //# hangs with large tables on slow server.
1554
- if (!ini_get('safe_mode')) @set_time_limit(3*60);
1555
- $results = $wpdb->query("SET wait_timeout = 160");
1556
-
1557
- //TODO: use a subquery for MySQL 5+
1558
  //main query
1559
- // - retrieve one row per wassup_id with timestamp = max(timestamp) (ie. latest record)
1560
- // "sql_buffer_result" select option helps in cases where it takes a long time to retrieve results. -Helene D. 2/29/09
1561
- $qry = sprintf("SELECT SQL_BUFFER_RESULT *, max(`timestamp`) as max_timestamp, min(`timestamp`) as min_timestamp, count(wassup_id) as page_hits FROM %s WHERE `timestamp` >= %s %s %s GROUP BY wassup_id ORDER BY max_timestamp DESC %s",
1562
  $this->tableName,
1563
- $this->from_date,
1564
- $ss,
1565
- $this->whereis,
1566
  $this->Limit);
1567
  $results = $wpdb->get_results($qry);
1568
- if (empty($results) || !is_array($results)) { //try without buffer
1569
- $qry = sprintf("SELECT *, max(`timestamp`) as max_timestamp, min(`timestamp`) as min_timestamp, count(wassup_id) as page_hits FROM %s WHERE `timestamp` >= %s %s %s GROUP BY wassup_id ORDER BY max_timestamp DESC %s",
 
1570
  $this->tableName,
1571
- $this->from_date,
1572
- $ss,
1573
- $this->whereis,
1574
  $this->Limit);
1575
  $results = $wpdb->get_results($qry);
1576
  }
1577
- //return $results;
1578
  break;
1579
  case "count":
1580
  // These are the queries to count the items hits/pages/spam
1581
- $qry = sprintf("SELECT COUNT(%s `wassup_id`) AS itemstot FROM %s WHERE `timestamp` >= %s %s %s",
1582
- $distinct_type,
1583
- $this->tableName,
1584
- $this->from_date,
1585
- $ss,
1586
- $this->whereis);
1587
  $results = $wpdb->get_var($qry);
1588
- //$itemstot = $wpdb->get_var($qry);
1589
- //return $itemstot;
1590
  break;
1591
  case "main-ip": //TODO
1592
  // These are the queries to count the hits/pages/spam by ip
1593
- $qry = sprintf("SELECT *, max(`timestamp`) as max_timestamp, min(`timestamp`) as min_timestamp, count(`ip`) as page_hits FROM %s WHERE `timestamp` >= %s %s %s GROUP BY ip ORDER BY max_timestamp DESC %s",
1594
  $this->tableName,
1595
- $this->from_date,
1596
- $ss,
1597
- $this->whereis,
1598
  $this->Limit);
1599
  $results = $wpdb->get_results($qry);
1600
  break;
1601
  case "count-ip": //TODO
1602
  // These are the queries to count the hits/pages/spam by ip
1603
- $qry = sprintf("SELECT COUNT(%s `ip`) AS itemstot FROM %s WHERE `timestamp` >= %s %s %s",
1604
- $distinct_type,
1605
- $this->tableName,
1606
- $this->from_date,
1607
- $ss,
1608
- $this->whereis);
1609
  $results = $wpdb->get_var($qry);
1610
  break;
1611
  } //end switch
1612
- if (!empty($results)) {
1613
- return $results;
1614
- } else {
1615
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
1616
  }
 
1617
  } //end function calc_tot
1618
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1619
  // $Ctype = chart's type by time
1620
  // $Res = resolution
1621
  // $Search = string to add to where clause
1622
- function TheChart($Ctype, $Res, $chart_height, $Search="", $axes_type, $chart_bg, $chart_loc="page", $chart_group="") {
1623
- global $wpdb, $wassup_options, $wdebug_mode;
1624
-
1625
- $mysqlversion=substr(mysql_get_server_info(),0,3);
1626
- $cache_table = (!empty($wassup_options->wassup_table)?$wassup_options->wassup_table."_meta":$wpdb->prefix."wassup_meta");
1627
- $this->searchString = $Search;
1628
- if (is_numeric($Ctype)) {
1629
- $this->Last = $Ctype;
1630
- } else {
1631
- $Ctype=1; /* default to 24-hour chart */
1632
- }
1633
  $chart_url="";
1634
- $chart_key=""; //for cache record key
1635
- $cache_id=0; //for cache record unique id
1636
-
1637
  //First check for cached chart
1638
- if (!empty($wassup_options->wassup_cache)) {
1639
- //create chart_id for cached charts
1640
- $chart_key = "$chart_loc{$Res}x{$chart_height}-{$axes_type}{$chart_group}{$Ctype}{$Search}".intval(date('i')/15).date('HdmY');
1641
- //TODO
1642
- $chart_cache = $wpdb->get_results("SELECT * from $cache_table WHERE `wassup_key`='$chart_key' && `meta_key`='chart'");
1643
- if (count($chart_cache)>0 && !empty($wassup_cache[0]->meta_value)) {
1644
- $chart_url = html_entity_decode($wassup_cache[0]->meta_value);
1645
- $cache_id = $wassup_cache[0]->meta_id;
1646
- if ($wdebug_mode) {
1647
- echo "\n<!-- Cached chart found. cache_id=$cache_id -->\n";
1648
- }
1649
- }
1650
  }
1651
-
1652
  //Second..create new chart
1653
  if (empty($chart_url)) {
1654
  //Add Search variable to WHERE clause
1655
  $ss="";
1656
- if (!empty($Search)) {
1657
- $ss = $this->buildSearch($Search);
1658
- }
1659
- $hour_todate = $this->to_date;
1660
-
1661
- //# MySql 'FROM_UNIXTIME' converts a UTC timestamp to a
1662
- //# datetime value localized to MySQL's session timezone.
1663
- //# Since `timestamp` was already localized before insert,
1664
- //# any datetime translation using MySQL's 'FROM_UNIXTIME'
1665
- //# must be converted to UTC/GMT afterwards to get an
1666
- //# accurate datetime value for Wordpress.
1667
- //Important Note: Since Wordpress v2.8.3, PHP timezone was
1668
- // modified within Wordpress in a manner that could cause
1669
- // a mismatch between PHP timezone and MySQL timezone
1670
- // when Wordpress is in a different timezone from it's
1671
- // host server. This change triggered charts timeline
1672
- // errors in Wassup 1.7.2.1.
1673
- // Since Wassup v1.8, a new argument 'tzoffset' was added
1674
- // to 'wassupOptions::getMySQLsetting()' that calculates
1675
- // MySQL's time offset by subtracting Mysql NOW() from
1676
- // Wordpress current_time(), removing the problematic
1677
- // timezone value from the equation.
1678
- $UTCoffset = $wassup_options->getMySQLsetting("tzoffset");
1679
  if (empty($UTCoffset)) $UTCoffset = "+0:00"; //GMT
1680
- //$WPoffset = (int)(get_option("gmt_offset")*60*60);
1681
- //$PHPoffset = (int)date('Z');
1682
- //
1683
- //#for US/Euro date display: USA Timezone=USA date format.
1684
- //TODO: Use date format in Wordpress to determine x-axis format
1685
- if (in_array(date('T'), array("ADT","AST","AKDT","AKST","CDT","CST","EDT","EST","HADT","HAST","MDT","MST","PDT","PST"))) {
1686
- $USAdate = true;
1687
- } else {
1688
- $USAdate = false;
1689
- }
1690
  $hour_fromdate = $this->from_date;
1691
  $point_label = array();
1692
  $x_divisor=1;
@@ -1695,8 +1645,36 @@ class WassupItems {
1695
  $x_groupformat = "%Y%m%d%H%i";
1696
  $wp_groupformat = 'YmdHi';
1697
  $cache_time=300; //5-minute cache
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1698
  // Options by chart type
1699
- switch ($Ctype) {
1700
  case ".05":
1701
  case ".1":
1702
  $cTitle = __("Last 1 Hour", "wassup");
@@ -1705,17 +1683,25 @@ class WassupItems {
1705
  $x_points = 12; //no. of x-axis points
1706
  $x_increment = 300; //5 minute increments
1707
  $x_divisor = $x_increment;
1708
- $cache_time=180; //3-minute cache
1709
  break;
1710
  case ".25":
1711
- case ".4":
1712
  $cTitle = __("Last 6 Hours", "wassup");
1713
  $x_axes_label = "%H:%i";
1714
  $wp_timeformat = 'H:i';
1715
- $x_points = 12; //number of x-axis points
1716
  $x_increment = 30*60; //30 minute increments
1717
  $x_divisor = $x_increment;
1718
- $cache_time=300; //5-minute cache
 
 
 
 
 
 
 
 
 
1719
  break;
1720
  case "7":
1721
  $cTitle = __("Last 7 Days", "wassup");
@@ -1742,8 +1728,13 @@ class WassupItems {
1742
  $x_axes_label = "%a %d %b";
1743
  $wp_timeformat = 'D d M';
1744
  }
1745
- $x_points = 14;
1746
- $x_increment = 24*60*60; //24-hour increments
 
 
 
 
 
1747
  break;
1748
  case "30":
1749
  $cTitle = __("Last Month", "wassup");
@@ -1777,15 +1768,17 @@ class WassupItems {
1777
  $cTitle = __("Last 6 Months", "wassup");
1778
  $x_groupformat = "%Y%m";
1779
  $wp_groupformat = 'Ym';
 
1780
  $x_axes_label = " %b %Y";
1781
- $x_points = 0; //6
1782
  break;
1783
  case "365":
1784
  $cTitle = __("Last Year", "wassup");
1785
  $x_groupformat = "%Y%m";
1786
  $wp_groupformat = 'Ym';
 
1787
  $x_axes_label = "%b %Y";
1788
- $x_points = 0; //12
1789
  break;
1790
  case "0":
1791
  $cTitle = __("All Time", "wassup");
@@ -1800,14 +1793,15 @@ class WassupItems {
1800
  $wp_groupformat = 'YmdH';
1801
  $x_axes_label = "%H:00";
1802
  $wp_timeformat = 'H:00';
1803
- $x_points = 24; //no. of x-axis points
1804
- $x_increment = 60*60; //1-hour increments
1805
  $x_divisor = $x_increment;
1806
  }
 
1807
 
1808
  //create Wordpress labels to replace the MySQL x-axis labels which could be incorrect due to PHP/MySQL timezone mismatch issues
1809
  if ($x_points >0 && $hour_fromdate >0) {
1810
- $points_end = current_time('timestamp')+60;
1811
  for ($i=0;$i<$x_points;$i++) {
1812
  $x_timestamp=((int)(($hour_fromdate+(($i+1)*$x_increment))/$x_divisor))*$x_divisor;
1813
  if ($x_timestamp < $points_end) {
@@ -1824,33 +1818,34 @@ class WassupItems {
1824
  echo " \$tgroup=".implode("|",$tgroup)."-->";
1825
  }
1826
  }
1827
- //if ($hour_fromdate == "") $hour_fromdate = strtotime("-24 hours", $hour_todate);
1828
-
1829
  if ($x_divisor > 1) {
1830
- $qry = sprintf("SELECT COUNT( DISTINCT `wassup_id` ) AS items, COUNT(`wassup_id`) AS pages, CAST(`timestamp`/$x_divisor AS UNSIGNED)*$x_divisor AS xgroup, DATE_FORMAT(CONVERT_TZ( FROM_UNIXTIME(CAST((`timestamp`+0)/$x_divisor AS UNSIGNED)*$x_divisor), '%s', '+0:00'), '%s') as thedate FROM %s WHERE `timestamp` > %s %s %s GROUP BY 3 ORDER BY `timestamp`",
1831
  $UTCoffset,
1832
  $x_axes_label,
1833
  $this->tableName,
1834
- $hour_fromdate,
1835
- $this->whereis,
1836
- $ss);
1837
  } else {
1838
- $qry = sprintf("SELECT COUNT( DISTINCT `wassup_id` ) AS items, COUNT(`wassup_id`) AS pages, DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(CAST(`timestamp` AS UNSIGNED)), '%s', '+0:00'), '%s') AS xgroup, DATE_FORMAT(CONVERT_TZ( FROM_UNIXTIME(CAST(`timestamp` AS UNSIGNED)), '%s', '+0:00'), '%s') as thedate FROM %s WHERE `timestamp` > %s %s %s GROUP BY 3 ORDER BY `timestamp`",
 
1839
  $UTCoffset,
1840
  $x_groupformat,
1841
  $UTCoffset,
1842
  $x_axes_label,
1843
  $this->tableName,
1844
- $hour_fromdate,
1845
- $this->whereis,
1846
- $ss);
 
 
 
 
1847
  }
1848
  if ($wdebug_mode) {
1849
- echo "\n<!-- \$query= $qry-->\n";
 
 
1850
  }
1851
- $qry_result = $wpdb->get_results($qry,ARRAY_A);
1852
  // Extract arrays for Visits, Pages and X_Axis_Label
1853
- $chart_points = count($qry_result);
1854
  if ($chart_points > 0) {
1855
  //MySQL results have sufficient data points
1856
  if ($chart_points >= $x_points-1 || empty($tlabel)) {
@@ -1870,20 +1865,17 @@ class WassupItems {
1870
  while ($i <= $x_points-1 && $bhits['xgroup'] > $tgroup[$i]) {
1871
  //add 0-points to data
1872
  $y_hits[] = 0;
1873
- $y_pages[] = 0;
1874
  $x_label[] = $tlabel[$i];
1875
  $i=$i+1;
1876
  }
1877
  $y_hits[] = $bhits['items'];
1878
- $y_pages[] = $bhits['pages'];
1879
  $x_label[] = $bhits['thedate'];
1880
  $x_group[] = $bhits['xgroup']; //debug
1881
  $i = $i+1;
1882
  }
1883
  }
1884
- //prune overcrowded x-axis labels //TODO
1885
- //if (count($x_label) > 20 && $chart_width < 1000) {
1886
- //}
1887
  if ($wdebug_mode) {
1888
  echo "\n<!-- \$x-group= ".implode("|",$x_group);
1889
  echo "\n \$x-labels= ".implode("|",$x_label)."-->\n";
@@ -1905,97 +1897,30 @@ class WassupItems {
1905
  } elseif ($lablcount == 31) {
1906
  $x_grid=6.45;
1907
  }
 
1908
  // generate url for google chart image
1909
- $chart_url ="http://chart.apis.google.com/chart?chf=".$chart_bg."&chtt=".urlencode($cTitle)."&chls=4,1,0|2,6,2&chco=1111dd,FF6D06&chm=B,1111dd30,0,0,0&chg={$x_grid},25,1,5&cht=lc&chs={$Res}x{$chart_height}&chd=".Gchart_data($y_hits, $y_pages, $x_label, $x_groupformat, "main", $axes_type, $chart_loc);
1910
- }
1911
- } //end if empty($chart_url)
1912
- if (!empty($chart_url)) {
1913
  //cache chart url in wassup_meta table for up to 5 minutes
1914
- if (!empty($chart_key) && $cache_id==0) {
1915
- $wassup_cache = array('meta_id'=>$cache_id,
1916
- 'wassup_key'=>$chart_key,
1917
- 'meta_key'=>'chart',
1918
- 'meta_value'=>esc_attr($chart_url),
1919
- 'meta_expire'=>time()+$cache_time);
1920
- if (method_exists($wpdb,'insert')) { //WP 2.5+
1921
- $result = $wpdb->insert($cache_table,$wassup_cache);
1922
- }
1923
- }
1924
- return $chart_url;
1925
- } else {
1926
- return false;
1927
- }
1928
  } //end theChart
1929
-
1930
- // buildSearch() added to protect against Sql injection code
1931
- // in user-input parameter: "Search". -Helene D. 2/27/09
1932
- function buildSearch($Search,$specific_where_clause=null) {
1933
- global $wpdb;
1934
- $ss="";
1935
- //create the Search portion of a MySql WHERE clause
1936
- if (!empty($Search)) {
1937
- //escape chars that have special meaning in mysql 'like' [%\]
1938
- if (function_exists('like_escape')) { //WP 2.5+ function
1939
- $searchString = like_escape(trim($Search));
1940
- } else {
1941
- $searchString = str_replace(array("%", "_"), array("\\%", "\\_"), trim($Search));
1942
- }
1943
- $searchParam = esc_sql($searchString);
1944
-
1945
- // Create the Search portion of MySQL WHERE clause
1946
- $ss = sprintf(" AND (`ip` LIKE '%%%s%%' OR `hostname` LIKE '%%%s%%' OR `urlrequested` LIKE '%%%s%%' OR `agent` LIKE '%%%s%%' OR `referrer` LIKE '%%%s%%' OR `username` LIKE '%s%%' OR `comment_author` LIKE '%s%%')",
1947
- $searchParam,
1948
- $searchParam,
1949
- $searchParam,
1950
- $searchParam,
1951
- $searchParam,
1952
- $searchParam,
1953
- $searchParam);
1954
- } //if $Search
1955
- if (!empty($specific_where_clause)) {
1956
- $ss .= " ".trim($specific_where_clause);
1957
- }
1958
- return $ss;
1959
- } //end function buildSearch
1960
-
1961
  } //end class WassupItems
1962
 
1963
- // Class to check if a previous comment with a specific IP was detected as SPAM by Akismet default plugin
1964
- class wassup_checkComment {
1965
- //var $tablePrefix; //not used
1966
-
1967
- function isSpammer ($authorIP) {
1968
- global $wpdb;
1969
- $spam_comment=0;
1970
- if (!empty($authorIP)) {
1971
- $spam_comment = $wpdb->get_var("SELECT COUNT(comment_ID) AS spam_comment FROM ".$wpdb->prefix."comments WHERE comment_author_IP='$authorIP' AND comment_approved='spam'");
1972
- }
1973
- return $spam_comment;
1974
- }
1975
- /**
1976
- * new in 1.8: check for referrer spam that is also comment spam
1977
- */
1978
- function isRefSpam($referrerURL) {
1979
- global $wpdb;
1980
- $spam_comment=0;
1981
- if (!empty($referrerURL)) {
1982
- $spam_comment = $wpdb->get_var("SELECT COUNT(comment_ID) AS spam_comment FROM ".$wpdb->prefix."comments WHERE comment_author_url='$referrerURL' AND comment_approved='spam'");
1983
- }
1984
- return $spam_comment;
1985
- }
1986
- } //end wassup_checkComment
1987
-
1988
  /**
1989
  * A class for wassup CURL operations.
1990
  * @since v1.8
1991
  */
1992
  class wcURL {
1993
  var $data = array();
1994
-
1995
  function doRequest($method, $url, $vars) {
1996
  if (function_exists('curl_init')) {
1997
- $wassup_settings=get_option('wassup_settings');
1998
- $wassup_agent = apply_filters('http_headers_useragent',"WassUp/".$wassup_settings['wassup_version']." - www.wpwp.org");
1999
  $ch = curl_init();
2000
  curl_setopt($ch, CURLOPT_URL, $url);
2001
  curl_setopt($ch, CURLOPT_HEADER, false); //data only
@@ -2014,42 +1939,24 @@ class wcURL {
2014
  curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
2015
  }
2016
  $data = curl_exec($ch);
2017
-
2018
  $this->data = curl_getinfo($ch);
2019
  $this->data['content'] = $data;
2020
  $this->data['error'] = curl_error($ch);
2021
  curl_close($ch);
2022
- if (($this->data['error'] == '') && ($this->data['http_code'] < 400)) {
2023
- return true;
2024
- } else {
2025
- return false;
2026
- }
2027
  } else {
2028
  return false;
2029
  }
2030
  } //end doRequest
2031
-
2032
- function get($url) {
2033
- return $this->doRequest('GET', $url, 'NULL');
2034
- }
2035
-
2036
- function post($url, $vars) {
2037
- // vars is urlencoded string of field/value pairs, eg:field1=value1&field2=value2
2038
- return $this->doRequest('POST', $url, $vars);
2039
- }
2040
-
2041
- function getInfo($field) {
2042
- if (isset($this->data[$field])) {
2043
- return $this->data[$field];
2044
- }
2045
- else {
2046
- return null;
2047
- }
2048
- }
2049
-
2050
- function getData() {
2051
- return $this->data['content'];
2052
  }
 
2053
  } //end class wcURL
2054
 
2055
  /**
@@ -2062,18 +1969,22 @@ class wcURL {
2062
  function wFetchAPIData($api_url) {
2063
  global $wdebug_mode;
2064
 
2065
- $wassup_settings=get_option('wassup_settings');
2066
- $wassup_agent = apply_filters('http_headers_useragent',"WassUp/".$wassup_settings['wassup_version']." - www.wpwp.org");
2067
-
2068
- $apidata="";
2069
- //try Wordpress WP 2.7+ function 'wp_remote_get' for api results
2070
- if (function_exists('wp_remote_get')) {
2071
- $opts = array('user-agent'=>"$wassup_agent");
2072
- $api_remote=wp_remote_get($api_url,$opts);
2073
- if (!empty($api_remote['body'])) {
2074
- $apidata = $api_remote['body'];
2075
- } elseif (!empty($api_remote['response'])) {
2076
- $apidata = "no data";
 
 
 
 
2077
  }
2078
  $api_method='wp_remote_get'; //debug
2079
  }
@@ -2105,24 +2016,7 @@ function wFetchAPIData($api_url) {
2105
  print_r($apidata);
2106
  echo "-->\n";
2107
  }
 
2108
  return $apidata;
2109
-
2110
- } //end function wFetchAPIData
2111
-
2112
- /**
2113
- * Convert simple JSON data into a PHP object (default) or associative
2114
- * array. Emulates 'json_decode' function from PHP 5.2+
2115
- * @author: Helene Duncker <http://techfromhel.com>
2116
- * @param string,boolean
2117
- * @return (array or object)
2118
- * Since Wassup v1.8 2010-09-13
2119
- */
2120
- function xjson_decode($json,$to_array=false) {
2121
- $x=false;
2122
- if (!empty($json) && strpos($json,'{"')!==false) {
2123
- $out = '$x='.str_replace(array('{','":','}'),array('array(','"=>',')'),$json);
2124
- eval($out.';');
2125
- if (!$to_array) $x = (object) $x;
2126
- }
2127
- return $x;
2128
- } //end function xjson_decode
1
  <?php
2
+ /**
3
+ * Classes and functions for displaying WassUp reports, stats, chart, and map
4
+ *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage main.php module
7
+ */
8
+ //no direct request for this plugin module
9
+ if(!defined('ABSPATH')|| empty($GLOBALS['wp_version'])|| (!empty($_SERVER['SCRIPT_FILENAME'])&& realpath(preg_replace('/\\\\/','/',__FILE__))===realpath($_SERVER['SCRIPT_FILENAME']))){
10
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
11
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
12
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
13
+ exit;
14
+ }
15
+ if(!class_exists('wassup_pagination')){
16
+ //Digg Style Paginator Class based on the work of Victor De La Rocha - http://www.mis-algoritmos.com
17
  class wassup_pagination{
18
+ var $total_pages;
19
+ var $limit;
20
+ var $target;
21
+ var $page;
22
+ var $adjacents;
23
+ var $showCounter;
24
+ var $className;
25
+ var $parameterName;
26
+ var $nextT;
27
+ var $nextI;
28
+ var $prevT;
29
+ var $prevI;
30
+ var $urlF;
31
+ var $calculate;
32
+ var $pagination;
33
+ //constructor
34
+ function wassup_pagination(){ //moved here for readability
35
+ $this->total_pages=null;
36
+ $this->limit=null;
37
+ $this->target="";
38
+ $this->page=1;
39
+ $this->adjacents=2;
40
+ $this->showCounter=false;
41
+ $this->className="pagination";
42
+ //New in v1.9: renamed parameter to "pp" because a similar "page" parameter is already used in Wordpress admin
43
+ $this->parameterName="pp";
44
+
45
+ /*Buttons next and previous*/
46
+ $this->nextT=__("Next","wassup");
47
+ $this->nextI="&#187;"; //&#9658;
48
+ $this->prevT=__("Previous","wassup");
49
+ $this->prevI="&#171;"; //&#9668;
50
+
51
+ $this->urlF=false;//urlFriendly
52
+ $this->calculate=false;
53
+ $this->pagination="";
54
+ }
55
+ function items($value){$this->total_pages=intval($value);}
56
+ function limit($value){$this->limit=intval($value);}
57
+ function target($value){$this->target=$value;}
58
+ function currentPage($value){$this->page=intval($value);}
59
+ function adjacents($value){$this->adjacents=intval($value);}
 
 
 
60
  function showCounter($value=""){$this->showCounter=($value===true)?true:false;}
61
+ //to change the class name of the pagination div
 
62
  function changeClass($value=""){$this->className=$value;}
 
63
  function nextLabel($value){$this->nextT = $value;}
64
  function nextIcon($value){$this->nextI = $value;}
65
  function prevLabel($value){$this->prevT = $value;}
66
  function prevIcon($value){$this->prevI = $value;}
67
+ //to change the class name of the pagination div
 
68
  function parameterName($value=""){$this->parameterName=$value;}
69
+ //to change urlFriendly
 
70
  function urlFriendly($value="%"){
71
+ //New in v1.9: PHP4 'eregi' deprecated, replaced with preg_match
72
+ if(preg_match('/^ *$/i',$value)>0){
73
+ $this->urlF=false;
74
+ return false;
 
75
  }
76
+ $this->urlF=$value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
  function show(){
79
+ if(!$this->calculate){
80
+ if($this->calculate()) echo "<div class=\"$this->className\">$this->pagination</div>";
81
+ }elseif(!empty($this->pagination)){
82
+ echo "<div class=\"$this->className\">$this->pagination</div>";
83
  }
84
+ }
85
  function get_pagenum_link($id){
86
+ if(strpos($this->target,'?')===false){
87
+ if($this->urlF) return str_replace($this->urlF,$id,$this->target);
88
+ else return "$this->target?$this->parameterName=$id";
89
+ }else{
90
+ return "$this->target&$this->parameterName=$id";
91
+ }
92
+ }
 
 
93
  function calculate(){
94
+ $this->pagination="";
95
+ //$this->calculate == true; //v1.9 bugfix
96
+ $error=false;
97
+ if($this->urlF && $this->urlF !='%' && strpos($this->target,$this->urlF)===false){
98
+ echo 'Especificaste un wildcard para sustituir, pero no existe en el target<br />';
99
+ $error=true;
100
+ }elseif($this->urlF && $this->urlF=='%' && strpos($this->target,$this->urlF)===false){
101
+ echo 'Es necesario especificar en el target el comodin';
102
+ $error=true;
103
+ }
104
+ if($this->total_pages==null){
105
+ echo sprintf(__("You must specify the %s","wassup"),' <strong>'.__("number of pages","wassup").'</strong> ($class->items(1000))<br />');
106
+ $error=true;
107
+ }
108
+ if($this->limit==null){
109
+ echo sprintf(__("You must specify the %s to show per page","wassup"),' <strong>'.__("limit of items","wassup").'</strong>').' ($class->limit(10))<br />';
110
+ $error=true;
111
+ }
112
+ if($error)return false;
113
+ $n=trim($this->nextT.' '.$this->nextI);
114
+ $p=trim($this->prevI.' '.$this->prevT);
115
+ if($this->page==0)$this->page=1;
116
+ $prev=$this->page-1;
117
+ $next=$this->page+1;
118
+ $lastpage=ceil($this->total_pages/$this->limit);
119
+ $lpm1=$lastpage-1;
120
+ if($lastpage>1){
121
+ if($this->page>1)$this->pagination .="<a href=\"".$this->get_pagenum_link($prev)."\">$p</a>";
122
+ else $this->pagination .="<span class=\"disabled\">$p</span>";
123
+ if($lastpage < 7+($this->adjacents*2)){
124
+ for($counter=1;$counter<=$lastpage;$counter++){
125
+ if($counter==$this->page)$this->pagination .="<span class=\"current\">$counter</span>";
126
+ else $this->pagination .="<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
127
  }
128
+ }elseif($lastpage > 5+($this->adjacents*2)){ //enough pages to hide some
129
+ if($this->page < 1+($this->adjacents*2)){
130
+ for($counter=1;$counter< 4+($this->adjacents*2);$counter++){
131
+ if($counter==$this->page)$this->pagination .="<span class=\"current\">$counter</span>";
132
+ else $this->pagination .="<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
133
+ }
134
+ $this->pagination .="...";
135
+ $this->pagination .="<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
136
+ $this->pagination .="<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
137
+ }elseif($lastpage - ($this->adjacents*2) > $this->page && $this->page >($this->adjacents*2)){
138
+ $this->pagination .="<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
139
+ $this->pagination .="<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
140
+ $this->pagination .="...";
141
+ for($counter=$this->page-$this->adjacents;$counter<=$this->page+$this->adjacents;$counter++)
142
+ if($counter==$this->page) $this->pagination .="<span class=\"current\">$counter</span>";
143
+ else $this->pagination .="<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
144
+ $this->pagination .="...";
145
+ $this->pagination .="<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
146
+ $this->pagination .="<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
147
+ }else{
148
+ $this->pagination .="<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
149
+ $this->pagination .="<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
150
+ $this->pagination .="...";
151
+ for($counter=$lastpage - (2+($this->adjacents*2));$counter<=$lastpage;$counter++)
152
+ if($counter==$this->page)$this->pagination .="<span class=\"current\">$counter</span>";
153
+ else $this->pagination .="<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
+ }
156
+ if($this->page< $counter-1)$this->pagination .="<a href=\"".$this->get_pagenum_link($next)."\">$n</a>";
157
+ else $this->pagination .="<span class=\"disabled\">$n</span>";
158
+ if($this->showCounter)$this->pagination .="<div class=\"pagination_data\">($this->total_pages ".__("Pages","wassup").")</div>";
159
  }
160
+ $this->calculate=true;
161
+ return true;
162
+ } //end calculate
163
+ } //end class wassup_pagination
164
+ } //end if !class_exists
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
+ if(!class_exists('wDetector')){
167
+ /**
168
+ * Tracking class for simple user agent detection
169
+ * -loosely based on Detector class by Mohammad Hafiz bin Ismail (info@mypapit.net)
170
+ * -New in v1.9: renamed to 'wDetector' for compatibility with other plugins, removed unused/unneeded methods, and updated detection to include newer versions of windows and IE.
171
+ */
172
+ class wDetector{
173
  var $browser;
174
  var $browser_version;
175
  var $os_version;
176
  var $os;
177
  var $useragent;
178
+ function wdetector($ip="",$ua=""){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  $this->useragent=$ua;
180
  $this->check_os($ua);
181
  $this->check_browser($ua);
182
  }
183
+ function check_os($useragent){
184
+ $os="";
185
+ $version="";
186
+ if(preg_match("/Windows NT 10\.0/",$useragent,$match)){$os="Win10";$version="";}
187
+ elseif(preg_match("/Windows NT 6\.3/",$useragent,$match)){$os="Win8";$version="";}
188
+ elseif(preg_match("/Windows NT 6\.2/",$useragent,$match)){$os="Win8";$version="";}
189
+ elseif(preg_match("/Windows NT 6\.1/",$useragent,$match)){$os="Win7";$version="";}
190
+ elseif(preg_match("/Windows NT 6\.0/",$useragent,$match)){$os="WinVista";$version="";}
191
+ elseif(preg_match("/Windows NT 5\.2/",$useragent,$match)){$os="Win2003";$version="";}
192
+ elseif(preg_match("/Windows NT 5\.1/",$useragent,$match)){$os="WinXP";$version="";}
193
+ elseif(preg_match("/(?:Windows NT 5\.0|Windows 2000)/",$useragent,$match)){$os="Win2000";$version="";}
194
+ elseif(preg_match("/(?:WinNT|Windows\s?NT)\s?([0-4\.]+)?/",$useragent,$match)){$os="WinNT";$version=$match[1];}
195
+ elseif(preg_match("/Windows ME/",$useragent,$match)){$os="WinME";$version="";}
196
+ elseif(preg_match("/Mac OS X/",$useragent,$match)){$os="MacOSX";$version="";}
197
+ elseif(preg_match("/(Mac_PowerPC|Macintosh)/",$useragent,$match)){$os="MacPPC";$version="";}
198
+ elseif(preg_match("/(?:Windows95|Windows 95|Win95|Win 95)/",$useragent,$match)){$os="Win95";$version="";}
199
+ elseif(preg_match("/(?:Windows98|Windows 98|Win98|Win 98|Win 9x)/",$useragent,$match)){$os="Win98";$version="";}
200
+ elseif(preg_match("/(?:WindowsCE|Windows CE|WinCE|Win CE)/",$useragent,$match)){$os="WinCE";$version="";}
201
+ elseif(preg_match("/PalmOS/",$useragent,$match)){$os="PalmOS";}
202
+ elseif(preg_match("/\(PDA(?:.*)\)(.*)Zaurus/",$useragent,$match)){$os="Sharp Zaurus";}
203
+ elseif(preg_match("/Linux\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)){$os="Linux";$version=$match[1];}
204
+ elseif(preg_match("/NetBSD\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)){$os="NetBSD";$version=$match[1];}
205
+ elseif(preg_match("/OpenBSD\s*([0-9\.]+)?/",$useragent,$match)){$os="OpenBSD";$version=$match[1];}
206
+ elseif(preg_match("/CYGWIN\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)){$os="CYGWIN";$version=$match[1];}
207
+ elseif(preg_match("/SunOS\s*([0-9\.]+)?/",$useragent,$match)){$os="SunOS";$version=$match[1];}
208
+ elseif(preg_match("/IRIX\s*([0-9\.]+)?/",$useragent,$match)){$os="SGI IRIX";$version=$match[1];}
209
+ elseif (preg_match("/FreeBSD\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2})?\s*(?:i[0-9]{3})?)?/",$useragent,$match)){$os="FreeBSD";$version=$match[1];}
210
+ elseif(preg_match("/SymbianOS\/([0-9\.]+)/i",$useragent,$match)){$os="SymbianOS";$version=$match[1];}
211
+ elseif (preg_match("/Symbian\/([0-9\.]+)/i",$useragent,$match)){$os="Symbian";$version=$match[1];}
212
+ elseif (preg_match("/PLAYSTATION\s([0-9]+)/",$useragent,$match)){$os="Playstation";$version=$match[1];}
213
+ $this->os=$os;
214
+ $this->os_version=$version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  }
216
+ function check_browser($useragent) {
217
+ $browser="";
218
+ $version="";
219
+ if(strstr($useragent,' Edge/12.0')!==false){
220
+ $browser="IE";$version="11";
221
+ }elseif(strstr($useragent,' Gecko/')==false && preg_match("#^Mozilla\/\d\.\d\s\(Windows\sNT\s\d\.\d;(?:\s[0-9A-Za-z./]+;)+\srv\:([0-9\.]+)\)#",$useragent,$match)){
222
+ $browser="IE";
223
+ }elseif(preg_match("/^Mozilla(?:.*)compatible;\sMSIE\s(?:.*)Opera\s([0-9\.]+)/",$useragent,$match)){
224
+ $browser = "Opera";
225
+ }elseif(preg_match("/^Opera\/([0-9\.]+)/",$useragent,$match)){
226
+ $browser = "Opera";
227
+ }elseif(preg_match("/^Mozilla(?:.*)compatible;\siCab\s([0-9\.]+)/",$useragent,$match)){
228
+ $browser = "iCab";
229
+ }elseif(preg_match("/^iCab\/([0-9\.]+)/",$useragent,$match)){
230
+ $browser = "iCab";
231
+ }elseif(preg_match("/^Mozilla(?:.*)compatible;\sMSIE\s([0-9\.]+)/",$useragent,$match)){
232
+ $browser = "IE";
233
+ }elseif(preg_match("/^(?:.*)compatible;\sMSIE\s([0-9\.]+)/",$useragent,$match)){
234
+ $browser = "IE";
235
+ }elseif(preg_match("/^Mozilla(?:.*)(?:.*)Chrome/",$useragent,$match)){
236
+ $browser = "Google Chrome";
237
+ }elseif(preg_match("/^Mozilla(?:.*)(?:.*)Safari\/([0-9\.]+)/",$useragent,$match)){
238
+ $browser = "Safari";
239
+ }elseif(preg_match("/^Mozilla(?:.*)\(Macintosh(?:.*)OmniWeb\/v([0-9\.]+)/",$useragent,$match)){
240
+ $browser = "Omniweb";
241
+ }elseif(preg_match("/^Mozilla(?:.*)\(compatible; Google Desktop/",$useragent,$match)){
242
+ $browser = "Google Desktop";
243
+ }elseif(preg_match("/^Mozilla(?:.*)\(compatible;\sOmniWeb\/([0-9\.v-]+)/",$useragent,$match)){
244
+ $browser = "Omniweb";
245
+ }elseif(preg_match("/^Mozilla(?:.*)Gecko(?:.*?)(?:Camino|Chimera)\/([0-9\.]+)/",$useragent,$match)){
246
+ $browser = "Camino";
247
+ }elseif(preg_match("/^Mozilla(?:.*)Gecko(?:.*?)Netscape\/([0-9\.]+)/",$useragent,$match)){
248
+ $browser = "Netscape";
249
+ }elseif(preg_match("/^Mozilla(?:.*)Gecko(?:.*?)(?:Fire(?:fox|bird)|Phoenix)\/([0-9\.]+)/",$useragent,$match)){
250
+ $browser = "Firefox";
251
+ }elseif(preg_match("/^Mozilla(?:.*)Gecko(?:.*?)Minefield\/([0-9\.]+)/",$useragent,$match)){
252
+ $browser = "Minefield";
253
+ }elseif(preg_match("/^Mozilla(?:.*)Gecko(?:.*?)Epiphany\/([0-9\.]+)/",$useragent,$match)){
254
+ $browser = "Epiphany";
255
+ }elseif(preg_match("/^Mozilla(?:.*)Galeon\/([0-9\.]+)\s(?:.*)Gecko/",$useragent,$match)){
256
+ $browser = "Galeon";
257
+ }elseif(preg_match("/^Mozilla(?:.*)Gecko(?:.*?)K-Meleon\/([0-9\.]+)/",$useragent,$match)){
258
+ $browser = "K-Meleon";
259
+ }elseif(preg_match("/^Mozilla(?:.*)rv:([0-9\.]+)\)\sGecko/",$useragent,$match)){
260
+ $browser = "Mozilla";
261
+ }elseif(preg_match("/^Mozilla(?:.*)compatible;\sKonqueror\/([0-9\.]+);/",$useragent,$match)){
262
+ $browser = "Konqueror";
263
+ }elseif(preg_match("/^Mozilla\/(?:[34]\.[0-9]+)(?:.*)AvantGo\s([0-9\.]+)/",$useragent,$match)){
264
+ $browser = "AvantGo";
265
+ }elseif(preg_match("/^Mozilla(?:.*)NetFront\/([34]\.[0-9]+)/",$useragent,$match)){
266
+ $browser = "NetFront";
267
+ }elseif(preg_match("/^Mozilla\/([34]\.[0-9]+)/",$useragent,$match)){
268
+ $browser = "Netscape";
269
+ }elseif(preg_match("/^Liferea\/([0-9\.]+)/",$useragent,$match)){
270
+ $browser = "Liferea";
271
+ }elseif(preg_match("/^curl\/([0-9\.]+)/",$useragent,$match)){
272
+ $browser = "curl";
273
+ }elseif(preg_match("/^links\/([0-9\.]+)/i",$useragent,$match)){
274
+ $browser = "Links";
275
+ }elseif(preg_match("/^links\s?\(([0-9\.]+)/i",$useragent,$match)){
276
+ $browser = "Links";
277
+ }elseif(preg_match("/^lynx\/([0-9a-z\.]+)/i",$useragent,$match)){
278
+ $browser = "Lynx";
279
+ }elseif(preg_match("/^Wget\/([0-9\.]+)/i",$useragent,$match)){
280
+ $browser = "Wget";
281
+ }elseif(preg_match("/^Xiino\/([0-9\.]+)/i",$useragent,$match)){
282
+ $browser = "Xiino";
283
+ }elseif(preg_match("/^W3C_Validator\/([0-9\.]+)/i",$useragent,$match)){
284
+ $browser = "W3C Validator";
285
+ }elseif(preg_match("/^Jigsaw(?:.*) W3C_CSS_Validator_(?:[A-Z]+)\/([0-9\.]+)/i",$useragent,$match)){
286
+ $browser = "W3C CSS Validator";
287
+ }elseif(preg_match("/^Dillo\/([0-9\.]+)/i",$useragent,$match)){
288
+ $browser = "Dillo";
289
+ }elseif(preg_match("/^amaya\/([0-9\.]+)/i",$useragent,$match)){
290
+ $browser = "Amaya";
291
+ }elseif(preg_match("/^DocZilla\/([0-9\.]+)/i",$useragent,$match)){
292
+ $browser = "DocZilla";
293
+ }elseif(preg_match("/^fetch\slibfetch\/([0-9\.]+)/i",$useragent,$match)){
294
+ $browser = "FreeBSD libfetch";
295
+ }elseif(preg_match("/^Nokia([0-9a-zA-Z\-.]+)\/([0-9\.]+)/i",$useragent,$match)){
296
+ $browser="Nokia";
297
+ }elseif(preg_match("/^SonyEricsson([0-9a-zA-Z\-.]+)\/([a-zA-Z0-9\.]+)/i",$useragent,$match)){
298
+ $browser="SonyEricsson";
299
+ }
300
+ if(empty($version) && preg_match("/^\d+(\.\d+)?/",$match[1],$pcs)>0){
301
+ $version=$pcs[0];
302
+ }
303
+ $this->browser=$browser;
304
+ $this->browser_version=$version;
305
+ } //end check_browser
306
+ } //end class wDetector
307
 
308
+ /**
309
+ * Tracking class to check for previous comment spam activity
310
+ * -checks for previous spammer comment from IP or referrer url
311
+ */
312
+ class wassup_checkComment{
313
+ /** check for previous comment spam */
314
+ function isSpammer($authorIP=""){
315
+ global $wpdb;
316
+ if(empty($authorIP))$authorIP=$_SERVER['REMOTE_ADDR'];
317
+ if(!empty($authorIP)){
318
+ $sql=sprintf("SELECT COUNT(comment_ID) AS spam_comment FROM {$wpdb->prefix}comments WHERE comment_author_IP='%s' AND comment_approved='spam'",$authorIP);
319
+ $spam_comment=$wpdb->get_var($sql);
320
+ }
321
+ if(!empty($spam_comment) && !is_wp_error($spam_comment)) return true;
322
+ else return false;
323
  }
324
+ /** check for referrer spam that is also comment spam - @since v1.8 */
325
+ function isRefSpam($referrerURL) {
326
+ global $wpdb;
327
+ if(!empty($referrerURL)){
328
+ $sql=sprintf("SELECT COUNT(comment_ID) AS spam_comment FROM {$wpdb->prefix}comments WHERE comment_author_url='%s' AND comment_approved='spam'",$referrerURL);
329
+ $spam_comment=$wpdb->get_var($sql);
330
+ }
331
+ if(!empty($spam_comment) && !is_wp_error($spam_comment)) return true;
332
+ else return false;
 
 
 
 
 
333
  }
334
+ } //end Class
335
+ } //end if !class_exists('wDetector')
336
 
 
 
 
337
  //Truncate $input string to a length of $max
338
  function stringShortener($input, $max=0, $separator="(...)", $exceedFromEnd=0){
339
  if(!$input || !is_string($input)){return false;};
340
+
341
  //Replace all %-hex chars with literals and trim the input string
342
  // of whitespaces ...because it's shorter and more legible.
343
  // -Helene D. 11/18/07
344
+ $instring = trim(stripslashes(rawurldecode(html_entity_decode(wassupURI::disarm_attack($input))))," +\t");
345
 
346
  $inputlen=strlen($instring);
347
  $max=(is_numeric($max))?(integer)$max:$inputlen;
348
+ if($max <$inputlen){
 
349
  $separator=($separator)?$separator:"(...)";
350
  $modulus=(($max%2));
351
  $halfMax=floor($max/2);
360
  if (strlen($outstring) >= $inputlen) { //Because "Fir(...)fox" is longer than "Firefox"
361
  $outstring = $instring;
362
  }
363
+ // use 'esc_attr' and 'esc_html' to make malicious
364
+ // code harmless when echoed to the screen
365
+ $outstring=esc_attr(esc_html($outstring,ENT_QUOTES));
 
366
  } else {
367
+ $outstring = esc_attr(esc_html($instring,ENT_QUOTES));
368
  }
369
  return $outstring;
370
  } //end function stringShortener
371
 
372
+ //functions 'url_rootcheck','wAddSiteurl' and 'wCleanUrl' moved and renamed as wassupURI methods, 'wassupURI::is_root_url', 'wassupURI::add_siteurl' and 'wassupURI::cleanURL' in 'wassup.class.php' module.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
 
375
+ /**
376
+ * Display a single wassup record as a "raw" list of fields
377
+ * @since v1.9
378
+ * @param array (of arguments)
379
+ * @return void
380
+ */
381
+ function wassup_rawdataView($args=array()){
382
+ global $wpdb,$wassup_options;
383
+
384
+ //get arguments
385
+ $rk=false;
386
+ if(is_array($args) && !empty($args['rk'])) extract($args);
387
+ elseif(is_object($args) && !empty($args->wassup_id)) $rk=$args;
388
+ if(!empty($rk) && is_object($rk) && !empty($rk->wassup_id)){
389
+ $logged_user="";
390
+ echo "\n";?>
391
+ <div class="wassup-raw">
392
+ <h2><?php _e("Raw data","wassup");?>:</h2>
393
+ <span class="raw"><?php echo __("Visitor type","wassup").': ';
394
+ if(!empty($rk->login_name)){
395
+ $logged_user=trim($rk->login_name,', ');
396
+ if(strpos($logged_user,',')!==false){
397
+ $loginnames=explode(',',$logged_user);
398
+ foreach($loginnames AS $name){
399
+ $logged_user=trim($name);
400
+ if(!empty($logged_user)){
401
+ break;
402
+ }
403
+ }
404
+ }
405
+ if(!empty($logged_user)) echo __("Logged-in user","wassup").' - '.esc_attr($logged_user);
406
+ }elseif($rk->malware_type=="3"){
407
+ _e("Spammer/Hacker","wassup");
408
+ }elseif($rk->malware_type !="0"){
409
+ _e("Spammer","wassup");
410
+ }elseif($rk->comment_author != ""){
411
+ echo __("Comment author","wassup").' - '.esc_attr($rk->comment_author);
412
+ }elseif($rk->feed != ""){
413
+ echo __("Feed","wassup").' - '.esc_attr($rk->feed);
414
+ }elseif($rk->spider != ""){
415
+ echo __("Spider","wassup").' - '.esc_attr($rk->spider);
416
+ }else{
417
+ _e("Regular visitor","wassup");
418
+ }?></span>
419
+ <ul class="raw">
420
+ <li><span class="field"><?php echo __("IP","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->ip);?></span></li>
421
+ <li><span class="field"><?php echo __("Hostname","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->hostname);?></span></li>
422
+ <li><span class="field"><?php echo __("Url Requested","wassup");?>:</span><span class="raw"><?php
423
+ $p_title="";
424
+ if($rk->urlrequested=='/' && empty($rk->url_wpid)){
425
+ echo $rk->urlrequested;
426
+ }else{
427
+ echo wassupURI::cleanURL($rk->urlrequested);
428
+ }?></span>
429
+ <li><span class="field"><?php _e("Post/page ID","wassup");?>:</span><span class="raw"><?php
430
+ echo $rk->url_wpid;
431
+ if(!empty($rk->url_wpid) && is_numeric($rk->url_wpid)){
432
+ $result=$wpdb->get_var(sprintf("SELECT `post_title` from {$wpdb->prefix}posts WHERE `ID`=%d",(int)$rk->url_wpid));
433
+ if(empty($result) || is_wp_error($result)) $p_title=" ** ". __("none or deleted post","wassup")." ** ";
434
+ else $p_title=$result;
435
+ if(!empty($p_title)) echo '</span><nobr> &nbsp; &nbsp; '.__("Post/page Title","wassup").': </nobr><span class="raw">'.esc_attr($p_title);
436
+ }?></span></li>
437
+ <li><span class="field"><?php echo __("Referrer","wassup");?>:</span><span class="raw"><?php echo wassupURI::cleanURL($rk->referrer);?></span></li><?php
438
+ if(!empty($rk->search) || !empty($rk->searchengine) || !empty($rk->searchpage)){
439
+ echo "\n";?>
440
+ <li><span class="field"><?php echo __("Search Engine","wassup");?></span>:<span class="raw"><?php echo esc_attr($rk->searchengine);?></span></li>
441
+ <li><span class="field"><?php echo __("Search","wassup");?></span>:<span class="raw"><?php echo esc_attr($rk->search);?></span></li>
442
+ <li><span class="field"><?php echo __("Page","wassup");?></span>:<span class="raw"><?php echo esc_attr($rk->searchpage);?></span></li><?php
443
+ }?>
444
+ <li><span class="field"><?php echo __("User Agent","wassup");?>:</span><span class="raw"><?php echo wassupURI::disarm_attack($rk->agent);?></span></li><?php
445
+ if($rk->browser != ""){
446
+ echo "\n";?>
447
+ <li><span class="field"><?php echo __("Browser","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->browser);?></span></li><?php
448
+ }?>
449
+ <li><span class="field"><?php echo __("OS","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->os);?></span></li>
450
+ <li><span class="field"><?php echo __("Locale/Language","wassup")?>:</span><span class="raw"><?php echo esc_attr($rk->language);?></span></li>
451
+ <li><span class="field"><?php echo __("Screen Resolution","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->screen_res);?></span></li><?php
452
+ if(trim($rk->login_name,', ')!=""){
453
+ echo "\n";?>
454
+ <li><span class="field"><?php echo __("Username","wassup");?>:</span><span class="raw"><?php echo esc_attr(trim($rk->login_name,', '));?></span></li><?php
455
+ }
456
+ if($rk->comment_author != ""){
457
+ echo "\n";?>
458
+ <li><span class="field"><?php echo __("Comment Author","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->comment_author);?></span></li><?php
459
+ }
460
+ if($rk->spider != ""){
461
+ echo "\n";
462
+ if($rk->feed != ""){
463
+ if($rk->feed == $rk->spider){?>
464
+ <li><span class="field"><?php echo __("Feed","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->feed);?></span></li><?php
465
+ }else{?>
466
+ <li><span class="field"><?php echo __("Feed","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->spider)." ".esc_attr($rk->feed);?></span></li><?php
467
+ }
468
+ }else{?>
469
+ <li><span class="field"><?php echo __("Spider","wassup");?>:</span><span class="raw"><?php echo esc_attr($rk->spider);?></span></li><?php
470
+ }
471
+ }?>
472
+ <li><span class="field"><?php echo __("Spam","wassup");?>:</span><span class="raw"><?php echo (int)$rk->malware_type.' &nbsp;';
473
+ if($rk->malware_type=="1") echo '('.__("comment spam","wassup").')';
474
+ elseif($rk->malware_type=="2") echo '('.__("referrer spam","wassup").')';
475
+ elseif($rk->malware_type=="3") echo '('.__("hack/malware attempt","wassup").')';
476
+ else echo '('.__("not spam","wassup").')';?></span></li>
477
+ <li><span class="field"><?php echo 'Wassup ID';?>:</span><span class="raw"><?php echo esc_attr($rk->wassup_id);?></span></li>
478
+ <li><span class="field"><?php
479
+ $rawtimestamp=0;
480
+ if(!empty($numurl) && $numurl > 1) echo __("End timestamp","wassup");
481
+ else _e("Timestamp","wassup");?>:</span><span class="raw"><?php
482
+ if(!empty($rk->max_timestamp)) $rawtimestamp=$rk->max_timestamp;
483
+ elseif(!empty($rk->timestamp)) $rawtimestamp=$rk->timestamp;
484
+ if(!empty($rawtimestamp)){
485
+ if($wassup_options->wassup_time_format == 24) $datetimeF=gmdate('Y-m-d H:i:s',$rawtimestamp);
486
+ else $datetimeF=gmdate('Y-m-d h:i:s a',$rawtimestamp);
487
+ echo $datetimeF.' ( '.(int)$rawtimestamp.' )';
488
+ }else{
489
+ echo __("unknown","wassup");
490
+ }?></span></li>
491
+ </ul><?php
492
+ if(!empty($numurl) && $numurl > 1){
493
+ echo '<span class="indent-raw raw">'.sprintf(__("%d URLs visited in session","wassup"),(int)$numurl).'</span><br/>';
494
+ }?>
495
+ </div><?php
496
+ } //end if rk
497
+ } //end wassup_rawdataView
498
 
499
  //Output wassup records in the old Digg spy style...
500
  function wassup_spiaView ($from_date="",$rows=0,$spytype="",$spy_datasource="") {
501
+ global $wpdb,$wp_version,$current_user,$wassup_options,$wdebug_mode;
502
+ if(!class_exists('wassupOptions')) wassup_init();
503
+ if(empty($wassup_options)) $wassup_options=new wassupOptions;
504
+ $wassup_table=$wassup_options->wassup_table;
505
+ if(!is_object($current_user) || empty($current_user->ID)) $user=wp_get_current_user();
506
+ $wassup_user_settings=get_user_option('_wassup_settings',$current_user->ID);
507
+ $show_avatars=get_option('show_avatars');
508
+ if(!empty($show_avatars)) $show_avatars=true;
509
+ else $show_avatars=false;
510
  //check for arguments...
511
+ $to_date=current_time("timestamp");
512
+ if(empty($from_date)) $from_date= (int)$to_date - 7;
513
+ if($rows == 0 || !is_numeric($rows)) $rows=15;
514
+ if(empty($spytype)){
515
+ if(!empty($wassup_user_settings['spy_filter'])) $spytype=$wassup_user_settings['spy_filter'];
516
+ elseif(!empty($wassup_options->wassup_default_spy_type)) $spytype=$wassup_options->wassup_default_spy_type;
517
+ else $spytype="everything";
 
 
 
 
 
 
 
 
 
 
 
 
518
  }
519
+ //temp table is default data source
520
+ if(empty($spy_datasource)) $spy_datasource=$wassup_table."_tmp";
521
+ //mysql clause where conditions
522
+ $multisite_whereis="";
523
+ if($wassup_options->network_activated_plugin()){
524
+ if(!is_network_admin() && !empty($GLOBALS['current_blog']->blog_id)) $multisite_whereis=sprintf(" AND `subsite_id`=%d",(int)$GLOBALS['current_blog']->blog_id);
525
  }
526
+ $whereis=$wassup_options->getFieldOptions("wassup_default_type","sql",$spytype).$multisite_whereis;
527
+ $wassup_dbtask=array();
528
+ $screen_res_size=670;
529
+ if(!empty($wassup_options->wassup_screen_res)) $screen_res_size= (int)$wassup_options->wassup_screen_res;
530
+ if($screen_res_size < 670) $screen_res_size=670;
531
+ $max_char_len=($screen_res_size)/10;
532
+ $spy_timestamp=$to_date;
533
+ $map="spiamap";
534
  //define google geoip record and create javascript marker icon
535
+ $geoip_rec=array('ip'=>"",'latitude'=>"",'longitude'=>"",'city'=>"",'country_code'=>"");
536
  $geo_markers=0;
537
+ if($spy_datasource == $wassup_table) $qryC = $wpdb->get_results(sprintf("SELECT `id`, `wassup_id`, `timestamp`, `ip`, `hostname`, `searchengine`, `urlrequested`, `agent`, `referrer`, `spider`, `feed`, `username`, `comment_author`, `language`, `spam` FROM %s WHERE `timestamp` >'%d' %s ORDER BY `timestamp` DESC LIMIT %d",$spy_datasource,$from_date,$whereis,$rows));
538
+ else $qryC = $wpdb->get_results(sprintf("SELECT `id`, `wassup_id`, `timestamp`, `ip`, `hostname`, `searchengine`, `urlrequested`, `agent`, `referrer`, `spider`, `feed`, `username`, `comment_author`, `language`, `spam` FROM %s WHERE `timestamp` >'%d' %s ORDER BY `timestamp` LIMIT %d",$spy_datasource,$from_date,$whereis,$rows));
539
+ if(!is_wp_error($qryC)){
540
+ if(!empty($qryC)){
541
+ $qrows=count($qryC);
542
+ $row_count=0;
543
+ $char_len=$max_char_len*.9;
544
  //display the rows...
545
+ foreach ($qryC as $cv){
546
+ $unclass="";
547
  $ulclass="users";
548
+ $visitor=__("Regular visitor","wassup");
549
+ $referrer=__('Direct hit','wassup');
550
  $requesturl="";
551
+ $map_icon="pinuser";
552
  if ($wassup_options->wassup_time_format == "12") {
553
+ $timef=gmdate('h:i:s A', $cv->timestamp);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  } else {
555
+ $timef=gmdate('H:i:s', $cv->timestamp);
556
+ }
557
+ $ip=wassup_clientIP($cv->ip);
558
+ if(empty($cv->searchengine))$referrer=wassupURI::referrer_link($cv->referrer,$cv->urlrequested,$char_len,$cv->spam);
559
+ else $referrer=wassupURI::se_link($cv->referrer,$char_len,$cv->spam);
560
+ $requesturl=wassupURI::url_link($cv->urlrequested,$char_len,$cv->spam);
561
+ if($cv->hostname !="" && $cv->hostname !="unknown") $hostname=$cv->hostname;
562
+ else $hostname=__("unknown");
563
+ if(!empty($cv->spam)){ //v1.9 bugfix (was rk)
564
+ $unclass="sum-box-spam";
 
565
  $ulclass="spider";
566
+ $map_icon="pinbot";
567
+ if($cv->spam == "1"){
568
+ //comment spam
569
+ $visitor = __("Spammer","wassup").": ".esc_attr($hostname);
570
+ }else{ //hack attempt
571
+ $visitor = __("Spam/Malware","wassup").": ".esc_attr($hostname);
572
  }
573
+ if($cv->spider != "") $map_icon="pinbot";
574
+ }elseif($cv->spider != ""){
575
+ if($cv->feed != "") $visitor=__("Feedreader","wassup").": ".esc_attr($cv->spider);
576
+ else $visitor=__("Spider","wassup").": ".esc_attr($cv->spider);
577
+ $unclass="sum-box-spider";
578
  $ulclass="spider";
579
+ $map_icon="pinbot";
580
+ }elseif($cv->username != ""){
581
  // User is logged in or is a comment's author
582
+ $unclass="sum-box-log";
583
  $ulclass="userslogged";
584
+ $visitor=__("Logged user","wassup").": ".esc_attr($cv->username);
585
+ $map_icon="pinlogged";
586
+ }elseif($cv->comment_author != ""){
587
+ $unclass="sum-box-aut";
588
  $ulclass="users";
589
+ $visitor= __("Comment author","wassup").": $cv->comment_author";
590
+ $map_icon="pinauthor";
591
  } //end if cv->spam
 
 
592
  // Start getting GEOIP info
593
  $location="";
594
  $lat = "";
595
  $lon = "";
596
  $flag = "";
597
+ $markerHtml="";
598
+ if($ip !=$geoip_rec['ip'] && preg_match('#^(127\.0\.0\.1|192\.168\.|10\.10\.|\:\:1)#',$ip)==0){
599
+ //geolocate a new visitor IP
600
+ $geoip_rec=wGeolocateIP($ip);
601
  echo "\n\t<!-- heartbeat -->";
602
  $lat = $geoip_rec['latitude'];
603
  $lon = $geoip_rec['longitude'];
604
  $location = wGetLocationname($geoip_rec);
605
+ } elseif ($ip == $geoip_rec['ip']) {
606
+ //previous visit from same IP, so reuse data
607
  $lat = $geoip_rec['latitude'];
608
  $lon = $geoip_rec['longitude'];
609
  $location = wGetLocationname($geoip_rec);
610
  }
611
+ if (!empty($geoip_rec['country_code'])){
612
+ $locale=strtolower($geoip_rec['country_code']);
613
+ if(!empty($geoip_rec['country'])) $flag_title=__("Country","wassup").': '.$geoip_rec['country'];
614
+ else $flag_title=__("Country","wassup").': '.$geoip_rec['country_code'];
615
+ if(file_exists(WASSUPDIR."/img/flags/".$locale.".png")) {
616
+ $flag='<img src="'.WASSUPURL.'/img/flags/'.$locale.'.png" title="'.$flag_title.'" />';
617
+ //update language/locale code when different from geoip country code (not us)
618
+ if(empty($cv->language) || ($cv->language =="us" && $locale!="us")){
619
+ $wassup_dbtask[]=sprintf("UPDATE LOW_PRIORITY `$wassup_table` SET `language`='%s' WHERE `wassup_id`='%s' AND `language`='%s'",$locale,$cv->wassup_id,$cv->language);
620
+ }
621
+ }
622
  }
623
+ if(empty($flag) && !empty($cv->language)&& file_exists(WASSUPDIR."/img/flags/".$cv->language.".png")){
624
+ $flag='<img src="'.WASSUPURL.'/img/flags/'.$cv->language.'.png" title="'.__("Language","wassup").': '.strtoupper($cv->language).'"/>';
625
+ }
626
+ // output Javascript to add marker to the map
627
+ $markerjs="";
628
+ $ipclick='<span class="sum-box-ip '.$unclass.'">'.$ip.'</span>';
629
+ if($wassup_user_settings['spy_map']==1 && !empty($lon)&& !empty($lat)){
630
+ if($cv->username !=""){
631
+ $udata=get_user_by("login",esc_attr($cv->username));
632
+ if(!empty($udata->ID)){
633
+ if($show_avatars) $visitor = __("Logged user","wassup").": ".get_avatar($udata->ID,'16')." ".esc_attr($cv->username);
634
+ else $visitor = __("Logged user","wassup").": ".esc_attr($cv->username);
635
+ }
636
  }
637
+ $markerHtml='<div><div class="bubble">'.$visitor.'<br />IP: '.$ip."<br />".__("Country:","wassup").' '.$flag.' '.$location."<br />".__("URL Request:","wassup")." $timef - $requesturl".'<br /></div></div>';
638
+ $markerjs=wAdd_GeoMarker('spiamap',$cv->id,$lat,$lon,$markerHtml,$map_icon,true);
639
+ //New in v1.9: clickable ip repositions and zooms map at ip marker
640
+ $ipclick='<a href="#spia_map" onclick="showMarkerinfo(spiamap,'.$lat.','.$lon.',marker'.(int)$cv->id.',minfo'.(int)$cv->id.');return false;"><span class="sum-box-ip '.$unclass.'">'.$ip.'</span></a>';
641
+ } //end if spy_map
642
+ echo "\n";?>
643
+ <div class="sum-spy">
644
+ <div class="sum-rec sum-nav-spy"><?php echo $markerjs;echo "\n";?>
645
+ <div class="sum-box"><?php echo $ipclick;?></div>
646
+ <div class="sum-det sum-det-spy">
647
+ <span class="det1"><?php echo $requesturl; ?></span>
648
+ <span class="det2"><strong><?php echo $timef; ?> - </strong> <?php print $referrer; ?></span>
649
+ <span class="det2"><?php echo "$flag $location\n";?></span>
 
650
  </div>
651
+ </div>
652
  </div><!-- /sum-spy --><?php
653
+ $row_count +=1;
654
+ $spy_timestamp=$cv->timestamp;
655
  } //end foreach
656
+ if($spy_datasource == $wassup_table) $spy_timestamp=$qryC[0]->timestamp;
657
+ $expire=time()+60; //1 minute expire
658
+ $saved=wassupDb::update_wassupmeta($current_user->user_login,"_spytimestamp",$spy_timestamp,$expire);
659
+ //note that update_user_option could not be used for spy timestamp tracking because user meta queries are cached, causing duplicates
660
+ if(count($wassup_dbtask)>0){
661
+ $args=array('dbtasks'=>$wassup_dbtask);
662
+ if(is_admin() || version_compare($wp_version,'2.8','<')){
663
+ wassupDb::scheduled_dbtask($args);
664
+ }else{
665
+ wp_schedule_single_event(time()+30,'wassup_scheduled_dbtasks',$args);
 
666
  }
667
+ }
668
+ }elseif(!empty($wdebug_mode) && $to_date - $from_date >90 && $to_date%23 == 0){
669
+ //display a "no activity" message occasionally in wdebug_mode as visual indicator that spia.js javascript is running
670
+ echo "\n"; ?>
671
+ <div class="sum-spy">
672
+ <div class="sum-rec sum-nav-spy" style="width:auto;padding:3px;">
673
+ <span class="det3"><?php
674
+ if ($wassup_options->wassup_time_format == "12") {
675
+ echo gmdate('h:i:s A', $to_date);
676
+ } else {
677
+ echo gmdate('H:i:s', $to_date);
678
+ }
679
+ echo ' - '.__("No visitor activity","wassup");?> &nbsp; &nbsp; :-( &nbsp; </span>
680
+ </div>
681
  </div><?php
682
+ echo "\n";
 
683
  } //end if !empty($qryC)
684
+ } //end if is_wp_error
685
  } //end function wassup_spiaView
686
 
687
  /**
688
+ * return javascript to add a marker to a google map
689
  * @since v1.8
690
  */
691
+ function wAdd_GeoMarker($map,$item_id,$lat,$lon,$markerHtml,$map_icon,$pan=true) {
692
+ $markerjs='<script type="text/javascript">var pos=new google.maps.LatLng('.$lat.','.$lon.');var marker'.$item_id.'=new google.maps.Marker({map:'.$map.',position:pos,icon:'.$map_icon.',animation:google.maps.Animation.DROP});var mcontent=\''.str_replace('\'','"',$markerHtml).'\';var minfo'.$item_id.'=new google.maps.InfoWindow({content:mcontent});';
693
+ $markerjs .='google.maps.event.addListener(marker'.$item_id.',"click",function(){minfo'.$item_id.'.open('.$map.',marker'.$item_id.')});'.$map.'.setZoom(3);';
694
+ if($pan)$markerjs .=$map.'.panTo(pos);';
695
+ $markerjs .='</script>';
696
+ return $markerjs;
697
+ } //end wAdd_GeoMarker
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
698
 
699
  //return a location name formatted for wassup_spiaView from array argument
700
  //@since v1.8
701
  function wGetLocationname($geoip_rec=array()) {
702
+ $country_code="";
703
+ if(!empty($geoip_rec['country_code']))$country_code=strtoupper($geoip_rec['country_code']);
704
  if (!empty($geoip_rec['country'])) {
705
+ $location = $geoip_rec['country'].' ('.$country_code.')';
706
+ if(!empty($geoip_rec['city'])){
707
+ $location.=' '.sprintf(__("City: %s","wassup"),$geoip_rec['city']);
708
+ if ($country_code == "US" && !empty($geoip_rec['region'])) $location .= ', '.$geoip_rec['region'];
709
+ elseif ($country_code == "US" && !empty($geoip_rec['region_code'])) $location .= ', '.$geoip_rec['region_code'];
710
+ }elseif ($country_code == "US" && !empty($geoip_rec['region'])) {
711
+ $location.=' '.sprintf(__("City: %s","wassup"),__("unknown","wassup")).', '.$geoip_rec['region'];
712
+ }else{
713
+ $location.=' '.sprintf(__("City: %s","wassup"),__("unknown","wassup"));
714
+ }
715
+ }elseif (!empty($geoip_rec['country_name'])) {
716
+ $location = $geoip_rec['country_name'].' ('.$country_code.')';
717
+ if(!empty($geoip_rec['city'])){
718
+ $location.=' '.sprintf(__("City: %s","wassup"),$geoip_rec['city']);
719
+ if ($country_code == "US" && !empty($geoip_rec['region'])) $location .= ', '.$geoip_rec['region'];
720
+ elseif ($country_code == "US" && !empty($geoip_rec['region_code'])) $location .= ', '.$geoip_rec['region_code'];
721
+ }elseif ($country_code == "US" && !empty($geoip_rec['region'])) {
722
+ $location.=' '.sprintf(__("City: %s","wassup"),__("unknown","wassup")).', '.$geoip_rec['region'];
723
+ }else{
724
+ $location.=' '.sprintf(__("City: %s","wassup"),__("unknown","wassup"));
725
  }
726
  } else {
727
+ $location = __("Country: unknown, City: unknown","wassup");
728
  }
729
+ return wptexturize($location);
730
  }
731
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  /**
733
+ * get geographic location and coordinates for an IP address and cache the data in 'wassup_meta' table.
 
734
  * Since version 1.8
735
+ * @param array (ip address or hostname)
736
  * @return array (ip, location, latitude, longitude, country)
737
  */
738
  function wGeolocateIP($ip) {
739
  global $wpdb, $wdebug_mode;
740
+ $geourl = "http://freegeoip.net/json/$ip";
741
+ //$geourl = "http://www.telize.com/geoip/$ip"; //API not public as of 11/15/15
 
 
 
742
  $geoip = array('ip'=>$ip,'latitude'=>"",'longitude'=>"",'city'=>"",'country_code'=>"");
743
+ if(!empty($ip) && $ip!= "127.0.0.1" && $ip!= "::1" && substr($ip,0,8)!= "192.168."){
744
+ $geodata=false;
745
+ $cached=false;
746
  //1st check for cached copy of geoip in wassup_meta
747
+ $geodata = wassupDb::get_wassupmeta($ip,'geoip');
748
+ if(!empty($geodata) && is_array($geodata)){
749
+ $geoip = $geodata;
750
+ $cached=true;
751
+ }else{
752
+ //keep checking
753
+ $geodata=false;
754
+ }
755
+ //2nd try PHP geoip extension function 'geoip_record_by_name'
756
+ if(empty($geodata) && function_exists('geoip_record_by_name')){
757
+ $geodata=geoip_record_by_name($ip);
758
+ if(is_array($geodata) && !empty($geodata['country_code'])) $geoip=$geodata;
759
+ //keep checking
760
+ if(!is_array($geodata) || empty($geodata['city'])) $geodata=false;
761
+ }
762
+ //3rd: remote lookups of geoip (web service api)
763
+ //..uses Wordpress 'wp_remote_get' or 'cURL' for geoip
764
+ if(empty($geodata)){
765
+ $geodata=wFetchAPIData($geourl);
766
+ if(!empty($geodata) && !is_wp_error($geodata)){
767
+ if(!is_array($geodata)) $geodata=json_decode($geodata,true);
768
+ if(is_array($geodata) && !empty($geodata['country_code'])) $geoip=$geodata;
769
+ else $geodata=false;
770
+ }else{
771
+ $geodata=false;
772
  }
 
 
 
 
 
 
 
 
773
  }
774
+ if(!empty($geodata['country_code'])){
 
775
  $geoip = $geodata;
776
+ $geoip['country_code']=strtolower($geodata['country_code']);
777
+ }
778
+ //cache geoip data (with city) for up to 3-days
779
+ if(!$cached){
780
+ if(!empty($geoip['country_code'])){
781
+ if(!empty($geoip['city'])) $expire = time() + 3*24*3600;
782
+ else $expire= time()+24*3600; //1 day cache
783
+ }else{
784
+ $expire= time()+30*60; //30 min cache
 
 
 
 
 
 
785
  }
786
+ $cache_id=wassupDb::save_wassupmeta($ip,'geoip',$geoip,$expire);
787
  } //end if !empty(geoip['city'])
788
  } //end if !empty(ip)
 
789
  return $geoip;
790
  } //end function wGeolocateIP
791
 
792
+ /**
793
+ * Return an associative array containing the top statistics results from MySql query
794
+ * parameters are: stat_type, limit, from-condition (mysql)
795
+ * return array keys('top_count','top_item','visit_timestamp",["top_group","top_link"])
796
+ * @author Helene D. 2009-03-04
797
+ * @param string, integer, string
798
+ * @return array
 
 
 
 
 
 
799
  */
800
+ function wGetStats($stat_type, $stat_limit=10, $stat_condition="",$return_sql=false) {
801
+ global $wpdb, $wassup_options, $wdebug_mode;
802
+ if(!class_exists('wassupOptions')){
803
+ wassup_init();
804
+ $wassup_options=new wassupOptions;
805
+ }elseif(empty($wassup_options)){
806
+ $wassup_options=new wassupOptions;
 
 
 
 
 
807
  }
808
+ if (!is_array($wassup_options->wassup_top10)) $top_ten = unserialize(html_entity_decode($wassup_options->wassup_top10));
809
+ else $top_ten=$wassup_options->wassup_top10;
810
+ $wpurl= strtolower(wassupURI::get_wphome());
811
+ $blogurl= strtolower(wassupURI::get_sitehome());
812
+ $wassup_table=$wassup_options->wassup_table;
813
+ if (empty($stat_limit) || !(is_numeric($stat_limit))) $stat_limit=10;
814
+ //set mysql where condition, if needed
815
  if (empty($stat_condition)) {
816
  $to_date = current_time('timestamp');
817
  $from_date = ((int)$to_date - 24*(60*60)); //24 hours
818
+ $stat_condition = " `timestamp` >='$from_date'";
 
 
 
 
 
 
819
  }
820
+ $sql="";
 
 
821
  //top search phrases...
822
+ if ($stat_type == "searches" || $stat_type=="search") {
823
+ $sql=sprintf("SELECT count(*) AS top_count, `search` AS top_item, max(`timestamp`) AS visit_timestamp, `referrer` AS top_link FROM $wassup_table WHERE %s AND `search`!='' AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition,$stat_limit);
824
 
825
+ //Top external referrers...
826
+ }elseif($stat_type=="referrers" || $stat_type=="referrer"){
827
  //exclude internal referrals
828
  $wurl = parse_url($blogurl);
829
  $sitedomain = $wurl['host'];
839
  }
840
  //create mysql conditional statement to exclude referrers
841
  $exclude_referrers = "";
842
+ $exclude_array = array_unique(explode(",", str_replace(', ',',',$exclude_list)));
843
+ $regex_domains="";
844
  foreach ($exclude_array as $exclude_domain) {
845
+ $www='www\\.';
846
+ if(preg_match('#^(www\d?\.)(.+)#i',$exclude_domain,$pcs)>0){
847
+ if(!empty($pcs[1]))$www=str_replace('.','\\.',$pcs[1]);
848
+ $exclude_domain=$pcs[2];
 
 
 
849
  }
850
+ //New in v1.9: wildcard(*) allowed in domain
851
+ if(empty($regex_domains)) $regex_domains=str_replace(array('.','*'),array('\\.','.*'),rtrim(trim($exclude_domain),'*,'));
852
+ else $regex_domains.="|".str_replace(array('.','*'),array('\\.','.*'),rtrim(trim($exclude_domain),'*,'));
853
+ } //end foreach
854
+ if(!empty($regex_domains)){
855
+ $exclude_referrers .=" AND TRIM(LEADING 'http://' FROM TRIM(LEADING 'https://' FROM `referrer`)) NOT RLIKE '^(".$www.")?(".$regex_domains.")' AND `referrer` NOT RLIKE '.*:(".$www.")?(".$regex_domains.")' AND `referrer` NOT RLIKE '.*="."https?://(".$www.")?(".$regex_domains.")'";
856
  }
857
+ //exclude the major search engines from referrers
858
+ $exclude_referrers .=" AND TRIM(LEADING 'http://' FROM TRIM(LEADING 'https://' FROM `referrer`)) NOT RLIKE '^(".$www.")?".'([0-9]|[a-z]|\\-|\\.|_)*\\.?(google'.'\\.'."com|yahoo".'\\.'."com|bing".'\\.'."com)'";
859
+ $sql=sprintf("SELECT count(*) AS top_count, TRIM(LEADING '//' FROM TRIM(LEADING 'http:' FROM TRIM(LEADING 'https:' FROM `referrer`))) AS top_item, max(`timestamp`) AS visit_timestamp, `referrer` AS top_link FROM $wassup_table WHERE %s AND `referrer`!='' AND `search`='' AND `spam`='0' %s GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d", $stat_condition, $exclude_referrers, $stat_limit);
 
860
 
861
  //top url requests...
862
+ } elseif ($stat_type == "urlrequested" || $stat_type=="requests"){
863
+ //New in v1.9: removed labels ('#xxxx') and query parameters except for '[?&]p=xx' from url for better url matching in MySQL
864
+ $stat_condition1=$stat_condition." AND `urlrequested` NOT LIKE '%?p=%' AND `urlrequested` NOT LIKE '%&p=%'";
865
+ $stat_condition2=$stat_condition." AND `urlrequested` LIKE '%?p=%' OR `urlrequested` LIKE '%&p=%'";
866
+ $sql=sprintf("SELECT count(*) AS top_count, LOWER(TRIM(TRAILING '/' FROM SUBSTRING_INDEX(SUBSTRING_INDEX(`urlrequested`, '/index.php', 1), '#', 1))) AS top_group, max(`timestamp`) AS visit_timestamp, LOWER(urlrequested) AS top_item, SUBSTRING_INDEX(`urlrequested`, '#', 1) AS top_link FROM $wassup_table WHERE %s AND `spam`='0' GROUP BY 2 UNION SELECT count(*) AS top_count, LOWER(TRIM(TRAILING '&' FROM SUBSTRING_INDEX(`urlrequested`, '#', 1))) AS top_group, max(`timestamp`) AS visit_timestamp, LOWER(urlrequested) AS top_item, SUBSTRING_INDEX(`urlrequested`, '#', 1) AS top_link FROM $wassup_table WHERE %s AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition1, $stat_condition2, $stat_limit);
867
  //top browser...
868
+ } elseif ($stat_type == "browser" || $stat_type=="browsers"){
869
+ $sql=sprintf("SELECT count(DISTINCT `wassup_id`) AS top_count, SUBSTRING_INDEX(SUBSTRING_INDEX(`browser`, ' 0.', 1), '.', 1) AS top_item, max(`timestamp`) AS visit_timestamp FROM $wassup_table WHERE %s AND `browser`!='' AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition, $stat_limit);
 
870
  //top os...
871
  } elseif ($stat_type == "os") {
872
+ $sql=sprintf("SELECT count(DISTINCT `wassup_id`) as top_count, `os` AS top_item, max(`timestamp`) AS visit_timestamp FROM $wassup_table WHERE %s AND `os`!='' AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition,$stat_limit);
 
873
  //top language/locale..
874
+ } elseif ($stat_type == "language" || $stat_type=="locale"){
875
+ $sql=sprintf("SELECT count(DISTINCT `wassup_id`) as top_count, LOWER(`language`) as top_item, max(`timestamp`) AS visit_timestamp FROM $wassup_table WHERE %s AND language!='' AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition, $stat_limit);
 
876
  //top visitors...
877
+ } elseif ($stat_type == "visitor" || $stat_type=="visitors"){
878
+ $sql=sprintf("SELECT count(DISTINCT `wassup_id`) as top_count, `username` as top_item, '1loggedin_user' as visitor_type, max(`timestamp`) as visit_timestamp FROM $wassup_table WHERE %s AND `username`!='' AND `spam`='0' GROUP BY 2 UNION SELECT count(DISTINCT `wassup_id`) as top_count, comment_author as top_item, '2comment_author' as visitor_type, max(`timestamp`) as visit_timestamp FROM $wassup_table WHERE %s AND `username`='' AND comment_author!='' AND `spam`='0' GROUP BY 2 UNION SELECT count(DISTINCT `wassup_id`) as top_count, `hostname` as top_item, '3hostname' as visitor_type, max(`timestamp`) as visit_timestamp FROM $wassup_table WHERE %s AND `username`='' AND comment_author='' AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3, 2 LIMIT %d",$stat_condition,$stat_condition,$stat_condition,$stat_limit);
 
879
  //top postid (post|page)
880
+ } elseif ($stat_type == "postid" || $stat_type == "article" || $stat_type=="articles" || $stat_type=="url_wpid") {
881
+ $exclude_frontpage="";
882
+ if(!empty($top_ten['top_nofrontpage'])){
883
+ $front_pageid=0;
884
+ $show_on_front=get_option('show_on_front');
885
+ if($show_on_front=="page") $front_pageid=get_option('page_on_front');
886
+ if(!empty($front_pageid) && is_numeric($front_pageid)) $exclude_frontpage=sprintf("AND `url_wpid`!='%d'",$front_pageid);
887
+ }
888
+ $sql=sprintf("SELECT count(*) AS top_count, `url_wpid` AS top_group, max(`timestamp`) as visit_timestamp, `post_title` AS top_item, SUBSTRING_INDEX(`urlrequested`, '#', 1) AS top_link FROM $wassup_table, {$wpdb->prefix}posts WHERE %s AND `spam`='0' AND `url_wpid`!='' AND `url_wpid`>'0' %s AND `url_wpid`={$wpdb->prefix}posts.ID GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition,$exclude_frontpage,$stat_limit);
889
+ //New in v1.9: stats on any column that exists in wassup table
890
+ }elseif(!empty($stat_type)){
891
+ $col=$wpdb->get_row(sprintf("SHOW COLUMNS FROM %s LIKE '%s'",$wtable_name,wassupDb::esc_like(esc_attr($stat_type))));
892
+ if(!is_wp_error($col) && !empty($col)){
893
+ $sql=sprintf("SELECT count(DISTINCT `wassup_id`) AS top_count, `$stat_type` AS top_item, max(`timestamp`) as visit_timestamp FROM $wassup_table WHERE %s AND `$stat_type`!='' AND `spam`='0' GROUP BY 2 ORDER BY 1 DESC, 3 DESC LIMIT %d",$stat_condition,$stat_limit);
894
+ }else{
895
+ $error_msg=" column does not exist in table ".$stat_type;
896
+ }
897
+ }else{
898
+ $error_msg=" missing table column name ";
899
+ }
900
+ if(!empty($sql)){
901
+ if(!empty($return_sql)){
902
+ return $sql;
903
+ }else{
904
+ $top_stats=$wpdb->get_results($sql);
905
+ if(is_wp_error($top_stats)){
906
+ $error_msg=" error# ".$top_stats->get_error_code().": ".$top_stats->get_error_message()."\nSQL=".$sql."\n";
907
+ }elseif(!empty($top_stats[0]->top_count)){
908
+ if($wdebug_mode){
909
+ echo "\n<!-- top $stat_type query=$sql";
910
+ echo "\n -->";
911
+ }
912
+ return $top_stats;
913
+ }else{
914
+ $error_msg=" invalid data from query SQL=".$sql;
915
+ }
916
  }
917
  }
918
+ if(!empty($error_msg)){
919
+ if($wdebug_mode)echo "\n<!-- ".__FUNCTION__." ERROR: ".$error_msg." -->";
 
 
 
920
  }
921
+ return false;
922
  } //end function wGetStats
923
 
924
  /**
927
  * @param string(4)
928
  * @return none
929
  */
930
+ function wassup_top10view ($from_date="",$to_date="",$res="",$top_limit=0,$title=false) {
931
+ global $wpdb,$wp_version,$wassup_options,$wdebug_mode;
932
+ if(!class_exists('wassupOptions')){
933
+ wassup_init();
934
+ $wassup_options=new wassupOptions;
935
+ }elseif(empty($wassup_options)){
936
+ $wassup_options=new wassupOptions;
937
+ }else{
938
+ $wassup_options->loadSettings();
939
  }
940
+ $wassup_table=$wassup_options->wassup_table;
941
+ if(!is_array($wassup_options->wassup_top10)) $top_ten=maybe_unserialize(html_entity_decode($wassup_options->wassup_top10));
942
+ else $top_ten=$wassup_options->wassup_top10;
943
+ if(empty($top_ten) || !is_array($top_ten))$top_ten=$wassup_options->defaultSettings("top10");
944
+ $wassup_table=$wassup_options->wassup_table;
945
+ $blogurl = wassupURI::get_sitehome();
 
946
  $url = parse_url($blogurl);
947
  $sitedomain = preg_replace('/^www\./i','',$url['host']);
948
 
953
  @set_time_limit(2*60); // ...to 2 minutes
954
  }
955
  }
956
+ $col_count=array_sum($top_ten);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
957
  //extend page width to make room for more than 5 columns
958
+ if(empty($res))$res=$wassup_options->wassup_screen_res;
959
+ if($res < 640 && $col_count >3)$res=640;
960
+ $char_len=(int)($res/$col_count);
961
+ $min_width=(($char_len < 90)?90:$char_len);
962
+ //Since v1.8.3: top_limit in top10 array
963
  if (empty($top_limit) || !is_numeric($top_limit)) {
964
+ if (!empty($top_ten['toplimit'])) $top_limit = (int) $top_ten['toplimit'];
965
+ else $top_limit = 10; //default
 
 
 
966
  }
967
+ //build mysql conditional query...
968
+ $multisite_condition="";
969
+ //for multisite/network activation
970
+ if($wassup_options->network_activated_plugin()){
971
+ if(!is_network_admin() && !empty($GLOBALS['current_blog']->blog_id)) $multisite_condition = sprintf(" AND `subsite_id`=%d",(int)$GLOBALS['current_blog']->blog_id);
972
+ }
973
+ if(empty($from_date))$from_date=$wpdb->get_var(sprintf("SELECT MIN(`timestamp`) FROM %s WHERE `timestamp`>0 %s",$wassup_table,$multisite_condition));
974
+ if(empty($to_date))$to_date=current_time("timestamp");
975
+ $top_condition = "`timestamp` BETWEEN '".$from_date."' AND '".$to_date."'";
976
+ if (!empty($top_ten['top_nospider'])) $top_condition .= " AND spider=''";
977
+ $top_condition .= $multisite_condition;
978
+ //top stats header
979
+ $table_class="";
980
+ if(!empty($_GET['popup'])){
981
+ $table_class=' class="popup"';
982
+ $wdformat=get_option("date_format");
983
+ if(($to_date-$from_date)>24*60*60)$stats_range=gmdate("$wdformat",$from_date)." - ".gmdate("$wdformat",$to_date);
984
+ else $stats_range=gmdate("$wdformat H:00",$from_date)." - ".gmdate("$wdformat H:00",$to_date);
985
+ $statsheader='<span class="stats-print-btn"><a href="#" class="button" onclick="printstat();return false;">'.__("Print","wassup").'</a></span>'."\n";
986
+ $statsheader.='<h4>'.get_option("blogname").'</h4>'."\n";
987
+ $statsheader.='<span>'.sprintf(__('Top Stats for Period: %s','wassup'),$stats_range).'</span>';
988
  }
989
  echo "\n"; ?>
990
+ <div id="wassup-topstats">
991
+ <table<?php echo $table_class;?>><?php
992
+ if(!empty($statsheader)){
993
+ echo "\n";?>
994
+ <caption>
995
+ <?php echo $statsheader;?>
996
+ </caption><?php
997
+ }elseif(!empty($title)){
998
+ echo "\n";?>
999
+ <caption>
1000
+ <?php echo esc_attr($title);?>
1001
+ </caption><?php
1002
  }
1003
+ echo "\n";?>
1004
+ <tbody>
1005
+ <tr><?php
1006
+ $cwidth=0;
1007
+ $cols=0;
1008
  //show a line# column for long data columns
1009
  if ($top_limit > 10) wPrintRowNums($top_limit);
1010
 
1011
  //#output top 10 searches
1012
  if ($top_ten['topsearch'] == 1) {
1013
  $top_results = wGetStats("searches",$top_limit,$top_condition);
1014
+ ?>
1015
+ <td<?php if($cols==0)echo ' class="firstcol"'; if(!empty($top_results) && count($top_results) >0){$cwidth=2*$min_width; echo ' style="min-width:'.$cwidth.'px"';}?>>
1016
  <ul class="charts">
1017
+ <li class="chartsT"><?php echo _e("TOP QUERY", "wassup");?></li> <?php
1018
  $i=0;
1019
  $ndigits=1;
1020
+ if (!empty($top_results) && count($top_results) >0) {
1021
  $ndigits = strlen("{$top_results[0]->top_count}");
1022
  foreach ($top_results as $top10) {
1023
  echo "\n"; ?>
1024
+ <li class="wassup-nowrap"><nobr><?php
1025
+ if ($top10->top_item=="_notprovided_")$top_string='('.__("not provided","wassup").')';
1026
+ else $top_string=stringShortener(preg_replace('/'.preg_quote($blogurl,'/').'/i','',$top10->top_item),$char_len);
1027
+ echo wPadNum($top10->top_count,$ndigits).' <a href="'.$top10->top_link.'" target="_BLANK" title="'.substr($top10->top_item,0,$wassup_options->wassup_screen_res-100).'">'.$top_string.'</a>';?></nobr></li><?php
1028
+ $i++;
1029
  }
1030
  }
1031
  //finish list with empty <li> for style consistency
1032
+ wListFiller($i,$top_limit,""); ?>
1033
  </ul>
1034
+ </td> <?php
1035
+ $cols+=1;
1036
  } // end if topsearch
1037
 
1038
+ //#output top 10 referrers (not spam)
1039
+ $top_results=array();
1040
+ $cwidth=0;
1041
  if ($top_ten['topreferrer'] == 1) {
1042
  //to prevent browser timeouts, send <!--heartbeat--> output
1043
  echo "\n<!--heartbeat-->";
1044
  $top_results = wGetStats("referrers",$top_limit,$top_condition);
1045
+ ?>
1046
+ <td<?php if($cols==0)echo ' class="firstcol"'; if(!empty($top_results) && count($top_results) >0){$cwidth=(int)(2.5*$min_width); echo ' style="min-width:'.$cwidth.'px"';}?>>
1047
  <ul class="charts">
1048
  <li class="chartsT"><?php _e("TOP REFERRER", "wassup"); ?></li><?php
1049
  $i=0;
1050
  $ndigits=1;
1051
+ if (!empty($top_results) && count($top_results) >0) {
1052
  $ndigits = strlen("{$top_results[0]->top_count}");
1053
  foreach ($top_results as $top10) {
1054
  echo "\n"; ?>
1055
+ <li class="wassup-nowrap"><?php echo wPadNum($top10->top_count,$ndigits);
1056
+ echo ' <a href="'.wassupURI::cleanURL($top10->top_link).'" title="'.wassupURI::cleanURL($top10->top_link).'" target="_BLANK">';
1057
+ echo preg_replace('#^https?\://(?:www\d?\.)?#i','',wassupURI::cleanURL($top10->top_item));
1058
+ echo '</a>';?></li><?php
 
 
 
 
 
1059
  $i++;
1060
  }
1061
  }
1062
+ wListFiller($i,$top_limit,""); ?>
1063
+ </ul>
1064
+ </td> <?php
1065
+ $cols+=1;
1066
  } //end if topreferrer
1067
 
1068
  //#output top 10 url requests
1069
+ $cwidth=0;
1070
+ $top_results=array();
1071
+ if($top_ten['toprequest']==1){
1072
+ echo "\n<!--heartbeat-->\n";
1073
+ $top_results=wGetStats("urlrequested",$top_limit,$top_condition);
1074
+ ?>
1075
+ <td<?php if($cols==0)echo ' class="firstcol"'; if(!empty($top_results) && count($top_results) >0){$cwidth=(int)(2.5*$min_width); echo ' style="min-width:'.$cwidth.'px"';}?>>
1076
  <ul class="charts">
1077
  <li class="chartsT"><?php _e("TOP REQUEST", "wassup"); ?></li><?php
1078
  $i=0;
1079
  $ndigits=1;
1080
+ if (!empty($top_results) && count($top_results) >0) {
1081
  $ndigits = strlen("{$top_results[0]->top_count}");
1082
  foreach ($top_results as $top10) {
1083
  echo "\n"; ?>
1084
+ <li class="wassup-nowrap"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1085
+ if (strstr($top10->top_item,'[')) { //no link for 404 pages
1086
+ echo ' <span class="top10" title="'.substr($top10->top_item,0,$wassup_options->wassup_screen_res-100).'">'.preg_replace('/'.preg_quote($blogurl,'/').'/i', '', $top10->top_item).'</span>';
1087
  } else {
1088
+ echo ' <a href="'.wassupURI::add_siteurl($top10->top_link).'" target="_BLANK" title="'.substr($top10->top_item,0,$wassup_options->wassup_screen_res-100).'">'.preg_replace('/'.preg_quote($blogurl,'/').'/i', '', $top10->top_item).'</a>';
1089
  } ?></nobr></li><?php
1090
  $i++;
1091
  }
1092
  }
1093
+ wListFiller($i,$top_limit,""); ?>
 
1094
  </ul>
1095
+ </td><?php
1096
+ $cols+=1;
1097
  } //end if toprequest
1098
 
1099
  //#get top 10 browsers...
1100
+ $cwidth=0;
1101
+ $top_results=array();
1102
+ if($top_ten['topbrowser']==1){
1103
+ echo "\n<!--heartbeat-->\n";
1104
+ $top_results=wGetStats("browser",$top_limit,$top_condition);
1105
+ ?>
1106
+ <td<?php if($cols==0)echo ' class="firstcol"';elseif($cols==$col_count-1) echo 'class="lastcol"';if(!empty($top_results) && count($top_results) >0){$cwidth=$min_width+5; echo ' style="min-width:'.$cwidth.'px"';}?>>
1107
  <ul class="charts">
1108
  <li class="chartsT"><?php _e("TOP BROWSER", "wassup") ?></li><?php
1109
  $i=0;
1110
  $ndigits=1;
1111
+ if (!empty($top_results) && count($top_results) >0) {
1112
  $ndigits = strlen("{$top_results[0]->top_count}");
1113
  foreach ($top_results as $top10) {
1114
  echo "\n"; ?>
1115
+ <li class="wassup-nowrap"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1116
  echo ' <span class="top10" title="'.$top10->top_item.'">'.stringShortener($top10->top_item, $char_len).'</span>'; ?></nobr></li><?php
1117
  $i++;
1118
  }
1119
  }
1120
+ wListFiller($i,$top_limit,""); ?>
 
1121
  </ul>
1122
+ </td><?php
1123
+ $cols+=1;
1124
+ } //end if topbrowser
1125
 
1126
  //#output top 10 operating systems...
1127
+ $cwidth=0;
1128
+ $top_results=array();
1129
+ if($top_ten['topos']==1){
1130
+ echo "\n<!--heartbeat-->\n";
1131
+ $top_results=wGetStats("os",$top_limit,$top_condition);
1132
+ ?>
1133
+ <td<?php if($cols==0)echo ' class="firstcol"';elseif($cols==$col_count-1) echo 'class="lastcol"';if(!empty($top_results) && count($top_results) >0){$cwidth=$min_width+5; echo ' style="min-width:'.$cwidth.'px"';}?>>
1134
  <ul class="charts">
1135
  <li class="chartsT"><?php _e("TOP OS", "wassup") ?></li><?php
1136
  $i=0;
1137
  $ndigits=1;
1138
+ if (!empty($top_results) && count($top_results) >0) {
1139
  $ndigits = strlen("{$top_results[0]->top_count}");
1140
  foreach ($top_results as $top10) {
1141
  echo "\n"; ?>
1142
+ <li class="wassup-nowrap"><nobr><?php echo wPadNum($top10->top_count,$ndigits); ?> <span class="top10" title="<?php echo $top10->top_item; ?>"><?php echo stringShortener($top10->top_item, $char_len); ?></span></nobr></li><?php
1143
  $i++;
1144
  }
1145
  }
1146
+ wListFiller($i,$top_limit,""); ?>
 
1147
  </ul>
1148
+ </td><?php
1149
+ $cols+=1;
1150
  } // end if topos
1151
+
1152
  //#output top 10 locales/geographic regions...
1153
+ $cwidth=0;
1154
+ $top_results=array();
1155
+ if($top_ten['toplocale']==1){
1156
+ echo "\n<!--heartbeat-->\n";
1157
+ $top_results=wGetStats("language",$top_limit,$top_condition);
1158
+ ?>
1159
+ <td<?php if($cols==0)echo ' class="firstcol"';elseif($cols==$col_count-1) echo 'class="lastcol"';if(!empty($top_results) && count($top_results) >0){$cwidth=$min_width+5; echo ' style="min-width:'.$cwidth.'px"';}?>>
1160
  <ul class="charts">
1161
  <li class="chartsT"><?php _e("TOP LOCALE", "wassup"); ?></li><?php
1162
  $i=0;
1163
  $ndigits=1;
1164
+ if(count($top_results)>0){
1165
+ $ndigits=strlen("{$top_results[0]->top_count}");
1166
+ foreach($top_results as $top10){
1167
+ echo "\n";?>
1168
+ <li class="wassup-nowrap"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1169
+ echo ' <img src="'.WASSUPURL.'/img/flags/'.strtolower($top10->top_item).'.png" alt="" />';?>
1170
+ <span class="top10" title="<?php echo $top10->top_item;?>"><?php echo $top10->top_item;?></span></nobr></li><?php
1171
  $i++;
1172
  }
1173
  }
1174
+ wListFiller($i,$top_limit,""); ?>
 
1175
  </ul>
1176
+ </td><?php
1177
+ $cols+=1;
1178
+ }// end if toplocale
1179
 
1180
  //#output top visitors
1181
+ $cwidth=0;
1182
+ $top_results=array();
1183
+ if($top_ten['topvisitor']==1){
1184
+ echo "\n<!--heartbeat-->\n";
1185
+ $top_results=wGetStats("visitor",$top_limit,$top_condition);
1186
+ ?>
1187
+ <td<?php if($cols==0)echo ' class="firstcol"';elseif($cols==$col_count-1) echo 'class="lastcol"';if(!empty($top_results) && count($top_results) >0){ $cwidth= (int)(1.5*$min_width); echo ' style="min-width:'.$cwidth.'px"';}?>>
1188
  <ul class="charts">
1189
  <li class="chartsT"><?php _e("TOP VISITOR", "wassup"); ?></li><?php
1190
  $i=0;
1191
  $ndigits=1;
1192
+ if (!empty($top_results) && count($top_results)>0) {
1193
  $ndigits = strlen("{$top_results[0]->top_count}");
1194
  foreach ($top_results as $top10) {
1195
  if ($top10->visitor_type == "1loggedin_user")
1199
  else
1200
  $uclass="";
1201
  echo "\n"; ?>
1202
+ <li class="wassup-nowrap"><nobr><?php echo wPadNum($top10->top_count,$ndigits).' <span class="top10'.$uclass.'" title="'.$top10->top_item.'">'.stringShortener($top10->top_item, $char_len).'</span>'; ?></nobr></li><?php
1203
  $i++;
1204
  } //end loop
1205
  }
1206
+ wListFiller($i,$top_limit,""); ?>
 
1207
  </ul>
1208
+ </td><?php
1209
+ $cols+=1;
1210
+ } // end if topvisitor
1211
 
1212
  //#output top article (post|page by id)
1213
+ $cwidth=0;
1214
+ $top_results=array();
1215
+ if($top_ten['toppostid']==1){
1216
+ echo "\n<!--heartbeat-->\n";
1217
+ $top_results=wGetStats("postid",$top_limit,$top_condition);
1218
+ ?>
1219
+ <td<?php if($cols==0)echo ' class="firstcol"';elseif($cols==$col_count-1) echo 'class="lastcol"';if(!empty($top_results) && count($top_results) >0){ $cwidth=2*$min_width; echo ' style="min-width:'.$cwidth.'px"';}?>>
1220
  <ul class="charts">
1221
  <li class="chartsT"><?php _e("TOP ARTICLE", "wassup"); ?></li><?php
1222
  $i=0;
1223
  $ndigits=1;
1224
+ if (!empty($top_results) && count($top_results) >0) {
1225
  $ndigits = strlen("{$top_results[0]->top_count}");
1226
  foreach ($top_results as $top10) {
1227
  echo "\n"; ?>
1228
+ <li class="wassup-nowrap"><nobr><?php echo wPadNum($top10->top_count,$ndigits);
1229
+ echo ' <a href="'.wassupURI::add_siteurl($top10->top_link).'" target="_BLANK" title="'.$top10->top_item.'">'.stringShortener($top10->top_item,$char_len).'</a>'; ?> </nobr></li><?php
1230
  $i++;
1231
  }
1232
  }
1233
+ wListFiller($i,$top_limit,""); ?>
 
1234
  </ul>
1235
+ </td><?php
1236
+ $cols+=1;
 
 
 
1237
  }
1238
+ ?>
1239
+ </tr>
1240
+ </tbody></table>
1241
  <span style="font-size:7pt;"> <?php
1242
  if ($wassup_options->wassup_spamcheck == 1 || !empty($top_ten['top_nospider'])) { ?><br/>*<?php
1243
  if ($wassup_options->wassup_spamcheck == 1 && !empty($top_ten['top_nospider'])) {
1247
  } else {
1248
  _e("This report excludes spam records","wassup");
1249
  }
1250
+ }?>
1251
+ </span><?php
1252
+ if(!empty($wdebug_mode)) echo "\n<br/> Res=$res &nbsp; char_len=$char_len \n";?>
1253
  </div> <?php
1254
  } //end wassup_top10view
1255
 
1298
  return ($padhtml);
1299
  }
1300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1301
  //Round the integer to the next near 10
1302
  function roundup($value) {
1303
  //$dg = digit_count($value);
1328
  $maxPage = roundup(max($pages));
1329
  $halfPage = ($maxPage/2);
1330
  }
 
1331
  // A list of encoding characters to help later, as per Google's example
1332
  $simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
 
1333
  $chartData = "s:";
 
1334
  // Chart type has two datasets
1335
  if ($charttype == "main") {
1336
  $label_time = "";
1354
  for ($i = 0; $i < count($pages); $i++) {
1355
  $currentPage = $pages[$i];
1356
  $currentTime = $atime[$i];
 
1357
  if ($currentPage > -1) {
1358
  $chartData.=substr($simpleEncoding,61*($currentPage/$maxPage),1);
1359
  } else {
1367
  } else {
1368
  $chartAPIdata=$chartData."&chxt=x,y,r&chxl=0:|".$label_time."1:|0|".$halfValue."|".$maxValue."|2:|0|".$halfPage."|".$maxPage."&chxs=0,6b6b6b,9";
1369
  }
 
1370
  // Chart type has one one dataset
1371
  // It's unused now
1372
  } else {
1374
  $currentValue = $Wvisits[$i];
1375
  $currentTime = $atime[$i];
1376
  $label_time.=str_replace(' ', '+', $currentTime)."|";
 
1377
  if ($currentValue > -1) {
1378
  $chartData.=substr($simpleEncoding,61*($currentValue/$maxValue),1);
1379
  } else {
1383
  $chartAPIdata=$chartData."&chxt=x,y&chxl=0:|".$label_time."|1:|0|".$halfValue."|".$maxValue."&chxs=0,6b6b6b,9";
1384
  }
1385
  return $chartAPIdata;
1386
+ } //end Gchart_data
 
1387
 
1388
  // Used to show main visitors details query, to count items and to extract data for main chart
1389
  class WassupItems {
 
1390
  var $tableName;
1391
  var $from_date;
1392
  var $to_date;
1393
  var $searchString;
1394
+ var $_whereis; //private,protected
1395
  var $ItemsType;
1396
  var $Limit;
1397
  var $Last;
1398
  var $WpUrl;
1399
+ var $totrecords=0;
 
1400
  function wassupitems($table_name,$date_from,$date_to,$whereis=null,$limit=null) {
1401
+ global $wpdb,$wassup_options,$wdebug_mode;
1402
+ if (empty($wassup_options->wassup_table)) $wassup_options = new wassupOptions;
1403
+ $wassup_table = $wassup_options->wassup_table;
1404
+ $wassup_tmp_table = $wassup_table."_tmp";
1405
+ if(!empty($table_name) && wassupDb::table_exists($table_name)) $this->tableName=$table_name;
1406
+ else $this->tableName=$wassup_table;
1407
+ $wassup_user_settings=get_user_option('_wassup_settings');
1408
+ $datenow = current_time('timestamp');
1409
+ $to_date=0;
1410
+ $from_date=0;
1411
+ //use default range from wassup_settings
1412
+ if($date_from == "" || !is_numeric($date_from)){
1413
+ if(empty($whereis)){
1414
+ if(empty($date_to) || !is_numeric($date_to)){
1415
+ if($table_name == $wassup_tmp_table){
1416
+ $from_date = $datenow - 3*60; //-3 minutes
1417
+ }else{
1418
+ if(!empty($wassup_user_settings['detail_time_period'])) $last=$wassup_user_settings['detail_time_period'];
1419
+ else $last = $wassup_options->wassup_time_period;
1420
+ $from_date = $datenow - (int)(($last*24)*3600);
1421
  }
1422
+ $to_date=$datenow;
1423
+ }else{
1424
+ $to_date = $date_to;
1425
+ }
1426
  }
1427
+ }else{
1428
+ $from_date = $date_from;
1429
  }
1430
  $this->tableName = $table_name;
1431
+ $this->from_date = $from_date;
1432
+ $this->to_date = $to_date;
1433
+ if(empty($limit)|| strpos($limit,"LIMIT")===false){
1434
+ if(!is_numeric($limit)){
1435
+ if(!empty($wassup_user_settings['detail_limit'])) $limit=$wassup_user_settings['detail_limit'];
1436
+ else $limit=$wassup_options->wassup_default_limit;
1437
+ }
1438
+ $this->Limit="LIMIT ".(int)$limit;
1439
+ }else{
1440
+ $this->Limit=esc_attr($limit);
1441
+ }
1442
+ //New in v1.9: this->_whereis replaces to_date/from_date in where condition to add multisite blog id in query
1443
+ if (!empty($whereis)){
1444
+ if (preg_match('/^\s*(AND|OR)/i',$whereis)>0){
1445
+ if(!empty($from_date)){
1446
+ if(empty($to_date) || ($datenow -$to_date)<10 || $from_date >= $to_date){
1447
+ $this->_whereis = sprintf("`timestamp`>='%d' %s",$from_date,$whereis);
1448
+ }else{
1449
+ $this->_whereis=sprintf("`timestamp` BETWEEN '%d' AND '%d' %s",$from_date,$to_date,$whereis);
1450
+ }
1451
+ }elseif(!empty($to_date)){
1452
+ $this->_whereis=sprintf("`timestamp` <= '%d' %s",$to_date,$whereis);
1453
+ }else{
1454
+ $this->_whereis=sprintf("`timestamp` >'0' %s",$whereis);
1455
+ }
1456
+ }else{
1457
+ $this->_whereis=$whereis;
1458
+ }
1459
+ }else{
1460
+ if(!empty($from_date)){
1461
+ if(empty($to_date) || ($datenow -$to_date)<10 || $from_date >= $to_date){
1462
+ $this->_whereis=sprintf("`timestamp`>='%d'",$from_date);
1463
+ }else{
1464
+ $this->_whereis=sprintf("`timestamp` BETWEEN '%d' AND '%d'",$from_date,$to_date);
1465
+ }
1466
+ }elseif(!empty($to_date)){
1467
+ $this->_whereis=sprintf("`timestamp` <= '%d'",$to_date);
1468
+ }else{
1469
+ $this->_whereis="`timestamp` >'0'";
1470
+ }
1471
+ //add multisite condition only when there is no 'whereis' parameter
1472
+ if($wassup_options->network_activated_plugin()){
1473
+ if(!is_network_admin() && !empty($GLOBALS['current_blog']->blog_id)){
1474
+ $this->_whereis .=sprintf(" AND `subsite_id`=%d",(int)$GLOBALS['current_blog']->blog_id);
1475
+ }
1476
+ }
1477
+ }
1478
+ $totrecords=$wpdb->get_var(sprintf("SELECT count(*) from %s WHERE %s",esc_attr($this->tableName),$this->_whereis));
1479
+ if(is_wp_error($totrecords)){
1480
+ $error_msg=" MySQL error#".$totrecords->get_error_code()." ".$totrecords->get_error_message();
1481
+ }elseif(is_numeric($totrecords)){
1482
+ $this->totrecords=$totrecords;
1483
+ }
1484
+ if($wdebug_mode){
1485
+ echo "\n<!-- ";
1486
+ echo "\n WassupItems: _whereis=$this->_whereis";
1487
+ echo "\n WassupItems: totrecords={$this->totrecords}";
1488
+ if(!empty($error_msg)) "\n ERROR: ".error_msg;
1489
+ echo "\n -->";
1490
+ }
1491
  }
 
1492
  // Function to show main query and count items
1493
+ function calc_tot($Type,$Search="",$specific_where_clause=null,$distinct_type=null){
1494
+ global $wpdb,$wdebug_mode;
1495
+ $this->ItemsType=$Type;
1496
+ $this->searchString=$Search;
1497
+ $ss="";
1498
+ if(!empty($Search)|| !empty($specific_where_clause))$ss=$this->buildSearch($Search,$specific_where_clause);
1499
+ if(!empty($ss) && stristr($this->_whereis, ' OR ')!==false) $whereis= '('.$this->_whereis.')'.$ss;
1500
+ else $whereis= $this->_whereis . $ss;
1501
+ $buffered="";
1502
+ //abort if there is nothing in totrecords var
1503
+ if(empty($this->totrecords) || !is_numeric($this->totrecords)){
1504
+ return;
1505
+ }
1506
+ //use "sql_buffer_result" to help speed up retrieval of large datasets
1507
+ if($this->totrecords >5000)$buffered="SQL_BUFFER_RESULT";
1508
  // Switch by every (global) items type (visits, pageviews, spams, etc...)
1509
+ switch ($Type) {
1510
+ // This is the MAIN query to show the chronology
1511
  case "main":
1512
+ //## Extend mysql wait timeout to 2.5 minutes and extend php script timeout to 3 minutes to prevent script hangs
1513
+ if(!ini_get('safe_mode')){
1514
+ $stimeout=ini_get("max_execution_time");
1515
+ if(!is_numeric($stimeout)||(int)$stimeout <180) set_time_limit(180);
1516
+ }
1517
+ $mtimeout=$wpdb->get_var("SELECT @@session.wait_timeout AS mtimeout FROM dual");
1518
+ if(is_numeric($mtimeout) && $mtimeout<160) $result=$wpdb->query("SET wait_timeout=160");
1519
  //main query
1520
+ // "sql_buffer_result" select option helps in cases where it takes a long time to retrieve results.
1521
+ $qry = sprintf("SELECT $buffered `id`, `wassup_id`, max(`timestamp`) as max_timestamp, min(`timestamp`) as min_timestamp, count(`wassup_id`) as page_hits, `ip`, `hostname`, `urlrequested`, `referrer`, GROUP_CONCAT(DISTINCT `username` ORDER BY `username` SEPARATOR ', ') AS login_name, `comment_author`, `agent`, `browser`, `os`, `spider`, `feed`, max(`spam`) AS malware_type, `screen_res`, `language`, `search`, `searchengine`, `searchpage`, `url_wpid` FROM %s WHERE %s GROUP BY `wassup_id` ORDER BY max_timestamp DESC %s",
 
1522
  $this->tableName,
1523
+ $whereis,
 
 
1524
  $this->Limit);
1525
  $results = $wpdb->get_results($qry);
1526
+ //try without buffer
1527
+ if ((is_wp_error($results) || empty($results) || !is_array($results)) && !empty($this->totrecords) && !empty($buffered)) {
1528
+ $qry = sprintf("SELECT `id`, `wassup_id`, max(`timestamp`) as max_timestamp, min(`timestamp`) as min_timestamp, count(`wassup_id`) as page_hits, `ip`, `hostname`, `urlrequested`, `referrer`, GROUP_CONCAT(DISTINCT `username` ORDER BY `username` SEPARATOR ', ') AS login_name, `comment_author`, `agent`, `browser`, `os`, `spider`, `feed`, max(`spam`) AS malware_type, `screen_res`, `language`, `search`, `searchengine`, `searchpage`, `url_wpid` FROM %s WHERE %s GROUP BY `wassup_id` ORDER BY max_timestamp DESC %s",
1529
  $this->tableName,
1530
+ $whereis,
 
 
1531
  $this->Limit);
1532
  $results = $wpdb->get_results($qry);
1533
  }
 
1534
  break;
1535
  case "count":
1536
  // These are the queries to count the items hits/pages/spam
1537
+ $distinct="";
1538
+ if($distinct_type=="DISTINCT")$distinct="DISTINCT ";
1539
+ $qry=sprintf("SELECT COUNT(%s`wassup_id`) AS itemstot FROM %s WHERE %s", $distinct, $this->tableName, $whereis);
 
 
 
1540
  $results = $wpdb->get_var($qry);
 
 
1541
  break;
1542
  case "main-ip": //TODO
1543
  // These are the queries to count the hits/pages/spam by ip
1544
+ $qry=sprintf("SELECT *, max(`timestamp`) as max_timestamp, min(`timestamp`) as min_timestamp, count(`ip`) AS page_hits, GROUP_CONCAT(DISTINCT `wassup_id` ORDER BY `wassup_id` SEPARATOR ',') AS visits FROM %s WHERE %s GROUP BY `ip` ORDER BY max_timestamp DESC %s",
1545
  $this->tableName,
1546
+ $whereis,
 
 
1547
  $this->Limit);
1548
  $results = $wpdb->get_results($qry);
1549
  break;
1550
  case "count-ip": //TODO
1551
  // These are the queries to count the hits/pages/spam by ip
1552
+ $distinct="";
1553
+ if($distinct_type=="DISTINCT")$distinct="DISTINCT ";
1554
+ $qry = sprintf("SELECT COUNT(%s`ip`) AS itemstot FROM %s WHERE %s", $distinct, $this->tableName, $whereis);
 
 
 
1555
  $results = $wpdb->get_var($qry);
1556
  break;
1557
  } //end switch
1558
+ if (is_wp_error($results)){
1559
+ $error_msg=" calc_tot MySQL error#".$results->get_error_code()." ".$results->get_error_message()."\n qry=".$qry."\n";
1560
+ $results=false;
1561
+ }elseif(empty($results)){
1562
+ $results=false;
1563
+ }
1564
+ if($wdebug_mode){
1565
+ if(!empty($error_msg)){
1566
+ echo "\n<!-- WassupItems ERROR: ".error_msg. " -->";
1567
+ }elseif(empty($results)){
1568
+ echo "\n<!-- WassupItems::calc_tot No results from query -->";
1569
+ }elseif(is_array($results)){
1570
+ echo "\n<!-- ";
1571
+ echo "\n WassupItems::calc_tot ".count($results).' results from query'."\n -->";
1572
+ }else {
1573
+ echo "\n<!-- WassupItems::calc_tot 1 result from query results=$results -->";
1574
+ }
1575
  }
1576
+ return $results;
1577
  } //end function calc_tot
1578
 
1579
+ //Build the "search" portion of a MySQL WHERE clause...for Visitor details' mark-ip search or general search
1580
+ function buildSearch($Search,$specific_where_clause=null) {
1581
+ global $wpdb;
1582
+ $ss="";
1583
+ if (!empty($Search)) {
1584
+ $wassup_user_settings=get_user_option('_wassup_settings');
1585
+ $searchString=wassupDb::esc_like(trim($Search));
1586
+ $searchParam=esc_sql($searchString);
1587
+ //do an IP-only search when Search == wassupOptions::wip
1588
+ $wip=(!empty($wassup_user_settings['wip'])? $wassup_user_settings['wip']:0);
1589
+ if(!empty($wip)&& $Search==$wip){
1590
+ //for IP-only search
1591
+ $ss=sprintf(" AND `ip`='%s'",$searchParam);
1592
+ }else{ //for general search
1593
+ $ss = sprintf(" AND (`ip` LIKE '%%%s%%' OR `hostname` LIKE '%%%s%%' OR `urlrequested` LIKE '%%%s%%' OR `agent` LIKE '%%%s%%' OR `referrer` LIKE '%%%s%%' OR `username` LIKE '%s%%' OR `comment_author` LIKE '%s%%')",
1594
+ $searchParam,
1595
+ $searchParam,
1596
+ $searchParam,
1597
+ $searchParam,
1598
+ $searchParam,
1599
+ $searchParam,
1600
+ $searchParam);
1601
+ }
1602
+ }
1603
+ if (!empty($specific_where_clause)) {
1604
+ $ss .= " ".trim($specific_where_clause);
1605
+ }
1606
+ return $ss;
1607
+ } //end buildSearch
1608
+
1609
  // $Ctype = chart's type by time
1610
  // $Res = resolution
1611
  // $Search = string to add to where clause
1612
+ function TheChart($Ctype, $Res, $chart_height, $Search="", $axes_type, $chart_bg, $chart_loc="page", $chart_group="") {
1613
+ global $wpdb,$wassup_options,$wdebug_mode;
1614
+ if (is_numeric($Ctype)) $this->Last = $Ctype;
1615
+ else $Ctype=1; // defaults to 24-hour chart
1616
+ $chart_points=0;
 
 
 
 
 
 
1617
  $chart_url="";
 
 
 
1618
  //First check for cached chart
1619
+ $chart_key="$chart_loc{$Res}{$axes_type}{$chart_group}{$Ctype}_".intval(date('i')/15).date('HdmY');
1620
+ if(!empty($Search))$chart_key .="_s".esc_attr($Search);
1621
+ $chart_url=wassupDb::get_wassupmeta($chart_key,'_chart');
1622
+ if (!empty($chart_url)) {
1623
+ if ($wdebug_mode)
1624
+ echo "\n<!-- Cached chart found. chart_key=$chart_key -->\n";
1625
+ } else {
1626
+ $chart_key = "";
 
 
 
 
1627
  }
 
1628
  //Second..create new chart
1629
  if (empty($chart_url)) {
1630
  //Add Search variable to WHERE clause
1631
  $ss="";
1632
+ if(!empty($Search)) $ss=$this->buildSearch($Search);
1633
+ $whereis= $this->_whereis . $ss;
1634
+ $hour_todate = $this->to_date;
1635
+ //`timestamp` is localized before insert into table, so datetime translation from MySQL with 'FROM_UNIXTIME' must be converted to UTC/GMT afterwards to get an accurate datetime value for Wordpress.
1636
+ $UTCoffset = wassupDb::get_db_setting("tzoffset");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1637
  if (empty($UTCoffset)) $UTCoffset = "+0:00"; //GMT
1638
+ //set x-axis date format to Wordpress date format
1639
+ $USAdate = $wassup_options->is_USAdate();
 
 
 
 
 
 
 
 
1640
  $hour_fromdate = $this->from_date;
1641
  $point_label = array();
1642
  $x_divisor=1;
1645
  $x_groupformat = "%Y%m%d%H%i";
1646
  $wp_groupformat = 'YmdHi';
1647
  $cache_time=300; //5-minute cache
1648
+ $points_end = current_time('timestamp')+5;
1649
+ //variable x-axis timeframe for "All time"
1650
+ if($Ctype == "0") {
1651
+ $secs=floor(($points_end-$hour_fromdate)/300)*300;
1652
+ if($secs<3600){ //up to 1 hour
1653
+ $crange=".05";
1654
+ }elseif($secs<21600){ //up to 6 hours
1655
+ $crange=".25";
1656
+ }elseif($secs<86400){ //up to 1 day
1657
+ $crange="1";
1658
+ }elseif($secs<86400*7){ //up to 1 week
1659
+ $crange="7";
1660
+ }elseif($secs<86400*14){ //up to 2 weeks
1661
+ $crange="14";
1662
+ }elseif($secs<86400*31){ //up to 1 month
1663
+ $crange="30";
1664
+ }elseif($secs<86400*91){ //up to 3 months
1665
+ $crange="90";
1666
+ }elseif($secs<86400*182){ //up to 6 months
1667
+ $crange="180";
1668
+ }elseif($secs<86400*366){ //up to 1 year
1669
+ $crange="365";
1670
+ }else{
1671
+ $crange="0";
1672
+ }
1673
+ }else{
1674
+ $crange=$Ctype;
1675
+ }
1676
  // Options by chart type
1677
+ switch ($crange) {
1678
  case ".05":
1679
  case ".1":
1680
  $cTitle = __("Last 1 Hour", "wassup");
1683
  $x_points = 12; //no. of x-axis points
1684
  $x_increment = 300; //5 minute increments
1685
  $x_divisor = $x_increment;
1686
+ $cache_time=90; //1.5-minute cache
1687
  break;
1688
  case ".25":
 
1689
  $cTitle = __("Last 6 Hours", "wassup");
1690
  $x_axes_label = "%H:%i";
1691
  $wp_timeformat = 'H:i';
1692
+ $x_points = 12;
1693
  $x_increment = 30*60; //30 minute increments
1694
  $x_divisor = $x_increment;
1695
+ $cache_time=180; //3-minute cache
1696
+ break;
1697
+ case ".5":
1698
+ $cTitle = __("Last 12 Hours", "wassup");
1699
+ $x_axes_label="%d %H:00";
1700
+ $wp_timeformat='d H:00';
1701
+ $x_points = 12;
1702
+ $x_increment = 60*60; //1 hour increments
1703
+ $x_divisor = $x_increment;
1704
+ $cache_time=180; //3-minute cache
1705
  break;
1706
  case "7":
1707
  $cTitle = __("Last 7 Days", "wassup");
1728
  $x_axes_label = "%a %d %b";
1729
  $wp_timeformat = 'D d M';
1730
  }
1731
+ if((int)$Res > 640){
1732
+ $x_points = 14;
1733
+ $x_increment = 24*60*60; //1-day increments
1734
+ }else{
1735
+ $x_points = 7;
1736
+ $x_increment = 48*60*60; //2-day increments
1737
+ }
1738
  break;
1739
  case "30":
1740
  $cTitle = __("Last Month", "wassup");
1768
  $cTitle = __("Last 6 Months", "wassup");
1769
  $x_groupformat = "%Y%m";
1770
  $wp_groupformat = 'Ym';
1771
+ $wp_timeformat='M Y';
1772
  $x_axes_label = " %b %Y";
1773
+ $x_points=6;
1774
  break;
1775
  case "365":
1776
  $cTitle = __("Last Year", "wassup");
1777
  $x_groupformat = "%Y%m";
1778
  $wp_groupformat = 'Ym';
1779
+ $wp_timeformat='M Y';
1780
  $x_axes_label = "%b %Y";
1781
+ $x_points=12;
1782
  break;
1783
  case "0":
1784
  $cTitle = __("All Time", "wassup");
1793
  $wp_groupformat = 'YmdH';
1794
  $x_axes_label = "%H:00";
1795
  $wp_timeformat = 'H:00';
1796
+ $x_points = 12; //no. of x-axis points
1797
+ $x_increment = 2*60*60; //2-hour increments
1798
  $x_divisor = $x_increment;
1799
  }
1800
+ if($Ctype == "0") $cTitle=__("All Time","wassup");
1801
 
1802
  //create Wordpress labels to replace the MySQL x-axis labels which could be incorrect due to PHP/MySQL timezone mismatch issues
1803
  if ($x_points >0 && $hour_fromdate >0) {
1804
+ //$points_end = current_time('timestamp')+60;
1805
  for ($i=0;$i<$x_points;$i++) {
1806
  $x_timestamp=((int)(($hour_fromdate+(($i+1)*$x_increment))/$x_divisor))*$x_divisor;
1807
  if ($x_timestamp < $points_end) {
1818
  echo " \$tgroup=".implode("|",$tgroup)."-->";
1819
  }
1820
  }
 
 
1821
  if ($x_divisor > 1) {
1822
+ $qry = sprintf("SELECT COUNT( DISTINCT `wassup_id` ) AS items, COUNT(`wassup_id`) AS pages, CAST(`timestamp`/$x_divisor AS UNSIGNED)*$x_divisor AS xgroup, DATE_FORMAT(CONVERT_TZ( FROM_UNIXTIME(CAST((`timestamp`+0)/$x_divisor AS UNSIGNED)*$x_divisor), '%s', '+0:00'), '%s') as thedate FROM %s WHERE %s GROUP BY 3 ORDER BY `timestamp`",
1823
  $UTCoffset,
1824
  $x_axes_label,
1825
  $this->tableName,
1826
+ $whereis);
 
 
1827
  } else {
1828
+ //SELECT COUNT(DISTINCT `wassup_id` ) AS items, COUNT(`wassup_id`) AS pages, DATE_FORMAT(DATE_ADD('1970-01-01 00:00:00', INTERVAL CAST(`timestamp` AS UNSIGNED) SECOND), '%s') AS xgroup, DATE_FORMAT(DATE_ADD('1970-01-01 00:00:00', INTERVAL CAST(`timestamp` AS UNSIGNED) SECOND)), '%s') as thedate FROM wp_wassup WHERE %s GROUP BY 3 ORDER BY `timestamp`
1829
+ $qry = sprintf("SELECT COUNT( DISTINCT `wassup_id` ) AS items, COUNT(`wassup_id`) AS pages, DATE_FORMAT(CONVERT_TZ(FROM_UNIXTIME(CAST(`timestamp` AS UNSIGNED)), '%s', '+0:00'), '%s') AS xgroup, DATE_FORMAT(CONVERT_TZ( FROM_UNIXTIME(CAST(`timestamp` AS UNSIGNED)), '%s', '+0:00'), '%s') as thedate FROM %s WHERE %s GROUP BY 3 ORDER BY `timestamp`",
1830
  $UTCoffset,
1831
  $x_groupformat,
1832
  $UTCoffset,
1833
  $x_axes_label,
1834
  $this->tableName,
1835
+ $whereis);
1836
+ }
1837
+ $qry_result = $wpdb->get_results($qry,ARRAY_A);
1838
+ if(is_wp_error($qry_result)){
1839
+ $error_msg=" theChart MySQL error#".$qry_result->get_error_code()." ".$qry_result->get_error_message()."\n qry=".esc_attr($qry)."\n";
1840
+ }else{
1841
+ $chart_points = count($qry_result);
1842
  }
1843
  if ($wdebug_mode) {
1844
+ if(!empty($error_msg)) echo "\n<!-- WassupItems ERROR: ".error_msg. " -->";
1845
+
1846
+ else echo "\n<!-- \$query= $qry-->\n";
1847
  }
 
1848
  // Extract arrays for Visits, Pages and X_Axis_Label
 
1849
  if ($chart_points > 0) {
1850
  //MySQL results have sufficient data points
1851
  if ($chart_points >= $x_points-1 || empty($tlabel)) {
1865
  while ($i <= $x_points-1 && $bhits['xgroup'] > $tgroup[$i]) {
1866
  //add 0-points to data
1867
  $y_hits[] = 0;
1868
+ $y_pages[] = 0;
1869
  $x_label[] = $tlabel[$i];
1870
  $i=$i+1;
1871
  }
1872
  $y_hits[] = $bhits['items'];
1873
+ $y_pages[] = $bhits['pages'];
1874
  $x_label[] = $bhits['thedate'];
1875
  $x_group[] = $bhits['xgroup']; //debug
1876
  $i = $i+1;
1877
  }
1878
  }
 
 
 
1879
  if ($wdebug_mode) {
1880
  echo "\n<!-- \$x-group= ".implode("|",$x_group);
1881
  echo "\n \$x-labels= ".implode("|",$x_label)."-->\n";
1897
  } elseif ($lablcount == 31) {
1898
  $x_grid=6.45;
1899
  }
1900
+ //TODO: Google image chart api deprecated as of 4/20/2012 - replace with Google interactive charts api after 4/15/2015 - see: https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart
1901
  // generate url for google chart image
1902
+ $chart_url ="https://chart.googleapis.com/chart?cht=lc&chf=".$chart_bg."&chtt=".urlencode($cTitle)."&chls=4,1,0|2,6,2&chco=1111dd,FF6D06&chm=B,1111dd30,0,0,0&chg={$x_grid},25,1,5&chs={$Res}x{$chart_height}&chd=".Gchart_data($y_hits, $y_pages, $x_label, $x_groupformat, "main", $axes_type, $chart_loc);
 
 
 
1903
  //cache chart url in wassup_meta table for up to 5 minutes
1904
+ $chart_key="$chart_loc{$Res}{$axes_type}{$chart_group}{$Ctype}_".intval(date('i')/15).date('HdmY');
1905
+ if(!empty($Search))$chart_key .="_s".esc_attr($Search);
1906
+ $expire=(int)(time()+$cache_time);
1907
+ $cache_id=wassupDb::save_wassupmeta($chart_key,'_chart',"$chart_url",$expire);
1908
+ } //end if chart_points>0
1909
+ } //end if chart_url
1910
+ if (!empty($chart_url)) return $chart_url;
1911
+ else return false;
 
 
 
 
 
 
1912
  } //end theChart
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1913
  } //end class WassupItems
1914
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1915
  /**
1916
  * A class for wassup CURL operations.
1917
  * @since v1.8
1918
  */
1919
  class wcURL {
1920
  var $data = array();
 
1921
  function doRequest($method, $url, $vars) {
1922
  if (function_exists('curl_init')) {
1923
+ $wassup_agent = apply_filters('http_headers_useragent',"WassUp/".WASSUPVERSION." - www.wpwp.org");
 
1924
  $ch = curl_init();
1925
  curl_setopt($ch, CURLOPT_URL, $url);
1926
  curl_setopt($ch, CURLOPT_HEADER, false); //data only
1939
  curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
1940
  }
1941
  $data = curl_exec($ch);
 
1942
  $this->data = curl_getinfo($ch);
1943
  $this->data['content'] = $data;
1944
  $this->data['error'] = curl_error($ch);
1945
  curl_close($ch);
1946
+ if (($this->data['error'] == '') && ($this->data['http_code'] < 400)) return true;
1947
+ else return false;
 
 
 
1948
  } else {
1949
  return false;
1950
  }
1951
  } //end doRequest
1952
+ function get($url){return $this->doRequest('GET',$url,'NULL');}
1953
+ // vars is urlencoded string of field/value pairs, eg:field1=value1&field2=value2
1954
+ function post($url,$vars){return $this->doRequest('POST', $url, $vars);}
1955
+ function getInfo($field){
1956
+ if (isset($this->data[$field])) return $this->data[$field];
1957
+ else return null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1958
  }
1959
+ function getData(){return $this->data['content'];}
1960
  } //end class wcURL
1961
 
1962
  /**
1969
  function wFetchAPIData($api_url) {
1970
  global $wdebug_mode;
1971
 
1972
+ $wassup_agent=apply_filters('http_headers_useragent',"WassUp/".WASSUPVERSION." - www.wpwp.org");
1973
+ $apidata=array();
1974
+ //lets not wait for slow server responses
1975
+ $stimeout=0;
1976
+ if(!ini_get('safe_mode')){
1977
+ $stimeout=ini_get("max_execution_time");
1978
+ //decrease script timeout to 7 seconds to avoid slowdowns due to slow server response
1979
+ if((int)$stimeout>7)set_time_limit(7);
1980
+ }
1981
+ //try Wordpress 'wp_remote_get' for api results
1982
+ if(function_exists('wp_remote_get')){
1983
+ $opts=array('user-agent'=>"$wassup_agent");
1984
+ $api_remote=@wp_remote_get($api_url,$opts);
1985
+ if(!is_wp_error($api_remote) && is_array($api_remote)){
1986
+ if(!empty($api_remote['body']))$apidata=$api_remote['body'];
1987
+ elseif(!empty($api_remote['response']))$apidata="no data";
1988
  }
1989
  $api_method='wp_remote_get'; //debug
1990
  }
2016
  print_r($apidata);
2017
  echo "-->\n";
2018
  }
2019
+ if(!empty($stimeout))set_time_limit($stimeout);
2020
  return $apidata;
2021
+ } //end wFetchAPIData
2022
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/settings.php CHANGED
@@ -1,39 +1,58 @@
1
  <?php
2
  /**
3
- * @package WassUP
4
- * @subpackage settings.php module
 
 
 
 
5
  */
 
 
 
 
 
 
6
  /**
7
- * wassup_optionsView form to view and change Wassup's option settings
8
- * and perform some maintenance operations.
 
 
9
  */
10
- function wassup_optionsView() {
11
- global $wpdb, $wp_version, $user_level, $wassupversion, $wassup_options, $wdebug_mode;
12
-
13
- $GMapsAPI="http://code.google.com/intl/en/apis/maps";
14
-
15
- //must be admin to view or edit settings
16
- //if ($user_level >= 8) {
17
 
 
18
  $adminemail = get_bloginfo('admin_email');
19
  $alert_msg = "";
20
  $alertstyle = 'color:red; background-color:#ffd;';
21
- $wassup_table = (!empty($wassup_options->wassup_table))? $wassup_options->wassup_table: $wpdb->prefix . "wassup";
22
  $wassup_meta_table = $wassup_table . "_meta";
23
  $table_engine = "";
24
  $table_collation = "";
 
 
 
 
 
 
 
 
 
25
 
26
  if ($wassup_options->wassup_remind_flag == 2) {
27
  $alert_msg = '<p style="color:red;font-weight:bold;">'.__('ATTENTION! Your WassUp table have reached the maximum value you set, I disabled the alert, you can re-enable it here.','wassup').'</p>';
28
  $wassup_options->wassup_remind_flag = 0;
29
  $wassup_options->saveSettings();
30
  }
 
31
  $data_rows = 0;
32
  $data_lenght = 0;
33
- if ($wpdb->get_var("SHOW TABLES LIKE '$wassup_table'") == $wassup_table) {
34
- $table_status = $wpdb->get_results("SHOW TABLE STATUS LIKE '$wassup_table'");
35
- foreach ($table_status as $fstatus) {
36
- $data_lenght = $fstatus->Data_length;
 
37
  $data_rows = (int) $fstatus->Rows;
38
  if (isset($fstatus->Engine)) {
39
  $table_engine = $fstatus->Engine;
@@ -42,289 +61,490 @@ function wassup_optionsView() {
42
  }
43
  $table_collation = (isset($fstatus->Collation)? $fstatus->Collation: '');
44
  }
45
- //$tusage2 = ($data_lenght/1024/1024); //not used
46
  } else { ?>
47
  <span style="<?php echo $alertstyle; ?>"><br /><strong><?php echo __('IMPORTANT').': WassUp '.__("table empty or does not exist!","wassup"); ?></strong></span>
48
  <?php }
 
 
49
  ?>
 
50
  <p style="padding:10px 0 10px 0;"><?php _e('Select the options you want for WassUp plugin','wassup'); ?></p><?php
51
- $tab=0;
52
- if (isset($_POST['delete_now'])) { $tab=3; }
53
- elseif (!empty($_GET['tab']) && is_numeric($_GET['tab']) && $_GET['tab']>0 && $_GET['tab']<9) {
54
- $tab = (int) $_GET['tab'];
 
 
 
 
 
 
 
 
 
55
  }
56
- if ($tab < 1 || $tab > 4 ) {
57
- if (isset($_POST['submit-options'])) $tab=1;
58
- elseif (isset($_POST['submit-options2'])) $tab=2;
59
- elseif (isset($_POST['submit-options3'])) $tab=3;
60
- elseif (isset($_POST['submit-options4'])) $tab=4;
61
- else $tab=1;
 
 
 
 
62
  }
 
 
 
 
63
  echo "\n"; ?>
64
-
65
- <form name="wassupsettings" action="" method="post">
 
 
 
66
  <div class="ui-tabs" id="tabcontainer">
67
  <ul class="ui-tabs-nav">
68
- <li<?php if ($tab == "1") echo ' class="ui-tabs-selected"'; ?>><a href="#wassup_opt_frag-1"><span><?php _e("General Setup", "wassup") ?></span></a></li>
69
- <li<?php if ($tab == "2") echo ' class="ui-tabs-selected"'; ?>><a href="#wassup_opt_frag-2"><span><?php _e("Statistics Recording", "wassup") ?></span></a></li>
70
- <li<?php if ($tab == "3") echo ' class="ui-tabs-selected"'; ?>><a href="#wassup_opt_frag-3"><span><?php _e("Manage Files & Database", "wassup") ?></span></a></li>
71
- <li<?php if ($tab == "4") echo ' class="ui-tabs-selected"'; ?>><a href="#wassup_opt_frag-4"><span><?php _e("Uninstall", "wassup") ?></span></a></li>
 
 
 
 
 
 
 
72
  </ul>
73
 
74
- <div id="wassup_opt_frag-1" class="optionstab<?php if ($tab == "1") echo ' tabselected'; ?>">
75
- <h3><?php _e('Your default screen resolution (browser width)','wassup'); ?></h3>
76
- <p><strong><?php _e('Default screen resolution (in pixels)','wassup'); ?></strong>:
77
- <select name='wassup_screen_res' style="width:90px;">
78
- <?php $wassup_options->showFormOptions("wassup_screen_res"); ?>
79
- </select>
80
- </p><br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  <h3><?php _e('User Permissions'); ?></h3>
82
- <p><strong><?php _e('Set minimum users level which can view and manage WassUp plugin','wassup'); ?></strong>:
 
83
  <select name="wassup_userlevel">
84
- <?php $wassup_options->showFormOptions("wassup_userlevel"); ?>
85
  </select>
86
- <?php echo "(".__('default Administrator','wassup').")"; ?>
87
  </p><br/>
88
-
89
- <h3><?php _e('Dashboard Settings','wassup'); ?></h3>
90
- <p><input type="checkbox" name="wassup_dashboard_chart" value="1" <?php if($wassup_options->wassup_dashboard_chart == 1) print "CHECKED"; ?> /> <strong><?php _e('Display small chart in the dashboard','wassup'); ?></strong>
 
 
 
91
  </p><br/>
92
-
93
- <h3><?php _e('Spy Visitors Settings','wassup'); ?></h3>
94
- <p> <input type="checkbox" name="wassup_geoip_map" value="1" <?php
95
- //if (!function_exists('curl_init')) { print "DISABLED"; }
96
- if ($wassup_options->wassup_geoip_map == 1) print "CHECKED"; ?> />
97
- <strong><?php _e('Display a GEO IP Map in the spy visitors view','wassup'); ?></strong></p><?php
98
- // Test Google Maps Key If test fails deactivate *map option
99
- //if (function_exists('curl_init')) { //can work without cURL
100
- $code_error="";
101
- /*
102
  if ($wassup_options->wassup_geoip_map == 1) {
103
- $code = geocodeWassUp("Ancona", $wassup_options->wassup_googlemaps_key);
104
- if ((int)$code[0] != 200) {
105
- $code_error = "<script type=\"text/javascript\">jQuery(document).ready(function($){ $(\"#key_error\").fadeIn(2000); });</script><p id='key_error' style='text-align:center;background:#FA8C97;border:1px solid #999;padding:4px;margin:4px;width:40%;display:none;'>--->> <strong>".__("WARNING","wassup")."</strong> ".__("Activation problem >> Error code","wassup").": <a href='{$GMapsAPI}/documentation/reference.html#GGeoStatusCode' target='_BLANK'>".$code[0]."</a> <<---</p>";
106
- $wassup_options->wassup_geoip_map = 0;
107
- //$wassup_options->wassup_googlemaps_key = ""; //don't erase key...may need later
108
- $wassup_options->saveSettings();
109
- echo "$code_error\n";
110
- }
111
- }
112
- */ ?>
113
- <!-- p> <strong>Google Maps API <?php _e("key","wassup"); ?>:</strong> <input type="text" name="wassup_googlemaps_key" size="40" value="<?php print $wassup_options->wassup_googlemaps_key; ?>" /> - <a href="<?php echo $GMapsAPI.'/signup.html?url='.get_bloginfo('wpurl'); ?>"><?php _e("signup for your key","wassup"); ?></a></p -->
114
- <?php
115
- //no curl - now works without cUrl using 'wp_remote_get'
116
- //} else {
117
- //echo '<p class="small">'.__("Geo IP Map requires","wassup")." PHP <strong>Curl</strong>. ".__("Please install it to be able to activate this feature","wassup").".</p>";
118
- //} ?>
119
- <p> <strong><?php echo _e('Set update speed of Spy data in microseconds','wassup'); ?></strong> :
120
- <input type="text" name="wassup_spy_speed" size="5" value="<?php if (empty($wassup_options->wassup_spy_speed)) echo "5000"; else echo $wassup_options->wassup_spy_speed; ?>" />
121
- <?php echo "<nobr>(".__('default 5000, minimum 1000','wassup').")</nobr>"; ?><br/>
122
- <?php echo __('Decrease if some visitor records are missing from Spy view. Increase if multiple duplicate records are shown.','wassup'); ?>
123
  </p><br/>
124
 
125
  <h3><?php _e('Visitor Detail Settings','wassup'); ?></h3>
126
- <p> <strong><?php _e('Time format 12/24 Hour','wassup'); ?></strong>:
127
- &nbsp; 12h <input type="radio" name="wassup_time_format" value="12" <?php if($wassup_options->wassup_time_format == 12) print "CHECKED"; ?> />
128
- &nbsp; &nbsp; 24h <input type="radio" name="wassup_time_format" value="24" <?php if($wassup_options->wassup_time_format == 24) print "CHECKED"; ?> />
129
- </p>
130
- <p> <strong><?php _e('Show chart type - How many axes','wassup'); ?></strong>:
131
- <select name='wassup_chart_type'>
132
- <?php $wassup_options->showFormOptions("wassup_chart_type"); ?>
133
- </select>
134
- </p>
135
- <p> <strong><?php echo __('Set how many minutes wait for automatic page refresh','wassup'); ?></strong>:
136
- <input type="text" name="wassup_refresh" size="2" value="<?php print $wassup_options->wassup_refresh; ?>" /> <?php _e('minutes (default 3)','wassup'); ?>
137
- </p>
138
- <p> <strong><?php _e('Show visitor details for the last','wassup'); ?></strong>:
139
  <select name='wassup_time_period'>
140
- <?php $wassup_options->showFormOptions("wassup_time_period"); ?>
141
  </select>
142
  </p>
 
 
 
 
143
  <p> <strong><?php _e('Filter visitor details for','wassup'); ?></strong>:
144
  <select name='wassup_default_type'>
145
- <?php $wassup_options->showFormOptions("wassup_default_type"); ?>
146
  </select>
147
  </p>
 
 
 
 
 
 
148
  <p> <strong><?php _e('Number of items per page','wassup'); ?></strong>:
149
  <select name='wassup_default_limit'>
150
- <?php $wassup_options->showFormOptions("wassup_default_limit"); ?>
151
  </select>
152
  </p><br />
153
-
154
- <h3><?php _e('Customize Top Stats Lists','wassup'); ?></h3><?php
155
- //New in 1.8.3:
156
- // 1) toplimit option to customize top stats list size
157
- // 2) toppostid option to list top post-ID items (articles)
158
- // 3) top_nospider option to exclude spider visits from all
159
- // top stats lists
160
- $top_ten = unserialize(html_entity_decode($wassup_options->wassup_top10));
161
  if (!is_array($top_ten)) { //in case corrupted
162
  $top_ten = $wassup_options->defaultSettings("top10");
163
  }
164
- if (empty($top_ten["toplimit"])) $top_ten["toplimit"] = 10;
165
- echo "\n"; ?>
166
- <p> <strong> <?php _e("Set the list length size for Top Stats", "wassup"); ?></strong>:
167
- <input type="text" name="toplimit" size="2" value="<?php echo (int)$top_ten['toplimit']; ?>" /> (<?php _e("default 10","wassup"); ?>)
168
  </p>
169
- <p style="margin-top:5px;"> <strong> <?php _e("Choose one or more items to list in Top Stats", "wassup"); ?></strong> (<?php _e("over 5 selections may cause horizontal scrolling","wassup"); ?>):<br />
170
- <div style="padding-left:25px;padding-top:0;margin-top:0;display:block;clear:left;">
171
- <div style="display:block; vertical-align:top; float:left; width:225px;">
172
- <input type="checkbox" name="topsearch" value="1" <?php if($top_ten['topsearch'] == 1) print "CHECKED"; ?> /><?php _e("Top Searches", "wassup"); ?><br />
173
- <input type="checkbox" name="topreferrer" value="1" <?php if($top_ten['topreferrer'] == 1) print "CHECKED"; ?> /><?php _e("Top Referrers", "wassup"); ?>*<br />
174
- <input type="checkbox" name="toprequest" value="1" <?php if($top_ten['toprequest'] == 1) print "CHECKED"; ?> /><?php _e("Top Requests", "wassup"); ?><br />
175
  </div>
176
- <div style="display:block; vertical-align:top; float:left; width:225px;">
177
- <input type="checkbox" name="topbrowser" value="1" <?php if($top_ten['topbrowser'] == 1) print "CHECKED"; ?> /><?php _e("Top Browsers", "wassup"); ?> <br />
178
- <input type="checkbox" name="topos" value="1" <?php if($top_ten['topos'] == 1) print "CHECKED"; ?> /><?php _e("Top OS", "wassup"); ?> <br />
179
- <input type="checkbox" name="toplocale" value="1" <?php if($top_ten['toplocale'] == 1) print "CHECKED"; ?> /><?php _e("Top Locales", "wassup"); ?></span><br />
180
  </div>
181
- <div style="vertical-align:top; float:left; width:225px;">
182
- <input type="checkbox" name="topvisitor" value="1" <?php if(!empty($top_ten['topvisitor'])) print "CHECKED"; ?> /><?php _e("Top Visitors", "wassup"); ?><br />
183
- <input type="checkbox" name="toppostid" value="1" <?php if(!empty($top_ten['toppostid'])) print "CHECKED"; ?> /><?php _e("Top Articles", "wassup"); ?></span><br /><!--
184
- //TODO
185
- <input type="checkbox" name="topfeed" value="1" DISABLED /><?php _e("Top Feeds", "wassup"); ?><br />
186
- <input type="checkbox" name="topcrawler" value="1" DISABLED /><?php _e("Top Crawlers", "wassup"); ?> --><br />
187
  </div>
188
  </div>
189
  </p><p style="clear:left;"></p>
190
- <p style="margin-top:5px;"> *<strong><?php _e("Exclude the following website domains from Top Referrers", "wassup"); ?></strong> :<br />
191
  <span style="padding-left:10px;display:block;clear:left;">
192
- <textarea name="topreferrer_exclude" rows="2" style="width:66%;"><?php echo $top_ten['topreferrer_exclude']; ?></textarea><br />
193
- <?php echo __("Comma separated value","wassup")." (ex: mydomain2.net, mydomain2.info). ". __("List whole domains only. Wildcards and partial domains will be ignored.","wassup"). " ";
194
- _e("Don't list your website domain defined in WordPress","wassup"); ?>.</span>
195
- </p>
196
- <p> <input type="checkbox" name="top_nospider" value="1" <?php if($top_ten['top_nospider'] == 1) print "CHECKED"; ?> />
 
 
 
 
 
 
 
 
197
  <strong> <?php _e("Exclude all spider records from Top Stats", "wassup"); ?></strong>
198
  </p>
199
  <br /><br />
200
- <p style="clear:both;padding-left:0;padding-top:15px;"><input type="submit" name="submit-options" class="submit-opt wassup-button button-primary" value="<?php _e('Save Settings','wassup'); ?>" />&nbsp;<input type="reset" name="reset" class="reset-opt wassup-button" value="<?php _e('Reset','wassup'); ?>" /> - <input type="submit" name="reset-to-default" class="default-opt wassup-button" value="<?php _e("Reset to Default", "wassup"); ?>" /></p><br />
 
201
  </div>
202
 
203
- <div id="wassup_opt_frag-2" class="optionstab<?php if ($tab == "2") echo ' tabselected'; ?>">
204
- <h3><?php _e('Statistics Recording Settings','wassup'); ?></h3>
205
- <p> <input type="checkbox" name="wassup_active" value="1" <?php if($wassup_options->wassup_active == 1) print "CHECKED"; ?> /> <strong><?php _e('Enable/Disable Recording','wassup'); ?></strong></p>
206
- <p style="margin-top:5px;"> <strong> <?php _e("Checkbox to record statistics for each type of \"visitor\"", "wassup") ?></strong><br />
 
 
207
  <span style="padding-left:25px;padding-top:0;margin-top:0;display:block;clear:left;">
208
- <input type="checkbox" name="wassup_loggedin" value="1" <?php if($wassup_options->wassup_loggedin == 1) print "CHECKED"; ?> /> <?php _e("Record logged in users", "wassup") ?><br />
209
- <input type="checkbox" name="wassup_admin" value="1" <?php if($wassup_options->wassup_admin == 1) print "CHECKED"; ?> /> <?php _e("Record logged in administrators", "wassup") ?><br />
210
- <input type="checkbox" name="wassup_spider" value="1" <?php if($wassup_options->wassup_spider == 1) print "CHECKED"; ?> /> <?php _e("Record spiders and bots", "wassup") ?><br />
211
- <input type="checkbox" name="wassup_attack" value="1" <?php if($wassup_options->wassup_attack == 1) print "CHECKED"; ?> /> <?php _e("Record attack/exploit attempts (libwww-perl agent)", "wassup") ?><br />
212
  </span>
213
  </p>
214
- <br /><p><input type="checkbox" name="wassup_spamcheck" value="1" <?php if($wassup_options->wassup_spamcheck == 1 ) print "CHECKED"; ?> /> <strong><?php _e('Enable/Disable Spam Check on Records','wassup'); ?></strong></p>
215
- <p style="margin-top:5px;"> <strong> <?php _e('Checkbox to record statistics for each type of "spam"','wassup'); ?></strong><br />
216
  <span style="padding-left:25px;padding-top:0;margin-top:0;display:block;clear:left;">
217
- <input type="checkbox" name="wassup_spam" value="1" <?php if($wassup_options->wassup_spam == 1) print "CHECKED"; ?> /> <?php _e('Record Akismet comment spam attempts','wassup'); ?> (<?php _e('check if an IP has previous comments as spam','wassup'); ?>)<br />
218
- <input type="checkbox" name="wassup_refspam" value="1" <?php if($wassup_options->wassup_refspam == 1) print "CHECKED"; ?> /> <?php _e('Record referrer spam attempts','wassup'); ?><br />
219
- <input type="checkbox" name="wassup_hack" value="1" <?php if($wassup_options->wassup_hack == 1) print "CHECKED"; ?> /> <?php _e("Record admin break-in/hacker attempts", "wassup") ?><br />
 
220
  </span>
 
 
 
 
221
  </p>
222
- <br />
223
- <h3><?php _e('Statistics Recording Exceptions','wassup'); ?></h3>
224
- <p><strong><?php echo __("Sites","wassup")."\n<br /> &nbsp; ".__('Enter source IPs to exclude from recording','wassup'); ?></strong>:
225
  <br /><span style="padding-left:10px;display:block;clear:left;">
226
- <textarea name="wassup_exclude" rows="2" style="width:60%;"><?php print $wassup_options->wassup_exclude; ?></textarea></span> &nbsp; <?php _e("comma separated value (ex: 127.0.0.1, 10.0.0.1, etc...)", "wassup") ?></p>
227
-
228
- <br /><p><strong><?php echo __("Users","wassup")."\n<br /> &nbsp; ".__('Enter usernames to exclude from recording','wassup'); ?></strong>:
 
 
229
  <br /><span style="padding-left:10px;display:block;clear:left;">
230
- <textarea name="wassup_exclude_user" rows="2" style="width:60%;"><?php print $wassup_options->wassup_exclude_user; ?></textarea></span> &nbsp; <?php _e("comma separated value, enter a registered user's login name (ex: bobmarley, enyabrennan, etc.)", "wassup") ?></p>
231
- <br /><p><strong><?php echo __("Posts/pages","wassup")."\n<br /> &nbsp; ".__('Enter requested URLs to exclude from recording','wassup'); ?></strong>:
 
 
 
232
  <br /><span style="padding-left:10px;display:block;clear:left;">
233
- <textarea name="wassup_exclude_url" rows="2" style="width:60%;"><?php print $wassup_options->wassup_exclude_url; ?></textarea></span> &nbsp; <?php _e("comma separated value, don't enter entire url, only the last path or some word to exclude (ex: /category/wordpress, 2007, etc...)", "wassup") ?></p>
234
- <p style="clear:both;padding-left:0;padding-top:15px;"><input type="submit" name="submit-options2" class="submit-opt wassup-button button-primary" value="<?php _e('Save Settings','wassup'); ?>" />&nbsp;<input type="reset" name="reset" class="reset-opt wassup-button" value="<?php _e('Reset','wassup'); ?>" /> - <input type="submit" name="reset-to-default" class="default-opt wassup-button" value="<?php _e("Reset to Default", "wassup"); ?>" /></p><br />
 
 
 
 
 
 
 
 
 
235
  </div>
236
-
237
- <div id="wassup_opt_frag-3" class="optionstab<?php if ($tab == "3") echo ' tabselected'; ?>">
238
- <?php /*
239
- //TODO ?
240
- //<!--
241
- //<br /><h3><?php _e('Rescan Old Records','wassup'); ?></h3>
242
- // <p><?php _e("Statistical records collected by earlier versions of WassUp may not have the latest spider, search engine, and spam data properly identified. Click the \"Rescan\" button to retroactively scan and update old records","wassup"); ?>.
243
- // <br /><input type="button" name="rescan" value="<?php _e('Rescan Old Records','wassup'); ?>" />
244
- // </p><br />
245
- // -->
246
- */ ?>
247
- <h3><?php _e('Select actions for table growth','wassup'); ?></h3>
248
- <p><?php _e("WassUp table grows very fast, especially if your site is frequently visited. I recommend you delete old records sometimes.","wassup");
249
- echo "<br/>".__('You can delete all Wassup records now (Empty Table), you can set an automatic delete option to delete selected old records daily, and you can manually delete selected old records once (Delete NOW).','wassup');
250
  echo " ".__("If you haven't database space problems, you can leave the table as is.","wassup"); ?></p>
251
- <p><?php _e('Current WassUp table usage is','wassup'); ?>:
252
- <strong><?php
253
- $tusage = number_format(($data_lenght/1024/1024), 2, ",", " ");
254
- if ( (int)$tusage >= (int)$wassup_options->wassup_remind_mb) {
255
- print '<span style="'.$alertstyle.'">'.$tusage.'</span>';
256
- } else { print $tusage; } ?>
257
- </strong> Mb (<?php echo $data_rows.' '.__('records','wassup'); ?>)</p>
258
  <?php print $alert_msg; ?>
259
- <p><input type="checkbox" name="wassup_remind_flag" value="1" <?php if ($wassup_options->wassup_remind_flag == 1) print "CHECKED"; ?>>
260
- <strong><?php _e('Alert me','wassup'); ?></strong> (<?php _e('email to','wassup'); ?>: <strong><?php print $adminemail; ?></strong>) <?php _e('when table reaches','wassup'); ?> <input type="text" name="wassup_remind_mb" size="3" value="<?php print $wassup_options->wassup_remind_mb; ?>"> Mb</p>
261
- <p><input type="checkbox" name="wassup_empty" value="1">
262
- <strong><?php _e('Empty table','wassup'); ?></strong> (<a href="?<?php echo $_SERVER['QUERY_STRING'].'&tab=2&export=1&whash='.$wassup_options->whash; ?>"><?php _e('export table in SQL format','wassup'); ?></a>)
 
 
 
 
 
 
 
 
 
263
  </p>
264
-
265
- <h3 style="padding-left:15px;"><?php _e("Delete old records","wassup"); ?></h3>
266
- <p style="padding-left: 20px;"><strong><?php _e("Automatically delete","wassup"); ?></strong>:
267
- <select name="delete_filter"><?php $wassup_options->showFormOptions("delete_filter"); ?></select> <?php _e("records older than", "wassup") ?>
268
- <select name="delete_auto"><?php $wassup_options->showFormOptions("delete_auto"); ?></select> &nbsp;<?php _e("daily","wassup"); ?>.</p>
269
- <p style="padding-left: 20px;"><strong><?php _e("Manually delete","wassup"); ?></strong>:
270
- <select name="delete_filter_manual"><?php $wassup_options->showFormOptions("delete_filter"); ?></select> <?php _e("records older than", "wassup") ?>
271
- <select name="delete_manual">
272
- <option value="never"><?php _e("Action is NOT undoable", "wassup") ?> &nbsp;</option>
273
- <option value="-1 day"><?php _e("24 hours", "wassup") ?></option>
274
- <option value="-1 week"><?php _e("7 days", "wassup") ?></option>
275
- <option value="-2 weeks"><?php _e("2 weeks", "wassup") ?></option>
276
- <option value="-1 month"><?php _e("1 month", "wassup") ?></option>
277
- <option value="-3 months"><?php _e("3 months", "wassup") ?></option>
278
- <option value="-6 months"><?php _e("6 months", "wassup") ?></option>
279
- <option value="-1 year"><?php _e("1 year", "wassup") ?></option>
280
- </select> &nbsp;<?php _e("once","wassup"); ?>.</p>
281
- <p style="padding-left: 20px;">
282
- <input type="button" name="delete_now" class="submit-opt wassup-hot-button" value="<?php _e('Delete NOW','wassup'); ?>" onclick="submit();" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  </p><br/>
284
- <h3><?php _e('Cache storage option','wassup'); ?></h3>
285
- <p><input type="checkbox" name="wassup_cache" value="1" <?php
286
- if ($wpdb->get_var("SHOW TABLES LIKE '$wassup_meta_table'") != $wassup_meta_table) {
287
- echo "DISABLED"; //meta table required for cache
288
- } elseif ($wassup_options->wassup_cache == 1 ) {
289
- echo "CHECKED";
290
- } ?> /> <strong><?php echo __('Enable cache for storing some remote API data locally in WassUp table','wassup'); ?></strong></p>
291
- <p style="color:#555; margin-top:0; padding-top:0;"><?php _e('Reduces the number of requests to remote API servers and may improve WassUp admin page load.','wassup'); ?></p><br/>
292
-
293
- <h3><?php _e("Server Settings and Memory Resources","wassup"); ?></h3>
294
- <p style="color:#555; margin-top:0; padding-top:0;"><?php echo __('For information only. Some values may be adjustable in startup files', 'wassup').", wp_config.php ".__('and','wassup')." php.ini ".__('or','wassup')." php5.ini"; ?>.</p>
295
- <p style="margin-bottom:0; padding-top:10px;"><strong>WassUp <?php _e('Version'); ?></strong>: <?php echo $wassupversion; ?>
296
- <ul class="varlist">
297
- <li><strong>WassUp <?php _e('Table name','wassup'); ?></strong>: <?php echo $wassup_options->wassup_table; ?></li>
298
- <li><strong>WassUp <?php _e('Table Charset/collation','wassup'); ?></strong>: <?php
299
- if (!empty($table_collation)) {
300
- echo $table_collation;
301
- } else {
302
- _e("unknown","wassup");
303
- }?></li></ul>
 
 
 
 
 
 
 
 
304
  </p>
305
- <p style="margin-bottom:0; padding-top:10px;"><strong>WordPress <?php _e('Version','wassup'); ?></strong>: <?php echo $wp_version; ?>
306
- <ul class="varlist">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  <li><strong>WordPress <?php _e('Character set','wassup'); ?></strong>: <?php echo get_option('blog_charset'); ?></li>
308
  <li><strong>WordPress <?php _e('Language','wassup'); ?></strong>: <?php echo get_bloginfo('language'); ?></li>
309
- <li><strong>WordPress Cache</strong>:<?php
310
  if (!defined('WP_CACHE') || WP_CACHE===false || trim(WP_CACHE)==="") {
311
- echo ' <span style="color:green;">'.__("not set","wassup").'</span>';
312
  } else {
313
- echo ' <span style="color:red;">';
314
- if (WP_CACHE === true) echo 'On';
315
  else echo "WP_CACHE";
316
  echo '</span>';
317
  }
318
  ?></li>
319
- <li><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  $WPtimezone = get_option('timezone_string');
321
- echo '<strong>WordPress ';
 
322
  if (!empty($WPtimezone)) {
323
- echo __('Timezone')."</strong>: $WPtimezone";
324
  $wpoffset = (current_time('timestamp') - time())/3600;
325
- } else {
326
- echo __('Time Offset','wassup').'</strong>:';
327
- $wpoffset = get_option("gmt_offset");
328
  }
329
  if ($wpoffset !== false && $wpoffset != "") {
330
  echo ' UTC ';
@@ -332,32 +552,39 @@ function wassup_optionsView() {
332
  else { echo $wpoffset; }
333
  }
334
  echo ' '.__('hours').' ('.gmdate(get_option('time_format'),(time()+($wpoffset*3600))).')'; ?></li>
335
- <?php
336
  $host_timezone = $wassup_options->getHostTimezone(true);
337
  if (!empty($host_timezone)) {
338
- echo "<li><strong>WordPress ".__("Host Timezone","wassup")."</strong>: ";
339
  if (is_array($host_timezone)) {
340
  echo $host_timezone[0]. " (UTC $host_timezone[1])";
341
  } else {
342
  echo $host_timezone;
343
  }
344
- echo "</li>\n";
345
- } ?>
346
-
347
- <li><strong>WordPress <?php _e('Host Server','wassup'); ?></strong>: <?php
348
  $sys_server = "";
349
  if (!empty($_SERVER['SERVER_SOFTWARE'])) {
350
  $sys_server = $_SERVER['SERVER_SOFTWARE'];
351
- } elseif (defined('PHP_OS')) {
352
- $sys_server = PHP_OS;
353
- } elseif (function_exists('apache_get_version')) {
354
- $sys_server = apache_get_version();
 
 
 
 
 
 
355
  }
356
  if (!empty($sys_server)) echo $sys_server;
357
  else _e("unknown","wassup");
358
  ?></li>
359
- <li><strong>WordPress <?php _e('Browser Client','wassup'); ?></strong>: <?php
360
  echo " <!-- ";
 
 
361
  $browser = new UADetector;
362
  echo " -->";
363
  if (!empty($browser->name) && $browser->agenttype == "B") {
@@ -365,49 +592,67 @@ function wassup_optionsView() {
365
  if ($browser->is_mobile) echo " on ".$browser->os;
366
  } else _e("unknown","wassup");
367
  ?></li>
368
- </ul></p>
369
- <p style="margin-bottom:0; padding-top:10px;"><strong>PHP <?php _e('Version'); ?></strong>: <?php echo PHP_VERSION; ?>
370
- <ul class="varlist">
 
 
 
 
371
  <li><strong>PHP <?php _e("Safe Mode", "wassup"); ?></strong>: <?php
372
- if (ini_get("safe_mode")) {
373
- _e("on","wassup");
374
- } else {
375
- _e("off","wassup");
376
- ?></li>
377
  <li><strong>PHP <?php _e("File Open Restrictions", "wassup"); ?></strong> (open_basedir): <?php
378
  $open_basedir=ini_get('open_basedir');
379
- if (empty($open_basedir)) {
380
- _e("off","wassup");
381
- } else {
382
- echo __("on","wassup").'<!-- '.$open_basedir.' -->';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  }
 
384
  }
385
- ?></li>
386
- <li><strong>PHP <?php _e("Memory Allocation","wassup"); ?></strong>: <?php
 
387
  $memory_use=0;
388
  if (function_exists('memory_get_usage')) {
389
  $memory_use=round(memory_get_usage()/1024/1024,2);
390
  }
391
- $memory_limit = ini_get('memory_limit');
392
  if (preg_match('/^(\d+){1,4}(\w?)/',$memory_limit,$matches) > 0) {
393
  $mem=(int)$matches[1];
394
- if ( $mem < 12 && $matches[2] == "M") {
395
- print '<span style="'.$alertstyle.'">'.$memory_limit."</span>";
396
- } else {
397
- echo $memory_limit;
398
- }
399
- } else {
400
  $memory_limit=0; _e("unknown","wassup");
401
  }
402
  ?></li>
403
- <li><strong>PHP <?php _e("Memory Usage","wassup"); ?></strong>: <?php
404
- if ($memory_limit >0 && ($memory_limit-$memory_use) < 2) {
405
- print '<span style="'.$alertstyle.'">'.$memory_use."M</span>";
406
- } elseif ($memory_use >0) {
407
- echo $memory_use."M";
408
- } else {
409
- _e("unknown","wassup");
410
- }
411
  ?></li>
412
  <li><strong>PHP <?php _e("Script Timeout Limit","wassup"); ?></strong>: <?php
413
  $max_execute = ini_get("max_execution_time");
@@ -415,15 +660,15 @@ function wassup_optionsView() {
415
  else { _e("unknown","wassup"); }
416
  ?></li>
417
  <li><strong>PHP <?php _e("Browser Capabilities File","wassup"); ?></strong> (browscap): <?php
418
- $browscap = ini_get("browscap");
419
- if ( $browscap == "") { _e("not set","wassup"); }
420
- else { echo basename($browscap); }
421
  ?></li>
422
  <li><strong>PHP Curl</strong>: <?php
423
  if (!function_exists('curl_init')) { _e("not installed","wassup"); }
424
  else { _e("installed","wassup"); }
425
  ?></li>
426
- <li><strong>PHP <?php
427
  //different from Host server TZ since Wordpress 2.8.3+
428
  $php_offset = (int)date('Z')/(60*60);
429
  if (version_compare(PHP_VERSION, '5.1', '>=')) {
@@ -442,34 +687,45 @@ function wassup_optionsView() {
442
  } else {
443
  echo "UTC +$php_offset ".__('hours');
444
  }
445
- if (!empty($WPtimezone)) {
446
- echo " <small> (".__("Modified by Wordpress since v2.8.3","wassup").")</small>\n";
447
- }
448
- ?></li>
449
- </ul></p><?php
450
  //###MySQL server settings
451
  $sql_version = $wpdb->get_var("SELECT version() as version");
452
- //$sql_version = mysql_get_server_info();
453
  if (!empty($sql_version) && version_compare($sql_version, '4.1', '>=')) {
454
- $sql_conf = @$wpdb->get_results("SELECT @@global.time_zone AS tzglobal, @@session.time_zone AS tzsession, @@session.collation_connection AS char_collation, @@session.wait_timeout AS wait_timeout, @@global.connect_timeout AS connect_timeout, @@global.key_buffer_size as index_buffer, @@session.read_buffer_size AS read_buffer, @@global.query_cache_size AS query_cache_size, @@global.query_cache_type AS query_cache_type, @@global.delayed_queue_size AS delayed_queue_size, @@session.storage_engine AS storage_engine");
455
  }
456
  if (!empty($sql_conf) && is_array($sql_conf)) {
 
457
  $sql_tzglobal = isset($sql_conf[0]->tzglobal)? $sql_conf[0]->tzglobal : "";
458
  $sql_timezone = isset($sql_conf[0]->tzsession)? $sql_conf[0]->tzsession : $sql_tzglobal;
459
  $sql_collation = isset($sql_conf[0]->char_collation)? $sql_conf[0]->char_collation : "";
460
  $sql_wait_timeout = isset($sql_conf[0]->wait_timeout)? $sql_conf[0]->wait_timeout : "";
461
  $sql_connect_timeout = isset($sql_conf[0]->connect_timeout)? $sql_conf[0]->connect_timeout : "";
462
  $sql_indexbuffer = isset($sql_conf[0]->index_buffer)? $sql_conf[0]->index_buffer : "";
 
463
  $sql_readbuffer = isset($sql_conf[0]->read_buffer)? $sql_conf[0]->read_buffer : "";
 
464
  $sql_query_cache = isset($sql_conf[0]->query_cache_size)? $sql_conf[0]->query_cache_size : "";
465
- $sql_cache_type = isset($sql_conf[0]->query_cache_type)? $sql_conf[0]->query_cache_type : "";
 
466
  $sql_delayed_queue = isset($sql_conf[0]->delayed_queue_size)? $sql_conf[0]->delayed_queue_size : "";
 
 
467
  $sql_engine = isset($sql_conf[0]->storage_engine)? $sql_conf[0]->storage_engine : "";
 
 
 
 
 
468
  } else {
469
  //for old MySQL versions (pre 4.1)
470
  $sql_vars = $wpdb->get_results("SHOW VARIABLES");
471
  foreach ($sql_vars AS $var) {
472
- if ($var->Variable_name == "timezone") {
 
 
473
  $sql_timezone = $var->Value;
474
  } elseif ($var->Variable_name == "time_zone") {
475
  $sql_timezone = $var->Value;
@@ -479,14 +735,24 @@ function wassup_optionsView() {
479
  $sql_wait_timeout = $var->Value;
480
  } elseif ($var->Variable_name == "key_buffer_size") {
481
  $sql_indexbuffer = $var->Value;
 
 
482
  } elseif ($var->Variable_name == "read_buffer_size") {
483
  $sql_readbuffer = $var->Value;
 
 
484
  } elseif ($var->Variable_name == "query_cache_size") {
485
  $sql_query_cache = $var->Value;
486
  } elseif ($var->Variable_name == "query_cache_type") {
487
- $sql_query_cache_type = $var->Value;
 
 
488
  } elseif ($var->Variable_name == "delayed_queue_size") {
489
  $sql_delayed_queue = $var->Value;
 
 
 
 
490
  } elseif ($var->Variable_name == "storage_engine") {
491
  $sql_engine = $var->Value;
492
  } elseif (empty($sql_engine) && $var->Variable_name == "table_type") {
@@ -494,60 +760,96 @@ function wassup_optionsView() {
494
  }
495
  }
496
  if ($wdebug_mode) {
497
- print_r($sql_vars); //debug
 
 
498
  }
499
  } ?>
500
- <p style="margin-bottom:0; padding-top:10px;"><strong>MySQL <?php _e('Version'); ?></strong>: <?php if (!empty($sql_version)) { echo $sql_version; } else { _e("unknown","wassup"); } ?>
501
- <ul class="varlist">
502
- <li><strong>MySQL <?php _e('Engine','wassup'); ?></strong>: <?php
503
- if (!empty($table_engine)) {
504
- echo $table_engine;
505
- } elseif (!empty($sql_engine)) {
506
- echo $sql_engine;
507
- } else {
508
- _e("unknown","wassup");
509
- }
510
- ?></li>
511
  <li><strong>MySQL <?php _e('Charset/collation','wassup'); ?></strong>: <?php if (!empty($sql_collation)) {
512
  echo $sql_collation;
513
  } else {
514
- $sql_charset = mysql_client_encoding();
515
  if (!empty($sql_charset)) {
516
  echo $sql_charset;
517
  } else { _e("unknown","wassup"); }
518
  }
519
  ?></li>
520
- <li><strong>MySQL <?php _e('Query Cache','wassup'); ?></strong>: <?php
521
- if (is_numeric($sql_query_cache)) {
522
- if ((int)$sql_query_cache >0) {
523
- echo (round((int)$sql_query_cache/1024/1024)) . "M";
524
- } else {
525
- echo $sql_query_cache." (".__("disabled","wassup").")";
 
 
526
  }
527
  } else {
528
  _e("unknown","wassup");
529
- } ?></li>
530
- <li><strong>MySQL <?php _e('Delayed Insert Queue'); ?></strong>: <?php
531
- if (is_numeric($sql_delayed_queue)) {
532
- if ((int)$sql_delayed_queue >0) {
533
- echo (int)$sql_delayed_queue ." ".__("rows","wassup");
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  } else {
535
- echo $sql_delayed_queue." (".__("not supported","wassup").")";
536
  }
537
  } else {
538
- _e("unknown","wassup");
539
  } ?></li>
540
- <li><strong>MySQL <?php _e('Index (Key) Buffer','wassup'); ?></strong>: <?php
541
- if (is_numeric($sql_indexbuffer)) {
542
- if ((int)$sql_indexbuffer >0) {
543
- echo (round((int)$sql_indexbuffer/1024/1024)) . "M";
 
 
 
 
 
544
  } else {
545
- echo $sql_indexbuffer." (".__("disabled","wassup").")";
546
  }
547
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  _e("unknown","wassup");
549
- }
550
- ?></li>
551
  <li><strong>MySQL <?php _e('Read Buffer','wassup'); ?></strong>: <?php
552
  if (is_numeric($sql_readbuffer)) {
553
  if ((int)$sql_readbuffer >0) {
@@ -557,8 +859,34 @@ function wassup_optionsView() {
557
  }
558
  } else {
559
  _e("unknown","wassup");
560
- }
561
- ?></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  <li><strong>MySQL <?php _e("Wait Timeout","wassup"); ?></strong>: <?php
563
  if (is_numeric($sql_wait_timeout)) {
564
  echo $sql_wait_timeout." ".__("seconds","wassup");
@@ -575,41 +903,124 @@ function wassup_optionsView() {
575
  $mysql_tz = $host_timezone;
576
  }
577
  } else {
578
- $mysql_tz = $wassup_options->getMySQLsetting('timezone');
579
  }
580
- $mysqloffset = $wassup_options->getTimezoneOffset();
581
  if ($sql_timezone != $mysql_tz) {
582
  echo $sql_timezone.' ('.$mysql_tz.' UTC '.(int)($mysqloffset/3600).')';
583
  } else {
584
  echo $sql_timezone.' (UTC '.(int)($mysqloffset/3600).')';
585
  }
586
- echo " <small> (".__("May be different from PHP since Wordpress v2.8.3","wassup").")</small>\n";
 
587
  ?></li>
588
- </ul></p>
589
- <br /><br />
590
- <p style="clear:both;padding-left:0;padding-top:15px;"><input type="submit" name="submit-options3" class="submit-opt wassup-button button-primary" value="<?php _e('Save Settings','wassup'); ?>" />&nbsp;<input type="reset" name="reset" class="reset-opt wassup-button" value="<?php _e('Reset','wassup'); ?>" /> - <input type="submit" name="reset-to-default" class="default-opt wassup-button" value="<?php _e("Reset to Default", "wassup"); ?>" /></p><br />
 
 
591
  </div>
592
-
593
- <div id="wassup_opt_frag-4" class="optionstab<?php if ($tab == "4") echo ' tabselected'; ?>">
 
594
  <h3><?php _e('Want to uninstall WassUp?', 'wassup') ;?></h3>
595
  <p><?php _e('No problem. Before you deactivate this plugin, check the box below to cleanup any data that was collected by WassUp that could be left behind.', 'wassup') ;?></p><br />
596
- <p><input type="checkbox" name="wassup_uninstall" value="1" <?php if ($wassup_options->wassup_uninstall == 1 ) print "CHECKED"; ?> /> <strong><?php _e('Permanently remove WassUp data and settings from Wordpress','wassup'); ?></strong></p>
597
  <?php if ($wassup_options->wassup_uninstall == 1) { ?>
598
- <span style="font-size:95%;font-weight:bold; margin-left:20px;<?php echo $alertstyle; ?>"><span style="text-decoration:blink;padding-left:5px;"><?php _e("WARNING","wassup"); ?>! </span><?php _e("All WassUp data and settings will be DELETED upon deactivation of this plugin","wassup"); ?>.</span><br />
599
  <?php } ?>
600
- <p><?php _e("This action cannot be undone. Before uninstalling WassUp, you should backup your Wordpress database first. WassUp data is stored in the table", "wassup"); ?> <strong><?php
601
- if (!empty($wassup_options->wassup_table))
602
- echo $wassup_options->wassup_table;
603
- else echo $wpdb->prefix.'wassup'; ?></strong>.</p>
604
 
605
- <br /><p><?php _e("To help improve this plugin, we would appreciate your feedback at","wassup"); ?> <a href="http://www.wpwp.org">www.wpwp.org</a>.</p>
606
  <br /><br />
607
- <p style="clear:both;padding-left:0;padding-top:15px;"><input type="submit" name="submit-options4" class="submit-opt wassup-button button-primary" value="<?php _e('Save Settings','wassup'); ?>" />&nbsp;<input type="reset" name="reset" value="<?php _e('Reset','wassup'); ?>" class="reset-opt wassup-button" /> - <input type="submit" name="reset-to-default" class="default-opt wassup-button" value="<?php _e("Reset to Default", "wassup"); ?>" /></p><br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
608
  </div>
609
- </form>
610
- </div> <!-- /#tabcontainer -->
611
  <br />
 
612
  <?php
613
- //} //end if user_level
614
  } //end wassup_optionsView
615
  ?>
1
  <?php
2
  /**
3
+ * Displays Options form for editing WassUp's settings and FAQ
4
+ *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage settings.php
7
+ * @author Helene Duncker (http://helenesit.com)
8
+ *
9
  */
10
+ //no direct request for this plugin module
11
+ if(!defined('ABSPATH')|| empty($GLOBALS['wp_version'])|| !empty($_SERVER['SCRIPT_FILENAME'])&& realpath(preg_replace('/\\\\/','/',__FILE__))===realpath($_SERVER['SCRIPT_FILENAME'])){
12
+ if(!headers_sent()){header('Location: /?p=404page&err=wassup403');exit;
13
+ }elseif(function_exists('wp_die')){wp_die("Bad Request: ".esc_attr(wp_kses(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI']),array())));exit;
14
+ }else{die("Bad Request: ".htmlspecialchars(preg_replace('/(&#37;|&amp;#37;|%)(?:[01][0-9A-F]|7F)/i','',$_SERVER['REQUEST_URI'])));exit;}
15
+ }
16
  /**
17
+ * wassup_optionsView
18
+ * - form to view and change Wassup's wp_option settings
19
+ * @param integer
20
+ * @return void
21
  */
22
+ function wassup_optionsView($tab=0) {
23
+ global $wpdb,$wp_version,$current_user,$wassup_options,$wdebug_mode;
 
 
 
 
 
24
 
25
+ $GMapsAPI_signup="https://developers.google.com/maps/documentation/javascript/get-api-key#key"; //v3 key signup
26
  $adminemail = get_bloginfo('admin_email');
27
  $alert_msg = "";
28
  $alertstyle = 'color:red; background-color:#ffd;';
29
+ $wassup_table=$wassup_options->wassup_table;
30
  $wassup_meta_table = $wassup_table . "_meta";
31
  $table_engine = "";
32
  $table_collation = "";
33
+ //$wp_min_memory=40; //since WordPress 3.5+
34
+ $wp_min_memory=64; //40MB caused out of mem. errors in WP 3.8+
35
+ if(!is_object($current_user) || empty($current_user->ID)){
36
+ $user=wp_get_current_user();
37
+ }
38
+ $goodstyle = 'color:green;';
39
+ $disabledstyle = 'color:#999;';
40
+ $disabled='disabled="DISABLED"';
41
+ $checked='checked="CHECKED"';
42
 
43
  if ($wassup_options->wassup_remind_flag == 2) {
44
  $alert_msg = '<p style="color:red;font-weight:bold;">'.__('ATTENTION! Your WassUp table have reached the maximum value you set, I disabled the alert, you can re-enable it here.','wassup').'</p>';
45
  $wassup_options->wassup_remind_flag = 0;
46
  $wassup_options->saveSettings();
47
  }
48
+ //get current wassup table size
49
  $data_rows = 0;
50
  $data_lenght = 0;
51
+ if (wassupDb::table_exists($wassup_table)) {
52
+ $fstatus = wassupDb::table_status($wassup_table);
53
+ if (!empty($fstatus) && is_object($fstatus)) {
54
+ //New in v1.9: db size includes index size
55
+ $data_lenght=$fstatus->Data_length+$fstatus->Index_length;
56
  $data_rows = (int) $fstatus->Rows;
57
  if (isset($fstatus->Engine)) {
58
  $table_engine = $fstatus->Engine;
61
  }
62
  $table_collation = (isset($fstatus->Collation)? $fstatus->Collation: '');
63
  }
 
64
  } else { ?>
65
  <span style="<?php echo $alertstyle; ?>"><br /><strong><?php echo __('IMPORTANT').': WassUp '.__("table empty or does not exist!","wassup"); ?></strong></span>
66
  <?php }
67
+ $wwidgets= __('Visitors Online or Top Stats','wassup');
68
+ $wwidgets_link='<a href="'.admin_url("widgets.php").'">'.__('Widgets menu','wassup').'</a>';
69
  ?>
70
+ <p><?php echo sprintf(__("You can add a sidebar Widget with some useful statistics information by activating the %s widget from the %s.","wassup"), $wwidgets,$wwidgets_link);?></p>
71
  <p style="padding:10px 0 10px 0;"><?php _e('Select the options you want for WassUp plugin','wassup'); ?></p><?php
72
+ if(empty($tab) || (!is_numeric($tab) && $tab!="donate" && $tab!="faq")){
73
+ if(isset($_POST['delete_now'])) $tab=3;
74
+ elseif(isset($_POST['submit-options'])) $tab=1;
75
+ elseif(isset($_POST['submit-options2'])) $tab=2;
76
+ elseif(isset($_POST['submit-options3'])) $tab=3;
77
+ elseif(isset($_POST['submit-options4'])) $tab=4;
78
+ else{
79
+ $tab=1;
80
+ if(!empty($_REQUEST['tab'])){
81
+ if (is_numeric($_REQUEST['tab']) && $_REQUEST['tab']>0 && $_REQUEST['tab']<7) $tab = (int)$_REQUEST['tab'];
82
+ elseif($_REQUEST['tab']=="donate" || $_REQUEST['tab']=="faq") $tab=$_REQUEST['tab'];
83
+ }
84
+ }
85
  }
86
+ if ($wdebug_mode) {
87
+ echo "\n<!-- ";
88
+ echo "\n tab=$tab &nbsp; wassup_table=$wassup_table &nbsp; wassup_meta_table=$wassup_meta_table";
89
+ echo "\n POST values \$_POST:";
90
+ print_r($_POST);
91
+ if(!empty($fstatus)) {
92
+ echo "\n fstatus=";
93
+ print_r($fstatus);
94
+ }
95
+ echo "-->\n";
96
  }
97
+ //New in v1.9: show uninstall tab for multisite/subdomain sites and for Wordpress 2.x
98
+ $has_uninstall_tab=false;
99
+ $wassup_network_settings=array();
100
+ if(version_compare($wp_version,"3.0","<") || (is_multisite() && is_subdomain_install() && !is_main_site())) $has_uninstall_tab=true;
101
  echo "\n"; ?>
102
+ <form name="wassupsettings" id="wassupsettings" action="" method="post">
103
+ <?php
104
+ //New in v1.9: wp_nonce field added to settings for referer validation and security
105
+ wp_nonce_field('wassupsettings-'.$current_user->ID);
106
+ echo "\n";?>
107
  <div class="ui-tabs" id="tabcontainer">
108
  <ul class="ui-tabs-nav">
109
+ <li id="opt-tab1" class="optionstab<?php if($tab=="1")echo ' ui-tabs-active';?>"><a href="#wassup_opt_frag-1"><span><?php _e("General Setup","wassup");?></span></a></li>
110
+ <li id="opt-tab2" class="optionstab<?php if($tab=="2")echo ' ui-tabs-active';?>"><a href="#wassup_opt_frag-2"><span><?php _e("Filters & Exclusions","wassup")?></span></a></li>
111
+ <li id="opt-tab3" class="optionstab <?php if($tab=="3")echo ' ui-tabs-active';?>"><a href="#wassup_opt_frag-3"><span><?php _e("Manage Files & Data","wassup");?></span></a></li><?php
112
+ if($has_uninstall_tab){
113
+ echo "\n";?>
114
+ <li id="opt-tab4" class="optionstab <?php if($tab=="4")echo ' ui-tabs-active';?>"><a href="#wassup_opt_frag-4"><span><?php _e("Uninstall","wassup");?></span></a></li><?php
115
+ }
116
+ //New in v1.9: new "donate" and "faq" tabs
117
+ echo "\n";?>
118
+ <li id="opt-tab-faq" class="optionstab faqtab<?php if($tab=="faq" || $tab=="5")echo ' ui-tabs-active';?>"><a href="#wassup_opt_frag-5"><span>F.A.Q.&nbsp;</span></a></li>
119
+ <li id="opt-tab-donate" class="optionstab donatetab<?php if($tab=="donate" || $tab=="6")echo ' ui-tabs-active';?>"><a href="#wassup_opt_frag-6"><span><?php _e("Donate","wassup");?></span></a></li>
120
  </ul>
121
 
122
+ <div id="wassup_opt_frag-1" class="optionspanel<?php if ($tab == "1") echo ' tabselected'; ?>"><br/><?php
123
+ //New in v1.9: multisite options
124
+ $wassup_network_settings=array();
125
+ if(is_multisite() && (is_network_admin() || (is_main_site() && is_super_admin()))){
126
+ $wassup_network_settings=get_site_option('wassup_network_settings');
127
+ echo "\n";?>
128
+ <h2><?php _e('Networkwide Settings','wassup');?></h2>
129
+ <p class="noindent-opt"><?php echo __("Multisite settings that applies to all subsites in the network.","wassup");?></p>
130
+ <input type="hidden" name="_network_settings" value="1"/>
131
+ <h3><?php _e("Network Statistics Recording","wassup");?></h3>
132
+ <p class="description"><?php echo __("Enables Wassup visitor tracking on all subsites in network. Do NOT disable unless upgrading plugin.","wassup");?></p>
133
+ <p><input type="checkbox" name="network_active" value="1" <?php if(!empty($wassup_network_settings['wassup_active'])) echo $checked;?> /> <strong><?php _e('Enable Statistics Recording for network.','wassup');?></strong><br/>
134
+ <span class="opt-note"><?php echo " ".__("Can be overridden on individual subsites to disable statistics recording.","wassup");?></span><?php
135
+ if(!empty($wassup_network_settings['wassup_table'])){?><br/>
136
+ <h3><?php _e("Network Subsites Options","wassup");?></h3>
137
+ <p><input type="checkbox" name="wassup_menu" value="1" <?php if(!empty($wassup_network_settings['wassup_menu'])) echo $checked;?> /> <strong><?php _e("Show Wassup's main admin menu to subsite administrators.","wassup");?></strong><br/>
138
+ <span class="opt-note"><?php echo " ".__("Uncheck to disable Wassup main menu and Wassup-options submenu for all users except Network administrator (super-admin). Dashboard submenu \"Wassup-stats\" and dashboard widget display are unaffected.","wassup");?></span></p><?php
139
+ }?><br/>
140
+ <hr/>
141
+ <h2><?php _e('Site Settings','wassup');?></h2>
142
+ <p class="noindent-opt"><?php echo __("Main site settings/default settings for network subsites.","wassup");?></p><?php
143
+ } //end if multisite
144
+ ?>
145
+ <h3><?php _e('Statistics Recording','wassup');?></h3>
146
+ <p class="description"><?php echo __("By default, Wassup collects, analyzes, and stores new visitor hits and checks each record for spam and malware activity.","wassup");?></p>
147
+ <p><input type="checkbox" name="wassup_active" value="1" <?php if($wassup_options->wassup_active == 1) echo $checked;?> /> <strong><?php _e('Enable statistics recording','wassup');?></strong><br/>
148
+ <span class="opt-note"><?php
149
+ if (!is_multisite()) echo " ".__("Do NOT disable unless upgrading or troubleshooting plugin problems.","wassup");
150
+ else echo " ".__("Do NOT disable unless troubleshooting plugin problems.","wassup");
151
+ ?></span>
152
+ </p>
153
+ <p class="checkbox-indent"><input type="checkbox" name="wassup_spamcheck" value="1" <?php if($wassup_options->wassup_spamcheck == 1) echo $checked;?> /> <strong><?php _e('Enable spam and malware detection on records','wassup');?></strong><br/>
154
+ <span class="opt-note"><?php echo " ".__("For identification only. Does NOT stop attacks nor protect your site.","wassup");?></span>
155
+ </p><br/>
156
  <h3><?php _e('User Permissions'); ?></h3>
157
+ <p class="description"><?php echo __("Grants readonly access to Wassup-stats dashboard submenu and to the dashboard widget for users with the selected role or higher. Only administrators have access to Wassup main menu and Wassup Options panel to edit settings and delete data.","wassup");?></p>
158
+ <p><strong><?php _e('Set minimum user level that can view WassUp stats','wassup'); ?></strong>:
159
  <select name="wassup_userlevel">
160
+ <?php $wassup_options->showFieldOptions("wassup_userlevel"); ?>
161
  </select>
162
+ <?php echo "<nobr>(".__('default administrator','wassup').")</nobr>";?>
163
  </p><br/>
164
+ <h3><?php _e('Screen resolution','wassup');?></h3>
165
+ <p class="description"><?php echo __("Adjusts chart size and resets the max-width/truncation point of long texts.","wassup");?></span>
166
+ <p class="indent-opt"><strong><?php _e('Your default screen resolution (in pixels)','wassup');?></strong>:
167
+ <select name='wassup_screen_res' style="width:90px;">
168
+ <?php $wassup_options->showFieldOptions("wassup_screen_res");?>
169
+ </select>
170
  </p><br/>
171
+ <h3><?php _e('Dashboard Widget','wassup'); ?></h3>
172
+ <p><input type="checkbox" name="wassup_dashboard_chart" value="1" <?php if($wassup_options->wassup_dashboard_chart==1) echo $checked; ?> /> <strong><?php _e('Enable widget/small chart in admin dashboard','wassup'); ?></strong>
173
+ </p><br/>
174
+ <h3><?php _e('Spy Visitors Settings','wassup'); ?></h3><?php
175
+ $disabled="";
176
+ $checked="";
177
+ $not_required=" ".__("not required","wassup");
 
 
 
178
  if ($wassup_options->wassup_geoip_map == 1) {
179
+ //New in v1.9: Api key not required for Google!Maps v3
180
+ $checked= 'checked="CHECKED"';
181
+ if (!empty($wassup_options->wassup_googlemaps_key))$api_key=esc_attr(strip_tags(html_entity_decode($wassup_options->wassup_googlemaps_key)));
182
+ else $api_key = $not_required;
183
+ } else {
184
+ $checked = 'onclick=\'jQuery("#wassup_googlemaps_key").removeAttr("disabled");\'';
185
+ $api_key = $not_required;
186
+ $disabled =' disabled="DISABLED" style="color:#99a;"';
187
+ }
188
+ echo "\n";?>
189
+ <p class="indent-opt"> <input type="checkbox" name="wassup_geoip_map" value="1" <?php echo $checked; ?> />
190
+ <strong><?php _e('Display a GEO IP Map in the spy visitors view','wassup'); ?></strong></p><?php
191
+ echo "\n"; ?>
192
+ <p class="checkbox-indent"><strong>Google Maps API <?php _e("key","wassup"); ?>:</strong> <input type="text" name="wassup_googlemaps_key" id="wassup_googlemaps_key" size="40" value=<?php echo '"'.esc_attr($api_key).'"'.$disabled.' onfocus="this.value=(this.value==\''.$not_required.'\') ? \'\' : this.value;" onblur="this.value=(this.value==\'\') ? \''.$not_required.'\' : this.value;"'; ?> /> - <a href="<?php echo $GMapsAPI_signup; ?>" target="_blank"><?php _e("signup for your key","wassup"); ?></a>
193
+ <br/>&nbsp; <?php echo __('For usage exceeding 25000 daily map views per domain.','wassup');
194
+ $checked='checked="CHECKED"';
195
+ $disabled='disabled="DISABLED"'; ?>
 
 
 
196
  </p><br/>
197
 
198
  <h3><?php _e('Visitor Detail Settings','wassup'); ?></h3>
199
+ <p> <strong><?php _e('Show visitor details from the last','wassup'); ?></strong>:
 
 
 
 
 
 
 
 
 
 
 
 
200
  <select name='wassup_time_period'>
201
+ <?php $wassup_options->showFieldOptions("wassup_time_period"); ?>
202
  </select>
203
  </p>
204
+ <p><strong><?php _e('Time format 12/24 Hour','wassup'); ?></strong>:
205
+ &nbsp; 12h <input type="radio" name="wassup_time_format" value="12" <?php if($wassup_options->wassup_time_format == 12) echo $checked; ?> />
206
+ &nbsp; &nbsp; 24h <input type="radio" name="wassup_time_format" value="24" <?php if($wassup_options->wassup_time_format == 24) echo $checked; ?> />
207
+ </p>
208
  <p> <strong><?php _e('Filter visitor details for','wassup'); ?></strong>:
209
  <select name='wassup_default_type'>
210
+ <?php $wassup_options->showFieldOptions("wassup_default_type"); ?>
211
  </select>
212
  </p>
213
+ <p class="indent-opt"><input type="checkbox" name="wassup_chart" value="1" <?php if(!empty($wassup_options->wassup_chart)) echo $checked; ?> /> <strong><?php _e('Display line chart in detail view','wassup'); ?></strong></p>
214
+ <p class="checkbox-indent"><strong><?php _e('Line chart type - how many axes?','wassup'); ?></strong> <select name='wassup_chart_type'> <?php $wassup_options->showFieldOptions("wassup_chart_type"); ?> </select></p>
215
+ <p><strong><?php echo __('Set how many minutes wait for automatic page refresh','wassup'); ?></strong>:
216
+ <input type="text" name="wassup_refresh" size="2" value="<?php echo (int)$wassup_options->wassup_refresh;?>" /> <?php _e('minutes','wassup');
217
+ echo ' <nobr>('.__('default 3, 0=no refresh','wassup').')</nobr>';?>
218
+ </p>
219
  <p> <strong><?php _e('Number of items per page','wassup'); ?></strong>:
220
  <select name='wassup_default_limit'>
221
+ <?php $wassup_options->showFieldOptions("wassup_default_limit"); ?>
222
  </select>
223
  </p><br />
224
+ <h3><?php _e('Top Stats Lists','wassup'); ?></h3>
225
+ <p class="description"><?php echo __("Customize Top stats by selected criteria below.","wassup").' '.__("Stats are in descending order from highest count and known spam and malware attempts are excluded from counts.","wassup");
226
+ //Since v1.8.3: toplimit, top_nospider, toppostid (top articles) options added
227
+ $top_ten = maybe_unserialize($wassup_options->wassup_top10);
 
 
 
 
228
  if (!is_array($top_ten)) { //in case corrupted
229
  $top_ten = $wassup_options->defaultSettings("top10");
230
  }
231
+ $show_on_front=get_option('show_on_front');?></p>
232
+ <p><strong> <?php _e("Length size limit of top lists", "wassup");?></strong>: <input type="text" name="toplimit" size="2" value="<?php
233
+ if (empty($top_ten["toplimit"])) echo "10";
234
+ else echo (int)$top_ten['toplimit']; ?>" /> (<?php _e("default 10","wassup"); ?>)
235
  </p>
236
+ <p class="indent-opt"><strong><?php _e("Choose one or more items to list in Top Stats", "wassup"); ?></strong> (<?php _e("over 5 selections may cause horizontal scrolling","wassup"); ?>):<br />
237
+ <div class="topstats-opt">
238
+ <div class="topstats-col">
239
+ <input type="checkbox" name="topsearch" value="1" <?php if($top_ten['topsearch'] == 1) echo $checked; ?> /> <?php _e("Top Searches", "wassup"); ?><br />
240
+ <input type="checkbox" name="topreferrer" value="1" <?php if($top_ten['topreferrer'] == 1) echo $checked; ?> /> <?php _e("Top Referrers", "wassup"); ?><strong>&sup1;</strong><br />
241
+ <input type="checkbox" name="toppostid" value="1" <?php if(!empty($top_ten['toppostid'])) echo $checked; ?> /> <?php _e("Top Articles", "wassup");if($show_on_front=="page") echo '<strong>&sup2;</strong>';?><br />
242
  </div>
243
+ <div class="topstats-col">
244
+ <input type="checkbox" name="toprequest" value="1" <?php if($top_ten['toprequest'] == 1) echo $checked; ?> /> <?php _e("Top Requests", "wassup"); ?><br />
245
+ <input type="checkbox" name="topbrowser" value="1" <?php if($top_ten['topbrowser'] == 1) echo $checked; ?> /> <?php _e("Top Browsers", "wassup"); ?> <br />
246
+ <input type="checkbox" name="topos" value="1" <?php if($top_ten['topos'] == 1) echo $checked; ?> /> <?php _e("Top OS", "wassup"); ?> <br />
247
  </div>
248
+ <div class="topstats-col">
249
+ <input type="checkbox" name="toplocale" value="1" <?php if($top_ten['toplocale'] == 1) echo $checked; ?> /> <?php _e("Top Locales", "wassup"); ?><br />
250
+ <input type="checkbox" name="topvisitor" value="1" <?php if(!empty($top_ten['topvisitor'])) echo $checked; ?> /> <?php _e("Top Visitors", "wassup"); ?><br />
251
+ <br />
 
 
252
  </div>
253
  </div>
254
  </p><p style="clear:left;"></p>
255
+ <p class="indent-opt"><strong>&sup1;<?php _e("Exclude the following website domains from Top Referrers","wassup");?></strong> (<?php _e("applies to top stats view and widgets","wassup");?>):<br />
256
  <span style="padding-left:10px;display:block;clear:left;">
257
+ <textarea name="topreferrer_exclude" rows="2" style="width:66%;"><?php echo esc_attr($top_ten['topreferrer_exclude']); ?></textarea></span>
258
+ <span class="opt-note"><?php echo __("comma separated value","wassup")." (ex: mydomain2.net, mydomain2.info). ". __("List whole domains only. Wildcards and partial domains will be ignored.","wassup"). " ";
259
+ _e("Don't list your website domain defined in WordPress","wassup"); ?>.</span><br/>
260
+ </p><br/><?php
261
+ echo "\n";
262
+ if($show_on_front=="page"){?>
263
+ <p class="indent-opt"><strong>&sup2;<?php _e("Exclude site front page from Top Articles","wassup");?></strong>: <input type="checkbox" name="top_nofrontpage" value="1" <?php if(!empty($top_ten['top_nofrontpage'])) echo $checked;?>/> (<?php _e("applies to top stats view and widgets","wassup");?>)
264
+ </p><br/><?php
265
+ }else{?>
266
+ <input type="hidden" name="top_nofrontpage" value="0"/><?php
267
+ }
268
+ echo "\n";?>
269
+ <p class="indent-opt"> <input type="checkbox" name="top_nospider" value="1" <?php if(!empty($top_ten['top_nospider'])) echo $checked; ?> />
270
  <strong> <?php _e("Exclude all spider records from Top Stats", "wassup"); ?></strong>
271
  </p>
272
  <br /><br />
273
+ <p class="submit"><input type="submit" name="submit-options" id="submit-options" class="submit-opt button button-left button-primary" value="<?php _e('Save Settings','wassup');?>" onclick="jQuery('#submit-options').val('Saving...');" />&nbsp;<input type="reset" name="reset" class="reset-opt button button-secondary" value="<?php _e('Reset','wassup');?>" /> - <input type="submit" name="reset-to-default" class="default-opt button button-caution wassup-button" value="<?php _e("Reset to Default", "wassup");?>" /></p>
274
+ <p class="opt-prev-next"><a href="<?php echo admin_url('admin.php?page=wassup-options&tab=2');?>"><?php echo __("Next","wassup").'&rarr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p></p><br />
275
  </div>
276
 
277
+ <div id="wassup_opt_frag-2" class="optionspanel<?php if ($tab == "2") echo ' tabselected'; ?>">
278
+ <h3><?php _e('Recording Filters and Exclusions','wassup');?></h3>
279
+ <p class="description"><?php echo __("Use the filter checkboxes and exclusion input fields below to customize Wassup's statistics recording so that only the data that you need for your site analyses are stored.","wassup");?>
280
+ </p><br/>
281
+ <h3><?php echo __("Visitor Type Filters:","wassup"); ?></h3>
282
+ <p style="padding-top:0;"><strong> &nbsp; <?php echo __("Checkbox to enable recording by type of \"visitor\"", "wassup");?></strong><br/>
283
  <span style="padding-left:25px;padding-top:0;margin-top:0;display:block;clear:left;">
284
+ <input type="checkbox" name="wassup_anonymous" value="1" <?php echo $checked." ".$disabled.' style="'.$disabledstyle.'"';?> /> <?php _e("Record regular visitors","wassup");?><br/>
285
+ <input type="checkbox" name="wassup_loggedin" value="1" <?php if($wassup_options->wassup_loggedin == 1) echo $checked;?> /> <?php _e("Record logged in users", "wassup");?><br />
286
+ <input type="checkbox" name="wassup_admin" value="1" <?php if($wassup_options->wassup_admin == 1) echo $checked;?> /> <?php _e("Record logged in administrators", "wassup");?><br />
287
+ <input type="checkbox" name="wassup_spider" value="1" <?php if($wassup_options->wassup_spider == 1) echo $checked;?> /> <?php _e("Record spiders and bots", "wassup");?><br />
288
  </span>
289
  </p>
290
+ <h3><?php echo __("Spam and Malware Filters:","wassup"); ?></h3>
291
+ <p style="padding-top:0;"><strong> &nbsp; <?php echo __('Checkbox to enable recording of each type of "spam"','wassup'); ?></strong><br />
292
  <span style="padding-left:25px;padding-top:0;margin-top:0;display:block;clear:left;">
293
+ <input type="checkbox" name="wassup_spam" value="1" <?php if($wassup_options->wassup_spam == 1) echo $checked; ?> /> <?php _e('Record Akismet comment spam attempts','wassup'); ?> (<?php _e('check if an IP has previous comments as spam','wassup'); ?>)<br />
294
+ <input type="checkbox" name="wassup_refspam" value="1" <?php if($wassup_options->wassup_refspam == 1) echo $checked; ?> /> <?php _e('Record referrer spam attempts','wassup'); ?><br />
295
+ <input type="checkbox" name="wassup_hack" value="1" <?php if($wassup_options->wassup_hack == 1) echo $checked; ?> /> <?php _e("Record admin break-in/hacker attempts", "wassup") ?><br />
296
+ <input type="checkbox" name="wassup_attack" value="1" <?php if($wassup_options->wassup_attack == 1) echo $checked; ?> /> <?php _e("Record attack/exploit attempts (libwww-perl agent)", "wassup") ?><br />
297
  </span>
298
+ </p><br />
299
+ <h3><?php _e('Recording Exceptions','wassup');?></h3>
300
+ <p class="description"><?php _e("You can exclude a single visitor (by IP, hostname or username) or you can exclude a specific URL request from being stored in WassUp records.","wassup");
301
+ echo " ".__("Note that recording exceptions lower overall statistics counts and excessive exclusions can affect page load speed on slow host servers.","wassup");?>
302
  </p>
303
+ <h3 class="indent-opt"><?php echo __("Exclude by IP","wassup");?></h3>
304
+ <p style="padding-top:0;padding-bottom:0;"><strong><?php echo __('Enter source IPs to omit from recording','wassup');?></strong>:
 
305
  <br /><span style="padding-left:10px;display:block;clear:left;">
306
+ <textarea name="wassup_exclude" rows="2" style="width:60%;"><?php echo esc_url($wassup_options->wassup_exclude);?></textarea></span>
307
+ <span class="opt-note"><?php echo __("comma separated value (ex: 127.0.0.1, 10.0.0.1, etc...).","wassup")." ".__("A single wildcard (*) can be placed after the last '.' or '::' position for range exclusions (ex: 10.10.100.*, 192.168.*).","wassup");?></span>
308
+ </p><br/>
309
+ <h3 class="indent-opt"><?php echo __("Exclude by Hostname","wassup");?></h3>
310
+ <p style="padding-top:0;padding-bottom:0;"><strong><?php echo __('Enter source hostnames to omit from recording','wassup');?></strong>:
311
  <br /><span style="padding-left:10px;display:block;clear:left;">
312
+ <textarea name="wassup_exclude_host" rows="2" style="width:60%;"><?php echo esc_attr($wassup_options->wassup_exclude_host);?></textarea></span>
313
+ <span class="opt-note"><?php echo __("comma separated value (ex: host1.domain.com, host2.domain.net, etc...).", "wassup")." ".__("A single wildcard (*) can be placed before the first '.' for domain network exclusions (ex: *.spamdomain.com, *.hackers.malware.net).","wassup");?></span>
314
+ </p><br/>
315
+ <h3 class="indent-opt"><?php echo __("Exclude by Username","wassup");?></h3>
316
+ <p style="padding-top:0;"><strong><?php echo __('Enter usernames to omit from recording','wassup');?></strong>:
317
  <br /><span style="padding-left:10px;display:block;clear:left;">
318
+ <textarea name="wassup_exclude_user" rows="2" style="width:60%;"><?php echo esc_attr($wassup_options->wassup_exclude_user);?></textarea></span>
319
+ <span class="opt-note"><?php _e("comma separated value, enter a registered user's login name (ex: bobmarley, enyabrennan, etc.)", "wassup");?></span>
320
+ </p><br/>
321
+ <h3 class="indent-opt"><?php echo __("Exclude by URL request","wassup");?></h3>
322
+ <p style="padding-top:0;"><strong><?php echo __('Enter URLs of page/post/feed to omit from recording','wassup');?></strong>:
323
+ <br /><span style="padding-left:10px;display:block;clear:left;">
324
+ <textarea name="wassup_exclude_url" rows="2" style="width:60%;"><?php echo esc_url($wassup_options->wassup_exclude_url);?></textarea></span>
325
+ <span class="opt-note"><?php _e("comma separated value, don't enter entire url, only the last path or some word to exclude (ex: /category/wordpress, 2007, etc...)", "wassup");?></span>
326
+ </p><br />
327
+ <p class="submit"><input type="submit" name="submit-options2" id="submit-options2" class="submit-opt button button-left button-primary" value="<?php _e('Save Settings','wassup');?>" onclick="jQuery('#submit-options2').val('Saving...');" />&nbsp;<input type="reset" name="reset" class="reset-opt button button-secondary" value="<?php _e('Reset','wassup');?>" /> - <input type="submit" name="reset-to-default" class="default-opt button button-caution wassup-button" value="<?php _e("Reset to Default", "wassup");?>" /></p>
328
+ <p class="opt-prev-next"><a href="<?php echo admin_url('admin.php?page=wassup-options&tab=1');?>"><?php echo '&larr;'.__("Prev","wassup");?></a> &nbsp; &nbsp; <a href="<?php echo admin_url('admin.php?page=wassup-options&tab=3');?>"><?php echo __("Next","wassup").'&rarr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p><br />
329
  </div>
330
+
331
+ <div id="wassup_opt_frag-3" class="optionspanel<?php if ($tab == "3") echo ' tabselected'; ?>">
332
+ <h3><?php _e("Table Management Options","wassup");?></h3>
333
+ <?php //New in v1.9: include index size in table size
334
+ $tusage=($data_lenght/1024/1024);
335
+ if ($wassup_options->is_USAdate())$tusagef=number_format($tusage, 1);
336
+ else $tusagef=number_format($tusage,2,","," ");
337
+ $alertmb=(int)$wassup_options->wassup_remind_mb;
338
+ if(empty($alertmb)) $alertmb=100;?>
339
+ <h3 class="indent-opt"><?php _e('Select actions for table growth','wassup'); ?>:</h3>
340
+ <p class="description"><?php _e("WassUp table grows very fast, especially if your site is frequently visited. I recommend you delete old records sometimes.","wassup");
341
+ echo " ".__('You can delete all Wassup records now (Empty Table), you can set an automatic delete option to delete selected old records daily, and you can manually delete selected old records once (Delete NOW).','wassup');
 
 
342
  echo " ".__("If you haven't database space problems, you can leave the table as is.","wassup"); ?></p>
343
+ <p class="indent-opt"><?php echo __('Current WassUp table usage is','wassup').': <strong>';
344
+ if((int)$tusage >= $alertmb)echo '<span style="'.$alertstyle.'">'.$tusagef.'</span>';
345
+ else echo $tusagef;
346
+ echo '</strong> Mb ('.$data_rows.' '.__('records','wassup').')';?></p>
 
 
 
347
  <?php print $alert_msg; ?>
348
+ <p class="indent-opt"><input type="checkbox" name="wassup_remind_flag" value="1" <?php if($wassup_options->wassup_remind_flag==1) echo $checked;?>>
349
+ <strong><?php _e('Alert me','wassup'); ?></strong> (<?php _e('email to','wassup'); ?>: <strong><?php print $adminemail; ?></strong>) <?php _e('when table reaches','wassup'); ?> <input type="text" name="wassup_remind_mb" size="3" value="<?php echo (int)$wassup_options->wassup_remind_mb; ?>"> Mb</p><?php
350
+ //New in v1.9: more delete filters for auto delete
351
+ ?>
352
+ <h3 class="indent-opt"><?php _e("Delete old records","wassup");?>:</h3><?php
353
+ $exporturl=wp_nonce_url(admin_url('admin.php?page=wassup-options&tab=3&export=1'),'wassupexport-'.$current_user->ID);?>
354
+ <p class="indent-opt description"><?php
355
+ echo sprintf(__("Before deleting, you can save Wassup data in SQL 'export' format onto your local computer by clicking %s below.","wassup"), '<a class="export-wassup" href="'.$exporturl.'">'.__('export table','wassup').'</a>');
356
+ echo " ".__("Reload this screen after export to view export messages.", "wassup");?></p>
357
+ <p> &nbsp;<label for="do_delete_auto"><input type="checkbox" name="do_delete_auto" id="do_delete_auto" value="1" <?php if ($wassup_options->delete_auto!="never") echo $checked;?>/> <strong><?php _e("Automatically delete","wassup");?></strong>: </label>
358
+ <select name="delete_filter"><?php $wassup_options->showFieldOptions("delete_filter"); ?></select>
359
+ <nobr><?php _e("records older than", "wassup"); ?>
360
+ <select name="delete_auto"><?php $wassup_options->showFieldOptions("delete_auto"); ?></select> &nbsp;<?php _e("daily","wassup"); ?></nobr>
361
  </p>
362
+ <p> &nbsp;<label for="do_delete_manual"><input type="checkbox" name="do_delete_manual" id="do_delete_manual" value="1" /> <strong><?php _e("Manually delete","wassup");?></strong>:</label>
363
+ <select name="delete_filter_manual"><?php $wassup_options->showFieldOptions("delete_filter","all");?></select>
364
+ <nobr><?php _e("records older than", "wassup"); ?>
365
+ <select name="delete_manual"><?php $wassup_options->showFieldOptions("delete_auto","never");?></select>&nbsp; <?php _e("once","wassup");?></nobr>
366
+ </p><?php
367
+ //New in v1.9: Delete by record ID# - for use with export
368
+ $last_export_id=wassupDb::get_wassupmeta($wassup_table,'_export_recid-'.$current_user->ID);
369
+ if (empty($last_export_id) || !is_numeric($last_export_id))
370
+ $last_export_id=0;?>
371
+ <p> &nbsp;<label for="do_delete_recid"><input type="checkbox" name="do_delete_recid" id="do_delete_recid" value="1" /> <strong><?php _e("Delete all records up to record ID#","wassup");?></strong>:</label>
372
+ <input type="text" name="delete_recid" id="delete_recid" value="<?php if (!empty($_POST['delete_recid']) && is_numeric($_POST['delete_recid'])) echo $_POST['delete_recid']; else echo '0';?>" /> <nobr>(<?php echo __("Last exported record ID#:","wassup")." ".$last_export_id;?>)</nobr>
373
+ </p>
374
+ <p class="indent-opt"> &nbsp;<label for="do_delete_empty"><input type="checkbox" name="do_delete_empty" id="do_delete_empty" value="1"/> <strong><?php _e('Empty table','wassup');?></strong></label>
375
+ (<a class="export-wassup" href="<?php echo $exporturl;?>"><?php _e('export table in SQL format','wassup');?></a>)
376
+ </p>
377
+ <p style="margin-top:20px;">
378
+ <input type="button" name="delete_now" class="submit-opt button button-danger wassup-hot-button" value="<?php _e('Delete NOW','wassup'); ?>" onclick="submit();"/><br/><span>&nbsp;<nobr><?php _e("Action is NOT undoable!", "wassup");?></nobr></span>
379
+ </p>
380
+ <br/>
381
+ <h3><?php _e("Table Optimization","wassup");?>:</h3>
382
+ <input type="hidden" name="wassup_dbengine" value="<?php echo $table_engine;?>"/>
383
+ <p class="indent-opt description"><?php
384
+ //New in v1.9: checkbox to turn off automatic optimization plus date content is now used for optimization schedule
385
+ $msg="";?><span id="info-optimize" class="opt-info"><?php
386
+ echo __("By default, WassUp tables are automatically optimized weekly and after each bulk deletion. This helps keep WassUp running fast, but it can sometimes cause slowdowns especially when there is a corrupt record in the table.","wassup")." ";
387
+ echo __("You can cancel automatic optimization by unchecking the box below.","wassup");?></span> <?php
388
+ //check if table is optimizable...some innodb is not
389
+ $is_optimizable_table=true;
390
+ $tengine=strtolower($table_engine);
391
+ if($tengine !="myisam" && $tengine !="archive"){
392
+ $is_optimizable_table=wassupDb::is_optimizable_table($wassup_table);
393
+ }
394
+ if(empty($wassup_options->wassup_optimize) && !$is_optimizable_table) echo '<em>'.__("Your table engine does NOT support the \"optimize\" command.","wassup").'</em>'."\n";?>
395
+ </p>
396
+ <p><label for="wassup_optimize_on">&nbsp; <input type="checkbox" name="wassup_optimize_on" value="1" <?php
397
+ if(!empty($wassup_options->wassup_optimize)){
398
+ echo $checked;
399
+ }elseif(!$is_optimizable_table){
400
+ echo " $disabled";
401
+ }?>/> <strong><?php _e("Enable automatic table optimization","wassup");?></strong></label><br/><?php
402
+ $optimize_schedule="";
403
+ if (empty($wassup_options->wassup_optimize)){
404
+ $optimize_schedule="never";
405
+ }else{
406
+ $timenow=((int)(current_time('timestamp')/100))*100;
407
+ $hours_left=((int)$wassup_options->wassup_optimize - $timenow)/3600;
408
+ if($hours_left < -24) {
409
+ $optimize_schedule=__("is overdue","wassup");
410
+ }elseif ($hours_left < 24 ){
411
+ $optimize_schedule=__("today","wassup");
412
+ } else {
413
+ $days_left=(int)($hours_left/24);
414
+ if ($days_left < 7) $optimize_schedule=sprintf(__("%d days","wassup"),(int)$days_left);
415
+ else $optimize_schedule=__("1 week","wassup");
416
+ }
417
+ echo "\n".'<!-- today='.$timenow.' &nbsp;optimize='.$wassup_options->wassup_optimize.' &nbsp; optimize-today(in hours)='.$hours_left.' -->';
418
+ }?>
419
+ <span class="opt-note"><?php
420
+ if($optimize_schedule != "never"){
421
+ echo " &nbsp; ".sprintf(__("Next scheduled optimization is: %s (approximately)","wassup"), '<strong>'.$optimize_schedule.'</strong>');
422
+ }else{
423
+ echo " &nbsp; ".sprintf(__("Next scheduled optimization is: %s","wassup"), '<strong>'.__("never","wassup").'</strong>');
424
+ }?></span>
425
+ </p>
426
+ <br/>
427
+ <h3><?php _e('Data Storage Methods','wassup');?></h3><?php
428
+ /* cache table is no longer optional (required)
429
+ <h3>Cache storage option</h3>
430
+ <p><input type="checkbox" name="wassup_cache" value="1" <?php
431
+ if ($wassup_options->wassup_cache == 1 ) {
432
+ echo $checked;
433
+ }elseif ($sql_meta_table_name!=$wassup_meta_table) {
434
+ echo $disabled;
435
+ }?>/>
436
+ <strong><?php echo __('Enable cache for storing some remote API data locally in WassUp table','wassup'); ?></strong><br/>
437
+ <span class="opt-note"><?php _e('Reduces the number of requests to remote API servers and improves WassUp page load speed.','wassup'); ?></span>
438
  </p><br/>
439
+ */
440
+ $msg="";
441
+ echo "\n";?>
442
+ <h3 class="indent-opt">MySQL <?php echo __("Delayed Insert","wassup");?>:</h3>
443
+ <p class="description"><span id="info-delayedinsert" class="opt-info"><?php
444
+ echo __("When possible, WassUp uses the \"Delayed insert\" method of saving records in MySQL to store new visitor records. This method helps keep Wassup running fast on high-volume sites and during volume spikes on all sites. However, it can be inefficient on low-volume sites and sometimes host administrators disable it on shared servers.","wassup")." ";
445
+ echo __("You can turn off \"delayed insert\" by unchecking the box below.","wassup");?></span> <?php
446
+ $delayed_style="";
447
+ if(strstr($tengine,"isam")===false && strstr($tengine,"archive")===false){
448
+ if(empty($wassup_options->delayed_insert)){
449
+ echo '<em>'.__("This method is unavailable for your storage engine type.","wassup").'</em>';
450
+ $delayed_style= ' '.$disabled.' style="background-color:#ddd;'.$disabledstyle.'"';
451
+ }else{
452
+ $delayed_style=' style="'.$alertstyle.'"';
453
+ }
454
+ }else{
455
+ $delayed_queue_size=wassupDb::get_db_setting("delayed_queue_size");
456
+ $max_delayed_threads=wassupDb::get_db_setting("max_delayed_threads");
457
+ if(!is_numeric($delayed_queue_size) || (int)$delayed_queue_size==0 || (int)$max_delayed_threads==0){
458
+ if(empty($wassup_options->delayed_insert)){
459
+ echo '<em>'.__("This method is disabled on your host server.","wassup").'</em>';
460
+ $delayed_style= ' '.$disabled.' style="background-color:#ddd;'.$disabledstyle.'"';
461
+ }else{
462
+ $delayed_style=' style="'.$alertstyle.'"';
463
+ }
464
+ }
465
+ }?></p>
466
+ <p class="indent-opt"><label for="delayed_insert">&nbsp; <input type="checkbox" name="delayed_insert" value="1" <?php if(!empty($wassup_options->delayed_insert))echo $checked;?><?php echo $delayed_style;?>/> <strong><?php _e("Store new visitor records with \"delayed insert\"","wassup");?></strong></label>
467
  </p>
468
+ <br/>
469
+ <p class="submit"><input type="submit" name="submit-options3" id="submit-options3" class="submit-opt button button-left button-primary wassup-button" value="<?php _e('Save Settings','wassup');?>" onclick="jQuery('#submit-options3').val('Saving...');" />&nbsp;<input type="reset" name="reset" class="reset-opt button" value="<?php _e('Reset','wassup');?>" /> - <input type="submit" name="reset-to-default" class="default-opt button button-caution" value="<?php _e("Reset to Default", "wassup");?>" /></p>
470
+ <br/>
471
+ <div id="info-sysinfo" class="description">
472
+ <hr/>
473
+ <h3><?php _e("Server Settings and Memory Resources","wassup"); ?></h3>
474
+ <p style="color:#555; margin-top:0; padding-top:0;"><?php echo sprintf(__('For information only. Some values may be adjustable in startup files: %s','wassup'),__('"wp_config.php", "php.ini" and "my.ini"','wassup'));?>.</p>
475
+ <p class="sys-settings"><strong>WassUp <?php _e('Version'); ?></strong>: <?php echo WASSUPVERSION; ?></p>
476
+ <ul class="varlist">
477
+ <li><strong>WassUp <?php _e('Table name','wassup');?></strong>: <?php echo $wassup_options->wassup_table;?></li>
478
+ <li><strong>WassUp <?php _e('Table Charset/collation','wassup');?></strong>: <?php
479
+ if (!empty($table_collation)) echo $table_collation;
480
+ else _e("unknown","wassup");?></li><?php echo "\n";
481
+ if (!empty($table_engine)) {?>
482
+ <li><strong>WassUp <?php _e('Table engine','wassup');?></strong>: <?php echo $table_engine;
483
+ }?></li>
484
+ <li><strong>Wassup <?php _e('Upgrade date','wassup');?></strong>: <?php if(!empty($wassup_options->wassup_upgraded) && is_numeric($wassup_options->wassup_upgraded)) echo date("Y-m-d H:i:s",$wassup_options->wassup_upgraded);else _e("unknown","wassup");?></li>
485
+ </ul>
486
+ <p class="sys-settings"><strong>WordPress <?php _e('Version','wassup'); ?></strong>: <?php echo $wp_version; ?></p>
487
+ <ul class="varlist"><?php
488
+ //New in v1.9: Show when multisite network is enabled
489
+ $is_multisite=false;
490
+ if (function_exists('is_multisite')) {
491
+ echo "\n"; ?>
492
+ <li><strong>WordPress <?php _e('Multisite network','wassup');?></strong>:<?php
493
+ if (is_multisite()) {
494
+ $is_multisite=true;
495
+ echo ' '.__("on","wassup");
496
+ } else {
497
+ echo ' '.__("off","wassup");?></li><?php
498
+ }
499
+ echo "\n";
500
+ } ?>
501
  <li><strong>WordPress <?php _e('Character set','wassup'); ?></strong>: <?php echo get_option('blog_charset'); ?></li>
502
  <li><strong>WordPress <?php _e('Language','wassup'); ?></strong>: <?php echo get_bloginfo('language'); ?></li>
503
+ <li><strong>WordPress Cache</strong>: <?php
504
  if (!defined('WP_CACHE') || WP_CACHE===false || trim(WP_CACHE)==="") {
505
+ echo __("not set","wassup");
506
  } else {
507
+ echo ' <span style="'.$alertstyle.'">';
508
+ if (WP_CACHE === true) echo __("on","wassup");
509
  else echo "WP_CACHE";
510
  echo '</span>';
511
  }
512
  ?></li>
513
+ <li><strong>WordPress <?php _e('Memory Allocation','wassup');?></strong>: <?php
514
+ //New in v1.9: display wordpress memory size
515
+ $memory_limit=ini_get('memory_limit');
516
+ if (defined('WP_MEMORY_LIMIT'))
517
+ $wp_memory=WP_MEMORY_LIMIT;
518
+ else
519
+ $wp_memory=$memory_limit;
520
+ $mem=0;
521
+ if (preg_match('/^(\d+)(\s?\w)?/',$wp_memory,$match)>0) {
522
+ $mem = (int)$match[1];
523
+ if (!empty($match[2]) && strtolower($match[2])=='g')
524
+ $mem = (int)$match[1]*1024;
525
+ if ($mem >= $wp_min_memory) {
526
+ echo $mem . 'M';
527
+ }elseif($mem < 40){
528
+ if(version_compare($wp_version,"3.5",">=")|| $mem < 32)
529
+ echo '<span style="'.$alertstyle.'">'.$mem.'M</span>';
530
+ else echo $mem . 'M';
531
+ }elseif ($mem < 64 && (version_compare($wp_version,"3.8",">=")|| $is_multisite)){
532
+ echo '<span style="'.$alertstyle.'">'.$mem.'M</span>';
533
+ }else{
534
+ echo $mem . 'M';
535
+ }
536
+ } else {
537
+ echo $wp_memory;
538
+ } ; ?></li>
539
+ <li><strong>WordPress <?php
540
  $WPtimezone = get_option('timezone_string');
541
+ if (!empty($WPtimezone))echo __('Timezone');
542
+ else echo __('Time Offset','wassup');?></strong>: <?php
543
  if (!empty($WPtimezone)) {
544
+ echo $WPtimezone;
545
  $wpoffset = (current_time('timestamp') - time())/3600;
546
+ }else{
547
+ $wpoffset = get_option("gmt_offset");
 
548
  }
549
  if ($wpoffset !== false && $wpoffset != "") {
550
  echo ' UTC ';
552
  else { echo $wpoffset; }
553
  }
554
  echo ' '.__('hours').' ('.gmdate(get_option('time_format'),(time()+($wpoffset*3600))).')'; ?></li>
555
+ <li><strong>WordPress <?php _e("Host Timezone","wassup");?></strong>: <?php
556
  $host_timezone = $wassup_options->getHostTimezone(true);
557
  if (!empty($host_timezone)) {
 
558
  if (is_array($host_timezone)) {
559
  echo $host_timezone[0]. " (UTC $host_timezone[1])";
560
  } else {
561
  echo $host_timezone;
562
  }
563
+ }else{
564
+ echo __("unknown");
565
+ }?></li>
566
+ <li><strong>WordPress <?php _e('Host Server','wassup'); ?></strong>: <?php
567
  $sys_server = "";
568
  if (!empty($_SERVER['SERVER_SOFTWARE'])) {
569
  $sys_server = $_SERVER['SERVER_SOFTWARE'];
570
+ }
571
+ if (empty($sys_server) || $sys_server == "Apache") {
572
+ if (defined('PHP_OS') && PHP_OS != 'Apache') {
573
+ $sys_server = PHP_OS;
574
+ } else {
575
+ $sys_server = php_uname();
576
+ }
577
+ if ((empty($sys_server) || $sys_server == "Apache") && function_exists('apache_get_version')) {
578
+ $sys_server = apache_get_version();
579
+ }
580
  }
581
  if (!empty($sys_server)) echo $sys_server;
582
  else _e("unknown","wassup");
583
  ?></li>
584
+ <li><strong>WordPress <?php _e('Browser Client','wassup'); ?></strong>: <?php
585
  echo " <!-- ";
586
+ if(!class_exists('UADetector'))
587
+ include_once(WASSUPDIR."/lib/uadetector.class.php");
588
  $browser = new UADetector;
589
  echo " -->";
590
  if (!empty($browser->name) && $browser->agenttype == "B") {
592
  if ($browser->is_mobile) echo " on ".$browser->os;
593
  } else _e("unknown","wassup");
594
  ?></li>
595
+ </ul>
596
+ <p class="sys-settings"><strong>PHP <?php _e('Version'); ?></strong>: <?php echo PHP_VERSION; ?></p>
597
+ <ul class="varlist"><?php
598
+ //New in v1.9: 'safe_mode' deprecated in PHP 5.3 and removed in 5.4
599
+ $safe_mode="off";
600
+ if (version_compare(PHP_VERSION, '5.3', '<')) {
601
+ echo "\n"; ?>
602
  <li><strong>PHP <?php _e("Safe Mode", "wassup"); ?></strong>: <?php
603
+ $safe_mode= strtolower(ini_get("safe_mode"));
604
+ if ($safe_mode == "on") echo __("on","wassup");
605
+ else echo __("off","wassup");
606
+ ?></li><?php
607
+ } ?>
608
  <li><strong>PHP <?php _e("File Open Restrictions", "wassup"); ?></strong> (open_basedir): <?php
609
  $open_basedir=ini_get('open_basedir');
610
+ if (empty($open_basedir))
611
+ echo __("off","wassup");
612
+ else
613
+ echo __("on","wassup") . '<!-- '.$open_basedir.' -->';
614
+ ?></li>
615
+ <li><strong>PHP <?php _e("URL File Open", "wassup"); ?></strong> (allow_url_fopen): <?php
616
+ $allow_url_fopen=ini_get('allow_url_fopen');
617
+ if ($allow_url_fopen) _e("on", "wassup");
618
+ else _e("off","wassup");
619
+ ?></li>
620
+ <li><strong>PHP <?php _e("Disabled functions", "wassup");?></strong>: <?php
621
+ //New in v1.9: list of disabled PHP functions
622
+ if ($safe_mode != "on") {
623
+ $disabled_funcs=ini_get('disable_functions');
624
+ if (!empty($disabled_funcs)) {
625
+ $darray=explode(',',$disabled_funcs);
626
+ array_walk($darray,'trim');
627
+ sort($darray);
628
+ if ($darray[0]=='') array_shift($darray);
629
+ $disabled_funcs=preg_replace('/(^|[ ,])(error_reporting|ini_get|ini_set|set_time_limit|shell_exec)([ ,]|$)/','\1<span style="'.$alertstyle.'">\2</span>\3',implode(', ', $darray));
630
+ echo '<br/><span style="display:block; padding-left:20px;">'.$disabled_funcs.'</span>';
631
  }
632
+ else _e("none","wassup");?></li><?php
633
  }
634
+ echo "\n"; ?>
635
+ <li><strong>PHP <?php _e("Memory Allocation","wassup"); ?></strong>: <?php
636
+ $mem=0;
637
  $memory_use=0;
638
  if (function_exists('memory_get_usage')) {
639
  $memory_use=round(memory_get_usage()/1024/1024,2);
640
  }
641
+ //$memory_limit = ini_get('memory_limit'); //set for WP memory alloc above
642
  if (preg_match('/^(\d+){1,4}(\w?)/',$memory_limit,$matches) > 0) {
643
  $mem=(int)$matches[1];
644
+ if ( $mem < 128 && $matches[2] == "M") echo '<span style="'.$alertstyle.'">'.$memory_limit."</span>";
645
+ else echo $memory_limit;
646
+ } else {
 
 
 
647
  $memory_limit=0; _e("unknown","wassup");
648
  }
649
  ?></li>
650
+ <li><strong>PHP <?php _e("Memory Usage","wassup"); ?></strong>: <?php
651
+ if (!empty($mem) && ($mem-$memory_use) < 2)
652
+ echo '<span style="'.$alertstyle.'">'.$memory_use."M</span>";
653
+ elseif ($memory_use >0)
654
+ echo $memory_use."M";
655
+ else _e("unknown","wassup");
 
 
656
  ?></li>
657
  <li><strong>PHP <?php _e("Script Timeout Limit","wassup"); ?></strong>: <?php
658
  $max_execute = ini_get("max_execution_time");
660
  else { _e("unknown","wassup"); }
661
  ?></li>
662
  <li><strong>PHP <?php _e("Browser Capabilities File","wassup"); ?></strong> (browscap): <?php
663
+ $browscap=ini_get("browscap");
664
+ if($browscap=="") echo __("not set","wassup");
665
+ else echo basename($browscap);
666
  ?></li>
667
  <li><strong>PHP Curl</strong>: <?php
668
  if (!function_exists('curl_init')) { _e("not installed","wassup"); }
669
  else { _e("installed","wassup"); }
670
  ?></li>
671
+ <li><strong>PHP <?php
672
  //different from Host server TZ since Wordpress 2.8.3+
673
  $php_offset = (int)date('Z')/(60*60);
674
  if (version_compare(PHP_VERSION, '5.1', '>=')) {
687
  } else {
688
  echo "UTC +$php_offset ".__('hours');
689
  }
690
+ if (!empty($WPtimezone)&& version_compare($wp_version,'2.8.3','>=')) {
691
+ echo ' <small> ('.__("as modified in Wordpress","wassup").')</small>';
692
+ }?></li>
693
+ </ul><?php
 
694
  //###MySQL server settings
695
  $sql_version = $wpdb->get_var("SELECT version() as version");
 
696
  if (!empty($sql_version) && version_compare($sql_version, '4.1', '>=')) {
697
+ $sql_conf = @$wpdb->get_results("SELECT @@max_user_connections AS max_connections, @@global.time_zone AS tzglobal, @@session.time_zone AS tzsession, @@session.collation_connection AS char_collation, @@session.wait_timeout AS wait_timeout, @@global.connect_timeout AS connect_timeout, @@global.key_buffer_size as index_buffer, @@global.innodb_buffer_pool_size AS innodb_buffer_size, @@session.read_buffer_size AS read_buffer, @@have_query_cache AS have_query_cache, @@global.query_cache_size AS query_cache_size, @@global.query_cache_type AS query_cache_type, @@global.query_cache_limit AS query_cache_limit, @@global.delayed_queue_size AS delayed_queue_size, @@global.delayed_insert_timeout AS delayed_insert_timeout, @@global.max_delayed_threads AS max_delayed_threads, @@session.storage_engine AS storage_engine");
698
  }
699
  if (!empty($sql_conf) && is_array($sql_conf)) {
700
+ $sql_max_connections= isset($sql_conf[0]->max_connections)? (int)$sql_conf[0]->max_connections : 0;
701
  $sql_tzglobal = isset($sql_conf[0]->tzglobal)? $sql_conf[0]->tzglobal : "";
702
  $sql_timezone = isset($sql_conf[0]->tzsession)? $sql_conf[0]->tzsession : $sql_tzglobal;
703
  $sql_collation = isset($sql_conf[0]->char_collation)? $sql_conf[0]->char_collation : "";
704
  $sql_wait_timeout = isset($sql_conf[0]->wait_timeout)? $sql_conf[0]->wait_timeout : "";
705
  $sql_connect_timeout = isset($sql_conf[0]->connect_timeout)? $sql_conf[0]->connect_timeout : "";
706
  $sql_indexbuffer = isset($sql_conf[0]->index_buffer)? $sql_conf[0]->index_buffer : "";
707
+ $sql_buffersize = isset($sql_conf[0]->innodb_buffer_size)? $sql_conf[0]->innodb_buffer_size : "";
708
  $sql_readbuffer = isset($sql_conf[0]->read_buffer)? $sql_conf[0]->read_buffer : "";
709
+ $sql_query_cache_enabled = isset($sql_conf[0]->have_query_cache)? strtolower($sql_conf[0]->have_query_cache) : "off";
710
  $sql_query_cache = isset($sql_conf[0]->query_cache_size)? $sql_conf[0]->query_cache_size : "";
711
+ $sql_cache_type = isset($sql_conf[0]->query_cache_type)? strtolower($sql_conf[0]->query_cache_type) : "";
712
+ $sql_cache_limit = isset($sql_conf[0]->query_cache_limit)? $sql_conf[0]->query_cache_limit : "";
713
  $sql_delayed_queue = isset($sql_conf[0]->delayed_queue_size)? $sql_conf[0]->delayed_queue_size : "";
714
+ $sql_delayed_timeout = isset($sql_conf[0]->delayed_insert_timeout)? $sql_conf[0]->delayed_insert_timeout : "";
715
+ $sql_delayed_threads = isset($sql_conf[0]->max_delayed_threads)? $sql_conf[0]->max_delayed_threads : "";
716
  $sql_engine = isset($sql_conf[0]->storage_engine)? $sql_conf[0]->storage_engine : "";
717
+ if ($wdebug_mode) {
718
+ echo "\n<!-- MySQL variables \$sql_conf:";
719
+ print_r($sql_conf);
720
+ echo "-->\n";
721
+ }
722
  } else {
723
  //for old MySQL versions (pre 4.1)
724
  $sql_vars = $wpdb->get_results("SHOW VARIABLES");
725
  foreach ($sql_vars AS $var) {
726
+ if ($var->Variable_name == "max_user_connections") {
727
+ $sql_max_connections= (int)$sql_conf[0]->max_connections;
728
+ } elseif ($var->Variable_name == "timezone") {
729
  $sql_timezone = $var->Value;
730
  } elseif ($var->Variable_name == "time_zone") {
731
  $sql_timezone = $var->Value;
735
  $sql_wait_timeout = $var->Value;
736
  } elseif ($var->Variable_name == "key_buffer_size") {
737
  $sql_indexbuffer = $var->Value;
738
+ } elseif ($var->Variable_name == "innodb_buffer_pool_size") {
739
+ $sql_buffersize = $var->Value;
740
  } elseif ($var->Variable_name == "read_buffer_size") {
741
  $sql_readbuffer = $var->Value;
742
+ } elseif ($var->Variable_name == "have_query_cache") {
743
+ $sql_query_cache_enabled = strtolower($var->Value);
744
  } elseif ($var->Variable_name == "query_cache_size") {
745
  $sql_query_cache = $var->Value;
746
  } elseif ($var->Variable_name == "query_cache_type") {
747
+ $sql_cache_type = strtolower($var->Value);
748
+ } elseif ($var->Variable_name == "query_cache_limit") {
749
+ $sql_cache_limit = $var->Value;
750
  } elseif ($var->Variable_name == "delayed_queue_size") {
751
  $sql_delayed_queue = $var->Value;
752
+ } elseif ($var->Variable_name == "delayed_insert_timeout") {
753
+ $sql_delayed_timeout = $var->Value;
754
+ } elseif ($var->Variable_name == "max_delayed_threads") {
755
+ $sql_delayed_threads = $var->Value;
756
  } elseif ($var->Variable_name == "storage_engine") {
757
  $sql_engine = $var->Value;
758
  } elseif (empty($sql_engine) && $var->Variable_name == "table_type") {
760
  }
761
  }
762
  if ($wdebug_mode) {
763
+ echo "\n<!-- MySQL variables \$sql_vars:";
764
+ print_r($sql_vars);
765
+ echo "-->\n";
766
  }
767
  } ?>
768
+ <p class="sys-settings"><strong>MySQL <?php _e('Version'); ?></strong>: <?php if (!empty($sql_version)) { echo $sql_version; } else { _e("unknown","wassup"); } ?>
769
+ <ul class="varlist">
770
+ <li><strong>MySQL <?php _e('Storage Engine','wassup'); ?></strong>: <?php
771
+ if (!empty($sql_engine)) {
772
+ echo $sql_engine;
773
+ if (empty($table_engine)) $table_engine=$sql_engine;
774
+ } elseif (!empty($table_engine)) {
775
+ echo $table_engine;
776
+ } else {
777
+ _e("unknown","wassup");
778
+ } ?></li>
779
  <li><strong>MySQL <?php _e('Charset/collation','wassup'); ?></strong>: <?php if (!empty($sql_collation)) {
780
  echo $sql_collation;
781
  } else {
782
+ $sql_charset = wassupDb::mysql_client_encoding();
783
  if (!empty($sql_charset)) {
784
  echo $sql_charset;
785
  } else { _e("unknown","wassup"); }
786
  }
787
  ?></li>
788
+ <li><strong>MySQL <?php _e('Max User Connections','wassup'); ?></strong>: <?php
789
+ if(isset($sql_max_connections) && is_numeric($sql_max_connections)){
790
+ if($sql_max_connections >0){
791
+ if($sql_max_connections < 48)
792
+ echo '<span style="'.$alertstyle.'">'.$sql_max_connections.'</span> ('.__("possibly too small","wassup").')';
793
+ else echo (int)$sql_max_connections;
794
+ }else{
795
+ echo __("unlimited/up to server maximum","wassup");
796
  }
797
  } else {
798
  _e("unknown","wassup");
799
+ }?></li>
800
+ <li><strong>MySQL <?php _e('Query Cache Allocation','wassup'); ?></strong>: <?php
801
+ if (preg_match('/^(on|yes|1|true)$/i',$sql_query_cache_enabled)>0) {
802
+ if (is_numeric($sql_query_cache) && (int)$sql_query_cache >0) {
803
+ $cache_size = round((int)$sql_query_cache/1024/1024);
804
+ if ($cache_size >256) {
805
+ if ($sql_cache_type != "2" && stristr($sql_cache_type,'demand')===false)
806
+ echo '<span style="'.$alertstyle.'">'.$cache_size.'M </span> ('.__("possibly too big, reduces available RAM.","wassup").')';
807
+ else
808
+ echo $cache_size.'M';
809
+ } else {
810
+ echo $cache_size . "M";
811
+ }
812
+ if ($sql_cache_type == "2" || stristr($sql_cache_type,'demand')!==false) {
813
+ echo " (".__("on demand","wassup").")";
814
+ } elseif (is_numeric($sql_cache_limit)) {
815
+ echo "</li>\n\t\t<li><strong>MySQL ".__("Cached Query Limit","wassup")."</strong>: ".round((int)$sql_cache_limit/1024/1024) .'M</nobr>';
816
+ }
817
  } else {
818
+ echo $sql_query_cache." (".__("disabled","wassup").")";
819
  }
820
  } else {
821
+ _e("disabled","wassup");
822
  } ?></li>
823
+ <li><strong>MySQL <?php _e('Index Buffer','wassup'); ?></strong>: <?php
824
+ if (empty($table_engine) || stristr($table_engine,"myisam")!==false) {
825
+ //key_buffer is MyISAM parameter only
826
+
827
+ if (is_numeric($sql_indexbuffer)) {
828
+ if ((int)$sql_indexbuffer >0)
829
+ echo (round((int)$sql_indexbuffer/1024/1024)) . "M (key buffer)";
830
+ else
831
+ echo $sql_indexbuffer." (".__("disabled","wassup").")";
832
  } else {
833
+ _e("unknown","wassup");
834
  }
835
+ } elseif (stristr($table_engine,"innodb")!==false) {
836
+ //InnoDB uses "innodb_buffer_pool_size"
837
+ if (is_numeric($sql_buffersize)) {
838
+ if ((int)$sql_buffersize >0)
839
+ echo (round((int)$sql_buffersize/1024/1024)) . "M (buffer pool size)";
840
+ else
841
+ echo $sql_buffersize." (".__("disabled","wassup").")";
842
+ } else {
843
+ _e("unknown","wassup");
844
+ }
845
+ } elseif (is_numeric($sql_indexbuffer)) {
846
+ if ((int)$sql_indexbuffer >0)
847
+ echo (round((int)$sql_indexbuffer/1024/1024)) . "M";
848
+ else
849
+ echo $sql_indexbuffer." (".__("disabled","wassup").")";
850
+ } else {
851
  _e("unknown","wassup");
852
+ } ?></li>
 
853
  <li><strong>MySQL <?php _e('Read Buffer','wassup'); ?></strong>: <?php
854
  if (is_numeric($sql_readbuffer)) {
855
  if ((int)$sql_readbuffer >0) {
859
  }
860
  } else {
861
  _e("unknown","wassup");
862
+ } ?></li>
863
+ <li><strong>MySQL <?php
864
+ if (empty($table_engine) || stristr($table_engine,"isam")!==false) {
865
+ if (!is_numeric($sql_delayed_queue) || (int)$sql_delayed_queue == 0 || (int)$sql_delayed_threads == 0) {
866
+ echo __("Delayed Insert","wassup").'</strong>: '.__("disabled","wassup");
867
+ } elseif (is_numeric($sql_delayed_threads) && (int)$sql_delayed_threads >0) {
868
+ echo __("Delayed Insert Queue","wassup"); ?></strong>: <?php
869
+ echo (int)$sql_delayed_queue ." ".__("rows","wassup");
870
+ if (isset($sql_delayed_timeout)) {
871
+ echo "</li>\n\t\t<li><strong>MySQL ".__("Delayed Handler Timeout","wassup")."</strong>: ";
872
+ if ((int)$sql_delayed_timeout >60)
873
+ echo ($sql_delayed_timeout/60)." ".__("minutes");
874
+ elseif ((int)$sql_delayed_timeout >25)
875
+ echo $sql_delayed_timeout." ".__("seconds");
876
+ else
877
+ echo '<span style="'.$alertstyle.'">'.$sql_delayed_timeout.'</span> '.("seconds");
878
+ }
879
+ } else {
880
+ echo __("Delayed Insert Queue","wassup").'</strong>: '.__("unknown","wassup");
881
+ }
882
+ } else {
883
+ if (stristr($table_engine,"innodb")!==false)
884
+ echo __("Delayed Insert","wassup").'</strong>: '.__("not supported","wassup");
885
+ elseif (!is_numeric($sql_delayed_queue) || (int)$sql_delayed_queue == 0)
886
+ echo __("Delayed Insert","wassup").'</strong>: '.__("disabled","wassup");
887
+ else
888
+ echo __("Delayed Insert Queue","wassup").'</strong>: '.__("unknown","wassup");
889
+ } ?></li>
890
  <li><strong>MySQL <?php _e("Wait Timeout","wassup"); ?></strong>: <?php
891
  if (is_numeric($sql_wait_timeout)) {
892
  echo $sql_wait_timeout." ".__("seconds","wassup");
903
  $mysql_tz = $host_timezone;
904
  }
905
  } else {
906
+ $mysql_tz = wassupDb::get_db_setting('timezone');
907
  }
908
+ $mysqloffset = wassupDb::get_db_setting('tzoffset');
909
  if ($sql_timezone != $mysql_tz) {
910
  echo $sql_timezone.' ('.$mysql_tz.' UTC '.(int)($mysqloffset/3600).')';
911
  } else {
912
  echo $sql_timezone.' (UTC '.(int)($mysqloffset/3600).')';
913
  }
914
+ if (version_compare($wp_version,'2.8.3','>='))
915
+ echo ' <small> ('.__("may be different from PHP offset","wassup").')</small>';
916
  ?></li>
917
+ </ul>
918
+ <br />
919
+ </div><!-- /sysinfo -->
920
+ <p class="opt-prev-next"><a href="<?php echo admin_url('admin.php?page=wassup-options&tab=2');?>"><?php echo '&larr;'.__("Prev","wassup");?></a> &nbsp; &nbsp; <a href="<?php if($has_uninstall_tab)echo admin_url('admin.php?page=wassup-options&tab=4');else echo admin_url('admin.php?page=wassup-options&tab=sys');?>"><?php echo __("Next","wassup").'&rarr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p><br />
921
+ <!-- <p class="opt-prev-next"><a href="<?php if($has_uninstall_tab)echo admin_url('admin.php?page=wassup-options&tab=4');else echo admin_url('admin.php?page=wassup-options&tab=3');?>"><?php echo '&larr;'.__("Prev","wassup");?></a> &nbsp; &nbsp; <a href="<?php echo admin_url('admin.php?page=wassup-options&tab=faq');?>"><?php echo __("Next","wassup").'&rarr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p><br /> -->
922
  </div>
923
+ <?php
924
+ if($has_uninstall_tab){?>
925
+ <div id="wassup_opt_frag-4" class="optionspanel<?php if ($tab == "4") echo ' tabselected';?>">
926
  <h3><?php _e('Want to uninstall WassUp?', 'wassup') ;?></h3>
927
  <p><?php _e('No problem. Before you deactivate this plugin, check the box below to cleanup any data that was collected by WassUp that could be left behind.', 'wassup') ;?></p><br />
928
+ <p><input type="checkbox" name="wassup_uninstall" value="1" <?php if ($wassup_options->wassup_uninstall == 1 ) echo 'checked="CHECKED"'; ?> /> <strong><?php _e('Permanently remove WassUp data and settings.','wassup'); ?></strong></p>
929
  <?php if ($wassup_options->wassup_uninstall == 1) { ?>
930
+ <span style="font-size:95%;font-weight:bold; margin-left:20px;<?php echo $alertstyle; ?>"><span style="text-decoration:blink;padding-left:5px;"><?php _e("WARNING","wassup"); ?>! </span><?php _e("All WassUp data and settings will be DELETED upon deactivation of this plugin.","wassup"); ?></span><br />
931
  <?php } ?>
932
+ <p><?php echo sprintf(__("This action cannot be undone. Before uninstalling WassUp, you should backup your Wordpress database first. WassUp data is stored in the table %s.", "wassup"),'<strong>'.$wassup_options->wassup_table.'</strong>');?></p>
 
 
 
933
 
934
+ <br /><p><?php echo sprintf(__("To help improve this plugin, we would appreciate your feedback at %s.","wassup"),'<a href="http://www.wpwp.org">www.wpwp.org</a>');?></p>
935
  <br /><br />
936
+ <p class="submit"><input type="submit" name="submit-options4" id="submit-options4" class="submit-opt button button-left button-primary" value="<?php _e('Save Settings','wassup');?>" onclick="jQuery('#submit-options4').val('Saving...');"/>&nbsp;<input type="reset" name="reset" value="<?php _e('Reset','wassup');?>" class="reset-opt button button-secondary" /> - <input type="submit" name="reset-to-default" class="default-opt button button-caution wassup-button" value="<?php _e("Reset to Default", "wassup");?>" /></p>
937
+ <p class="opt-prev-next"><a href="<?php echo admin_url('admin.php?page=wassup-options&tab=3');?>"><?php echo '&larr;'.__("Prev","wassup");?></a> &nbsp; &nbsp; <a href="<?php echo admin_url('admin.php?page=wassup-options&tab=faq');?>"><?php echo __("Next","wassup").'&larr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p><br />
938
+ </div><?php
939
+ } //if has_uninstall_tab
940
+ ?>
941
+ <div id="wassup_opt_frag-5" class="optionspanel faqpanel<?php if($tab=="faq" || $tab=="5") echo ' tabselected';?>">
942
+ <h3><?php echo __("Frequently Asked Questions","wassup");?></h3>
943
+ <ol>
944
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I add WassUp's chart to my admin dashboard?","wassup");?></span><br/>
945
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("Check the box for \"Enable widget/small chart in admin dashboard\" under %s tab.","wassup"),'<span class="code">WassUp >> '.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span></li>
946
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I display WassUp widgets on my site?","wassup");?></span><br/>
947
+ <strong>A:</strong> <span class="faq-answer"><?php echo __("From Wordpress widgets panel, drag the \"WassUp Online\" widget or the \"Wassup Top Stats\" widget from the list of available widgets on the left into your theme's \"Sidebar\" or \"Footer\" area on the right or use the Customizer to add Wassup widgets interactively.","wassup");?></span></li>
948
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("My Wordpress theme is not widget ready. Is it possible to display WassUp widgets on my site?","wassup");?></span><br/>
949
+ <strong>A:</strong> <span class="faq-answer"><?php echo __("Yes. Insert the template tag \"wassup_sidebar()\" into your theme's \"sidebar.php\" file to display Wassup widgets as a single combined widget on your site.","wassup");?></span></li>
950
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I view the real-time visitor geolocation map in WassUp?","wassup");?></span><br/>
951
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("Check the box for \"Display a GEO IP Map in spy visitors view\" in %s tab and save, then navigate to %s panel to see the map.","wassup"),'<span class="code">WassUp >> '.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>','<span class="code">WassUp >><nobr>'.__("SPY Visitors","wassup").'</nobr></span>');?></span></li>
952
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("The map has vanished and I get the message: \"Google has disabled use of the Maps API for this application\". How do I fix this?","wassup");?></span><br/>
953
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("Erase the contents of \"Google Maps API Key\" field under %s tab. Since WassUp 1.8.4, an API key is not required for viewing Google!Maps API v3 maps in WassUp.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span></li>
954
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I exclude a visitor from being recorded?","wassup");?></span><br/>
955
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("Navigate to %s tab and enter a visitor's username, IP address, or hostname into the appropriate text area for that \"Recording Exclusion\" type.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("Filters & Exclusions","wassup").']</nobr></span>');?></span></li>
956
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I stop (temporarily) WassUp from recording new visits on my site?","wassup");?></span><br/>
957
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("Uncheck the box for \"Enable statistics recording\" under %s tab.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span></li>
958
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("In Wordpress multisite, how do I stop (temporarily) WassUp from recording new visits on all sites in the network?","wassup");?></span><br/>
959
+ <strong>A#1:</strong> <span class="faq-answer"><?php echo sprintf(__("If plugin is \"network activated\", login as network admin, go to the Network admin dashboard, navigate to %s tab and Uncheck the box for \"Enable Statistics Recording for network\" and save.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >>['.__("General Setup","wassup").']</span>');?></span><br/>
960
+ <strong>A#2:</strong> <span class="faq-answer"><?php echo sprintf(__("If plugin is NOT \"network activated\", login as network admin, go to the main site/parent domain admin dashboard, navigate to %s tab, then Uncheck the box for \"Enable Statistics Recording for network\" and save.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span>
961
+ </li>
962
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("No data is being displayed; or \"Visitor Details\" panel show 0 records for the last 24 hours. How do I fix this?","wassup");?></span><br/>
963
+ <strong>A #1:</strong> <span class="faq-answer"><?php echo sprintf(__("Check the box for \"Enable statistics recording\" setting under %s tab and save.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span><br/>
964
+ <strong>A #2:</strong> <span class="faq-answer"><?php echo sprintf(__("Click the [Reset to Default] button under %s tab.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span><br/>
965
+ <strong>A #3:</strong> <span class="faq-answer"><?php echo sprintf(__("Navigate to %s tab and uncheck the \"MySQL Delayed Insert\" setting and save.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("Manage File & Data","wassup").']</nobr></span>');?></span><br/>
966
+ <strong>A #4:</strong> <span class="faq-answer"><?php echo __("Deactivate and Re-activate Wassup from Wordpress Plugins panel.","wassup");?></span><br/>
967
+ <strong>A #5:</strong> <span class="faq-answer"><?php echo sprintf(__("If you have access to MySql/phpMyAdmin on your host server, run the MySql command %s to repair and release any locks on wassup table. Note that wassup table name may be different in other Wordpress setups.","wassup"),'<code>REPAIR TABLE '.$wassup_options->wassup_table.'</code>');?></span><br/>
968
+ <strong>A #6:</strong> <span class="faq-answer"><?php echo __("As a last resort, uninstall WassUp cleanly (delete data and files) and reinstall it.","wassup");?></span></li>
969
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("My popular web site is hosted on a shared server with restrictive database size limits. How do I prevent WassUp's table from growing too big for my allocated quota?","wassup");?></span><br/>
970
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("Navigate to %s tab and enable the setting for \"Auto Delete\" of old records and/or check the box to receive an email alert when the table size limit is exceeded.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("Manage File & Data","wassup").']</nobr></span>');?></span></li>
971
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("WassUp visitor counts are much lower than actual for my website. Why is there a discrepancy and how do I fix it?","wassup");?></span><br/>
972
+ <strong>A:</strong> <span class="faq-answer"><?php echo __("Low visitor count is likely caused by page caching on your website. WassUp is incompatible with static page caching plugins such as WP Supercache, WP Cache, and Hyper Cache. To fix, uninstall your cache plugin or switch to a different (javascript-based) statistics plugin.","wassup");?></span></li>
973
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("Is there any caching plugin that works with WassUp?","wassup");?></span><br/>
974
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("%s is the only caching plugin verified to work with WassUp.","wassup"),'<a href="http://wordpress.org/extend/plugins/wp-widget-cache/">WP Widget Cache</a>');?></span></li>
975
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How can I make Wassup run faster?","wassup");?></span><br/>
976
+ <strong>A #1:</strong> <span class="faq-answer"><?php echo sprintf(__("Keep Wassup table size small with automatic deletions or periodic manual delete of old records under %s tab.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("Manage File & Data","wassup").']</nobr></span>');?></span><br/>
977
+ <strong>A #2:</strong> <span class="faq-answer"><?php echo __("If using the \"Top Stats\" widget on your site, set refresh frequency to 15 minutes or higher.","wassup");?></span><br/>
978
+ <strong>A #3:</strong> <span class="faq-answer"><?php echo sprintf(__("Reduce the number of recording exclusions (by ip/hostname/username/url) under %s tab.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("Filters & Exclusions","wassup").']</nobr></span>');?></span><br/>
979
+ <strong>A #4:</strong> <span class="faq-answer"><?php
980
+ $files='<span class="code">badhosts.txt, badhosts-intl.txt,'.__("and","wassup").' lib/akismet.class.php</span>';
981
+ echo sprintf(__("Delete the files %s from Wassup plugin folder to force reduce I/O usage in spam/malware detection.","wassup"),$files);?></span><br/>
982
+ <strong>A #5:</strong> <span class="faq-answer"><?php echo sprintf(__("Stop all spam/malware detection by unchecking \"Enable Spam and malware detection on records\" under %s tab.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span></li>
983
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("Why does WassUp stats sometimes show more page views than actual pages clicked by a person?","wassup");?></span><br/>
984
+ <strong>A:</strong> <span class="faq-answer"><?php echo __("\"Phantom\" page views can occur when a user's browser does automatic feed retrieval, link pre-fetching, a page refresh, or automatically adds your website to it's \"Top sites\" window (Safari). WassUp tracks these because they are valid requests from the browser and are sometimes indistinguishable from user link clicks.","wassup");?></span></li>
985
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I upgrade WassUp safely when my site has frequent visitors?","wassup");?></span><br/>
986
+ <strong>A:</strong> <span class="faq-answer"><?php echo sprintf(__("To upgrade WassUp when your site is busy, you must first disable statistics recording manually under %s tab, then do the plugin upgrade, and afterwards re-enable recording manually when the upgrade is complete and the plugin is active.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("General Setup","wassup").']</nobr></span>');?></span></li>
987
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("An unspecified error occurred during plugin upgrade. What do I do next?","wassup");?></span><br/>
988
+ <strong>A:</strong> <span class="faq-answer"><?php echo __("Wait a few minutes. Do NOT re-attempt to upgrade nor try to activate the plugin again! An activation error with no explanation is probably due to your browser timing out, not an upgrade failure. WassUp continues it's upgrade in the background and will activate automatically when it is done. After a few minutes (5-10) has passed, revisit Wordpress admin Plugins panel and verify that Wassup plugin has activated.","wassup");?></span></li>
989
+ <li><strong>Q:</strong> <span class="faq-question"><?php echo __("How do I uninstall WassUp cleanly?","wassup");?></span><br/>
990
+ <strong>A #1:</strong> <span class="faq-answer"><?php echo __("From a single Wordpress site: navigate to Wordpress Plugins panel and deactivate WassUp plugin. Then, on the same page, click the \"delete\" link below WassUp name. This deletes both data and files permanently.","wassup");?></span><br/>
991
+ <strong>A #2:</strong> <span class="faq-answer"><?php echo __("From Wordpress multisite Network admin panel: navigate to Plugins panel and deactivate WassUp plugin. If the plugin is not \"network activated\", navigate to the main site/parent domain Plugins panel and deactivate Wassup plugin there, then return to Network admin Plugins panel. Click the \"delete\" link below WassUp name. This deletes both data and files permanently from the main site/parent domain and deletes Wassup data from all the subsites in the network.","wassup");?></span><br/>
992
+ <strong>A #3:</strong> <span class="faq-answer"><?php echo sprintf(__("From a subsite in Wordpress multisite: navigate to %s tab and check the box for \"Permanently remove WassUp data and settings\" and save. Next, go to the subsite's Plugins panel and deactivate WassUp plugin. This deletes the subsite's data permanently. No files are deleted (not needed).","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >><nobr>['.__("Uninstall","wassup").']</nobr></span>');?></span><br/>
993
+ <strong>A #4:</strong> <span class="faq-answer"><?php echo sprintf(__("From a Wordpress 2.x site: navigate to %s tab and check the box for \"Permanently remove WassUp data and settings\" and save. Next, go to Wordpress Plugins panel and deactivate WassUp plugin. This deletes the data permanently. To delete the plugin files from Wordpress 2.x, use an ftp client software on your PC or login to your host server's \"cpanel\" and use \"File Manager\" to delete the folder \"wassup\" from the %s directory on your host server.","wassup"),'<span class="code">WassUp >>'.__("Options","wassup").' >>['.__("Uninstall","wassup").']</span>','<code>/wordpress/wp-content/plugins/</code>');?></span></li>
994
+ </ol>
995
+ <p class="legend"><?php echo sprintf(__("Visit the %s to find more answers to your WassUp questions.","wassup"),'<a href="http://wordpress.org/support/plugin/wassup">'.__("Plugin Forum","wassup").'</a>');?></p>
996
+ <br />
997
+ <p class="opt-prev-next"><a href="<?php if($has_uninstall_tab)echo admin_url('admin.php?page=wassup-options&tab=4');else echo admin_url('admin.php?page=wassup-options&tab=3');?>"><?php echo '&larr;'.__("Prev","wassup");?></a> &nbsp; &nbsp; <a href="<?php echo admin_url('admin.php?page=wassup-options&tab=donate');?>"><?php echo __("Next","wassup").'&rarr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p><br />
998
+ </div>
999
+ <div id="wassup_opt_frag-6" class="optionspanel donatepanel<?php if($tab=="donate" || $tab=="6") echo ' tabselected';?>">
1000
+ <h3><?php _e("How you can donate","wassup"); ?></h3>
1001
+ <p><?php echo __("If you like this plugin, please consider making a donation to help keep it's development active.","wassup");?></p>
1002
+ <div class="donate-block">
1003
+ <div id="donate-paypal" class="donate-box"><strong><?php echo sprintf(__("Donate by %s","wassup"),'PayPal');?></strong>: <a href="http://www.wpwp.org" title="Donate" target="_blank"><img src="<?php echo WASSUPURL.'/img/btn_donateCC_LG.gif';?>"/></a></div>
1004
+ <div id="donate-bitcoin" class="donate-box"><strong><?php echo sprintf(__("Donate %s","wassup"), "BitCoins");?></strong>: <a id="BCdonate" href="#"><img src="<?php echo WASSUPURL.'/img/donate_64.png';?>" style="width:200px;height:50px;"/></a><br/>
1005
+ <div id="bc_placeholder" style="display:none;">
1006
+ <span><?php echo __("Send your bitcoin donation to this address","wassup");?></span>:
1007
+ <img class="bc-addr" src="http://helenesit.com/multimedia/images/bc-donate-addr<?php echo rand(1,3);?>.png" align="center" alt="15ohMGD6dg233Tfem2S7CdAoW8jC5WMW5T"/>
1008
+ </div>
1009
+ </div>
1010
+ </div>
1011
+ <div class="donate-block">
1012
+ <?php
1013
+ //DONOR LISTS or a DONATION CAMPAIGN can be added here or in a separate file, "donate.php" or as an external link or iframe.
1014
+ if (file_exists(WASSUPDIR."/lib/donate.php")) include_once(WASSUPDIR."/lib/donate.php");?>
1015
+ </div>
1016
+ <br />
1017
+ <p class="opt-prev-next"><a href="<?php echo admin_url('admin.php?page=wassup-options&tab=faq');?>"><?php echo '&larr;'.__("Prev","wassup");?></a> &nbsp; &nbsp; <a href="<?php echo admin_url('admin.php?page=wassup-options&tab=1');?>"><?php echo __("Next","wassup").'&rarr;';?></a> &nbsp; &nbsp; <a href="#wassupsettings" onclick="wScrollTop();return false;"><?php echo __("Top","wassup").'&uarr;';?></a></p><br />
1018
  </div>
1019
+ </div><!-- /#tabcontainer -->
1020
+ </form>
1021
  <br />
1022
+ <script type="text/javascript">jQuery("a#BCdonate").toggle(function(){jQuery('div#bc_placeholder').slideDown("slow");},function(){jQuery('div#bc_placeholder').slideUp("slow");return false;});</script>
1023
  <?php
1024
+ echo "\n";
1025
  } //end wassup_optionsView
1026
  ?>
lib/uadetector.class.php CHANGED
@@ -1,1707 +1,152 @@
1
  <?php
2
  /**
3
- * UADetector.class.php
4
- * Description: a PHP4 class for browser and spider identification
5
- * Updated: 2011-07-13
6
- * @version 0.9a5
7
- * @author Helene Duncker <techfromhel@gmail.com>
8
- * Author URI: http://techfromhel.webege.com/
9
  *
10
- * @copyright Copyright (c) 2009-2011 Helene Duncker
11
- * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  */
13
- /**
14
- * Usage: include_once(uadetector.class.php);
15
  * $useragent = new UADetector(); //returns object(16)
16
  *
17
- * Note: UADetector attempts to find the actual browser in use. This may
18
- * cause the "name" field to differ from "emulation" field when
19
- * user-agent "spoofing" is detected. Use the appropriate field
20
- * for your application type:
21
  * a) "Name" field is best for information and statistics only.
22
  * b) "Emulation" field is best for UI and customizations by browser type.
23
- *
24
- * Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
25
  */
26
- class UADetector {
27
- var $name = ''; //browser or spider name, not null
28
- var $version = ''; //browser or spider version, if available
29
- var $os = ''; //operating system+version, if available
30
- var $platform = ''; //operating system or device platform
31
- var $emulation = ''; //emulated browser plus major version#
32
- var $language = ''; //language code (not locale), if available
33
- var $device = ''; //PC, PDA, Phone, TV, if available
34
- var $model = ''; //Device manufacturer model, if available
35
- var $resolution = ''; //screen size (MMMxNNN), if in user-agent
36
- var $subscribers = ''; //feed subscriber count, if in user-agent
37
- var $is_mobile = false;
38
- var $is_browser = false;
39
- var $is_robot = false;
40
- var $is_spammer = false; //spam script injection code present
41
- var $agent = ''; //user-agent (unspoofed, if possible)
42
- var $agenttype = ''; //browser or spider type, not null:
43
- // B=Browser,
44
- // F=feedreader (could also have type=R)
45
- // R=robot (spider|archiver|validator),
46
- // S=Spammer/Script injector
47
- //var $done_browsers = false; //private
48
- //var $done_spiders = false; //private
49
- //var $is_active_agent = false; //private
50
-
51
- /**
52
- * For PHP 4 compatibility.
53
- * @access public
54
- * @param string $ua (optional)
55
- * @return none
56
- */
57
- function uadetector($ua="") {
58
- $this->__construct($ua);
59
- }
60
-
61
- /**
62
- * Main Contructor Class
63
- * Sets User Agent information such as name, version, ...
64
- * @constructor
65
- * @access public
66
- * @param string $ua (optional)
67
- * @return object(16)
68
- */
69
- function __construct($ua="") {
70
- global $wdebug_mode, $do_profile;
71
- $do_profile= false;
72
- if ($wdebug_mode && function_exists('profiler_beginSection')) {
73
- $do_profile = true;
74
- profiler_beginSection('(Subtot)uaDetector');
75
- }
76
- $this->is_browser = false;
77
- $this->is_mobile = false;
78
- $this->is_robot = false;
79
- $this->is_spammer = false;
80
-
81
- //initialize private booleans
82
- $this->done_browsers = false; //true after isBrowserAgent() is parsed
83
- $this->done_spiders = false; //true after isSpiderAgent() is parsed
84
- $this->is_active_agent = false; //true when agent is in http header
85
- //set agent, if not parameter
86
- if (empty($ua)) {
87
- $this->setDeviceUA();
88
- $ua = $this->agent;
89
- $this->is_active_agent = true; //ok to read http headers
90
- } else {
91
- $ua = trim($ua);
92
- $this->agent = $ua;
93
- }
94
-
95
- //Detect the brower/spider...
96
- //exclude invalid agents from full check
97
- if (!$this->isValidAgent($ua) && empty($this->name)) {
98
- $this->isUnknownAgent($ua);
99
- } else {
100
- //check user-agent data and set all variables...
101
- if ($this->isTopAgent()===false) {
102
- if ($this->isBrowserAgent()===false) {
103
- if ($this->isSpiderAgent()===false) {
104
- $this->isWTF();
105
- }}}
106
- }
107
-
108
- //set booleans
109
- if ($this->agenttype == "B") {
110
- $this->is_browser = true;
111
- } elseif ($this->agenttype == "R") {
112
- $this->is_robot = true;
113
- } elseif ($this->agenttype == "S") {
114
- $this->is_spammer = true;
115
- }
116
- if (empty($this->is_mobile) && $this->platform == "WAP") {
117
- $this->is_mobile = true;
118
- //TODO: assume mobile if screen width <400 & >132 ??
119
- }
120
-
121
- //set browser emulation field
122
- if (empty($this->emulation)) {
123
- $this->setEmulation();
124
- }
125
- //lastly, unset temporary private booleans...
126
- unset($this->done_browsers,$this->done_spiders,$this->is_active_agent);
127
-
128
- if ($do_profile) {
129
- profiler_endSection('(Subtot)uaDetector');
130
- }
131
- return;
132
- } //end function __construct
133
-
134
- /**
135
- * Check user agent against a known list of top user agents
136
- * @return associative array containing agent details
137
- */
138
- function isTopAgent($agent="") {
139
- //NOTE: Top agents are based on recent log data from
140
- // "WassUp", a web statistics plugin for WordPress 2.2+
141
- // available at http://www.wpwp.org
142
- global $wdebug_mode, $do_profile;
143
-
144
- // User agent parameter or class variable is required.
145
- $ua="";
146
- $is_current_ua = false;
147
- if (empty($agent)) {
148
- list($ua,$is_current_ua) = $this->isCurrentAgent();
149
- } else {
150
- $ua=$agent;
151
- }
152
- if (empty($ua)) { //nothing to check
153
- return false;
154
- }
155
- if ($do_profile) {
156
- profiler_beginSection('____ua::isTopAgent');
157
- }
158
- $os="";
159
- $top_ua = array('name'=>"",'version'=>"",'os'=>"",'platform'=>"",'language'=>"",'agenttype'=>"",'resolution'=>"");
160
-
161
- // #1 Googlebot
162
- if (preg_match("#^Mozilla/\d\.\d\s\(compatible;\sGooglebot/(\d\.\d);[\s\+]+http\://www\.google\.com/bot\.html\)$#i",$ua,$match)>0) {
163
- $top_ua['name'] = "Googlebot";
164
- $top_ua['version']=$match[1];
165
- $top_ua['agenttype']= "R";
166
- // #2 IE 8|7|6 on Windows7|2008|Vista|XP|2003|2000
167
- } elseif (preg_match('#^Mozilla/\d\.\d\s\(compatible;\sMSIE\s(\d+)(?:\.\d+)+;\s(Windows\sNT\s\d\.\d(?:;\sW[inOW]{2}64)?)(?:;\sx64)?;?(?:\sSLCC1;?|\sSV1;?|\sGTB\d;|\sTrident/\d\.\d;|\sFunWebProducts;?|\s\.NET\sCLR\s[0-9\.]+;?|\s(Media\sCenter\sPC|Tablet\sPC)\s\d\.\d;?|\sInfoPath\.\d;?)*\)$#',$ua,$match)>0) {
168
- $top_ua['name'] = 'IE';
169
- $top_ua['version'] = $match[1];
170
- $top_ua['platform']='Windows';
171
- $os = $match[2];
172
- $top_ua['os'] = $this->winOSversion($os);
173
- $top_ua['agenttype']= 'B';
174
- if (!empty($match[3])) {
175
- $top_ua['device'] = $match[3];
176
- }
177
- // #3 Firefox and other Mozilla browsers on Windows
178
- } elseif (preg_match('#^Mozilla/\d\.\d\s\(Windows;\sU;\s(.+);\s([a-z]{2}(?:\-[A-Za-z]{2})?);\srv\:\d(?:\.\d+)+\)\sGecko/\d+\s([A-Za-z\-0-9]+)/(\d+(?:\.\d+)+)(?:\s\(.*\))?$#',$ua,$match)>0) {
179
- $top_ua['name'] = $match[3];
180
- $top_ua['version'] = $match[4];
181
- $top_ua['language']=$match[2];
182
- $top_ua['platform']="Windows";
183
- $os = $match[1];
184
- $top_ua['os'] = $this->winOSversion($os);
185
- $top_ua['agenttype']= 'B';
186
- // #4 Yahoo!Slurp
187
- } elseif (preg_match('#^Mozilla/\d\.\d\s\(compatible;\s(Yahoo\!\s([A-Z]{2})?\s?Slurp)/?(\d\.\d)?;\shttp\://help\.yahoo\.com/.*\)$#i',$ua,$match)>0) {
188
- $top_ua['name'] = $match[1];
189
- if (!empty($match[3])) {
190
- $top_ua['version']=$match[3];
191
- }
192
- if (!empty($match[2])) {
193
- $top_ua['language']=$match[2];
194
- }
195
- $top_ua['agenttype']= 'R';
196
- // #5 BingBot
197
- } elseif (preg_match('#^Mozilla/\d\.\d\s\(compatible;\sbingbot/(\d\.\d)[^a-z0-9]+http\://www\.bing\.com/bingbot\.htm.$#',$ua,$match)>0) {
198
- $top_ua['name'] = 'BingBot';
199
- if (!empty($match[1])) {
200
- $top_ua['name'].=$match[1];
201
- }
202
- if (!empty($match[2])) {
203
- $top_ua['version']=$match[2];
204
- }
205
- $top_ua['agenttype']= 'R';
206
- // #6 FeedBurner
207
- } elseif (preg_match('#^FeedBurner/(\d\.\d)\s\(http\://www\.FeedBurner\.com\)$#',$ua,$match)>0) {
208
- $top_ua['name'] = 'FeedBurner';
209
- $top_ua['version']=$match[1];
210
- $top_ua['agenttype']= 'F';
211
- // #7 Wordpress
212
- } elseif (preg_match('#^WordPress/(?:wordpress(\-mu)\-)?(\d\.\d+)(?:\.\d+)*(?:\-[a-z]+)?(?:\;\shttp\://[a-z0-9_\.\:\/]+)?$#',$ua,$match)>0) {
213
- $top_ua['name'] = 'Wordpress';
214
- if (!empty($match[1])) {
215
- $top_ua['name']=$top_ua['name'].$match[1];
216
- }
217
- $top_ua['version']=$match[2];
218
- $top_ua['agenttype']= 'U';
219
- // #8 Firefox and Gecko browsers on Mac|*nix|OS/2 etc...
220
- } elseif (preg_match('#^Mozilla/\d\.\d\s\((Macintosh|X11|OS/2);\sU;\s(.+);\s([a-z]{2}(?:\-[A-Za-z]{2})?)(?:-mac)?;\srv\:\d(?:.\d+)+\)\sGecko/\d+\s([A-Za-z\-0-9]+)/(\d+(?:\.[0-9a-z\-\.]+))+(?:(\s\(.*\))(?:\s([A-Za-z\-0-9]+)/(\d+(?:\.\d+)+)))?$#',$ua,$match)>0) {
221
- $top_ua['name'] = $match[4];
222
- $top_ua['version'] = $match[5];
223
- $top_ua['language']=$match[3];
224
- $top_ua['platform']=$match[1];
225
- $os = $match[2];
226
- if (!empty($match[7])) {
227
- $top_ua['name'] = $match[7];
228
- $top_ua['version'] = $match[8];
229
- $os=$os." ".$match[4]." ".$match[5];
230
- } elseif (!empty($match[6])) {
231
- $os=$os.$match[6];
232
- }
233
- list($top_ua['os']) = $this->OSversion($os,$top_ua['platform'],$ua);
234
- $top_ua['agenttype']= 'B';
235
- // #9 Safari and Webkit-based browsers on all platforms
236
- } elseif (preg_match('#^Mozilla/\d\.\d\s\(([A-Za-z0-9/\.]+);\sU;?\s?(.*);\s?([a-z]{2}(?:\-[A-Za-z]{2})?)?\)\sAppleWebKit/[0-9\.]+\+?\s\((?:KHTML,\s)?like\sGecko\)(?:\s([a-zA-Z0-9\./]+(?:\sMobile)?)/?[A-Z0-9]*)?\sSafari/([0-9\.]+)$#',$ua,$match)>0) {
237
- $top_ua['name'] = 'Safari';
238
- if (!empty($match[4])) { $vers = $match[4]; }
239
- else { $vers = $match[5]; }
240
- $browser = $this->webkitVersion($vers,$ua);
241
- if (!empty($browser) && is_array($browser)) {
242
- $top_ua['name'] = $browser['name'];
243
- $top_ua['version'] = $browser['version'];
244
- }
245
- if (empty($match[2])) {
246
- $os = $match[1];
247
- } else {
248
- $top_ua['platform'] = $match[1];
249
- $os = $match[2];
250
- }
251
- if ($top_ua['platform'] == 'Windows') {
252
- $top_ua['os'] = $this->winOSversion($os);
253
- } else {
254
- list($top_ua['os']) = $this->OSversion($os,$top_ua['platform'],$ua);
255
- }
256
- $top_ua['language']=$match[3];
257
- $top_ua['agenttype']= 'B';
258
-
259
- // #10 Google Chrome browser on all platforms with or without language string
260
- } elseif (preg_match('#^Mozilla/\d+\.\d+\s(?:[A-Za-z0-9\./]+\s)?\((?:([A-Za-z0-9/\.]+);(?:\sU;)?\s?)?([^;]*)(?:;\s[A-Za-z]{3}64)?;?\s?([a-z]{2}(?:\-[A-Za-z]{2})?)?\)\sAppleWebKit/[0-9\.]+\+?\s\((?:KHTML,\s)?like\sGecko\)(?:\s([A-Za-z0-9_\-]+[^i])/([A-Za-z0-9\.]+)){1,3}(?:\sSafari/[0-9\.]+)?$#',$ua,$match)>0) {
261
- $top_ua['name'] = $match[4];
262
- $top_ua['version'] = $match[5];
263
- if (empty($match[2])) {
264
- $os = $match[1];
265
- } else {
266
- $top_ua['platform'] = $match[1];
267
- $os = $match[2];
268
- }
269
- if ($top_ua['platform'] == 'Windows') {
270
- $top_ua['os'] = $this->winOSversion($os);
271
- } else {
272
- list($top_ua['os']) = $this->OSversion($os,$top_ua['platform'],$ua);
273
- }
274
- if (!empty($match[3])) {
275
- $top_ua['language']=$match[3];
276
- }
277
- $top_ua['agenttype']= 'B';
278
- }
279
- //check http header for user agent spoofing and for os and screen resolution
280
- if ($is_current_ua) {
281
- list($name,$os,$platform,$resolution,$uatype) = $this->getHeaderData();
282
- if (!empty($name)) {
283
- $top_ua['name'] = $name;
284
- if (!empty($uatype)) $top_ua['agenttype'] = $uatype;
285
- }
286
- if (!empty($os)) $top_ua['os'] = $os;
287
- if (!empty($resolution)) $top_ua['resolution'] = $resolution;
288
- }
289
- //set class vars and return array
290
- if (!empty($top_ua['name'])) {
291
- //if agent is class var, set other class vars.
292
- if (empty($agent)) {
293
- $this->setClassVars($top_ua);
294
- }
295
- } else {
296
- $top_ua=false;
297
- }
298
- if ($wdebug_mode) {
299
- echo "\n".'<br />uadetector: top_ua->name='.$top_ua['name']."&nbsp; ".'top_ua->os='.$top_ua['os']; //debug
300
- if ($do_profile) {
301
- profiler_endSection('____ua::isTopAgent');
302
- }
303
- }
304
- return ($top_ua);
305
- } //end function isTopAgent
306
-
307
- /**
308
- * detect browsers
309
- * @access public
310
- * @param string (optional)
311
- * @return array (associative)
312
- */
313
- function isBrowserAgent($agent="") {
314
- global $wdebug_mode, $do_profile;
315
- $ua="";
316
- $is_current_ua = false;
317
- if (empty($agent)) {
318
- list($ua,$is_current_ua) = $this->isCurrentAgent();
319
- } else {
320
- $ua=$agent;
321
- }
322
- if (empty($ua)) { //nothing to check
323
- return false;
324
- }
325
- //##detect browsers
326
- $browser = array('name'=>"",'version'=>"",'os'=>"",'platform'=>"",'language'=>"",'agenttype'=>"B",'resolution'=>"",'device'=>"",'model'=>"", 'emulation'=>"");
327
-
328
- //spiders are not detected here, so exclude user agents that are likely spiders (ie. contains an email or URL, or spider-like keywords)
329
- if (isset($this->done_spiders) && !$this->done_spiders && preg_match('#(robot|bot[\s\-_\/\)]|bot$|blog|checker|crawl|feed|fetcher|libwww|[^\.e]link\s?|parser|reader|spider|verifier|href|https?\://|.+(?:\@|\s?at\s?)[a-z0-9_\-]+(?:\.|\s?dot\s?)|www[0-9]?\.[a-z0-9_\-]+\..+|\/.+\.(s?html?|aspx?|php5?|cgi))#i',$ua)>0) {
330
- //not spider if embedded browser or is a browser add-on such as spyware or translator
331
- if (preg_match('#(embedded\s?(WB|Web\sbrowser)|dynaweb|bsalsa\.com|muuk\.co|translat[eo]r?)#i',$ua)==0) {
332
- return false;
333
- }
334
- }
335
- if ($do_profile) {
336
- profiler_beginSection('_____ua::isBrowser');
337
- }
338
- //### Step 1: check for mobile or embedded browsers
339
- $ismobile = false;
340
- $wap = $this->isMobileAgent($ua);
341
- if (!empty($wap) && is_array($wap)) {
342
- $ismobile = true;
343
- $browser['name'] = $wap['name'];
344
- $browser['version'] = $wap['version'];
345
- $browser['device'] = $wap['device'];
346
- $browser['model'] = $wap['model'];
347
- $browser['os'] = $wap['os'];
348
- $browser['platform'] = "WAP";
349
- if (!empty($wap['language'])) $browser['language'] = $wap['language'];
350
- }
351
- //### Step 2: Check for MSIE-based browsers
352
- if (!$ismobile || empty($browser['name'])) {
353
- if (preg_match('/compatible(?:\;|\,|\s)+MSIE\s(\d+)(\.\d+)+(.*)/',$ua,$pcs)>0) {
354
- if ($wdebug_mode) {
355
- echo "\nMatch for MSIE-based browser<br/>";
356
- }
357
- $browser['name'] = 'IE';
358
- $browser['version'] = $pcs[1];
359
- $browser['emulation'] = rtrim('IE'." ".$this->majorVersion($pcs[1]));
360
- $iestring = $pcs[3];
361
- //differentiate IE from IE-based and IE-masked browsers or spiders
362
- if (preg_match('/\s(AOL|America\sOnline\sBrowser)\s(\d+(\.\d+)*)/',$iestring,$pcs)>0) {
363
- $browser['name'] = 'AOL';
364
- $browser['version'] = $pcs[2];
365
-
366
- } elseif (preg_match('#\s(Opera|Netscape|Crazy\sBrowser)/?\s?(\d+(?:\.\d+)*)#',$iestring,$pcs)>0) {
367
- $browser['name'] = $pcs[1];
368
- $browser['version'] = $pcs[2];
369
-
370
- } elseif (preg_match('/\s(Avant|Orca)\sBrowser;/',$iestring,$pcs)>0) {
371
- $browser['name'] = $pcs[1];
372
- $browser['version'] = "";
373
-
374
- } elseif (preg_match('/Windows\sCE;\s?IEMobile\s(\d+)(\.\d+)*\)/i',$iestring,$pcs)>0) {
375
- $browser['name'] = 'IEMobile';
376
- $browser['version'] = $pcs[1];
377
- $browser['os'] = 'WinCE';
378
- $browser['platform'] = 'WAP';
379
- $ismobile=true;
380
- } elseif (preg_match('#\s(\d+x\d+)?\;?\s?(?:WebTV|MSNTV)(?:/|\s)([0-9\.]+)*#i',$iestring,$pcs)>0) {
381
- $browser['name'] = "MSNTV";
382
- $browser['version'] = $pcs[2];
383
- $browser['platform'] = 'Embedded';
384
- $browser['device'] = 'TV';
385
- if (!empty($pcs[1])) {
386
- $browser['resolution'] = $pcs[1];
387
- }
388
- }
389
-
390
- //### Step 3: Check for All Other browsers
391
- //Opera browsers
392
- } elseif (preg_match('#Opera[/ ]([0-9\.]+)#',$ua,$pcs)>0) {
393
- $browser['name'] = 'Opera';
394
- $browser['version'] = $pcs[1];
395
-
396
- //Firefox-based browsers (Camino, Flock) (find before FF)
397
- } elseif (preg_match('#[^a-z](Camino|Flock|Galeon|Orca)/(\d+[\.0-9a-z]*)#',$ua,$pcs)>0) {
398
- if ($wdebug_mode) {
399
- echo "\nMatch for Firefox-based browser<br/>";
400
- }
401
- $browser['name'] = $pcs[1];
402
- $browser['version'] = $pcs[2];
403
-
404
- //other Gecko-type browsers (incl. Firefox)
405
- } elseif (preg_match('#Gecko/\d+\s([a-z0-9_\- ]+)/(\d+[\.0-9a-z]*)(?:$|[^a-z0-9_\-]+([a-z0-9_\- ]+)/(\d+[\.0-9a-z]*)|[^a-z0-9_\-]*\(.*\))#i',$ua,$pcs)>0) {
406
- if ($wdebug_mode) {
407
- echo "\nMatch for Gecko-type browser<br/>";
408
- }
409
- $browser['name'] = $pcs[1];
410
- $browser['version'] = $pcs[2];
411
- if (!empty($pcs[3]) && stristr($pcs[3],"Firefox")!==false) {
412
- $browser['name'] = 'Firefox';
413
- $browser['version'] = $pcs[4];
414
- }
415
- //Firefox browser
416
- } elseif (preg_match('#[^a-z](Fire(?:fox|bird))/?(\d+[\.0-9a-z]*)?#',$ua,$pcs)>0) {
417
- if ($wdebug_mode) {
418
- echo "\nMatch for Firefox browser<br/>";
419
- }
420
- $browser['name'] = $pcs[1];
421
- if (!empty($pcs[2])) {
422
- $browser['version'] = $pcs[2];
423
- }
424
- //Mozilla browser (like FF, but nothing after "rv:" or "Gecko")
425
- } elseif (preg_match('/^Mozilla\/\d\.\d.+\srv\:(\d[\.0-9a-z]+)[^a-z0-9]+(?:Gecko\/\d+)?$/i',$ua,$pcs)>0) {
426
- if ($wdebug_mode) {
427
- echo "\nMatch for Mozilla browser<br/>";
428
- }
429
- $browser['name'] = 'Mozilla';
430
- if (!empty($pcs[1])) {
431
- $browser['version'] = $pcs[1];
432
- }
433
-
434
- //WebKit-based browsers
435
- } elseif (preg_match('#^Mozilla/\d\.\d\s\((?:([a-z]{3,}.*\s)?([a-z]{2}(?:\-[A-Za-z]{2})?)?)\)\sAppleWebKit/[0-9\.]+\+?\s\([a-z, ]*like\sGecko[a-z\; ]*\)\s([a-zA-Z0-9\./]+(?:\sMobile)?/?[A-Z0-9]*)?(\sSafari/([0-9\.]+))?$#',$ua,$pcs)>0) {
436
- if ($wdebug_mode) {
437
- echo "\nMatch for WebKit-based browser<br/>";
438
- }
439
- if (!empty($pcs[3])) { $vers = $pcs[3]; }
440
- else { $vers = $pcs[5]; }
441
- $webkit = $this->webkitVersion($vers,$ua);
442
- if (!empty($webkit['name'])) {
443
- $browser['name'] = $webkit['name'];
444
- $browser['version'] = $webkit['version'];
445
- }
446
- if (!empty($pcs[2])) {
447
- $browser['language'] = $pcs[2];
448
- }
449
-
450
- //Text-only browsers Lynx, ELinks...(yep, they still exist)
451
- } elseif (preg_match("#^(E?Links|Lynx|(?:Emacs\-)?w3m)[^a-z0-9]+([0-9\.]+)?#i",$ua,$pcs)) {
452
- if ($wdebug_mode) {
453
- echo "\nMatch for text browser<br/>";
454
- }
455
- $browser['name'] = $pcs[1];
456
- if (!empty($pcs[2])) {
457
- $browser['version'] = $pcs[2];
458
- }
459
-
460
- //Some obscure browsers
461
- } elseif (preg_match("#(?:^|[^a-z0-9])(ActiveWorlds|Dillo|OffByOne)[/\sv\.]*([0-9\.]+)?#i",$ua,$pcs)) {
462
- $browser['name'] = $pcs[1];
463
- if (!empty($pcs[2])) {
464
- $browser['version'] = $pcs[2];
465
- } else {
466
- $browser['version'] = "";
467
- }
468
- }
469
- //TODO: Embedded web browsers (EZLinks, bsalsa)
470
- //
471
- if (empty($browser['name'])) {
472
- //Any browser that use the word "browser" in agent
473
- if (preg_match("#([a-z0-9]+)[\- _\.]Browser[/ v\.]*([0-9\.]+)?#i",$ua,$pcs)) {
474
- $browser['name'] = $pcs[1];
475
- if (!empty($pcs[2])) {
476
- $browser['version'] = $pcs[2];
477
- } else {
478
- $browser['version'] = "";
479
- }
480
-
481
- //simple alphanumeric strings are usually a crawler
482
- } elseif (preg_match("#^([a-z]+[\s_]?[a-z]*)[\-/]?([0-9\.]+)*$#",$ua,$pcs)>0) {
483
- $browser['name']=trim($pcs[1]);
484
- if (!empty($pcs[2])) {
485
- $browser['version']=$pcs[2];
486
- }
487
- if (empty($browser['os']) && $browser['platform'] != "WAP" && stristr($pcs[1],'mozilla')===false) {
488
- $browser['agenttype']= "R";
489
- }
490
- }
491
- }
492
- } //end if (!$ismobile)
493
-
494
- //get operating system
495
- if (empty($browser['os']) && !empty($browser['name']) && $browser['agenttype']=="B") {
496
- list($browser['os'],$platform) = $this->OSversion('',$browser['platform'],$ua);
497
- if (!empty($platform) && empty($browser['platform'])) {
498
- $browser['platform'] = $platform;
499
- }
500
- //if (empty($browser['os']) && empty($browser['platform']) {
501
- // $browser['os'] = "unknown";
502
- //}
503
- }
504
-
505
- //check http header for user agent spoofing and for os and screen resolution
506
- if ($is_current_ua) {
507
- list($name,$os,$platform,$resolution,$uatype) = $this->getHeaderData();
508
- if (!empty($name)) {
509
- $browser['name'] = $name;
510
- if (!empty($uatype)) $browser['agenttype'] = $uatype;
511
- }
512
- if (!empty($os)) $browser['os'] = $os;
513
- if (!empty($resolution)) $browser['resolution'] = $resolution;
514
- }
515
-
516
- if ($browser['agenttype'] == "B" && empty($browser['language'])) {
517
- $browser['language'] = $this->detectLanguage($ua);
518
- if (!empty($browser['resolution'])) {
519
- if (!empty($wap) || $browser['platform'] == 'WAP') {
520
- $browser['resolution'] = $this->detectResolution($ua,'WAP');
521
- } else {
522
- $browser['resolution'] = $this->detectResolution($ua);
523
- }
524
- }
525
- }
526
- //check for script injection in user-agent string
527
- if ($this->isSpammer($ua) !== false) {
528
- if (function_exists('__')) {
529
- $browser['name'] = __("Script Injection Bot");
530
- } else {
531
- $browser['name'] = "Script Injection Bot";
532
- }
533
- $browser['agenttype']= "S";
534
- }
535
- if ($wdebug_mode) {
536
- echo "\n".'<br />uadetector: browser->name='.$browser['name']."&nbsp; ".'browser->os='.$browser['os']; //debug
537
- }
538
- if (!empty($browser['name'])) {
539
- $browser['name'] = rtrim($browser['name'],'_- ');
540
- if (empty($agent)) {
541
- $this->setClassVars($browser);
542
- if ($ismobile || $browser['platform'] == 'WAP' || strstr($browser['name'],' Mobile')!==false || strstr($browser['name'],' Mini')!==false) {
543
- $this->is_mobile = true;
544
- }
545
- }
546
- } else {
547
- $browser=false;
548
- }
549
- $this->done_browsers=true;
550
- if ($do_profile) {
551
- profiler_endSection('_____ua::isBrowser');
552
- }
553
- return $browser;
554
- } //end function isBrowserAgent
555
-
556
- /**
557
- * detect mobile device browsers or other embedded browsers
558
- * @access public
559
- * @param string
560
- * @return array(browser, device, model, platform)
561
- */
562
- function isMobileAgent($agent="") {
563
- global $wdebug_mode, $do_profile;
564
- $ua="";
565
- $is_current_ua = false;
566
- if (empty($agent)) {
567
- list($ua,$is_current_ua) = $this->isCurrentAgent($agent);
568
- } else {
569
- $ua=$agent;
570
- }
571
- if (empty($ua)) { //nothing to check
572
- return false;
573
- }
574
- if ($do_profile) {
575
- profiler_beginSection('____ua::isMobileUA');
576
- }
577
- $ismobile = false;
578
- //$device = $ua;
579
- $wap = array('name'=>"", 'version'=>"",
580
- 'device'=>"", 'model'=>"",
581
- 'os'=>"", 'platform'=>"WAP");
582
- //detect known mobile browsers
583
-
584
- //Android-based devices
585
- if (preg_match("#^(?:([a-z0-9\-\s_]{3,})\s)?Mozilla/\d\.\d\s\([a-z\;\s]+Android\s([0-9\.]+)(?:\;\s([a-z]{2}(?:\-[A-Za-z]{2})?)\;)?.*Gecko\)\s([a-zA-Z0-9\./]+(?:\sMobile)?/?[A-Z0-9]*)?(\sSafari/([0-9\.]+))?#i",$ua,$pcs)) {
586
- if (!empty($pcs[4])) { $vers = $pcs[4]; }
587
- else { $vers = $pcs[6]; }
588
- $webkit = $this->webkitVersion($vers,$ua);
589
- if (!empty($webkit['name'])) {
590
- $wap['name'] = $webkit['name'];
591
- $wap['version'] = $webkit['version'];
592
- }
593
- $wap['os'] = "Android";
594
- if (!empty($pcs[2])) $wap['os'] .= " ".$this->majorVersion($pcs[2]);
595
- if (!empty($pcs[3])) $wap['language'] = $pcs[3];
596
- if (!empty($pcs[1])) $wap['device'] = $pcs[1];
597
-
598
- //Windows Mobile browsers
599
- } elseif (preg_match('#Windows\sCE;\s?IEMobile\s(\d+)(\.\d+)*\)#i',$ua,$pcs)>0) {
600
- $wap['name'] = 'IEMobile';
601
- $wap['version'] = $pcs[1];
602
- $wap['os'] = 'WinCE';
603
- //Opera Mini/mobile browsers
604
- } elseif (preg_match('#(Opera\s(?:Mini|Mobile))[/ ]([0-9\.]+)#',$ua,$pcs)>0) {
605
- $wap['name'] = $pcs[1];
606
- $wap['version'] = $pcs[2];
607
-
608
- //NetFront and other mobile/embedded browsers
609
- } elseif (preg_match("#(NetFront|NF\-Browser)/([0-9\.]+)#i",$ua,$pcs)) {
610
- $wap['name'] = "NetFront";
611
- $wap['version'] = $pcs[2];
612
- } elseif (preg_match("#[^a-z0-9](Bolt|Iris|Jasmine|Minimo|Novarra\-Vision|Polaris)/([0-9\.]+)#i",$ua,$pcs)) {
613
- $wap['name'] = $pcs[1];
614
- $wap['version'] = $pcs[2];
615
- } elseif (preg_match("#(UP\.browser|SMIT\-Browser)/([0-9\.]+)#i",$ua,$pcs)) {
616
- $wap['name'] = $pcs[1];
617
- $wap['version'] = $pcs[2];
618
- } elseif (preg_match("#\((jig\sbrowser).*\s([0-9\.]+)[^a-z0-9]#i",$ua,$pcs)) {
619
- $wap['name'] = $pcs[1];
620
- $wap['version'] = $pcs[2];
621
- } elseif (preg_match("#[^a-z]Obigo#i",$ua,$pcs)) {
622
- $wap['name'] = 'Obigo';
623
- } elseif (preg_match("#openwave(\suntrusted)?/([0-9\.]+)#i",$ua,$pcs)) {
624
- $wap['name'] = 'OpenWave';
625
- $wap['version'] = $pcs[2];
626
- }
627
- if (!empty($wap['name'])) {
628
- $ismobile = true;
629
- }
630
-
631
- //known mobile devices...
632
- if (preg_match('#(alcatel|amoi|blackberry|docomo\s|htc|ipaq|kindle|kwc|lge|lg\-|mobilephone|motorola|nexus\sone|nokia|PDA|Palm|Samsung|sanyo|smartphone|SonyEricsson|\st\-mobile|vodafone|zte)[/\-_\s]?((?:\d|[a-z])+\d+[a-z]*)*#i',$ua,$pcs)>0) {
633
- $ismobile = true;
634
- $wap['device'] = trim($pcs[1],'-_ /');
635
- if (!empty($pcs[2])) {
636
- $wap['model'] = $pcs[2];
637
- }
638
- if ($pcs[1] == "KWC") {
639
- $wap['device'] == "Kyocera phone";
640
- $wap['model'] == $pcs[0];
641
- }
642
- if (empty($wap['name'])) {
643
- $wap['name'] = $pcs[1];
644
- }
645
- }
646
- //check if user-agent has mobile profile
647
- if (!$ismobile) {
648
- if (preg_match('#(J2ME/MIDP|Profile/MIDP|Danger\sHiptop|\sOpenWeb\s\d)#i',$ua)>0) {
649
- $ismobile=true;
650
-
651
- //check if browser HTTP header has a mobile profile
652
- } elseif ($is_current_ua) {
653
- $header_profile =array('X_WAP_PROFILE','PROFILE','13_PROFILE','56_PROFILE');
654
- foreach ($header_profile AS $wap_profile) {
655
- if (!empty($_SERVER["HTTP_{$wap_profile}"])) {
656
- //has a user-agent profile header, so it's probably a mobile device
657
- $ismobile=true;
658
- break 1;
659
- }
660
- }
661
- //check for wireless transcoder gateways
662
- if (!$ismobile && !empty($_SERVER["HTTP_VIA"]) && preg_match('/([^a-z0-9]WAP|mobile)/i',$_SERVER["HTTP_VIA"])>0) {
663
- $ismobile=true;
664
- }
665
- }
666
- //TODO: check for wireless transcoder service user agents
667
- if (!$ismobile && preg_match('#wireless\stranscoder#i',$ua)>0) {
668
- $ismobile=true;
669
- }
670
- }
671
- //set os = device, if missing
672
- if ($ismobile) {
673
- if (!empty($wap['device'])) {
674
- if (empty($wap['name'])) {
675
- $wap['name'] = $wap['device'];
676
- } elseif (empty($wap['os'])) {
677
- $wap['os'] = $wap['device'];
678
- }
679
- }
680
- }
681
- if ($wdebug_mode) {
682
- echo "\n".'<br />uadetector: wap->name='.$wap['name']."&nbsp; ".'wap->device='.$wap['device']; //debug
683
- }
684
- if ($do_profile) {
685
- profiler_endSection('____ua::isMobileUA');
686
- }
687
- if ($ismobile) {
688
- if (empty($wap['os'])) $wap['os'] = "WAP";
689
- return $wap;
690
- } else {
691
- return false;
692
- }
693
- } //end function isMobileAgent
694
-
695
- /**
696
- * detect crawlers, feed readers, link checkers, and other spiders
697
- * @access public
698
- * @param string (optional)
699
- * @return array (associative)
700
- */
701
- function isSpiderAgent($agent="") {
702
- global $wdebug_mode, $do_profile;
703
- $ua="";
704
- $is_current_ua = false;
705
- list($ua,$is_current_ua) = $this->isCurrentAgent($agent);
706
- if (empty($ua)) { //nothing to check
707
- return false;
708
- }
709
- if ($do_profile) {
710
- profiler_beginSection('______ua::isSpider');
711
- }
712
- //##detect spiders
713
- $spider = array('name'=>"",'version'=>"",'os'=>"",'platform'=>"",'language'=>"",'agenttype'=>"R",'subscribers'=>"");
714
- // #11 FriendFeedBot
715
- if (preg_match('#^Mozilla/\d\.\d\s\(compatible;\sFriendFeedBot/([0-9\.]+);\s\+Http\://friendfeed\.com/about/bot\)$#',$ua,$match)>0) {
716
- $spider['name'] = 'FriendFeedBot';
717
- $spider['version']=$match[1];
718
- $spider['agenttype']= 'F';
719
-
720
- // #12 Twiceler
721
- } elseif (preg_match('#^Mozilla/\d\.\d\s\(Twiceler\-(\d\.\d)\shttp://www\.cuill?\.com/twiceler/robot\.html\)$#',$ua,$match)>0) {
722
- $spider['name'] = 'Twiceler';
723
- $spider['version']=$match[1];
724
- $spider['agenttype']= 'R';
725
-
726
- // #13 FeedFetcher Google
727
- } elseif (preg_match('#^Feedfetcher\-Google[;\s\(\+]+http\://www\.google\.com/feedfetcher\.html[;\)\s]+(?:(\d)\ssubscriber)?#',$ua,$match)>0) {
728
- $spider['name'] = 'FeedFetcher-Google';
729
- if (!empty($match[1])) {
730
- $spider['subscribers']= $match[1];
731
- }
732
- $spider['agenttype']= 'F';
733
-
734
- //Twitterfeed
735
- } elseif (preg_match('/[^a-z]twitterfeed/i',$ua,$match)>0) {
736
- $spider['name'] = 'Twitterfeed';
737
- $spider['agenttype']= 'F';
738
-
739
- // Nutch spiders
740
- } elseif (preg_match('#^([a-z]+)?/?nutch\-([0-9\.]+)#i',$ua,$match)>0) {
741
- if (!empty($match[1])) {
742
- $spider['name']= $match[1];
743
- } else {
744
- $spider['name']= 'Nutch';
745
- }
746
- $spider['version']=$match[2];
747
- $spider['platform'] = "Nutch";
748
-
749
- // Larbin spiders
750
- } elseif (preg_match('#^larbin[\-_\s\/]?(v?[0-9\.]+)?#i',$ua,$match)>0) {
751
- $spider['name']= 'Larbin';
752
- $spider['platform'] = "larbin";
753
- if (!empty($match[1])) {
754
- $spider['version']=$match[1];
755
- }
756
- } elseif (preg_match('#^([a-z_]+)[\-\s\/]?(v?[0-9\.]+)?[^a-z]+larbin([0-9\.]+)\@#i',$ua,$match)>0) {
757
- $spider['name']= $match[1];
758
- $spider['platform'] = "larbin";
759
- if (!empty($match[2])) {
760
- $spider['version']=$match[2];
761
- }
762
-
763
- // #Yahoo spiders
764
- } elseif (preg_match('#^Mozilla/\d\.\d[^a-z0-9_\-]+(Yahoo[\-\!\s_]+[a-z]+)/?([0-9\.]+)?[^a-z0-9_\-]+.+yahoo.*\.com#i',$ua,$match)>0) {
765
- $spider['name'] = $match[1];
766
- if (!empty($match[2])) {
767
- $spider['version']=$match[2];
768
- }
769
-
770
- // #Microsoft winHTTP-based spiders
771
- } elseif (preg_match('#WinHTTP#i',$ua,$match)>0) {
772
- $spider['name'] = "WinHTTP";
773
-
774
- // #Apple CFNetwork-based spiders
775
- } elseif (preg_match('#^((?:[a-z]|\%20)+)\/?([0-9\.]+).*[^a-z0-9]CFNetwork\/?([0-9\.]+)#',$ua,$match)>0) {
776
- $spider['name'] = $match[1];
777
- if (!empty($match[2])) {
778
- $spider['version']=$match[2];
779
- }
780
-
781
- // #Caching agents, Proxy server agents
782
- } elseif (preg_match('/^Mozilla\/\d\.\d\s\(compatible\;\s(HTTrack|ICS)(?:\s(\d\.[a-z0-9]+))?[^a-z0-9\s]/',$ua,$match)>0) {
783
- $spider['name'] = $match[1];
784
- if (!empty($match[2])) {
785
- $spider['version']=$match[2];
786
- }
787
- if (strlen($match[1]) < 5) {
788
- $spider['name'] = $match[1]. " Spider";
789
- }
790
-
791
- //TODO: Libwww spiders
792
- //TODO: Trackback agents from blogs on MovableType, Drupal, DotNetNuke,...
793
-
794
- // #Assume bot if user-agent includes a url (http|www) with a name repeated
795
- } elseif (preg_match('/^(?:Mozilla\/.*compatible[^a-z]*)?(([a-z]{3,})[\-\s_]?(?:bot|crawl|robot|spider|parser|reader)?[a-z]*)[^a-z^0-9]+v?\s?([0-9\.]+)?.*[^a-z]+(?:http|www).*[^a-z]+(?:\2|\3)\/?(?:\.?[a-z]+)?\.(?:com|net|org|html?|aspx?|[a-z]{2})/i',$ua,$match)>0) {
796
- $spider['name'] = $match[1];
797
- if (!empty($match[3])) {
798
- $spider['version'] = $match[3];
799
- }
800
- } elseif (preg_match('#^Mozilla\/\d\.\d\s\(compatible;\s([a-z_ ]+)(?:[-/](\d+\.\d+))?;\s.?http://(?:www\.)?[a-z]+(?:[a-z\.]+)\.(?:[a-z]{2,4})/?[a-z/]*(?:\.s?html?|\.php|\.aspx?)?\)$#i',$ua,$match)>0) {
801
- $spider['name'] = $match[1];
802
- if (!empty($match[2])) {
803
- $spider['version'] = $match[2];
804
- }
805
-
806
- // #Assume bot if user-agent 1st word and a contact domain are the same name, ex: Feedburner-feedburner.com, CazoodleBot,
807
- } elseif (preg_match('/([a-z\_\s\.]+)[\s\/\-_]?(v?[0-9\.]+)?.*(?:http\:\/\/|www\.)(\1)\.[a-z0-9_\-]+/i',$ua,$match)>0) {
808
- $spider['name'] = $match[1];
809
- if (!empty($match[2])) {
810
- $spider['version'] = $match[2];
811
- }
812
- // #Assume bot if one-word user-agent+http address
813
- } elseif (preg_match('/^([a-z\_\.]+)[\s\/\-_]?(v?[0-9\.]+)?[\s\(\+]*(?:http\:\/\/|www\.)[a-z0-9_\-]+\.[a-z0-9_\-\.]+\)?/i',$ua,$match)>0) {
814
- $spider['name'] = $match[1];
815
- if (!empty($match[2])) {
816
- $spider['version'] = $match[2];
817
- }
818
- // #Assume bot if name+http://name...
819
- } elseif (preg_match('/([a-z]+[a-z0-9]{2,})[\s\/\-]?([0-9\.]+)?[^a-z]+[^0-9]*http\:.*\/(\1)[^a-z]/i',$ua,$match)>0) {
820
- $spider['name'] = $match[1];
821
- if (!empty($match[2])) {
822
- $spider['version'] = $match[2];
823
- }
824
-
825
- // #Assume bot if name+name@emaildomain...
826
- } elseif (preg_match('/([a-z]+[a-z0-9]{2,})[\s\/\-]?([0-9\.]+)?.*[^a-z0-9](\1)@[a-z0-9\-_]{2,}\.[a-z0-9\-_]{2,}/i',$ua,$match)>0) {
827
- $spider['name'] = $match[1];
828
- if (!empty($match[2])) {
829
- $spider['version'] = $match[2];
830
- }
831
-
832
- // #Assume bot if user-agent includes contact email
833
- } elseif (preg_match('#^Mozilla\/\d\.\d\s\(compatible;\s([a-z_ ]+)(?:[-/](\d+\.\d+))?;\s[^a-z0-9]?([a-z0-9\.]+@[a-z0-9]+\.[a-z]{2,4})\)$#i',$ua,$match)>0) {
834
- $spider['name'] = $match[1];
835
- if (!empty($match[2])) {
836
- $spider['version'] = $match[2];
837
- }
838
- } elseif (preg_match('/^(([a-z]+)\s?(bot|crawler|robot|spider|\s[a-z]+)?)[\/\-\s_](v?[0-9\.]+)?.*[^a-z]+(?:\1|\2|\3)(?:\@|\s?at\s?)[a-z\-_]{2,}(?:\.|\s?dot\s)[a-z]{2,4}/i',$ua,$match)>0) {
839
- $spider['name'] = $match[1];
840
- if (!empty($match[4])) {
841
- $spider['version'] = $match[4];
842
- }
843
- } elseif (preg_match('/^(([a-z]+)\s?(bot|crawler|robot|spider|\s[a-z]+)?)[\/\-\s_](v?[0-9\.]+)?.*[^a-z]+[a-z\-_]+(?:\@|\s?at\s?)(?:\1|\2|\3)(?:\.|\s?dot\s)[a-z]{2,4}/i',$ua,$match)>0) {
844
- $spider['name'] = $match[1];
845
- if (!empty($match[4])) {
846
- $spider['version'] = $match[4];
847
- }
848
- } elseif (preg_match('/^([a-z]+)[\/\-\s_](v?[0-9\.]+)?.*[a-z0-9_\.]+(?:\@|\sat\s)[a-z0-9\-_]+(?:\.|\s?dot\s)[a-z]{2,4}[^a-z]/i',$ua,$match)>0) {
849
- $spider['name'] = $match[1];
850
- if (!empty($match[2])) {
851
- $spider['version'] = $match[2];
852
- }
853
-
854
- // Assume bot if user-agent contains (http|www)name
855
- // followed by name(+)/version. Ex: Daumoa spider
856
- } elseif (preg_match('/(?:http|www[a-z0-9]?)[^a-z].*[^a-z]([a-z0-9\-_]{4,}).*\.(?:com|net|org|biz|info|html?|aspx?|[a-z]{2})[^a-z0-9]+(\1[a-z_\-]+)[\/|\s|v]+([\d\.]+)/i',$ua,$match)>0) {
857
- $spider['name'] = $match[2];
858
- $spider['version'] = $match[3];
859
-
860
- // #Assume bot if one-word user-agent.
861
- } elseif (preg_match('/^([a-z\_\.]+)[\s\/\-_]?(v?[0-9\.]+)?$/i',$ua,$match)>0) {
862
- $spider['name'] = $match[1];
863
- if (!empty($match[2])) {
864
- $spider['version'] = $match[2];
865
- }
866
- // Assume bot if user-agent contains (http|www)name
867
- // followed by name(+)/version. Ex: Daumoa spider
868
- } elseif (preg_match('/(?:http|www[a-z0-9]?)[^a-z].*[^a-z]([a-z0-9\-_]{4,}).*\.(?:com|net|org|biz|info|html?|aspx?|[a-z]{2})[^a-z0-9]+(\1[a-z_\-]+)[\/|\s|v]+([\d\.]+)/i',$ua,$match)>0) {
869
- $spider['name'] = $match[2];
870
- $spider['version'] = $match[3];
871
-
872
- // #Assume bot if single-word user-agent.
873
- } elseif (preg_match('/^([a-z\_\.]+)[\s\/\-_]?(v?[0-9\.]+)?$/i',$ua,$match)>0) {
874
- $spider['name'] = $match[1];
875
- if (!empty($match[2])) {
876
- $spider['version'] = $match[2];
877
- }
878
-
879
- //Spiders with bot, spider, or crawler in name plus version
880
- } elseif (preg_match('#(\w+[\s\-_]?(?:bot|crawler|checker|feed|parser|reader|spider|verifier))(?:[\/\s\-\:_])?v?([0-9\.]+)#i',$ua,$match)>0) {
881
- $spider['name'] = $match[1];
882
- $spider['version']=$match[2];
883
-
884
- //Spiders with bot, reader, spider, or crawler with no version#
885
- } elseif (preg_match('#([a-z\s]*(?:blog|feed|site)?[a-z\s\-_]*(?:bot|checker|crawler|reader|parser|spider|verifier))(?:$|^[a-z])#i',$ua,$match)>0) {
886
- $spider['name'] = $match[1];
887
- $spider['version']="";
888
-
889
-
890
- //Some obscure spiders
891
- } elseif (preg_match('#(\spowermarks)\/([0-9\.]+)#i',$ua,$match)>0) {
892
- $spider['name'] = $match[1];
893
- $spider['version'] = $match[2];
894
- } else {
895
- if (preg_match("#(robot|bot[\s\-_\/]|bot$|crawl|spider|feed[\s\-_\/]|feed$|fetcher|parser|reader|href|[^\.e]link[\s\-_\/]|linkcheck|checker|http\:\/\/|[^a-z]www[0-9]?\.[a-z0-9_\-]+\.[a-z]{2,3}[^a-z])#i",$ua)>0) {
896
- $spider['name'] = "Unknown Spider";
897
- $spider['agenttype']= "R";
898
- } elseif (preg_match("#([a-z0-9_]+(?:\@|\sat\s)[a-z0-9_\-]+(?:\.|\sdot\s)|\/.+\.(?:html?|aspx?|php5?|cgi))#i",$ua)>0) {
899
- $spider['name'] = "Unknown Spider";
900
- $spider['agenttype']= 'R';
901
- }
902
- }
903
- //distinguish feed readers from other spiders
904
- if (!empty($spider['name'])) {
905
- if ($spider['agenttype'] != "F" && preg_match("/(feed|rss|atom|xml)/i",$ua)>0) {
906
- $spider['agenttype']= "F";
907
- if (stristr($spider['name'],$unknown)!==false) {
908
- $spider['name'] = "Unknown Feedreader";
909
- }
910
- }
911
- if (empty($spider['subscribers']) && preg_match("/([0-9]{1,10})\s?subscriber/i",$ua,$subscriber) > 0) {
912
- // It's a feedreader with some subscribers
913
- $spider['subscribers'] = $subscriber[1];
914
- $spider['agenttype']= "F";
915
- }
916
-
917
- //Some spiders give OS information
918
- if (empty($spider['os'])) {
919
- if (!$is_current_ua) {
920
- list($spider['os'],$platform) = $this->OSversion($ua);
921
- } else {
922
- list($spider['os'],$platform) = $this->OSversion();
923
- }
924
- if (!empty($platform) && empty($spider['platform'])) {
925
- $spider['platform'] = $platform;
926
- }
927
- }
928
- $spider['name'] = rtrim($spider['name'],'_- ');
929
- } //end if empty(spider[name])
930
-
931
- // #Check for spam and script injection attempts
932
- if ($this->isSpammer($ua) !== false) {
933
- $spider['name'] = _e("Script Injection Bot");
934
- $spider['agenttype']= "S";
935
- }
936
- if ($wdebug_mode) {
937
- echo "\n".'<br />uadetector: spider->name='.$spider['name']."&nbsp; "; //debug
938
- }
939
- if (empty($spider['name'])) {
940
- $spider=false;
941
- } else {
942
- $this->setClassVars($spider);
943
- }
944
- $this->done_spiders = true;
945
- if ($do_profile) {
946
- profiler_endSection('______ua::isSpider');
947
- }
948
- return $spider;
949
- } //end function isSpiderAgent
950
-
951
- /**
952
- * check if user-agent is a feed and find number of subscribers
953
- * @return array
954
- */
955
- function isFeed($feed_name,$ua="") {
956
- if (empty($ua)) {
957
- if (!empty($feed_name)) {
958
- $ua=$feed_name;
959
- $feed_name="";
960
- } else {
961
- $ua = $this->agent;
962
- }
963
- }
964
- //separate feed readers from spiders
965
- if (preg_match("/([0-9]+)\s?subscriber/i",$ua,$subscriber) >0) {
966
- // It's a feedreader with some subscribers
967
- $feed['subscribers'] = $subscriber[1];
968
- $feed['agenttype']= "F";
969
- } elseif (preg_match("/(feed|rss)/i",$ua)>0) {
970
- $feed['agenttype']= "F";
971
- }
972
- if (!empty($feed['agenttype'])) {
973
- if (!empty($feed_name)) {
974
- $feed['name'] = $feed_name;
975
- }
976
- return $feed;
977
- } else {
978
- return false;
979
- }
980
- } //end function isFeed
981
-
982
- /**
983
- * Check string for obvious signs of spam, hack, and script
984
- * injection attempts
985
- * @access public
986
- * @return boolean
987
- */
988
- function isSpammer($agent="") {
989
- if (empty($agent)) { $ua = $this->agent; }
990
- else { $ua=$agent; }
991
- $spambot=false;
992
- //## Find obvious script injection bots
993
- if (stristr($ua,'location.href')!==FALSE) {
994
- $spambot=true;
995
- } elseif (preg_match('/(<|&lt;|&#60;|%3C)script/i',$ua)>0) {
996
- $spambot=true;
997
- } elseif (preg_match('/(<|&lt;|&#60;|%3C)a(\s|%20|&#32;|\+)+href/i',$ua)>0) {
998
- $spambot=true;
999
- } elseif (preg_match('/(select|update).*( |%20|%#32;|\+)from( |%20|%#32;|\+)/i',$ua)>0) {
1000
- $spambot=true;
1001
- } elseif (preg_match('/(drop|alter)(?:\s|%20|%#32;|\+)table/i',$ua)>0) {
1002
- $spambot=true;
1003
- }
1004
-
1005
- return $spambot;
1006
- } //end function isSpammer
1007
-
1008
- /**
1009
- * Try to identify a mystery browser|spider by re-checking
1010
- * 'isBrowserAgent()' or by using PHP's 'get_browser' with server
1011
- * Browscap file in 'getBrowscap()'.
1012
- * @access private
1013
- * @return none
1014
- */
1015
- function isWTF($ua="") {
1016
- global $wdebug_mode, $do_profile;
1017
- //recheck browsers or check PHP's browser capabilities file
1018
- if (isset($this->done_browsers) && !$this->done_browsers) {
1019
- return $this->isBrowserAgent($ua);
1020
- } else {
1021
- //return false;
1022
- if ($do_profile) {
1023
- profiler_beginSection('_________ua::isWTF');
1024
- }
1025
- $unknown_agent = $this->getBrowscap($ua);
1026
- if (!empty($unknown_agent['name'])) {
1027
- $this->setClassVars($unknown_agent);
1028
- }
1029
- if ($wdebug_mode) {
1030
- echo "\n".'<br />uadetector: unknown_agent->name='.$unknown_agent['name']."&nbsp; "; //debug
1031
- }
1032
- if ($do_profile) {
1033
- profiler_endSection('_________ua::isWTF');
1034
- }
1035
- }
1036
- }
1037
-
1038
- /**
1039
- * Find operating system and platform from string (or user-agent)
1040
- * @access public
1041
- * @return array(os_type, platform, device)
1042
- */
1043
- function OSversion($os="",$platform="",$ua="") {
1044
- global $wdebug_mode, $do_profile;
1045
- if ($do_profile) {
1046
- profiler_beginSection('_____ua::OSversion');
1047
- }
1048
- $is_current_ua = false;
1049
- if (empty($os)) {
1050
- if (empty($ua)) {
1051
- list($ua, $is_current_ua) = $this->isCurrentAgent();
1052
- }
1053
- $os=$ua;
1054
- }
1055
- //some browsers (IEMobile) show OS in HTTP header, use when available
1056
- if ($is_current_ua) {
1057
- if (!empty($_SERVER['HTTP_UA_OS'])) {
1058
- $os = $_SERVER['HTTP_UA_OS'];
1059
- }
1060
- }
1061
- $os_type = "";
1062
- $device = "";
1063
- if (!empty($os)) {
1064
- if (preg_match('/(Windows|Win|NT)[0-9;\s\)\/]/',$os)>0) {
1065
- $os_type = $this->winOSversion($os);
1066
- if (!$os_type) { $os_type = "Windows"; }
1067
- $platform="Windows";
1068
- } elseif (strpos($os,'Intel Mac OS X')!==FALSE || strpos($os,'PPC Mac OS X')!==FALSE) {
1069
- $platform = 'Macintosh';
1070
- $os_type = 'MacOSX';
1071
- $device='PC';
1072
-
1073
- //iPhone OS similar to OSX, so test before OSX to identify
1074
- } elseif (preg_match('/\siPhone\sOS\s(\d+)?(?:_\d)*/i',$os,$match)>0) {
1075
- $version="";
1076
- if (!empty($match[1])) { $version = $match[1]; }
1077
- if (strpos($os,'iPod')!==FALSE) {
1078
- $os_type = 'iPhone OS';
1079
- $platform = "WAP";
1080
- $device = 'iPod Touch';
1081
- } else {
1082
- $os_type = 'iPhone OS';
1083
- $platform = "WAP";
1084
- $device = 'iPhone'." $version";
1085
- }
1086
- } elseif (stristr($os,'iPhone')!==FALSE) {
1087
- $os_type = 'iPhone';
1088
- $platform = "WAP";
1089
-
1090
- } elseif (strpos($os,'Mac OS X')!==FALSE) {
1091
- if (!empty($platform)) {
1092
- $os_type = "{$platform}";
1093
- } else {
1094
- $os_type = 'MacOSX';
1095
- $platform = 'Macintosh';
1096
- }
1097
- } elseif (preg_match('/Android\s?([0-9\.]+)?/',$os)>0) {
1098
- $os_type = 'Android'; //Google Android
1099
- if (!empty($match[1])) $version = $match[1];
1100
- $platform = 'WAP'; //Linux
1101
- } elseif (preg_match('/[^a-z0-9](BeOS|BePC|Zeta)[^a-z0-9]/',$os)>0) {
1102
- $os_type = 'BeOS';
1103
- } elseif (preg_match('/[^a-z0-9](Commodore\s?64)[^a-z0-9]/i',$os)>0) {
1104
- $os_type = 'Commodore64';
1105
- } elseif (preg_match('/[^a-z0-9]Darwin\/?([0-9\.]+)/i',$os,$match)>0) {
1106
- $os_type = "Darwin";
1107
- $version = $match[1];
1108
- if (preg_match('/(MacBook|iMac|Macintosh|powerpc-apple)/i',$os)>0){
1109
- $platform = 'Macintosh';
1110
- $device=$match[1];
1111
- } else {
1112
- $platform = 'Unix';
1113
- }
1114
- } elseif (preg_match('/[^a-z0-9]Darwin[^a-z0-9]/i',$os,$match)>0) {
1115
- $os_type = "Darwin";
1116
- $platform="Unix";
1117
- } elseif (preg_match('/((?:Free|Open|Net)BSD)\s?(?:[ix]?[386]+)?\s?([0-9\.]+)?/',$os,$match)>0) {
1118
- $os_type = $match[1];
1119
- if (!empty($match[2])) $version = $match[2];
1120
- $platform="Unix";
1121
- //find Linux os brand and version
1122
- } elseif (preg_match('/(?:(i[0-9]{3})\s)?Linux\s*((?:i[0-9]{3})?\s*(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})?\s*(?:[ix][0-9_]{3,})?)?(?:.+[\s\(](Android|CentOS|Debian|Fedora|Gentoo|Mandriva|PCLinuxOS|SuSE|[KX]?ubuntu)[\s\/\-\)]+(\d+[a-z0-9\.]*)?)?/i',$os,$match)>0) {
1123
- $os_type = 'Linux';
1124
- if (!empty($match[3])) {
1125
- $os_type = $match[3];
1126
- //only Ubuntu has non-browser version# after name
1127
- if (!empty($match[4]) && stristr($linuxos,'ubuntu')!==false) {
1128
- $version=$match[4];
1129
- }
1130
- } elseif (!empty($match[2])) {
1131
- $version = $match[2];
1132
- } elseif (!empty($match[1])) {
1133
- $version = $match[1];
1134
- }
1135
- $platform = 'Linux';
1136
- } elseif (preg_match('/Linux/i',$os,$match)>0) {
1137
- $os_type = $this->linuxOSversion($os);
1138
- $platform = "Linux";
1139
- } elseif (preg_match('/(Mac_PowerPC|Macintosh)/',$os)>0) {
1140
- $os_type = 'MacPPC';
1141
- $platform = 'Macintosh';
1142
- } elseif (preg_match('/Nintendo\s(Wii|DSi?)?/i',$os,$match)>0) {
1143
- $os_type = 'Nintendo';
1144
- $device = 'Nintendo';
1145
- if (!empty($match[1])) $device .= " ".$match[1];
1146
- } elseif (preg_match('/[^a-z0-9_\-]MS\-?DOS[^a-z]([0-9\.]+)?/i',$os,$match)>0) {
1147
- $os_type = 'MS-DOS'; //yep, it's still around
1148
- if (!empty($match[1])) { $version = $match[1]; }
1149
- } elseif (preg_match('/[^a-z0-9_\-]OS\/2[^a-z0-9_\-].+Warp\s([0-9\.]+)?/i',$os,$match)>0) {
1150
- $os_type = 'OS/2 Warp';
1151
- if (!empty($match[1])) { $version = $match[1]; }
1152
- } elseif (stristr($os,'PalmOS')!==FALSE) {
1153
- $os_type = 'PalmOS';
1154
- $platform = 'WAP';
1155
- } elseif (preg_match('/PLAYSTATION\s(\d+)/i',$os,$match)>0) {
1156
- $os_type = 'Playstation';
1157
- $version = $match[1];
1158
- $device = 'Playstation';
1159
- } elseif (preg_match('/IRIX\s*([0-9\.]+)?/i',$os,$match)>0) {
1160
- $os_type = 'SGI Irix';
1161
- if (!e
1
  <?php
2
  /**
3
+ * A PHP4 class for browser and spider identification
 
 
 
 
 
4
  *
5
+ * @package WassUp Real-time Analytics
6
+ * @subpackage wassup.class.php module
7
+ * @version 0.9b10
8
+ * @author Helene Duncker
9
+ * Author URI: http://helenesit.com
10
+ * Updated: 2015-08-22
11
+ *
12
+ * @copyright Copyright (c) 2009-2015 Helene Duncker
13
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
14
+ * Released under the GNU General Public License GPLv2 or later
15
+ * Disclaimer:
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
+ * See the GNU General Public License for more details.
20
  */
21
+ /* ------------------------------------------------
22
+ * USAGE: include_once(uadetector.class.php);
23
  * $useragent = new UADetector(); //returns object(16)
24
  *
25
+ * Note: UADetector attempts to find the actual browser in use. This may cause the "name" field to differ from "emulation" field when user-agent "spoofing" is detected. Use the appropriate field for your application type:
 
 
 
26
  * a) "Name" field is best for information and statistics only.
27
  * b) "Emulation" field is best for UI and customizations by browser type.
28
+ * ------------------------------------------------
 
29
  */