Pz-LinkCard - Version 0.1.2

Version Description

  • ffb
Download this release

Release Info

Developer poporon
Plugin Icon 128x128 Pz-LinkCard
Version 0.1.2
Comparing to
See all releases

Version 0.1.2

color-picker.js ADDED
@@ -0,0 +1 @@
 
1
+ (function($) { $('.color-picker').wpColorPicker(); })( jQuery );
languages/pz-linkcard-ja.mo ADDED
Binary file
languages/pz-linkcard-ja.po ADDED
@@ -0,0 +1,829 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013 WordPress
2
+ # This file is distributed under the same license as the WordPress package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Pz-LinkCard\n"
6
+ "Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
7
+ "POT-Creation-Date: 2015-10-05 00:08+0900\n"
8
+ "PO-Revision-Date: 2015-10-05 00:08+0900\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: poporon\n"
11
+ "Language: ja_JP\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.5.7\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+ "Plural-Forms: nplurals=1; plural=0;\n"
20
+ "X-Poedit-SearchPath-0: ..\n"
21
+
22
+ #: ../pz-linkcard-cacheman.php:129 ../pz-linkcard.php:187
23
+ msgid "LinkCard cache manager"
24
+ msgstr "リンクカード DBキャッシュ マネージャ"
25
+
26
+ #: ../pz-linkcard-cacheman.php:132
27
+ msgid "All"
28
+ msgstr "すべて"
29
+
30
+ #: ../pz-linkcard-cacheman.php:133
31
+ msgid "Internal"
32
+ msgstr "内部リンク"
33
+
34
+ #: ../pz-linkcard-cacheman.php:134
35
+ msgid "External"
36
+ msgstr "外部リンク"
37
+
38
+ #: ../pz-linkcard-cacheman.php:155
39
+ msgid "Select batch"
40
+ msgstr "一括処理を選択"
41
+
42
+ #: ../pz-linkcard-cacheman.php:157 ../pz-linkcard-cacheman.php:209
43
+ msgid "Select"
44
+ msgstr "選択してください"
45
+
46
+ #: ../pz-linkcard-cacheman.php:158
47
+ msgid "Renew SNS count"
48
+ msgstr "ソーシャルカウントを再取得"
49
+
50
+ #: ../pz-linkcard-cacheman.php:159
51
+ msgid "Delete"
52
+ msgstr "削除"
53
+
54
+ #: ../pz-linkcard-cacheman.php:161
55
+ msgid "Submit"
56
+ msgstr "適用"
57
+
58
+ #: ../pz-linkcard-cacheman.php:175 ../pz-linkcard-settings.php:330
59
+ msgid "URL"
60
+ msgstr "URL"
61
+
62
+ #: ../pz-linkcard-cacheman.php:178 ../pz-linkcard-settings.php:313
63
+ msgid "Title"
64
+ msgstr "タイトル"
65
+
66
+ #: ../pz-linkcard-cacheman.php:181
67
+ msgid "Site name"
68
+ msgstr "サイト名称"
69
+
70
+ #: ../pz-linkcard-cacheman.php:184
71
+ msgid "Tw"
72
+ msgstr ""
73
+
74
+ #: ../pz-linkcard-cacheman.php:187
75
+ msgid "f"
76
+ msgstr ""
77
+
78
+ #: ../pz-linkcard-cacheman.php:190
79
+ msgid "B!"
80
+ msgstr ""
81
+
82
+ #: ../pz-linkcard-cacheman.php:193
83
+ msgid "Regist"
84
+ msgstr "登録日時"
85
+
86
+ #: ../pz-linkcard-cacheman.php:196
87
+ msgid "Post ID"
88
+ msgstr "記事ID"
89
+
90
+ #: ../pz-linkcard-cacheman.php:199
91
+ msgid "Result code"
92
+ msgstr "結果コード"
93
+
94
+ #: ../pz-linkcard-settings.php:4 ../pz-linkcard.php:188
95
+ msgid "LinkCard Settings"
96
+ msgstr "リンクカード設定"
97
+
98
+ #: ../pz-linkcard-settings.php:30
99
+ msgid "Short code is not set."
100
+ msgstr "ショートコードが指定されていません。"
101
+
102
+ #: ../pz-linkcard-settings.php:60
103
+ msgid "Changes saved."
104
+ msgstr "設定を保存しました。"
105
+
106
+ #: ../pz-linkcard-settings.php:62
107
+ msgid "Not changed."
108
+ msgstr "設定は変更されませんでした。"
109
+
110
+ #: ../pz-linkcard-settings.php:71
111
+ msgid "Basic"
112
+ msgstr "基本設定"
113
+
114
+ #: ../pz-linkcard-settings.php:74
115
+ msgid "ShortCode"
116
+ msgstr "ショートコード"
117
+
118
+ #: ../pz-linkcard-settings.php:76 ../pz-linkcard-settings.php:81
119
+ #: ../pz-linkcard-settings.php:86 ../pz-linkcard-settings.php:91
120
+ msgid "distinguish between uppercase and lowercase letters"
121
+ msgstr "大文字と小文字は区別されます"
122
+
123
+ #: ../pz-linkcard-settings.php:79
124
+ msgid "ShortCode 2"
125
+ msgstr "ショートコード 2"
126
+
127
+ #: ../pz-linkcard-settings.php:84
128
+ msgid "ShortCode 3"
129
+ msgstr "ショートコード 3"
130
+
131
+ #: ../pz-linkcard-settings.php:89
132
+ msgid "ShortCode 4"
133
+ msgstr "ショートコード 4"
134
+
135
+ #: ../pz-linkcard-settings.php:94
136
+ msgid "Use inlinetext"
137
+ msgstr "ショートコードで囲んだ文字列"
138
+
139
+ #: ../pz-linkcard-settings.php:96
140
+ msgid "[Shortcode url=\"xxx\"]"
141
+ msgstr ""
142
+
143
+ #: ../pz-linkcard-settings.php:98
144
+ msgid "No use"
145
+ msgstr "使用しない"
146
+
147
+ #: ../pz-linkcard-settings.php:99
148
+ msgid "Use to excerpt"
149
+ msgstr "抜粋文として使用"
150
+
151
+ #: ../pz-linkcard-settings.php:100
152
+ msgid "Use to title"
153
+ msgstr "タイトルとして使用"
154
+
155
+ #: ../pz-linkcard-settings.php:102
156
+ msgid "[/Shortcode]"
157
+ msgstr ""
158
+
159
+ #: ../pz-linkcard-settings.php:107
160
+ msgid "Special Format"
161
+ msgstr "定型書式"
162
+
163
+ #: ../pz-linkcard-settings.php:110 ../pz-linkcard-settings.php:217
164
+ #: ../pz-linkcard-settings.php:250 ../pz-linkcard-settings.php:271
165
+ #: ../pz-linkcard-settings.php:297 ../pz-linkcard-settings.php:416
166
+ #: ../pz-linkcard-settings.php:426 ../pz-linkcard-settings.php:459
167
+ #: ../pz-linkcard-settings.php:469
168
+ msgid "None"
169
+ msgstr "なし"
170
+
171
+ #: ../pz-linkcard-settings.php:111
172
+ msgid "Pz-LkC Default"
173
+ msgstr "Pz リンクカード 標準書式"
174
+
175
+ #: ../pz-linkcard-settings.php:112
176
+ msgid "Cellophane tape \"center\""
177
+ msgstr "セロハンテープ(中央)"
178
+
179
+ #: ../pz-linkcard-settings.php:113
180
+ msgid "Cellophane tape \"Top corner\""
181
+ msgstr "セロハンテープ(左上と右上)"
182
+
183
+ #: ../pz-linkcard-settings.php:114
184
+ msgid "Cellophane tape \"long\""
185
+ msgstr "セロハンテープ(長め)"
186
+
187
+ #: ../pz-linkcard-settings.php:115
188
+ msgid "Slanting"
189
+ msgstr "斜め"
190
+
191
+ #: ../pz-linkcard-settings.php:116
192
+ msgid "3D Rotate"
193
+ msgstr "3D回転"
194
+
195
+ #: ../pz-linkcard-settings.php:117
196
+ msgid "Curling paper"
197
+ msgstr "紙がめくれた効果(ほとんどのテーマで正しく表示されません)"
198
+
199
+ #: ../pz-linkcard-settings.php:118
200
+ msgid "Neutral"
201
+ msgstr "ブルーグリーン"
202
+
203
+ #: ../pz-linkcard-settings.php:119
204
+ msgid "Orange"
205
+ msgstr "オレンジ"
206
+
207
+ #: ../pz-linkcard-settings.php:120
208
+ msgid "Green"
209
+ msgstr "グリーン"
210
+
211
+ #: ../pz-linkcard-settings.php:121
212
+ msgid "Blue"
213
+ msgstr "ブルー"
214
+
215
+ #: ../pz-linkcard-settings.php:123
216
+ msgid "Will some of the parameters are forcibly changed"
217
+ msgstr "選択した定型書式によって、一部の設定が無効になります。"
218
+
219
+ #: ../pz-linkcard-settings.php:129
220
+ msgid "Style"
221
+ msgstr "表示設定"
222
+
223
+ #: ../pz-linkcard-settings.php:132
224
+ msgid "Position"
225
+ msgstr "配置設定"
226
+
227
+ #: ../pz-linkcard-settings.php:139
228
+ msgid "Margin top"
229
+ msgstr "上の余白"
230
+
231
+ #: ../pz-linkcard-settings.php:141 ../pz-linkcard-settings.php:156
232
+ #: ../pz-linkcard-settings.php:173 ../pz-linkcard-settings.php:190
233
+ msgid "Not defined"
234
+ msgstr "設定しない"
235
+
236
+ #: ../pz-linkcard-settings.php:142 ../pz-linkcard-settings.php:157
237
+ #: ../pz-linkcard-settings.php:174 ../pz-linkcard-settings.php:191
238
+ msgid "0"
239
+ msgstr ""
240
+
241
+ #: ../pz-linkcard-settings.php:143 ../pz-linkcard-settings.php:158
242
+ #: ../pz-linkcard-settings.php:175 ../pz-linkcard-settings.php:192
243
+ #: ../pz-linkcard-settings.php:385 ../pz-linkcard-settings.php:386
244
+ msgid "4px"
245
+ msgstr ""
246
+
247
+ #: ../pz-linkcard-settings.php:144 ../pz-linkcard-settings.php:159
248
+ #: ../pz-linkcard-settings.php:176 ../pz-linkcard-settings.php:193
249
+ msgid "8px"
250
+ msgstr ""
251
+
252
+ #: ../pz-linkcard-settings.php:145 ../pz-linkcard-settings.php:160
253
+ #: ../pz-linkcard-settings.php:177 ../pz-linkcard-settings.php:194
254
+ #: ../pz-linkcard-settings.php:319
255
+ msgid "16px"
256
+ msgstr ""
257
+
258
+ #: ../pz-linkcard-settings.php:146 ../pz-linkcard-settings.php:161
259
+ #: ../pz-linkcard-settings.php:178 ../pz-linkcard-settings.php:195
260
+ msgid "32px"
261
+ msgstr ""
262
+
263
+ #: ../pz-linkcard-settings.php:147 ../pz-linkcard-settings.php:162
264
+ #: ../pz-linkcard-settings.php:179 ../pz-linkcard-settings.php:196
265
+ msgid "64px"
266
+ msgstr ""
267
+
268
+ #: ../pz-linkcard-settings.php:154
269
+ msgid "Margin left"
270
+ msgstr "左の余白"
271
+
272
+ #: ../pz-linkcard-settings.php:166
273
+ msgid "Width"
274
+ msgstr "カードの横幅"
275
+
276
+ #: ../pz-linkcard-settings.php:167
277
+ msgid "Height"
278
+ msgstr "カードの高さ"
279
+
280
+ #: ../pz-linkcard-settings.php:168
281
+ msgid "Trim"
282
+ msgstr "文字数"
283
+
284
+ #: ../pz-linkcard-settings.php:171
285
+ msgid "Margin right"
286
+ msgstr "右の余白"
287
+
288
+ #: ../pz-linkcard-settings.php:185
289
+ msgid "Centering"
290
+ msgstr "中央に寄せる"
291
+
292
+ #: ../pz-linkcard-settings.php:188
293
+ msgid "Margin bottom"
294
+ msgstr "下の余白"
295
+
296
+ #: ../pz-linkcard-settings.php:207
297
+ msgid "Link the whole"
298
+ msgstr "カード全体をリンク"
299
+
300
+ #: ../pz-linkcard-settings.php:209
301
+ msgid "Enclose the entire card at anchor"
302
+ msgstr ""
303
+ "カード全体をAタグで囲って、どこをクリックしてもリンク先を開くようにします。"
304
+
305
+ #: ../pz-linkcard-settings.php:214
306
+ msgid "Border"
307
+ msgstr "枠線の太さ"
308
+
309
+ #: ../pz-linkcard-settings.php:218
310
+ msgid "Gray thin"
311
+ msgstr "薄い色/細い(1px)"
312
+
313
+ #: ../pz-linkcard-settings.php:219
314
+ msgid "Gray"
315
+ msgstr "薄い色/普通(2px)"
316
+
317
+ #: ../pz-linkcard-settings.php:220
318
+ msgid "Gray thick"
319
+ msgstr "薄い色/太い(4px)"
320
+
321
+ #: ../pz-linkcard-settings.php:221
322
+ msgid "Black thin"
323
+ msgstr "黒/細い(1px)"
324
+
325
+ #: ../pz-linkcard-settings.php:222
326
+ msgid "Black"
327
+ msgstr "黒/普通(2px)"
328
+
329
+ #: ../pz-linkcard-settings.php:223
330
+ msgid "Black thick"
331
+ msgstr "黒/太い(4px)"
332
+
333
+ #: ../pz-linkcard-settings.php:224
334
+ msgid "Black frame"
335
+ msgstr "黒/額縁(8px)"
336
+
337
+ #: ../pz-linkcard-settings.php:225
338
+ msgid "Dodgerblue"
339
+ msgstr "ドジャー・ブルー(明るい青)"
340
+
341
+ #: ../pz-linkcard-settings.php:226
342
+ msgid "Mediumaquamarine"
343
+ msgstr "ミディアム・アクアマリーン(明るい緑)"
344
+
345
+ #: ../pz-linkcard-settings.php:227
346
+ msgid "Hotpink"
347
+ msgstr "ホット・ピンク(明るい赤)"
348
+
349
+ #: ../pz-linkcard-settings.php:228
350
+ msgid "Double"
351
+ msgstr "二重線"
352
+
353
+ #: ../pz-linkcard-settings.php:229
354
+ msgid "Dotted"
355
+ msgstr "点線"
356
+
357
+ #: ../pz-linkcard-settings.php:235
358
+ msgid "Layout"
359
+ msgstr "外観設定"
360
+
361
+ #: ../pz-linkcard-settings.php:236
362
+ msgid "Radius"
363
+ msgstr "角を丸める"
364
+
365
+ #: ../pz-linkcard-settings.php:245
366
+ msgid "Display URL"
367
+ msgstr "リンク先のURLを表示する"
368
+
369
+ #: ../pz-linkcard-settings.php:248 ../pz-linkcard-settings.php:413
370
+ #: ../pz-linkcard-settings.php:456
371
+ msgid "Thumbnail"
372
+ msgstr "サムネイル"
373
+
374
+ #: ../pz-linkcard-settings.php:251
375
+ msgid "Right"
376
+ msgstr "右側"
377
+
378
+ #: ../pz-linkcard-settings.php:252
379
+ msgid "Left"
380
+ msgstr "左側"
381
+
382
+ #: ../pz-linkcard-settings.php:254 ../pz-linkcard-settings.php:290
383
+ msgid "Shadow"
384
+ msgstr "影を付ける"
385
+
386
+ #: ../pz-linkcard-settings.php:259
387
+ msgid "Hollow content area"
388
+ msgstr "記事の情報に枠を付ける"
389
+
390
+ #: ../pz-linkcard-settings.php:264
391
+ msgid "Display excerpt"
392
+ msgstr "抜粋文を表示する"
393
+
394
+ #: ../pz-linkcard-settings.php:269 ../pz-linkcard-settings.php:433
395
+ #: ../pz-linkcard-settings.php:476 ../pz-linkcard-settings.php:496
396
+ msgid "Site information"
397
+ msgstr "サイト情報"
398
+
399
+ #: ../pz-linkcard-settings.php:272
400
+ msgid "Top"
401
+ msgstr "上側"
402
+
403
+ #: ../pz-linkcard-settings.php:273
404
+ msgid "Bottom"
405
+ msgstr "下側"
406
+
407
+ #: ../pz-linkcard-settings.php:275
408
+ msgid "Use SiteName"
409
+ msgstr "サイト名称を使用"
410
+
411
+ #: ../pz-linkcard-settings.php:280
412
+ msgid "Hollow"
413
+ msgstr "内側に影を付ける"
414
+
415
+ #: ../pz-linkcard-settings.php:294
416
+ msgid "Display SNS Count"
417
+ msgstr "シェア数を表示する"
418
+
419
+ #: ../pz-linkcard-settings.php:298
420
+ msgid "After Title"
421
+ msgstr "タイトルの後ろ"
422
+
423
+ #: ../pz-linkcard-settings.php:299
424
+ msgid "After site-name"
425
+ msgstr "サイト情報の後ろ"
426
+
427
+ #: ../pz-linkcard-settings.php:301
428
+ msgid "Hatena"
429
+ msgstr "はてなブックマーク"
430
+
431
+ #: ../pz-linkcard-settings.php:302
432
+ msgid "Facebook"
433
+ msgstr "フェイスブック(シェア数)"
434
+
435
+ #: ../pz-linkcard-settings.php:303
436
+ msgid "Twitter"
437
+ msgstr "ツイッター"
438
+
439
+ #: ../pz-linkcard-settings.php:304
440
+ msgid ""
441
+ "There is a possibility that the screen display is slow If you enable this "
442
+ "setting."
443
+ msgstr "有効にする取得APIによっては表示が遅くなる場合があります。"
444
+
445
+ #: ../pz-linkcard-settings.php:310
446
+ msgid "Letters"
447
+ msgstr "文字設定"
448
+
449
+ #: ../pz-linkcard-settings.php:318 ../pz-linkcard-settings.php:337
450
+ #: ../pz-linkcard-settings.php:353 ../pz-linkcard-settings.php:370
451
+ msgid "14px"
452
+ msgstr ""
453
+
454
+ #: ../pz-linkcard-settings.php:320
455
+ msgid "18px"
456
+ msgstr ""
457
+
458
+ #: ../pz-linkcard-settings.php:321
459
+ msgid "20px"
460
+ msgstr ""
461
+
462
+ #: ../pz-linkcard-settings.php:322
463
+ msgid "24px"
464
+ msgstr ""
465
+
466
+ #: ../pz-linkcard-settings.php:323 ../pz-linkcard-settings.php:375
467
+ msgid "100%"
468
+ msgstr ""
469
+
470
+ #: ../pz-linkcard-settings.php:324
471
+ msgid "120%"
472
+ msgstr ""
473
+
474
+ #: ../pz-linkcard-settings.php:325
475
+ msgid "140%"
476
+ msgstr ""
477
+
478
+ #: ../pz-linkcard-settings.php:335 ../pz-linkcard-settings.php:350
479
+ #: ../pz-linkcard-settings.php:366 ../pz-linkcard-settings.php:387
480
+ msgid "9px"
481
+ msgstr ""
482
+
483
+ #: ../pz-linkcard-settings.php:336 ../pz-linkcard-settings.php:352
484
+ #: ../pz-linkcard-settings.php:368
485
+ msgid "12px"
486
+ msgstr ""
487
+
488
+ #: ../pz-linkcard-settings.php:338 ../pz-linkcard-settings.php:354
489
+ #: ../pz-linkcard-settings.php:372
490
+ msgid "70%"
491
+ msgstr ""
492
+
493
+ #: ../pz-linkcard-settings.php:339 ../pz-linkcard-settings.php:355
494
+ #: ../pz-linkcard-settings.php:373
495
+ msgid "80%"
496
+ msgstr ""
497
+
498
+ #: ../pz-linkcard-settings.php:340 ../pz-linkcard-settings.php:356
499
+ #: ../pz-linkcard-settings.php:374
500
+ msgid "90%"
501
+ msgstr ""
502
+
503
+ #: ../pz-linkcard-settings.php:345
504
+ msgid "Excerpt"
505
+ msgstr "抜粋文"
506
+
507
+ #: ../pz-linkcard-settings.php:351 ../pz-linkcard-settings.php:367
508
+ msgid "11px"
509
+ msgstr ""
510
+
511
+ #: ../pz-linkcard-settings.php:361
512
+ msgid "Site-info."
513
+ msgstr "サイト情報"
514
+
515
+ #: ../pz-linkcard-settings.php:369
516
+ msgid "13px"
517
+ msgstr ""
518
+
519
+ #: ../pz-linkcard-settings.php:371 ../pz-linkcard-settings.php:388
520
+ msgid "60%"
521
+ msgstr ""
522
+
523
+ #: ../pz-linkcard-settings.php:380
524
+ msgid "Plugin link"
525
+ msgstr "プラグインのページ"
526
+
527
+ #: ../pz-linkcard-settings.php:393
528
+ msgid "Plugin-link"
529
+ msgstr "プラグイン名"
530
+
531
+ #: ../pz-linkcard-settings.php:401
532
+ msgid "External link"
533
+ msgstr "外部リンク"
534
+
535
+ #: ../pz-linkcard-settings.php:405 ../pz-linkcard-settings.php:448
536
+ #: ../pz-linkcard-settings.php:488
537
+ msgid "Background Color"
538
+ msgstr "背景色"
539
+
540
+ #: ../pz-linkcard-settings.php:409
541
+ msgid "Background image"
542
+ msgstr "背景画像"
543
+
544
+ #: ../pz-linkcard-settings.php:417 ../pz-linkcard-settings.php:427
545
+ #: ../pz-linkcard-settings.php:460 ../pz-linkcard-settings.php:470
546
+ msgid "Direct"
547
+ msgstr "直接取得する"
548
+
549
+ #: ../pz-linkcard-settings.php:418 ../pz-linkcard-settings.php:428
550
+ #: ../pz-linkcard-settings.php:461 ../pz-linkcard-settings.php:471
551
+ msgid "Use WebAPI"
552
+ msgstr "WebAPIを利用する"
553
+
554
+ #: ../pz-linkcard-settings.php:423 ../pz-linkcard-settings.php:466
555
+ msgid "Favicon"
556
+ msgstr "サイトアイコン"
557
+
558
+ #: ../pz-linkcard-settings.php:437 ../pz-linkcard-settings.php:480
559
+ msgid "Open new window/tab"
560
+ msgstr "新しいウィンドウで開く"
561
+
562
+ #: ../pz-linkcard-settings.php:444
563
+ msgid "Internal link"
564
+ msgstr "内部リンク"
565
+
566
+ #: ../pz-linkcard-settings.php:452 ../pz-linkcard-settings.php:492
567
+ msgid "Background Image"
568
+ msgstr "背景画像"
569
+
570
+ #: ../pz-linkcard-settings.php:485
571
+ msgid "This page"
572
+ msgstr "同ページへのリンク"
573
+
574
+ #: ../pz-linkcard-settings.php:503
575
+ msgid "Web-API"
576
+ msgstr "画像取得APIの指定"
577
+
578
+ #: ../pz-linkcard-settings.php:506
579
+ msgid "Favicon API"
580
+ msgstr "ファビコンの取得API"
581
+
582
+ #: ../pz-linkcard-settings.php:508
583
+ msgid ""
584
+ "%DOMAIN% replace to domain name (ex. poporon.poponet.jp )<br />%DOMAIN_URL% "
585
+ "replace to domain URL (ex. http://poporon.poponet.jp )"
586
+ msgstr ""
587
+ "%DOMAIN% と記述するとドメイン名(例.poporon.poponet.jp)に、<br />"
588
+ "%DOMAIN_URL% と記述するとドメインのURL(例.http://poporon.poponet.jp)に置き"
589
+ "換わります。"
590
+
591
+ #: ../pz-linkcard-settings.php:511
592
+ msgid "Thumbnail API"
593
+ msgstr "サムネイル画像の取得API"
594
+
595
+ #: ../pz-linkcard-settings.php:513
596
+ msgid "%URL% replace to URL"
597
+ msgstr "%URL% と記述するとURLに置き換わります"
598
+
599
+ #: ../pz-linkcard-settings.php:518
600
+ msgid "Debug"
601
+ msgstr "詳しい人用(Debug)"
602
+
603
+ #: ../pz-linkcard-settings.php:521
604
+ msgid "Use blockquote tag"
605
+ msgstr "BLOCKQUOTEをタグを使用する"
606
+
607
+ #: ../pz-linkcard-settings.php:523
608
+ msgid "without using DIV tag, and use BLOCKQUOTE tag"
609
+ msgstr "&lt;BLOCKQUOTE&gt;で囲んで引用扱いにします"
610
+
611
+ #: ../pz-linkcard-settings.php:526
612
+ msgid "Set nofollow"
613
+ msgstr "nofollowを付与する"
614
+
615
+ #: ../pz-linkcard-settings.php:528
616
+ msgid "In the case of an external site, it puts the \"nofollow\""
617
+ msgstr "外部リンクのリンクを nofollow にする"
618
+
619
+ #: ../pz-linkcard-settings.php:532
620
+ msgid "Reset img style"
621
+ msgstr "CSSリセット(img)"
622
+
623
+ #: ../pz-linkcard-settings.php:534
624
+ msgid ""
625
+ "When unnecessary frame is displayed on the image, you can improve it by case"
626
+ msgstr "画像がずれて表示されるときに改善される可能性が有ります(推奨)"
627
+
628
+ #: ../pz-linkcard-settings.php:538
629
+ msgid "specified CSS"
630
+ msgstr "指定したCSSを使用"
631
+
632
+ #: ../pz-linkcard-settings.php:540
633
+ msgid "Use specified CSS file"
634
+ msgstr "指定したCSSファイルを使用する"
635
+
636
+ #: ../pz-linkcard-settings.php:543 ../pz-linkcard-settings.php:548
637
+ msgid "CSS file"
638
+ msgstr "CSSファイル名"
639
+
640
+ #: ../pz-linkcard-settings.php:545
641
+ msgid "(ex. http://exsample.com/style.css )"
642
+ msgstr "例.http://exsample.com/style.css"
643
+
644
+ #: ../pz-linkcard-settings.php:552
645
+ msgid "CSS URL"
646
+ msgstr "CSSファイルのURL"
647
+
648
+ #: ../pz-linkcard-settings.php:557
649
+ msgid "Use HatenaBlogCard"
650
+ msgstr "はてなブログカードを利用する"
651
+
652
+ #: ../pz-linkcard-settings.php:559
653
+ msgid "External links will use Always HatenaBlogCard (Not recommended)"
654
+ msgstr "外部リンクは「はてなブログカード」を利用する(非推奨)"
655
+
656
+ #: ../pz-linkcard-settings.php:563
657
+ msgid "Display link to author page"
658
+ msgstr "プラグイン名を表示する"
659
+
660
+ #: ../pz-linkcard-settings.php:568
661
+ msgid "Plugin URL"
662
+ msgstr "プラグインページURL"
663
+
664
+ #: ../pz-linkcard-settings.php:572
665
+ msgid "Plugin name"
666
+ msgstr "プラグイン名"
667
+
668
+ #: ../pz-linkcard-settings.php:576
669
+ msgid "Plugin version"
670
+ msgstr "プラグインバージョン"
671
+
672
+ #: ../pz-linkcard-settings.php:580
673
+ msgid "Saved datetime"
674
+ msgstr "保存した日時"
675
+
676
+ #: ../pz-linkcard-settings.php:585
677
+ msgid "Display elapsed time"
678
+ msgstr "実行時間の表示"
679
+
680
+ #: ../pz-linkcard-settings.php:587
681
+ msgid "Output the elapsed time to HTML comment."
682
+ msgstr "作成にかかった時間をコメントとしてHTMLへ出力する"
683
+
684
+ #: ../pz-linkcard-settings.php:593
685
+ msgid "Initialize"
686
+ msgstr "初期化"
687
+
688
+ #: ../pz-linkcard-settings.php:596
689
+ msgid "Return to the initial setting"
690
+ msgstr "設定を初期状態へ戻す"
691
+
692
+ #: ../pz-linkcard-style.php:316
693
+ msgid "Style sheet saved."
694
+ msgstr "設定を元にスタイルシートを自動生成しました。"
695
+
696
+ #: ../pz-linkcard-style.php:318
697
+ msgid "Style sheet failed."
698
+ msgstr "スタイルシートの自動生成に失敗しました。"
699
+
700
+ #: ../pz-linkcard.php:187
701
+ msgid "Pz LkC Cache"
702
+ msgstr "Pz カード管理"
703
+
704
+ #: ../pz-linkcard.php:188
705
+ msgid "Pz LinkCard"
706
+ msgstr "Pz カード設定"
707
+
708
+ #: ../pz-linkcard.php:242
709
+ msgid "Settings"
710
+ msgstr "設定"
711
+
712
+ #: ../pz-linkcard.php:242
713
+ msgid "Manage"
714
+ msgstr "管理"
715
+
716
+ #~ msgid "Refresh"
717
+ #~ msgstr "再取得"
718
+
719
+ #~ msgid "This setting is not valid for \" Hatena-Blogcard\""
720
+ #~ msgstr "※この設定は「はてなブログカード」に対して影響しません。"
721
+
722
+ #~ msgid "Use SNS Count Cache"
723
+ #~ msgstr "プラグインを利用して取得"
724
+
725
+ #~ msgid "HatenaBlogCard"
726
+ #~ msgstr "Pz ブログカード"
727
+
728
+ #~ msgid "Color of title"
729
+ #~ msgstr "タイトルの文字色"
730
+
731
+ #~ msgid "Color of URL"
732
+ #~ msgstr "URLの文字色"
733
+
734
+ #~ msgid "Color of excerpt"
735
+ #~ msgstr "抜粋文の文字色"
736
+
737
+ #~ msgid "Background Image URL"
738
+ #~ msgstr "背景画像"
739
+
740
+ #~ msgid "none"
741
+ #~ msgstr "なし"
742
+
743
+ #~ msgid "Cellophane tape 2"
744
+ #~ msgstr "セロハンテープ(左上、右上)"
745
+
746
+ #~ msgid "Cellophane tape 3"
747
+ #~ msgstr "セロハンテープ(長)"
748
+
749
+ #~ msgid "gray"
750
+ #~ msgstr "薄い色/普通(2px)"
751
+
752
+ #~ msgid "This setting will be applied only if you specify a \"title\""
753
+ #~ msgstr "title を指定した場合のみ適用されます"
754
+
755
+ #~ msgid "Display information"
756
+ #~ msgstr "サイト情報を表示する"
757
+
758
+ #~ msgid "Top margin"
759
+ #~ msgstr "上の余白"
760
+
761
+ #~ msgid "Automatically adjust the margins"
762
+ #~ msgstr "カードの左右に余白を設けて中央に寄せる"
763
+
764
+ #~ msgid "Thumbnail position"
765
+ #~ msgstr "サムネイルの位置"
766
+
767
+ #~ msgid "elapsed time:"
768
+ #~ msgstr "実行時間:"
769
+
770
+ #~ msgid "seconds"
771
+ #~ msgstr "秒"
772
+
773
+ #~ msgid "sec"
774
+ #~ msgstr "秒"
775
+
776
+ #~ msgid "Display elapsed time required to create"
777
+ #~ msgstr "作成にかかった時間を表示する"
778
+
779
+ #, fuzzy
780
+ #~ msgid "(This Site)"
781
+ #~ msgstr "(このサイト内)"
782
+
783
+ #, fuzzy
784
+ #~ msgid "(This Page)"
785
+ #~ msgstr "(このページ)"
786
+
787
+ #~ msgid " (My Site)"
788
+ #~ msgstr "(このサイト内)"
789
+
790
+ #~ msgid "Reset CSS for img"
791
+ #~ msgstr ""
792
+ #~ "サムネイル画像やファビコンがずれて表示される場合にチェックを付けてみてくだ"
793
+ #~ "さい"
794
+
795
+ #~ msgid "Common"
796
+ #~ msgstr "共通"
797
+
798
+ #~ msgid "Shadow (thumbnail)"
799
+ #~ msgstr "サムネイル画像に影を付ける"
800
+
801
+ #~ msgid "2px"
802
+ #~ msgstr "2 ピクセル(普通)"
803
+
804
+ #~ msgid "3px"
805
+ #~ msgstr "3 ピクセル(やや太め)"
806
+
807
+ #~ msgid "6px"
808
+ #~ msgstr "6 ピクセル(極太)"
809
+
810
+ #~ msgid "Display thumbnail"
811
+ #~ msgstr "サムネイル画像"
812
+
813
+ #~ msgid "Cache time"
814
+ #~ msgstr "キャッシュ時間"
815
+
816
+ #~ msgid "Number of seconds to keep cache"
817
+ #~ msgstr "取得したタイトルと概要を保管しておく秒数"
818
+
819
+ #~ msgid "(Unimplemented)"
820
+ #~ msgstr "(未実装)※設定は反映されません。"
821
+
822
+ #~ msgid "Clear text cache"
823
+ #~ msgstr "キャッシュのクリア"
824
+
825
+ #~ msgid "After the invalidation of the plug-in , please activate again"
826
+ #~ msgstr "→プラグインの無効化を行った後、再度有効化してください"
827
+
828
+ #~ msgid "(External site)"
829
+ #~ msgstr "(外部リンク)"
pz-linkcard-cacheman.php ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!function_exists('get_option')) die;
3
+ if (!is_user_logged_in()) die;
4
+
5
+ $action = isset($_GET['action']) ? $_GET['action'] : null;
6
+ $sort_key = isset($_GET['sort_key']) ? $_GET['sort_key'] : null;
7
+ $order = isset($_GET['order']) ? $_GET['order'] : null;
8
+ $link_type = isset($_GET['link_type']) ? $_GET['link_type'] : null;
9
+ $cache_id = isset($_GET['cache_id']) ? $_GET['cache_id'] : null;
10
+ $confirm = isset($_GET['confirm']) ? $_GET['confirm'] : null;
11
+ $result_code = isset($_GET['result_code']) ? $_GET['result_code'] : null;
12
+ $paged = isset($_GET['paged']) ? $_GET['paged'] : null;
13
+
14
+ $bulk_id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
15
+
16
+ // echo 'action='.$action.'<br />';
17
+ // echo 'sort_key='.$sort_key.'<br />';
18
+ // echo 'order='.$order.'<br />';
19
+ // echo 'link_type='.$link_type.'<br />';
20
+ // echo 'bulk_id=<pre>';
21
+ // print_r($bulk_id);
22
+ // echo '</pre><br />';
23
+
24
+ global $wpdb;
25
+
26
+ if ($action) {
27
+ // check_admin_referer('pz_cacheman');
28
+
29
+ switch ($action) {
30
+ case 'renew':
31
+ if (isset($bulk_id) && is_array($bulk_id)) {
32
+ foreach ($bulk_id as $value) {
33
+ $wpdb->update(
34
+ $this->db,
35
+ array('nexttime' => 0),
36
+ array('id' => $value),
37
+ null,
38
+ array('%d')
39
+ );
40
+ }
41
+ }
42
+ break;
43
+
44
+ case 'delete':
45
+ if (isset($bulk_id) && is_array($bulk_id)) {
46
+ foreach ($bulk_id as $value) {
47
+ $wpdb->delete(
48
+ $this->db,
49
+ array('id' => $value),
50
+ array('%d')
51
+ );
52
+ }
53
+ }
54
+ break;
55
+ }
56
+ }
57
+
58
+ switch ($link_type) {
59
+ case 1:
60
+ $where = 'link_type<>0';
61
+ break;
62
+ case 2:
63
+ $where = 'link_type=0';
64
+ break;
65
+ default:
66
+ $link_tyle = 0;
67
+ $where = null;
68
+ }
69
+
70
+ switch ($sort_key) {
71
+ case 'id':
72
+ case 'url':
73
+ case 'url_key':
74
+ case 'link_type':
75
+ case 'site_name':
76
+ case 'domain':
77
+ case 'title':
78
+ case 'excerpt':
79
+ case 'result_code':
80
+ case 'post_id':
81
+ case 'sns_twitter':
82
+ case 'sns_facebook':
83
+ case 'sns_hatena':
84
+ case 'regist':
85
+ case 'nexttime':
86
+ break;
87
+ default:
88
+ $sort_key = 'uptime';
89
+ }
90
+
91
+ switch ($order) {
92
+ case 'desc':
93
+ $order = 'DESC';
94
+ break;
95
+ default:
96
+ $order = 'ASC';
97
+ }
98
+
99
+ $sql = "SELECT * FROM $this->db";
100
+ if (isset($where)) {
101
+ $sql .= ' WHERE '.$where;
102
+ }
103
+ if (isset($sort_key)) {
104
+ $sql .= ' ORDER BY '.$sort_key.' '.$order;
105
+ }
106
+
107
+ // テーブルデータ
108
+ $data_all = $wpdb->get_results($sql);
109
+
110
+ // SUB(CASE WHEN ... END) で一気に取れないぽい?
111
+ $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db");
112
+ $count_all = $result->count;
113
+ $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db WHERE link_type<>0");
114
+ $count_internal = $result->count;
115
+ $result = $wpdb->get_row("SELECT COUNT(*) AS count FROM $this->db WHERE link_type=0");
116
+ $count_external = $result->count;
117
+ $count_now = count($data_all);
118
+
119
+ $page_min = 1;
120
+ $page_max = ceil($count_now / 5);
121
+ $page_now = $paged;
122
+ $page_now = 2;
123
+ $page_prev = ($page_now > 1) ? $page_now - 1 : null;
124
+ $page_next = ($page_now < $page_max) ? $page_now + 1 : null;
125
+
126
+ ?>
127
+ <div class="wrap">
128
+
129
+ <h1><?php _e('LinkCard cache manager', $this->text_domain); ?></h1>
130
+
131
+ <ul class='subsubsub'>
132
+ <li class="all"><a href="tools.php?page=pz-linkcard-cache&sort_key=<?php echo $sortkey; ?>&link_type=0" <?php if ($link_type == 0) echo 'class="current"'; ?>><? _e('All', $this->text_domain); ?> <span class="count">(<?php echo $count_all; ?>)</span></a> |</li>
133
+ <li class="all"><a href="tools.php?page=pz-linkcard-cache&sort_key=<?php echo $sortkey; ?>&link_type=1" <?php if ($link_type == 1) echo 'class="current"'; ?>><? _e('Internal', $this->text_domain); ?> <span class="count">(<?php echo $count_internal; ?>)</span></a> |</li>
134
+ <li class="all"><a href="tools.php?page=pz-linkcard-cache&sort_key=<?php echo $sortkey; ?>&link_type=2" <?php if ($link_type == 2) echo 'class="current"'; ?>><? _e('External', $this->text_domain); ?> <span class="count">(<?php echo $count_external; ?>)</span></a></li>
135
+ </ul>
136
+
137
+ <?php /*
138
+ <div class='tablenav-pages'>
139
+ <span class="displaying-num"><?php echo $count_all.__('items'); ?></span>
140
+ <span class='pagination-links'>
141
+ <span class="tablenav-pages-navspan" aria-hidden="true">&laquo;</span>
142
+ <span class="tablenav-pages-navspan" aria-hidden="true">&lsaquo;<?php echo $page_prev;?></span>
143
+ <span class="paging-input"><label for="current-page-selector" class="screen-reader-text"></label><input class='current-page' id='current-page-selector' type='text' name='paged' value='<?php echo $page_now; ?>' size='2' aria-describedby='table-paging' /> / <span class='total-pages'><?php echo $page_max; ?></span></span>
144
+ <span class="tablenav-pages-navspan" aria-hidden="true">&rsaquo;<?php echo $page_next;?></span>
145
+ <span class="tablenav-pages-navspan" aria-hidden="true">&raquo;</span>
146
+ </div>
147
+ */ ?>
148
+
149
+ <form id="posts-filter" action="" method="get">
150
+ <?php /* wp_nonce_field('pz_cacheman'); */ ?>
151
+ <input type="hidden" name="page" value="pz-linkcard-cache">
152
+ <input type="hidden" name="paged" value="<?php echo $page_now; ?>">
153
+
154
+ <div class="alignleft actions bulkactions">
155
+ <label for='bulk-action-selector-top' class='screen-reader-text'><?php _e('Select batch', $this->text_domain); ?></label>
156
+ <select name='action' id='bulk-action-selector-top'>
157
+ <option value='-1' selected='selected'><?php _e('Select', $this->text_domain); ?></option>
158
+ <option value='renew' class="hide-if-no-js"><?php _e('Renew SNS count', $this->text_domain); ?></option>
159
+ <option value='delete'><?php _e('Delete', $this->text_domain); ?></option>
160
+ </select>
161
+ <input type="submit" id="doaction" class="button action" value="<?php _e('Submit', $this->text_domain); ?>" />
162
+
163
+ <div id="settings" style="clear:both;">
164
+
165
+ <table name="cachelist" class="wp-list-table widefat fixed striped posts">
166
+ <thead>
167
+ <tr>
168
+
169
+ <td id='cb' class='manage-column column-cb check-column'>
170
+ <label class="screen-reader-text" for="cb-select-all-1">'.__('Select all', $this->text_domain).'</label>
171
+ <input id="cb-select-all-1" type="checkbox" />
172
+ </td>
173
+
174
+ <th>
175
+ <a href="tools.php?page=pz-linkcard-cache&sort_key=url&link_type=<?php echo $link_type; ?>"><?php _e('URL', $this->text_domain); ?></a>
176
+ </th>
177
+ <th>
178
+ <a href="tools.php?page=pz-linkcard-cache&sort_key=title&link_type=<?php echo $link_type; ?>"><?php _e('Title', $this->text_domain); ?></a>
179
+ </th>
180
+ <th>
181
+ <a href="tools.php?page=pz-linkcard-cache&sort_key=site_name&link_type=<?php echo $link_type; ?>"><?php _e('Site name', $this->text_domain); ?></a>
182
+ </th>
183
+ <th style="word-break: keep-all; width: 50px;">
184
+ <?php _e('Tw', $this->text_domain); ?>
185
+ </th>
186
+ <th style="word-break: keep-all; width: 50px;">
187
+ <?php _e('fb', $this->text_domain); ?>
188
+ </th>
189
+ <th style="word-break: keep-all; width: 50px;">
190
+ <?php _e('B!', $this->text_domain); ?>
191
+ </th>
192
+ <th style="word-break: keep-all; width: 70px;">
193
+ <a href="tools.php?page=pz-linkcard-cache&sort_key=regist&order=desc&link_type=<?php echo $link_type; ?>"><?php _e('Regist', $this->text_domain); ?></a>
194
+ </th>
195
+ <th style="word-break: keep-all; width: 60px;">
196
+ <a href="tools.php?page=pz-linkcard-cache&sort_key=post_id&order=desc&link_type=<?php echo $link_type; ?>"><?php _e('Post ID', $this->text_domain); ?></a>
197
+ </th>
198
+ <th style="word-break: keep-all; width: 45px;">
199
+ <a href="tools.php?page=pz-linkcard-cache&sort_key=result_code&link_type=<?php echo $link_type; ?>"><?php _e('Result code', $this->text_domain); ?></a>
200
+ </th>
201
+ </tr>
202
+ </thead>
203
+ <tbody>
204
+ <?php
205
+ foreach ($data_all as $data) {
206
+ echo '<tr>';
207
+
208
+ echo ' <th scope="row" class="check-column">';
209
+ echo ' <label class="screen-reader-text" for="cb-select-'.$data->id.'">'.__('Select', $this->text_domain).'</label>';
210
+ echo ' <input id="cb-select-'.$data->id.'" type="checkbox" name="id[]" value="'.$data->id.'" />';
211
+ echo ' <div class="locked-indicator"></div>';
212
+ echo ' </th>';
213
+
214
+
215
+ // echo ' <td align="center"><a href="tools.php?page=pz-linkcard-cache&action=delete&cache_id='.$data->id.'&confirm='.$data->uptime.'">'.__('Delete', $text_domain).'</a></td>';
216
+ // echo ' <td align="center"><a href="tools.php?page=pz-linkcard-cache&action=delete&cache_id='.$data->id.'&confirm='.$data->uptime.'">'.__('Delete', $text_domain).'</a></td>';
217
+
218
+ echo ' <td style="word-break: break-all;">'.esc_url($data->url).'</td>';
219
+ echo ' <td>'.htmlentities($data->title).'</td>';
220
+ echo ' <td><span title="'.$data->domain.'">'.$data->site_name.'</span></td>';
221
+ // echo ' <td><img src="'.$data->thumbnail.'" style="max-height: 100px; max-width: 100px;"></td>';
222
+ // echo ' <td style="word-break: break-all;">'.$data->thumbnail.'</td>';
223
+ // echo ' <td></td>';
224
+ // echo ' <td><img src="'.$data->favicon.'" style="max-height: 100px; max-width: 100px;"></td>';
225
+ // echo ' <td style="word-break: break-all;">'.$data->favicon.'</td>';
226
+ // echo ' <td></td>';
227
+ $sns_count = $data->sns_twitter;
228
+ echo ' <td>'.(($sns_count >= 0) ? $sns_count : '-').'</td>';
229
+ $sns_count = $data->sns_facebook;
230
+ echo ' <td>'.(($sns_count >= 0) ? $sns_count : '-').'</td>';
231
+ $sns_count = $data->sns_hatena;
232
+ echo ' <td>'.(($sns_count >= 0) ? $sns_count : '-').'</td>';
233
+ echo ' <td>'.$data->regist.'</td>';
234
+ echo ' <td><a href="'.get_permalink($data->post_id).'" target="_blank" title="'.get_the_title($data->post_id).'">'.$data->post_id.'</td>';
235
+ echo ' <td>'.$data->result_code.'</td>';
236
+ echo '</tr>';
237
+ }
238
+ ?>
239
+ </tbody>
240
+ </table>
241
+ </div>
242
+ </div>
243
+ </div>
244
+
245
+ <?php
246
+ function paging($pages = '', $range = 2) {
247
+ $showitems = ($range * 2)+1;
248
+
249
+ global $paged;
250
+ if(empty($paged)) {
251
+ $paged = 1;
252
+ }
253
+ if($pages == '') {
254
+ global $wp_query;
255
+ $pages = $wp_query->max_num_pages;
256
+ if (!$pages) {
257
+ $pages = 1;
258
+ }
259
+ }
260
+
261
+ if(1 != $pages) {
262
+ echo "<div class='pagination'>";
263
+ if($paged > 2 && $paged > $range+1 && $showitems < $pages) {
264
+ echo "<a href='".get_pagenum_link(1)."'>&laquo;</a>";
265
+ }
266
+ if($paged > 1 && $showitems < $pages) {
267
+ echo "<a href='".get_pagenum_link($paged - 1)."'>&lsaquo;</a>";
268
+ }
269
+
270
+ for ($i=1; $i <= $pages; $i++) {
271
+ if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) {
272
+ echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
273
+ }
274
+ }
275
+
276
+ if ($paged < $pages && $showitems < $pages) {
277
+ echo "<a href='".get_pagenum_link($paged + 1)."'>&rsaquo;</a>";
278
+ }
279
+ if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) {
280
+ echo "<a href='".get_pagenum_link($pages)."'>&raquo;</a>";
281
+ }
282
+ echo "</div>\n";
283
+ }
284
+ }
285
+ ?>
pz-linkcard-settings.php ADDED
@@ -0,0 +1,604 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!function_exists("get_option")) die; ?>
2
+ <div class="wrap">
3
+ <div id="icon-options-general" class="icon32"></div>
4
+ <h2><?php _e('LinkCard Settings', $this->text_domain); ?></h2>
5
+ <div id="settings" style="clear:both;">
6
+ <?php
7
+ if ( isset($_POST['properties'])) {
8
+ check_admin_referer('pz_options');
9
+ $this->options = $_POST['properties'];
10
+ if (isset($this->options['initialize']) && $this->options['initialize'] == '1') {
11
+ delete_option('Pz_LinkCard_options');
12
+ $this->options = $this->defaults;
13
+ }
14
+
15
+ $this->options['ex-image'] = stripslashes($this->options['ex-image']);
16
+ $this->options['in-image'] = stripslashes($this->options['in-image']);
17
+ $this->options['th-image'] = stripslashes($this->options['th-image']);
18
+
19
+ $this->options['ex-info'] = stripslashes($this->options['ex-info']);
20
+ $this->options['in-info'] = stripslashes($this->options['in-info']);
21
+ $this->options['th-info'] = stripslashes($this->options['th-info']);
22
+
23
+ $this->options['favicon-api'] = preg_replace( array('/%DOMAIN%/i', '/%DOMAIN_URL%/i', '/%URL%/i' ), array('%DOMAIN%', '%DOMAIN_URL%', '%URL%'), (isset($this->options['favicon-api'])) ? $this->options['favicon-api'] : null );
24
+ $this->options['thumbnail-api'] = preg_replace( array('/%DOMAIN%/i', '/%DOMAIN_URL%/i', '/%URL%/i' ), array('%DOMAIN%', '%DOMAIN_URL%', '%URL%'), (isset($this->options['thumbnail-api'])) ? $this->options['thumbnail-api'] : null );
25
+
26
+ $this->options['saved-date'] = time();
27
+
28
+ $result = true;
29
+ if ($this->options['code1'] == '') {
30
+ echo '<div class="error fade"><p><strong>'.__('Short code is not set.', $this->text_domain).'</strong></p></div>';
31
+ $result = false;
32
+ }
33
+ $width = $this->options['width'];
34
+ if (substr($width, -1 ) == '%') {
35
+ $this->options['width'] = preg_replace('/[^0-9]/', '', $width).'%';
36
+ } else {
37
+ $width = preg_replace('/[^0-9]/', '', $width);
38
+ if ($width == '') {
39
+ $this->options['width'] = '500px';
40
+ } else {
41
+ $this->options['width'] = $width.'px';
42
+ }
43
+ }
44
+ $height = preg_replace('/[^0-9]/', '', $this->options['content-height']);
45
+ if ($height == '') {
46
+ $this->options['content-height'] = '108px';
47
+ } else {
48
+ $this->options['content-height'] = $height.'px';
49
+ }
50
+ $trim_count = preg_replace('/[^0-9]/', '', $this->options['trim-count']);
51
+ if ($trim_count == '') {
52
+ $this->options['trim-count'] = 130;
53
+ } else {
54
+ $this->options['trim-count'] = $trim_count;
55
+ }
56
+
57
+ if ($result == true) {
58
+ $result = update_option('Pz_LinkCard_options', $this->options);
59
+ if ($result == true) {
60
+ echo '<div class="updated fade"><p><strong>'.__('Changes saved.', $this->text_domain).'</strong></p></div>';
61
+ } else {
62
+ echo '<div class="error fade"><p><strong>'.__('Not changed.', $this->text_domain).'</strong></p></div>';
63
+ }
64
+ require_once ('pz-linkcard-style.php');
65
+ }
66
+ }
67
+ ?>
68
+ <form action="" method="post">
69
+ <?php wp_nonce_field('pz_options'); ?>
70
+
71
+ <h3><?php _e('Basic', $this->text_domain); ?></h3>
72
+ <table class="form-table">
73
+ <tr valign="top">
74
+ <th scope="row"><label for="inputtext"><?php _e('ShortCode', $this->text_domain); ?></label></th>
75
+ <td><input name="properties[code1]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['code1']); ?>" class="regular-text" />
76
+ <p><?php _e('distinguish between uppercase and lowercase letters', $this->text_domain); ?></p></td>
77
+ </tr>
78
+ <tr valign="top">
79
+ <th scope="row"><label for="inputtext"><?php _e('ShortCode 2', $this->text_domain); ?></label></th>
80
+ <td><input name="properties[code2]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['code2']); ?>" class="regular-text" />
81
+ <p><?php _e('distinguish between uppercase and lowercase letters', $this->text_domain); ?></p></td>
82
+ </tr>
83
+ <tr valign="top" style="display: none;">
84
+ <th scope="row"><label for="inputtext"><?php _e('ShortCode 3', $this->text_domain); ?></label></th>
85
+ <td><input name="properties[code3]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['code3']); ?>" class="regular-text" />
86
+ <p><?php _e('distinguish between uppercase and lowercase letters', $this->text_domain); ?></p></td>
87
+ </tr>
88
+ <tr valign="top" style="display: none;">
89
+ <th scope="row"><label for="inputtext"><?php _e('ShortCode 4', $this->text_domain); ?></label></th>
90
+ <td><input name="properties[code4]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['code4']); ?>" class="regular-text" />
91
+ <p><?php _e('distinguish between uppercase and lowercase letters', $this->text_domain); ?></p></td>
92
+ </tr>
93
+ <tr valign="top">
94
+ <th scope="row"><label for="inputtext"><?php _e('Use inlinetext', $this->text_domain); ?></label></th>
95
+ <td>
96
+ <?php _e('[Shortcode url="xxx"]', $this->text_domain); ?>
97
+ <select name="properties[use-inline]">
98
+ <option value="" <?php if($this->options['use-inline'] == '') echo 'selected="selected"'; ?>><?php _e('No use', $this->text_domain); ?></option>
99
+ <option value="1" <?php if($this->options['use-inline'] == '1') echo 'selected="selected"'; ?>><?php _e('Use to excerpt', $this->text_domain); ?></option>
100
+ <option value="2" <?php if($this->options['use-inline'] == '2') echo 'selected="selected"'; ?>><?php _e('Use to title', $this->text_domain); ?></option>
101
+ </select>
102
+ <?php _e('[/Shortcode]', $this->text_domain); ?>
103
+ </td>
104
+ </tr>
105
+
106
+ <tr valign="top">
107
+ <th scope="row"><label for="inputtext"><?php _e('Special Format', $this->text_domain); ?></label></th>
108
+ <td>
109
+ <select name="properties[special-format]">
110
+ <option value="" <?php if($this->options['special-format'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
111
+ <option value="LkC" <?php if($this->options['special-format'] == 'LkC') echo 'selected="selected"'; ?>><?php _e('Pz-LkC Default', $this->text_domain); ?></option>
112
+ <option value="ct1" <?php if($this->options['special-format'] == 'ct1') echo 'selected="selected"'; ?>><?php _e('Cellophane tape "center"', $this->text_domain); ?></option>
113
+ <option value="ct2" <?php if($this->options['special-format'] == 'ct2') echo 'selected="selected"'; ?>><?php _e('Cellophane tape "Top corner"', $this->text_domain); ?></option>
114
+ <option value="ct3" <?php if($this->options['special-format'] == 'ct3') echo 'selected="selected"'; ?>><?php _e('Cellophane tape "long"', $this->text_domain); ?></option>
115
+ <option value="slt" <?php if($this->options['special-format'] == 'slt') echo 'selected="selected"'; ?>><?php _e('Slanting', $this->text_domain); ?></option>
116
+ <option value="3Dr" <?php if($this->options['special-format'] == '3Dr') echo 'selected="selected"'; ?>><?php _e('3D Rotate', $this->text_domain); ?></option>
117
+ <option value="ppc" <?php if($this->options['special-format'] == 'ppc') echo 'selected="selected"'; ?>><?php _e('Curling paper', $this->text_domain); ?></option>
118
+ <option value="inN" <?php if($this->options['special-format'] == 'inN') echo 'selected="selected"'; ?>><?php _e('Neutral', $this->text_domain); ?></option>
119
+ <option value="inI" <?php if($this->options['special-format'] == 'inI') echo 'selected="selected"'; ?>><?php _e('Orange', $this->text_domain); ?></option>
120
+ <option value="inE" <?php if($this->options['special-format'] == 'inE') echo 'selected="selected"'; ?>><?php _e('Green', $this->text_domain); ?></option>
121
+ <option value="inR" <?php if($this->options['special-format'] == 'inR') echo 'selected="selected"'; ?>><?php _e('Blue', $this->text_domain); ?></option>
122
+ </select>
123
+ <br /><?php _e('Will some of the parameters are forcibly changed', $this->text_domain); ?></td>
124
+ </td>
125
+ </tr>
126
+ </table>
127
+ <?php submit_button(); ?>
128
+
129
+ <h3><?php _e('Style', $this->text_domain); ?></h3>
130
+ <table class="form-table">
131
+ <tr valign="top">
132
+ <th scope="row"><label for="inputtext"><?php _e('Position', $this->text_domain); ?></label></th>
133
+ <td>
134
+ <table style="border: 1px dashed #000; background-color: #eee;">
135
+ <tr>
136
+ <td>
137
+ </td>
138
+ <td align="center">
139
+ <?php _e('Margin top', $this->text_domain); ?><br />
140
+ <select name="properties[margin-top]">
141
+ <option value="" <?php if($this->options['margin-top'] == '') echo 'selected="selected"'; ?>><?php _e('Not defined', $this->text_domain); ?></option>
142
+ <option value="0" <?php if($this->options['margin-top'] == '0') echo 'selected="selected"'; ?>><?php _e('0', $this->text_domain); ?></option>
143
+ <option value="4px" <?php if($this->options['margin-top'] == '4px') echo 'selected="selected"'; ?>><?php _e('4px', $this->text_domain); ?></option>
144
+ <option value="8px" <?php if($this->options['margin-top'] == '8px') echo 'selected="selected"'; ?>><?php _e('8px', $this->text_domain); ?></option>
145
+ <option value="16px" <?php if($this->options['margin-top'] == '16px') echo 'selected="selected"'; ?>><?php _e('16px', $this->text_domain); ?></option>
146
+ <option value="32px" <?php if($this->options['margin-top'] == '32px') echo 'selected="selected"'; ?>><?php _e('32px', $this->text_domain); ?></option>
147
+ <option value="64px" <?php if($this->options['margin-top'] == '64px') echo 'selected="selected"'; ?>><?php _e('64px', $this->text_domain); ?></option>
148
+ </select>
149
+ </td>
150
+ <td></td>
151
+ </tr>
152
+ <tr>
153
+ <td align="center">
154
+ <?php _e('Margin left', $this->text_domain); ?><br />
155
+ <select name="properties[margin-left]">
156
+ <option value="" <?php if($this->options['margin-left'] == '') echo 'selected="selected"'; ?>><?php _e('Not defined', $this->text_domain); ?></option>
157
+ <option value="0" <?php if($this->options['margin-left'] == '0') echo 'selected="selected"'; ?>><?php _e('0', $this->text_domain); ?></option>
158
+ <option value="4px" <?php if($this->options['margin-left'] == '4px') echo 'selected="selected"'; ?>><?php _e('4px', $this->text_domain); ?></option>
159
+ <option value="8px" <?php if($this->options['margin-left'] == '8px') echo 'selected="selected"'; ?>><?php _e('8px', $this->text_domain); ?></option>
160
+ <option value="16px" <?php if($this->options['margin-left'] == '16px') echo 'selected="selected"'; ?>><?php _e('16px', $this->text_domain); ?></option>
161
+ <option value="32px" <?php if($this->options['margin-left'] == '32px') echo 'selected="selected"'; ?>><?php _e('32px', $this->text_domain); ?></option>
162
+ <option value="64px" <?php if($this->options['margin-left'] == '64px') echo 'selected="selected"'; ?>><?php _e('64px', $this->text_domain); ?></option>
163
+ </select>
164
+ </td>
165
+ <td align="center" style="border: 1px solid #000; background-color: #fff;">
166
+ <?php _e('Width', $this->text_domain); ?><input name="properties[width]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['width']); ?>" style="width: 80px;" /><br />
167
+ <?php _e('Height', $this->text_domain); ?><input name="properties[content-height]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['content-height']); ?>" style="width: 80px;" /><br />
168
+ <?php _e('Trim', $this->text_domain); ?><input name="properties[trim-count]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['trim-count']); ?>" style="width: 80px;" /><br />
169
+ </td>
170
+ <td align="center">
171
+ <?php _e('Margin right', $this->text_domain); ?><br />
172
+ <select name="properties[margin-right]">
173
+ <option value="" <?php if($this->options['margin-right'] == '') echo 'selected="selected"'; ?>><?php _e('Not defined', $this->text_domain); ?></option>
174
+ <option value="0" <?php if($this->options['margin-right'] == '0') echo 'selected="selected"'; ?>><?php _e('0', $this->text_domain); ?></option>
175
+ <option value="4px" <?php if($this->options['margin-right'] == '4px') echo 'selected="selected"'; ?>><?php _e('4px', $this->text_domain); ?></option>
176
+ <option value="8px" <?php if($this->options['margin-right'] == '8px') echo 'selected="selected"'; ?>><?php _e('8px', $this->text_domain); ?></option>
177
+ <option value="16px" <?php if($this->options['margin-right'] == '16px') echo 'selected="selected"'; ?>><?php _e('16px', $this->text_domain); ?></option>
178
+ <option value="32px" <?php if($this->options['margin-right'] == '32px') echo 'selected="selected"'; ?>><?php _e('32px', $this->text_domain); ?></option>
179
+ <option value="64px" <?php if($this->options['margin-right'] == '64px') echo 'selected="selected"'; ?>><?php _e('64px', $this->text_domain); ?></option>
180
+ </select>
181
+ </td>
182
+ </tr>
183
+ <tr>
184
+ <td>
185
+ <input name="properties[centering]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['centering']) ? $this->options['centering'] : null, 1); ?> /><?php _e('Centering', $this->text_domain); ?>
186
+ </td>
187
+ <td align="center">
188
+ <?php _e('Margin bottom', $this->text_domain); ?><br />
189
+ <select name="properties[margin-bottom]">
190
+ <option value="" <?php if($this->options['margin-bottom'] == '') echo 'selected="selected"'; ?>><?php _e('Not defined', $this->text_domain); ?></option>
191
+ <option value="0" <?php if($this->options['margin-bottom'] == '0') echo 'selected="selected"'; ?>><?php _e('0', $this->text_domain); ?></option>
192
+ <option value="4px" <?php if($this->options['margin-bottom'] == '4px') echo 'selected="selected"'; ?>><?php _e('4px', $this->text_domain); ?></option>
193
+ <option value="8px" <?php if($this->options['margin-bottom'] == '8px') echo 'selected="selected"'; ?>><?php _e('8px', $this->text_domain); ?></option>
194
+ <option value="16px" <?php if($this->options['margin-bottom'] == '16px') echo 'selected="selected"'; ?>><?php _e('16px', $this->text_domain); ?></option>
195
+ <option value="32px" <?php if($this->options['margin-bottom'] == '32px') echo 'selected="selected"'; ?>><?php _e('32px', $this->text_domain); ?></option>
196
+ <option value="64px" <?php if($this->options['margin-bottom'] == '64px') echo 'selected="selected"'; ?>><?php _e('64px', $this->text_domain); ?></option>
197
+ </select>
198
+ </td>
199
+ <td>
200
+ </td>
201
+ </tr>
202
+ </table>
203
+ </td>
204
+ </tr>
205
+
206
+ <tr valign="top">
207
+ <th scope="row"><label for="inputtext"><?php _e('Link the whole', $this->text_domain); ?></label></th>
208
+ <td><input name="properties[link-all]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['link-all']) ? $this->options['link-all'] : null, 1); ?> />
209
+ <?php _e('Enclose the entire card at anchor', $this->text_domain); ?>
210
+ </td>
211
+ </tr>
212
+
213
+ <tr valign="top">
214
+ <th scope="row"><label for="inputtext"><?php _e('Border', $this->text_domain); ?></label></th>
215
+ <td>
216
+ <select name="properties[border]">
217
+ <option value="" <?php if($this->options['border'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
218
+ <option value="1gr" <?php if($this->options['border'] == '1gr') echo 'selected="selected"'; ?>><?php _e('Gray thin', $this->text_domain); ?></option>
219
+ <option value="2gr" <?php if($this->options['border'] == '2gr') echo 'selected="selected"'; ?>><?php _e('Gray', $this->text_domain); ?></option>
220
+ <option value="4gr" <?php if($this->options['border'] == '4gr') echo 'selected="selected"'; ?>><?php _e('Gray thick', $this->text_domain); ?></option>
221
+ <option value="1bk" <?php if($this->options['border'] == '1bk') echo 'selected="selected"'; ?>><?php _e('Black thin', $this->text_domain); ?></option>
222
+ <option value="2bk" <?php if($this->options['border'] == '2bk') echo 'selected="selected"'; ?>><?php _e('Black', $this->text_domain); ?></option>
223
+ <option value="4bk" <?php if($this->options['border'] == '4bk') echo 'selected="selected"'; ?>><?php _e('Black thick', $this->text_domain); ?></option>
224
+ <option value="8bk" <?php if($this->options['border'] == '8bk') echo 'selected="selected"'; ?>><?php _e('Black frame', $this->text_domain); ?></option>
225
+ <option value="blu" <?php if($this->options['border'] == 'blu') echo 'selected="selected"'; ?>><?php _e('Dodgerblue', $this->text_domain); ?></option>
226
+ <option value="gre" <?php if($this->options['border'] == 'gre') echo 'selected="selected"'; ?>><?php _e('Mediumaquamarine', $this->text_domain); ?></option>
227
+ <option value="red" <?php if($this->options['border'] == 'red') echo 'selected="selected"'; ?>><?php _e('Hotpink', $this->text_domain); ?></option>
228
+ <option value="dbl" <?php if($this->options['border'] == 'dbl') echo 'selected="selected"'; ?>><?php _e('Double', $this->text_domain); ?></option>
229
+ <option value="dot" <?php if($this->options['border'] == 'dot') echo 'selected="selected"'; ?>><?php _e('Dotted', $this->text_domain); ?></option>
230
+ </select>
231
+ </td>
232
+ </tr>
233
+
234
+ <tr valign="top">
235
+ <th scope="row"><?php _e('Layout', $this->text_domain); ?></th>
236
+ <td><input name="properties[radius]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['radius']) ? $this->options['radius'] : null, 1); ?> /><?php _e('Radius', $this->text_domain); ?></td>
237
+ </tr>
238
+ <tr>
239
+ <th scope="row"></th>
240
+ <td>
241
+
242
+ <table style="border: 1px solid #000; background-color: #fff;">
243
+ <tr>
244
+ <td>
245
+ <input name="properties[display-url]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['display-url']) ? $this->options['display-url'] : null, 1); ?> /><?php _e('Display URL', $this->text_domain); ?>
246
+ </td>
247
+ <td rowspan="3" style="border: 1px solid #000;">
248
+ <?php _e('Thumbnail', $this->text_domain); ?><br />
249
+ <select name="properties[thumbnail-position]">
250
+ <option value="0" <?php if($this->options['thumbnail-position'] == '0') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
251
+ <option value="1" <?php if($this->options['thumbnail-position'] == '1') echo 'selected="selected"'; ?>><?php _e('Right', $this->text_domain); ?></option>
252
+ <option value="2" <?php if($this->options['thumbnail-position'] == '2') echo 'selected="selected"'; ?>><?php _e('Left', $this->text_domain); ?></option>
253
+ </select>
254
+ <br /><input name="properties[thumbnail-shadow]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['thumbnail-shadow']) ? $this->options['thumbnail-shadow'] : null, 1); ?> /><?php _e('Shadow', $this->text_domain); ?>
255
+ </td>
256
+ </tr>
257
+ <tr>
258
+ <td>
259
+ <input name="properties[content-inset]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['content-inset']) ? $this->options['content-inset'] : null, 1); ?> /><?php _e('Hollow content area', $this->text_domain); ?>
260
+ </td>
261
+ </tr>
262
+ <tr>
263
+ <td>
264
+ <input name="properties[display-excerpt]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['display-excerpt']) ? $this->options['display-excerpt'] : null, 1); ?> /><?php _e('Display excerpt', $this->text_domain); ?>
265
+ </td>
266
+ </tr>
267
+ <tr>
268
+ <td colspan="2">
269
+ <?php _e('Site information', $this->text_domain); ?>
270
+ <select name="properties[info-position]">
271
+ <option value="" <?php if($this->options['info-position'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
272
+ <option value="1" <?php if($this->options['info-position'] == '1') echo 'selected="selected"'; ?>><?php _e('Top', $this->text_domain); ?></option>
273
+ <option value="2" <?php if($this->options['info-position'] == '2') echo 'selected="selected"'; ?>><?php _e('Bottom', $this->text_domain); ?></option>
274
+ </select>
275
+ <input name="properties[use-sitename]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['use-sitename']) ? $this->options['use-sitename'] : null, 1); ?> /><?php _e('Use SiteName', $this->text_domain); ?>
276
+ </td>
277
+ </tr>
278
+ <tr>
279
+ <td>
280
+ <input name="properties[shadow-inset]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['shadow-inset']) ? $this->options['shadow-inset'] : null, 1); ?> /><?php _e('Hollow', $this->text_domain); ?>
281
+ </td>
282
+ <td>
283
+ </td>
284
+ </tr>
285
+ </table>
286
+ </td>
287
+ </tr>
288
+ <tr valign="top">
289
+ <th scope="row"></th>
290
+ <td><input name="properties[shadow]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['shadow']) ? $this->options['shadow'] : null, 1); ?> /><?php _e('Shadow', $this->text_domain); ?></td>
291
+ </tr>
292
+
293
+ <tr valign="top">
294
+ <th scope="row"><label for="inputtext"><?php _e('Display SNS Count', $this->text_domain); ?></label></th>
295
+ <td>
296
+ <select name="properties[sns-position]">
297
+ <option value="" <?php if($this->options['sns-position'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
298
+ <option value="1" <?php if($this->options['sns-position'] == '1') echo 'selected="selected"'; ?>><?php _e('After Title', $this->text_domain); ?></option>
299
+ <option value="2" <?php if($this->options['sns-position'] == '2') echo 'selected="selected"'; ?>><?php _e('After site-name', $this->text_domain); ?></option>
300
+ </select>
301
+ <input name="properties[sns-hatena]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['sns-hatena']) ? $this->options['sns-hatena'] : null, 1); ?> /><?php _e('Hatena', $this->text_domain); ?>
302
+ <input name="properties[sns-facebook]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['sns-facebook']) ? $this->options['sns-facebook'] : null, 1); ?> /><?php _e('Facebook', $this->text_domain); ?>
303
+ <input name="properties[sns-twitter]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['sns-twitter']) ? $this->options['sns-twitter'] : null, 1); ?> /><?php _e('Twitter', $this->text_domain); ?>
304
+ <br /><?php _e('There is a possibility that the screen display is slow If you enable this setting.', $this->text_domain); ?>
305
+ </td>
306
+ </tr>
307
+ </table>
308
+ <?php submit_button(); ?>
309
+
310
+ <h3><?php _e('Letters', $this->text_domain); ?></h3>
311
+ <table class="form-table">
312
+ <tr valign="top">
313
+ <th scope="row"><label for="inputtext"><?php _e('Title', $this->text_domain); ?></label></th>
314
+ <td>
315
+ <input name="properties[color-title]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['color-title']); ?>" />
316
+ <br />
317
+ <select name="properties[size-title]">
318
+ <option value="14px" <?php if($this->options['size-title'] == '14px') echo 'selected="selected"'; ?>><?php _e('14px', $this->text_domain); ?></option>
319
+ <option value="16px" <?php if($this->options['size-title'] == '16px') echo 'selected="selected"'; ?>><?php _e('16px', $this->text_domain); ?></option>
320
+ <option value="18px" <?php if($this->options['size-title'] == '18px') echo 'selected="selected"'; ?>><?php _e('18px', $this->text_domain); ?></option>
321
+ <option value="20px" <?php if($this->options['size-title'] == '20px') echo 'selected="selected"'; ?>><?php _e('20px', $this->text_domain); ?></option>
322
+ <option value="24px" <?php if($this->options['size-title'] == '24px') echo 'selected="selected"'; ?>><?php _e('24px', $this->text_domain); ?></option>
323
+ <option value="100%" <?php if($this->options['size-title'] == '100%') echo 'selected="selected"'; ?>><?php _e('100%', $this->text_domain); ?></option>
324
+ <option value="120%" <?php if($this->options['size-title'] == '120%') echo 'selected="selected"'; ?>><?php _e('120%', $this->text_domain); ?></option>
325
+ <option value="140%" <?php if($this->options['size-title'] == '140%') echo 'selected="selected"'; ?>><?php _e('140%', $this->text_domain); ?></option>
326
+ </select>
327
+ </td>
328
+ </tr>
329
+ <tr valign="top">
330
+ <th scope="row"><label for="inputtext"><?php _e('URL', $this->text_domain); ?></label></th>
331
+ <td>
332
+ <input name="properties[color-url]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['color-url']); ?>" />
333
+ <br />
334
+ <select name="properties[size-url]">
335
+ <option value="9px" <?php if($this->options['size-url'] == '9px') echo 'selected="selected"'; ?>><?php _e('9px', $this->text_domain); ?></option>
336
+ <option value="12px" <?php if($this->options['size-url'] == '12px') echo 'selected="selected"'; ?>><?php _e('12px', $this->text_domain); ?></option>
337
+ <option value="14px" <?php if($this->options['size-url'] == '14px') echo 'selected="selected"'; ?>><?php _e('14px', $this->text_domain); ?></option>
338
+ <option value="70%" <?php if($this->options['size-url'] == '70%') echo 'selected="selected"'; ?>><?php _e('70%', $this->text_domain); ?></option>
339
+ <option value="80%" <?php if($this->options['size-url'] == '80%') echo 'selected="selected"'; ?>><?php _e('80%', $this->text_domain); ?></option>
340
+ <option value="90%" <?php if($this->options['size-url'] == '90%') echo 'selected="selected"'; ?>><?php _e('90%', $this->text_domain); ?></option>
341
+ </select>
342
+ </td>
343
+ </tr>
344
+ <tr valign="top">
345
+ <th scope="row"><label for="inputtext"><?php _e('Excerpt', $this->text_domain); ?></label></th>
346
+ <td>
347
+ <input name="properties[color-excerpt]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['color-excerpt']); ?>" />
348
+ <br />
349
+ <select name="properties[size-excerpt]">
350
+ <option value="9px" <?php if($this->options['size-excerpt'] == '9px') echo 'selected="selected"'; ?>><?php _e('9px', $this->text_domain); ?></option>
351
+ <option value="11px" <?php if($this->options['size-excerpt'] == '11px') echo 'selected="selected"'; ?>><?php _e('11px', $this->text_domain); ?></option>
352
+ <option value="12px" <?php if($this->options['size-excerpt'] == '12px') echo 'selected="selected"'; ?>><?php _e('12px', $this->text_domain); ?></option>
353
+ <option value="14px" <?php if($this->options['size-excerpt'] == '14px') echo 'selected="selected"'; ?>><?php _e('14px', $this->text_domain); ?></option>
354
+ <option value="70%" <?php if($this->options['size-excerpt'] == '70%') echo 'selected="selected"'; ?>><?php _e('70%', $this->text_domain); ?></option>
355
+ <option value="80%" <?php if($this->options['size-excerpt'] == '80%') echo 'selected="selected"'; ?>><?php _e('80%', $this->text_domain); ?></option>
356
+ <option value="90%" <?php if($this->options['size-excerpt'] == '90%') echo 'selected="selected"'; ?>><?php _e('90%', $this->text_domain); ?></option>
357
+ </select>
358
+ </td>
359
+ </tr>
360
+ <tr valign="top">
361
+ <th scope="row"><label for="inputtext"><?php _e('Site-info.', $this->text_domain); ?></label></th>
362
+ <td>
363
+ <input name="properties[color-info]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['color-info']); ?>" />
364
+ <br />
365
+ <select name="properties[size-info]">
366
+ <option value="9px" <?php if($this->options['size-info'] == '9px') echo 'selected="selected"'; ?>><?php _e('9px', $this->text_domain); ?></option>
367
+ <option value="11px" <?php if($this->options['size-info'] == '11px') echo 'selected="selected"'; ?>><?php _e('11px', $this->text_domain); ?></option>
368
+ <option value="12px" <?php if($this->options['size-info'] == '12px') echo 'selected="selected"'; ?>><?php _e('12px', $this->text_domain); ?></option>
369
+ <option value="13px" <?php if($this->options['size-info'] == '13px') echo 'selected="selected"'; ?>><?php _e('13px', $this->text_domain); ?></option>
370
+ <option value="14px" <?php if($this->options['size-info'] == '14px') echo 'selected="selected"'; ?>><?php _e('14px', $this->text_domain); ?></option>
371
+ <option value="60%" <?php if($this->options['size-info'] == '60%') echo 'selected="selected"'; ?>><?php _e('60%', $this->text_domain); ?></option>
372
+ <option value="70%" <?php if($this->options['size-info'] == '70%') echo 'selected="selected"'; ?>><?php _e('70%', $this->text_domain); ?></option>
373
+ <option value="80%" <?php if($this->options['size-info'] == '80%') echo 'selected="selected"'; ?>><?php _e('80%', $this->text_domain); ?></option>
374
+ <option value="90%" <?php if($this->options['size-info'] == '90%') echo 'selected="selected"'; ?>><?php _e('90%', $this->text_domain); ?></option>
375
+ <option value="100%" <?php if($this->options['size-info'] == '100%') echo 'selected="selected"'; ?>><?php _e('100%', $this->text_domain); ?></option>
376
+ </select>
377
+ </td>
378
+ </tr>
379
+ <tr valign="top" style="display: none;">
380
+ <th scope="row"><label for="inputtext"><?php _e('Plugin link', $this->text_domain); ?></label></th>
381
+ <td>
382
+ <input name="properties[color-plugin]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['color-plugin']); ?>" />
383
+ <br />
384
+ <select name="properties[size-plugin]">
385
+ <option value="4px" <?php if($this->options['size-info'] == '4px') echo 'selected="selected"'; ?>><?php _e('4px', $this->text_domain); ?></option>
386
+ <option value="6px" <?php if($this->options['size-info'] == '6px') echo 'selected="selected"'; ?>><?php _e('4px', $this->text_domain); ?></option>
387
+ <option value="9px" <?php if($this->options['size-info'] == '9px') echo 'selected="selected"'; ?>><?php _e('9px', $this->text_domain); ?></option>
388
+ <option value="60%" <?php if($this->options['size-info'] == '60%') echo 'selected="selected"'; ?>><?php _e('60%', $this->text_domain); ?></option>
389
+ </select>
390
+ </td>
391
+ </tr>
392
+ <tr valign="top" style="display: none;">
393
+ <th scope="row"><label for="inputtext"><?php _e('Plugin-link', $this->text_domain); ?></label></th>
394
+ <td><input name="properties[color-plugin]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['color-plugin']); ?>" /></td>
395
+ </tr>
396
+
397
+ </table>
398
+ <?php submit_button(); ?>
399
+
400
+
401
+ <h3><?php _e('External link', $this->text_domain); ?></h3>
402
+ <table class="form-table">
403
+
404
+ <tr valign="top">
405
+ <th scope="row"><label for="inputtext"><?php _e('Background Color', $this->text_domain); ?></label></th>
406
+ <td><input name="properties[ex-bgcolor]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['ex-bgcolor']); ?>" /></td>
407
+ </tr>
408
+ <tr valign="top">
409
+ <th scope="row"><label for="inputtext"><?php _e('Background image', $this->text_domain); ?></label></th>
410
+ <td><input name="properties[ex-image]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['ex-image']); ?>" size="80" /></td>
411
+ </tr>
412
+ <tr valign="top">
413
+ <th scope="row"><label for="inputtext"><?php _e('Thumbnail', $this->text_domain); ?></label></th>
414
+ <td>
415
+ <select name="properties[ex-thumbnail]">
416
+ <option value="" <?php if($this->options['ex-thumbnail'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
417
+ <option value="1" <?php if($this->options['ex-thumbnail'] == '1') echo 'selected="selected"'; ?> disabled="disabled"><?php _e('Direct', $this->text_domain); ?></option>
418
+ <option value="3" <?php if($this->options['ex-thumbnail'] == '3') echo 'selected="selected"'; ?>><?php _e('Use WebAPI', $this->text_domain); ?></option>
419
+ </select>
420
+ </td>
421
+ </tr>
422
+ <tr valign="top">
423
+ <th scope="row"><label for="inputtext"><?php _e('Favicon', $this->text_domain); ?></label></th>
424
+ <td>
425
+ <select name="properties[ex-favicon]">
426
+ <option value="" <?php if($this->options['ex-favicon'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
427
+ <option value="1" <?php if($this->options['ex-favicon'] == '1') echo 'selected="selected"'; ?> disabled="disabled"><?php _e('Direct', $this->text_domain); ?></option>
428
+ <option value="3" <?php if($this->options['ex-favicon'] == '3') echo 'selected="selected"'; ?>><?php _e('Use WebAPI', $this->text_domain); ?></option>
429
+ </select>
430
+ </td>
431
+ </tr>
432
+ <tr valign="top">
433
+ <th scope="row"><label for="inputtext"><?php _e('Site information', $this->text_domain); ?></label></th>
434
+ <td><input name="properties[ex-info]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['ex-info']); ?>" class="regular-text" /></td>
435
+ </tr>
436
+ <tr valign="top">
437
+ <th scope="row"><label for="inputtext"><?php _e('Open new window/tab', $this->text_domain); ?></label></th>
438
+ <td><input name="properties[ex-target]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['ex-target']) ? $this->options['ex-target'] : null, 1); ?> /></td>
439
+ </tr>
440
+
441
+ </table>
442
+ <?php submit_button(); ?>
443
+
444
+ <h3><?php _e('Internal link', $this->text_domain); ?></h3>
445
+ <table class="form-table">
446
+
447
+ <tr valign="top">
448
+ <th scope="row"><label for="inputtext"><?php _e('Background Color', $this->text_domain); ?></label></th>
449
+ <td><input name="properties[in-bgcolor]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['in-bgcolor']); ?>" /></td>
450
+ </tr>
451
+ <tr valign="top">
452
+ <th scope="row"><label for="inputtext"><?php _e('Background Image', $this->text_domain); ?></label></th>
453
+ <td><input name="properties[in-image]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['in-image']); ?>" size="80" /></td>
454
+ </tr>
455
+ <tr valign="top">
456
+ <th scope="row"><label for="inputtext"><?php _e('Thumbnail', $this->text_domain); ?></label></th>
457
+ <td>
458
+ <select name="properties[in-thumbnail]">
459
+ <option value="" <?php if($this->options['in-thumbnail'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
460
+ <option value="1" <?php if($this->options['in-thumbnail'] == '1') echo 'selected="selected"'; ?>><?php _e('Direct', $this->text_domain); ?></option>
461
+ <option value="3" <?php if($this->options['in-thumbnail'] == '3') echo 'selected="selected"'; ?>><?php _e('Use WebAPI', $this->text_domain); ?></option>
462
+ </select>
463
+ </td>
464
+ </tr>
465
+ <tr valign="top">
466
+ <th scope="row"><label for="inputtext"><?php _e('Favicon', $this->text_domain); ?></label></th>
467
+ <td>
468
+ <select name="properties[in-favicon]">
469
+ <option value="" <?php if($this->options['in-favicon'] == '') echo 'selected="selected"'; ?>><?php _e('None', $this->text_domain); ?></option>
470
+ <option value="1" <?php if($this->options['in-favicon'] == '1') echo 'selected="selected"'; ?> <?php if(!function_exists('has_site_icon')) echo 'disabled="disabled"'; ?>><?php _e('Direct', $this->text_domain); ?></option>
471
+ <option value="3" <?php if($this->options['in-favicon'] == '3') echo 'selected="selected"'; ?>><?php _e('Use WebAPI', $this->text_domain); ?></option>
472
+ </select>
473
+ </td>
474
+ </tr>
475
+ <tr valign="top">
476
+ <th scope="row"><label for="inputtext"><?php _e('Site information', $this->text_domain); ?></label></th>
477
+ <td><input name="properties[in-info]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['in-info']); ?>" class="regular-text" /><br /></td>
478
+ </tr>
479
+ <tr valign="top">
480
+ <th scope="row"><label for="inputtext"><?php _e('Open new window/tab', $this->text_domain); ?></label></th>
481
+ <td><input name="properties[in-target]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['in-target']) ? $this->options['in-target'] : null, 1); ?> /></td>
482
+ </tr>
483
+
484
+ <tr valign="top">
485
+ <th scope="row"><label for="inputtext"><?php _e('This page', $this->text_domain); ?></label></th>
486
+ </tr>
487
+ <tr valign="top">
488
+ <th scope="row"><label for="inputtext"><?php _e('Background Color', $this->text_domain); ?></label></th>
489
+ <td><input name="properties[th-bgcolor]" type="text" class="color-picker" id="pickedcolor" value="<?php echo esc_attr($this->options['th-bgcolor']); ?>" /></td>
490
+ </tr>
491
+ <tr valign="top">
492
+ <th scope="row"><label for="inputtext"><?php _e('Background Image', $this->text_domain); ?></label></th>
493
+ <td><input name="properties[th-image]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['th-image']); ?>" size="80" /></td>
494
+ </tr>
495
+ <tr valign="top">
496
+ <th scope="row"><label for="inputtext"><?php _e('Site information', $this->text_domain); ?></label></th>
497
+ <td><input name="properties[th-info]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['th-info']); ?>" class="regular-text" /></td>
498
+ </tr>
499
+
500
+ </table>
501
+ <?php submit_button(); ?>
502
+
503
+ <h3><?php _e('Web-API', $this->text_domain); ?></h3>
504
+ <table class="form-table"
505
+ <tr valign="top">
506
+ <th scope="row"><label for="inputtext"><?php _e('Favicon API', $this->text_domain); ?></label></th>
507
+ <td><input name="properties[favicon-api]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['favicon-api']); ?>" size="80" />
508
+ <p><?php _e('%DOMAIN% replace to domain name (ex. poporon.poponet.jp )<br />%DOMAIN_URL% replace to domain URL (ex. http://poporon.poponet.jp )', $this->text_domain); ?></p></td>
509
+ </tr>
510
+ <tr valign="top">
511
+ <th scope="row"><label for="inputtext"><?php _e('Thumbnail API', $this->text_domain); ?></label></th>
512
+ <td><input name="properties[thumbnail-api]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['thumbnail-api']); ?>" size="80" />
513
+ <p><?php _e('%URL% replace to URL', $this->text_domain); ?></p></td>
514
+ </tr>
515
+ </table>
516
+ <?php submit_button(); ?>
517
+
518
+ <h3><?php _e('Debug', $this->text_domain); ?></h3>
519
+ <table class="form-table">
520
+ <tr valign="top">
521
+ <th scope="row"><label for="inputtext"><?php _e('Use blockquote tag', $this->text_domain); ?></label></th>
522
+ <td><input name="properties[blockquote]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['blockquote']) ? $this->options['blockquote'] : null, 1); ?> />
523
+ <?php _e('without using DIV tag, and use BLOCKQUOTE tag', $this->text_domain); ?></td>
524
+ </tr>
525
+ <tr valign="top">
526
+ <th scope="row"><label for="inputtext"><?php _e('Set nofollow', $this->text_domain); ?></label></th>
527
+ <td><input name="properties[nofollow]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['nofollow']) ? $this->options['nofollow'] : null, 1); ?> />
528
+ <?php _e('In the case of an external site, it puts the "nofollow"', $this->text_domain); ?></td>
529
+ </tr>
530
+
531
+ <tr valign="top">
532
+ <th scope="row"><label for="inputtext"><?php _e('Reset img style', $this->text_domain); ?></label></th>
533
+ <td><input name="properties[style-reset-img]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['style-reset-img']) ? $this->options['style-reset-img'] : null, 1); ?> />
534
+ <?php _e('When unnecessary frame is displayed on the image, you can improve it by case', $this->text_domain); ?></td>
535
+ </tr>
536
+
537
+ <tr valign="top">
538
+ <th scope="row"><label for="inputtext"><?php _e('specified CSS', $this->text_domain); ?></label></th>
539
+ <td><input name="properties[style]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['style']) ? $this->options['style'] : null, 1); ?> />
540
+ <?php _e('Use specified CSS file', $this->text_domain); ?></td>
541
+ </tr>
542
+ <tr valign="top">
543
+ <th scope="row"><label for="inputtext"><?php _e('CSS file', $this->text_domain); ?></label></th>
544
+ <td><input name="properties[css-file]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['css-file']); ?>" size="80" /><br />
545
+ <p><?php _e('(ex. http://exsample.com/style.css )', $this->text_domain); ?></p></td>
546
+ </tr>
547
+ <tr valign="top" style="display: none;">
548
+ <th scope="row"><label for="inputtext"><?php _e('CSS file', $this->text_domain); ?></label></th>
549
+ <td><input name="properties[css-path]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['css-path']); ?>" size="80" /><br />
550
+ </tr>
551
+ <tr valign="top" style="display: none;">
552
+ <th scope="row"><label for="inputtext"><?php _e('CSS URL', $this->text_domain); ?></label></th>
553
+ <td><input name="properties[css-url]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['css-url']); ?>" size="80" /><br />
554
+ </tr>
555
+
556
+ <tr valign="top">
557
+ <th scope="row"><label for="inputtext"><?php _e('Use HatenaBlogCard', $this->text_domain); ?></label></th>
558
+ <td><input name="properties[use-hatena]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['use-hatena']) ? $this->options['use-hatena'] : null, 1); ?> />
559
+ <?php _e('External links will use Always HatenaBlogCard (Not recommended)', $this->text_domain); ?></td>
560
+ </tr>
561
+
562
+ <tr valign="top">
563
+ <th scope="row"><label for="inputtext"><?php _e('Display link to author page', $this->text_domain); ?></label></th>
564
+ <td><input name="properties[plugin-link]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['plugin-link']) ? $this->options['plugin-link'] : null, 1); ?> disabled="disabled" />
565
+ <a href="<?php echo $this->options['plugin-url']; ?>" target="_blank"><?php echo $this->options['plugin-name']; ?></a></td>
566
+ </tr>
567
+ <tr valign="top" style="display: none;">
568
+ <th scope="row"><label for="inputtext"><?php _e('Plugin URL', $this->text_domain); ?></label></th>
569
+ <td><input name="properties[plugin-url]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['plugin-url']); ?>" class="regular-text" /></td>
570
+ </tr>
571
+ <tr valign="top" style="display: none;">
572
+ <th scope="row"><label for="inputtext"><?php _e('Plugin name', $this->text_domain); ?></label></th>
573
+ <td><input name="properties[plugin-name]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['plugin-name']); ?>" class="regular-text" /></td>
574
+ </tr>
575
+ <tr valign="top" style="display: none;">
576
+ <th scope="row"><label for="inputtext"><?php _e('Plugin version', $this->text_domain); ?></label></th>
577
+ <td><input name="properties[plugin-version]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['plugin-version']); ?>" class="regular-text" /></td>
578
+ </tr>
579
+ <tr valign="top" style="display: none;">
580
+ <th scope="row"><label for="inputtext"><?php _e('Saved datetime', $this->text_domain); ?></label></th>
581
+ <td><input name="properties[saved-date]" type="text" id="inputtext" value="<?php echo esc_attr($this->options['saved-date']); ?>" /></td>
582
+ </tr>
583
+
584
+ <tr valign="top">
585
+ <th scope="row"><label for="inputtext"><?php _e('Display elapsed time', $this->text_domain); ?></label></th>
586
+ <td><input name="properties[debug-time]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['debug-time']) ? $this->options['debug-time'] : null, 1); ?> />
587
+ <?php _e('Output the elapsed time to HTML comment.', $this->text_domain); ?></td>
588
+ </tr>
589
+
590
+ </table>
591
+ <?php submit_button(); ?>
592
+
593
+ <h3><?php _e('Initialize', $this->text_domain); ?></h3>
594
+ <table class="form-table">
595
+ <tr valign="top">
596
+ <th scope="row"><label for="inputtext"><?php _e('Return to the initial setting', $this->text_domain); ?></label></th>
597
+ <td><input name="properties[initialize]" type="checkbox" id="check" value="1" <?php checked(isset($this->options['initialize']) ? $this->options['initialize'] : null, 1); ?> /></td>
598
+ </tr>
599
+ </table>
600
+ <?php submit_button(); ?>
601
+
602
+ </form>
603
+ </div>
604
+ </div>
pz-linkcard-style.php ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!function_exists("get_option")) die; ?>
2
+ <?php
3
+ if (!isset($this->options['style']) || !$this->options['style']) {
4
+
5
+ // $css_file = plugin_dir_path(__FILE__).'style.css';
6
+ // $css_url = plugin_dir_url(__FILE__).'style.css';
7
+ $wp_upload_dir = wp_upload_dir();
8
+ $css_dir = $wp_upload_dir['basedir'].'/'.$this->slug;
9
+ $css_path = $wp_upload_dir['basedir'].'/'.$this->slug.'/style.css';
10
+ $css_url = $wp_upload_dir['baseurl'].'/'.$this->slug.'/style.css';
11
+ if (!is_dir($css_dir)) {
12
+ if (!wp_mkdir_p($css_dir)) {
13
+ $css_path = $wp_upload_dir['basedir'].'/'.$this->slug.'-style.css';
14
+ $css_url = $wp_upload_dir['baseurl'].'/'.$this->slug.'-style.css';
15
+ }
16
+ }
17
+ if (is_null($this->options['css-path']) || is_null($this->options['css-url']) || $this->options['css-path'] <> $css_path || $this->options['css-url'] <> $css_url) {
18
+ $this->options['css-path'] = $css_path;
19
+ $this->options['css-url'] = $css_url;
20
+ update_option('Pz_LinkCard_options', $this->options);
21
+ }
22
+
23
+ $temp_name = $this->plugin_dir_path.'pz-linkcard-templete.css'; // 元となるテンプレート
24
+
25
+ $file_text = file_get_contents($temp_name);
26
+ if ($file_text) {
27
+
28
+ // オマケ書式
29
+ switch ($this->options['special-format']) {
30
+ case 'LkC': // Pz-LkC Default
31
+ $file_text = str_replace('/*EX-IMAGE*/', 'background-image: linear-gradient(#78f 0%, #78f 10%, #fff 30%);',$file_text );
32
+ $file_text = str_replace('/*IN-IMAGE*/', 'background-image: linear-gradient(#ca4 0%, #ca4 10%, #fff 30%);',$file_text );
33
+ $file_text = str_replace('/*TH-IMAGE*/', 'background-image: linear-gradient(#ca4 0%, #ca4 10%, #eee 30%);',$file_text );
34
+ $file_text = str_replace('/*COLOR-INFO*/', 'color: #ffffff;',$file_text );
35
+ $file_text = str_replace('/*THUMBNAIL_POSITION*/', 'float: left;',$file_text );
36
+ break;
37
+ case 'ct1': // Cellophane tape center
38
+ $file_text = str_replace('/*WRAP*/', 'position: relative;',$file_text );
39
+ $file_text = str_replace('/*WRAP-BEFORE*/', 'content: "";display: block;position: absolute;left: 40%;top: -16px;width: 95px;height: 25px;z-index: 2;background-color: rgba(243,245,228,0.5);border: 2px solid rgba(255,255,255,0.5);-webkit-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-moz-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-webkit-transform: rotate(3deg);-moz-transform: rotate(3deg);-o-transform: rotate(3deg);', $file_text );
40
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2) , 0px 0px 16px rgba(0, 0, 0, 0.2) inset;', $file_text );
41
+ break;
42
+ case 'ct2': // Cellophane tape left right
43
+ $file_text = str_replace('/*WRAP*/', 'position: relative;',$file_text );
44
+ $file_text = str_replace('/*MARGIN-LEFT*/', 'margin-left: 40px;',$file_text );
45
+ $file_text = str_replace('/*WRAP-BEFORE*/', 'content: "";display: block;position: absolute;left: -40px;top: -4px;width: 75px;height: 25px;z-index: 2;background-color: rgba(243,245,228,0.5);border: 2px solid rgba(255,255,255,0.5);-webkit-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-moz-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-webkit-transform: rotate(-45deg);-moz-transform: rotate(-45deg);-o-transform: rotate(-45deg);', $file_text );
46
+ $file_text = str_replace('/*WRAP-AFTER*/', 'content: "";display: block;position: absolute;right: -20px;top: -2px;width: 75px;height: 25px;z-index: 2;background-color: rgba(243,245,228,0.5);border: 2px solid rgba(255,255,255,0.5);-webkit-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-moz-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-webkit-transform: rotate(16deg);-moz-transform: rotate(16deg);-o-transform: rotate(16deg);transform: rotate(16deg);', $file_text );
47
+ $file_text = str_replace('/*MARGIN-RIGHT*/', 'margin-right: 25px;',$file_text );
48
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2) , 0px 0px 16px rgba(0, 0, 0, 0.2) inset;', $file_text );
49
+ break;
50
+ case 'ct3': // Cellophane long
51
+ $file_text = str_replace('/*WRAP*/', 'position: relative;',$file_text );
52
+ $file_text = str_replace('/*WRAP-BEFORE*/', 'content: "";display: block;position: absolute;left: -5%;top: -12px;width: 110%;height: 25px;z-index: 2;background-color: rgba(243,245,228,0.5);border: 2px solid rgba(255,255,255,0.5);-webkit-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-moz-box-shadow: 1px 1px 4px rgba(200,200,180,0.8);box-shadow: 1px 1px 4px rgba(200,200,180,0.8);-webkit-transform: rotate(-3deg);-moz-transform: rotate(-3deg);-o-transform: rotate(-3deg);', $file_text );
53
+ $file_text = str_replace('/*MARGIN-LEFT*/', 'margin-left: 32px;',$file_text );
54
+ $file_text = str_replace('/*MARGIN-RIGHT*/', 'margin-right: 32px;',$file_text );
55
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2) , 0px 0px 16px rgba(0, 0, 0, 0.2) inset;', $file_text );
56
+ break;
57
+ case 'slt': // Slanting
58
+ $file_text = str_replace('/*WRAP*/', 'transform:skew(-10deg) rotate(1deg);-webkit-transform: skew(-10deg) rotate(1deg);-moz-transform:skew(-10deg) rotate(1deg);', $file_text );
59
+ $file_text = str_replace('/*MARGIN-LEFT*/', 'margin-left: 12px;',$file_text );
60
+ $file_text = str_replace('/*MARGIN-RIGHT*/', 'margin-right: 30px;',$file_text );
61
+ break;
62
+ case '3Dr': // 3D rotate
63
+ $file_text = str_replace('/*WRAP*/', '-webkit-transform:perspective(150px) scale3d(0.84,0.9,1) rotate3d(1,0,0,12deg);', $file_text );
64
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 0 20px 16px rgba(0, 0, 0, 0.6) , 0px 32px 32px rgba(0, 0, 0, 0.2) inset;', $file_text );
65
+ break;
66
+ case 'ppc': // Paper Curling
67
+ $file_text = str_replace('/*WRAP*/', 'position: relative;',$file_text );
68
+ $file_text = str_replace('/*WRAP-AFTER*/', 'z-index:-1;content:"";height:10px;width:60%;position:absolute;right:12px;bottom:11px;left:auto;transform:skew(5deg) rotate(5deg);-webkit-transform:skew(3deg) rotate(3deg);-moz-transform:skew(5deg) rotate(5deg);box-shadow:0 16px 16px rgba(0,0,0,1);-webkit-box-shadow:0 16px 16px rgba(0,0,0,1);-moz-box-shadow:0 16px 12px rgba(0,0,0,1);', $file_text );
69
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.8) , 0px 0px 16px rgba(0, 0, 0, 0.3) inset;', $file_text );
70
+ break;
71
+ case 'inN': // Neutral
72
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #59fbea;',$file_text );
73
+ $file_text = str_replace('/*COLOR-TITLE*/', 'color: #59fbea;',$file_text );
74
+ $file_text = str_replace('/*COLOR-URL*/', 'color: #59fbea;',$file_text );
75
+ $file_text = str_replace('/*COLOR-EXCERPT*/', 'color: #59fbea;',$file_text );
76
+ $file_text = str_replace('/*COLOR-INFO*/', 'color: #59fbea;',$file_text );
77
+ $file_text = str_replace('/*COLOR-PLUGIN*/', 'color: #59fbea;',$file_text );
78
+ $file_text = str_replace('/*EX-BGCOLOR*/', 'background-color: rgba(89,251,234,0.4);',$file_text );
79
+ $file_text = str_replace('/*IN-BGCOLOR*/', 'background-color: rgba(89,251,234,0.1);',$file_text );
80
+ $file_text = str_replace('/*TH-BGCOLOR*/', 'background-color: rgba(89,251,234,0.05);',$file_text );
81
+ break;
82
+ case 'inI': // Orange
83
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #ebbc4a;',$file_text );
84
+ $file_text = str_replace('/*COLOR-TITLE*/', 'color: #ebbc4a;',$file_text );
85
+ $file_text = str_replace('/*COLOR-URL*/', 'color: #ebbc4a;',$file_text );
86
+ $file_text = str_replace('/*COLOR-EXCERPT*/', 'color: #ebbc4a;',$file_text );
87
+ $file_text = str_replace('/*COLOR-INFO*/', 'color: #ebbc4a;',$file_text );
88
+ $file_text = str_replace('/*COLOR-PLUGIN*/', 'color: #ebbc4a;',$file_text );
89
+ $file_text = str_replace('/*EX-BGCOLOR*/', 'background-color: rgba(235,188,74,0.4);',$file_text );
90
+ $file_text = str_replace('/*IN-BGCOLOR*/', 'background-color: rgba(235,188,74,0.1);',$file_text );
91
+ $file_text = str_replace('/*TH-BGCOLOR*/', 'background-color: rgba(235,188,74,0.05);',$file_text );
92
+ break;
93
+ case 'inE': // Green
94
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #28f428;',$file_text );
95
+ $file_text = str_replace('/*COLOR-TITLE*/', 'color: #28f428;',$file_text );
96
+ $file_text = str_replace('/*COLOR-URL*/', 'color: #28f428;',$file_text );
97
+ $file_text = str_replace('/*COLOR-EXCERPT*/', 'color: #28f428;',$file_text );
98
+ $file_text = str_replace('/*COLOR-INFO*/', 'color: #28f428;',$file_text );
99
+ $file_text = str_replace('/*COLOR-PLUGIN*/', 'color: #28f428;',$file_text );
100
+ $file_text = str_replace('/*EX-BGCOLOR*/', 'background-color: rgba(40,244,40,0.4);',$file_text );
101
+ $file_text = str_replace('/*IN-BGCOLOR*/', 'background-color: rgba(40,244,40,0.1);',$file_text );
102
+ $file_text = str_replace('/*TH-BGCOLOR*/', 'background-color: rgba(40,244,40,0.05);',$file_text );
103
+ break;
104
+ case 'inR': // Blue
105
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #00c2ff;',$file_text );
106
+ $file_text = str_replace('/*COLOR-TITLE*/', 'color: #00c2ff;',$file_text );
107
+ $file_text = str_replace('/*COLOR-URL*/', 'color: #00c2ff;',$file_text );
108
+ $file_text = str_replace('/*COLOR-EXCERPT*/', 'color: #00c2ff;',$file_text );
109
+ $file_text = str_replace('/*COLOR-INFO*/', 'color: #00c2ff;',$file_text );
110
+ $file_text = str_replace('/*COLOR-PLUGIN*/', 'color: #00c2ff;',$file_text );
111
+ $file_text = str_replace('/*EX-BGCOLOR*/', 'background-color: rgba(0,194,255,0.4);',$file_text );
112
+ $file_text = str_replace('/*IN-BGCOLOR*/', 'background-color: rgba(0,194,255,0.1);',$file_text );
113
+ $file_text = str_replace('/*TH-BGCOLOR*/', 'background-color: rgba(0,194,255,0.05);',$file_text );
114
+ break;
115
+ }
116
+
117
+ // 文字色
118
+ $file_text = str_replace('/*COLOR-TITLE*/', 'color: '.$this->options['color-title'].';',$file_text );
119
+ $file_text = str_replace('/*COLOR-URL*/', 'color: '.$this->options['color-url'].';',$file_text );
120
+ $file_text = str_replace('/*COLOR-EXCERPT*/', 'color: '.$this->options['color-excerpt'].';',$file_text );
121
+ $file_text = str_replace('/*COLOR-INFO*/', 'color: '.$this->options['color-info'].';',$file_text );
122
+ $file_text = str_replace('/*COLOR-PLUGIN*/', 'color: '.$this->options['color-plugin'].';',$file_text );
123
+
124
+ // 文字の大きさ
125
+ $file_text = str_replace('/*SIZE-TITLE*/', 'font-size: '.$this->options['size-title'].';',$file_text );
126
+ $file_text = str_replace('/*SIZE-URL*/', 'font-size: '.$this->options['size-url'].';',$file_text );
127
+ $file_text = str_replace('/*SIZE-EXCERPT*/', 'font-size: '.$this->options['size-excerpt'].';',$file_text );
128
+ $file_text = str_replace('/*SIZE-INFO*/', 'font-size: '.$this->options['size-info'].';',$file_text );
129
+ $file_text = str_replace('/*SIZE-PLUGIN*/', 'font-size: '.$this->options['size-plugin'].';',$file_text );
130
+
131
+ // カードの周りへの余白
132
+ if ($this->options['margin-top']) {
133
+ $file_text = str_replace('/*MARGIN-TOP*/', 'margin-top: '.$this->options['margin-top'].';',$file_text );
134
+ }
135
+ if ($this->options['margin-right']) {
136
+ $file_text = str_replace('/*MARGIN-RIGHT*/', 'margin-right: '.$this->options['margin-right'].';',$file_text );
137
+ }
138
+ if ($this->options['margin-bottom']) {
139
+ $file_text = str_replace('/*MARGIN-BOTTOM*/', 'margin-bottom: '.$this->options['margin-bottom'].';',$file_text );
140
+ }
141
+ if ($this->options['margin-left']) {
142
+ $file_text = str_replace('/*MARGIN-LEFT*/', 'margin-left: '.$this->options['margin-left'].';',$file_text );
143
+ }
144
+
145
+ // カードの余白等調整
146
+ $file_text = str_replace('/*PADDING*/', 'padding: 6px 0px;',$file_text );
147
+
148
+ // img のスタイルを強制リセット
149
+ if (isset($this->options['style-reset-img'])) {
150
+ $file_text = str_replace('/*RESET-IMG*/', 'margin: 0 !important; padding: 0; border: none;', $file_text );
151
+ $file_text = str_replace('/*STATIC*/', 'position: static !important;',$file_text );
152
+ $file_text = str_replace('/*IMPORTANT*/', '!important',$file_text );
153
+ }
154
+
155
+ // 外部リンク背景
156
+ if ($this->options['ex-bgcolor']) {
157
+ $file_text = str_replace('/*EX-BGCOLOR*/', 'background-color: '.$this->options['ex-bgcolor'].';',$file_text );
158
+ }
159
+ if ($this->options['ex-image']) {
160
+ if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $this->options['ex-image'])) {
161
+ $file_text = str_replace('/*EX-IMAGE*/', 'background-image: url("'.$this->options['ex-image'].'");',$file_text );
162
+ } else {
163
+ $file_text = str_replace('/*EX-IMAGE*/', 'background-image: '.$this->options['ex-image'].';',$file_text );
164
+ }
165
+ }
166
+
167
+ // 内部リンク背景
168
+ if ($this->options['in-bgcolor']) {
169
+ $file_text = str_replace('/*IN-BGCOLOR*/', 'background-color: '.$this->options['in-bgcolor'].';',$file_text );
170
+ }
171
+ if ($this->options['in-image']) {
172
+ if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $this->options['in-image'])) {
173
+ $file_text = str_replace('/*IN-IMAGE*/', 'background-image: url("'.$this->options['in-image'].'");',$file_text );
174
+ } else {
175
+ $file_text = str_replace('/*IN-IMAGE*/', 'background-image: '.$this->options['in-image'].';',$file_text );
176
+ }
177
+ }
178
+
179
+ // 同ページリンク背景色
180
+ if ($this->options['th-bgcolor']) {
181
+ $file_text = str_replace('/*TH-BGCOLOR*/', 'background-color: '.$this->options['th-bgcolor'].';',$file_text );
182
+ }
183
+ if ($this->options['th-image']) {
184
+ if (preg_match('/https?(:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)$/', $this->options['th-image'])) {
185
+ $file_text = str_replace('/*TH-IMAGE*/', 'background-image: url("'.$this->options['th-image'].'");',$file_text );
186
+ } else {
187
+ $file_text = str_replace('/*TH-IMAGE*/', 'background-image: '.$this->options['th-image'].';',$file_text );
188
+ }
189
+ }
190
+
191
+ // センタリング指定あり
192
+ if (isset($this->options['centering']) && $this->options['centering'] == '1') {
193
+ $file_text = str_replace('/*LINKCARD-WRAP-MARGIN*/', 'margin: 0 auto;',$file_text );
194
+ $file_text = str_replace('/*HATENA-WRAP-MARGIN*/', 'margin: 0 auto;',$file_text );
195
+ } else {
196
+ $file_text = str_replace('/*LINKCARD-WRAP-MARGIN*/', 'margin: 0;',$file_text );
197
+ $file_text = str_replace('/*HATENA-WRAP-MARGIN*/', 'margin: 0;',$file_text );
198
+ }
199
+
200
+ // 角まる指定あり
201
+ if (isset($this->options['radius']) && $this->options['radius'] == '1') {
202
+ $file_text = str_replace('/*RADIUS*/', 'border-radius: 8px; -webkit-border-radius: 8px; -moz-border-radius: 8px;',$file_text );
203
+ $file_text = str_replace('/*THUMBNAIL-RADIUS*/', 'border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px;',$file_text );
204
+ }
205
+
206
+ // 影あり
207
+ if (isset($this->options['shadow']) && $this->options['shadow'] == '1') {
208
+ if (isset($this->options['shadow-inset']) && $this->options['shadow-inset'] == '1') {
209
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.5) , 0 0 16px rgba(0, 0, 0, 0.3) inset;',$file_text );
210
+ } else {
211
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.5);',$file_text );
212
+ }
213
+ } else {
214
+ if (isset($this->options['shadow-inset']) && $this->options['shadow-inset'] == '1') {
215
+ $file_text = str_replace('/*SHADOW*/', 'box-shadow: 0 0 16px rgba(0, 0, 0, 0.5) inset;',$file_text );
216
+ }
217
+ }
218
+
219
+ // サムネイル影あり
220
+ if (isset($this->options['thumbnail-shadow']) && $this->options['thumbnail-shadow'] == '1') {
221
+ $file_text = str_replace('/*THUMBNAIL-SHADOW*/', 'box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);',$file_text );
222
+ }
223
+
224
+ // 左寄せ/右寄せ
225
+ switch ($this->options['thumbnail-position']) {
226
+ case '1':
227
+ $file_text = str_replace('/*THUMBNAIL_POSITION*/', 'float: right;;',$file_text );
228
+ break;
229
+ case '2':
230
+ $file_text = str_replace('/*THUMBNAIL_POSITION*/', 'float: left;',$file_text );
231
+ break;
232
+ }
233
+
234
+ // 横幅
235
+ if ($this->options['width'] == '') {
236
+ $file_text = str_replace('/*WIDTH*/', 'max-width: 100%;',$file_text );
237
+ } else {
238
+ $file_text = str_replace('/*WIDTH*/', 'max-width: '.$this->options['width'].';',$file_text );
239
+ }
240
+
241
+ // 記事情報の高さ
242
+ if ($this->options['content-height'] == '') {
243
+ $file_text = str_replace('/*CONTENT-HEIGHT*/', 'height: 108px;',$file_text );
244
+ } else {
245
+ $file_text = str_replace('/*CONTENT-HEIGHT*/', 'height: '.$this->options['content-height'].';',$file_text );
246
+ }
247
+
248
+ // リンク先のURLを表示する
249
+ if (isset($this->options['display-url']) && $this->options['display-url'] == '1') {
250
+ $file_text = str_replace('/*DISPLAY-URL*/', 'display: block;',$file_text );
251
+ } else {
252
+ $file_text = str_replace('/*DISPLAY-URL*/', 'display: none;',$file_text );
253
+ }
254
+
255
+ // 枠線の太さ
256
+ switch ($this->options['border']) {
257
+ case '1gr':
258
+ $file_text = str_replace('/*BORDER*/', 'border: 1px solid #ddd;',$file_text );
259
+ break;
260
+ case '2gr':
261
+ $file_text = str_replace('/*BORDER*/', 'border: 2px solid #ddd;',$file_text );
262
+ break;
263
+ case '4gr':
264
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #ddd;',$file_text );
265
+ break;
266
+ case '1bk':
267
+ $file_text = str_replace('/*BORDER*/', 'border: 1px solid #444;',$file_text );
268
+ break;
269
+ case '2bk':
270
+ $file_text = str_replace('/*BORDER*/', 'border: 2px solid #444;',$file_text );
271
+ break;
272
+ case '4bk':
273
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #444;',$file_text );
274
+ break;
275
+ case '8bk':
276
+ $file_text = str_replace('/*BORDER*/', 'border: 8px solid #444;',$file_text );
277
+ break;
278
+ case 'blu':
279
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #1e90ff;',$file_text );
280
+ break;
281
+ case 'gre':
282
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #66cdaa;',$file_text );
283
+ break;
284
+ case 'red':
285
+ $file_text = str_replace('/*BORDER*/', 'border: 4px solid #ff69b4;',$file_text );
286
+ break;
287
+ case 'dbl':
288
+ $file_text = str_replace('/*BORDER*/', 'border: 4px double #444;',$file_text );
289
+ break;
290
+ case 'dot':
291
+ $file_text = str_replace('/*BORDER*/', 'border: 1px dotted #444;',$file_text );
292
+ break;
293
+ default:
294
+ $file_text = str_replace('/*BORDER*/', 'border: none;',$file_text );
295
+ break;
296
+ }
297
+
298
+ // 抜粋文の部分を凹ませる
299
+ if (isset($this->options['content-inset']) && $this->options['content-inset'] == '1') {
300
+ $file_text = str_replace('/*CONTENT-PADDING*/', 'padding: 6px;',$file_text );
301
+ $file_text = str_replace('/*CONTENT-INSET*/', 'box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5) inset;',$file_text );
302
+ $file_text = str_replace('/*CONTENT-BGCOLOR*/', 'background-color: rgba(255, 255, 255, 0.8 );',$file_text );
303
+ }
304
+
305
+ // ぽぽづれ。へのリンクを表示する
306
+ if (isset($this->options['plugin-link']) && $this->options['plugin-link'] == '1') {
307
+ $file_text = str_replace('/*CREDIT*/', 'display: block;',$file_text );
308
+ } else {
309
+ $file_text = str_replace('/*CREDIT*/', 'display: none;',$file_text );
310
+ }
311
+
312
+ $result = file_put_contents($css_path,$file_text);
313
+ global $pagenow;
314
+ if (isset($pagenow) && $pagenow == 'options-general.php') {
315
+ if ($result == true) {
316
+ echo '<div class="updated fade"><p><strong>'.__('Style sheet saved.', $this->text_domain).'</strong></p></div>';
317
+ } else {
318
+ echo '<div class="error fade"><p><strong>'.__('Style sheet failed.', $this->text_domain).'</strong></p></div>';
319
+ }
320
+ }
321
+ }
322
+ unset($temp_name);
323
+ unset($file_text);
324
+ unset($result);
325
+ }
pz-linkcard-templete.css ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* [Pz-LKC][0.0.1] CSS */
2
+ .linkcard {
3
+ /*MARGIN-TOP*/
4
+ /*MARGIN-BOTTOM*/
5
+ /*MARGIN-LEFT*/
6
+ /*MARGIN-RIGHT*/
7
+ }
8
+ .linkcard a {
9
+ text-decoration: none;
10
+ }
11
+ .linkcard img {
12
+ /*RESET-IMG*/
13
+ }
14
+ .linkcard-internal-wrapper {
15
+ /*LINKCARD-WRAP-MARGIN*/
16
+ /*BORDER*/
17
+ /*PADDING*/
18
+ /*RADIUS*/
19
+ /*SHADOW*/
20
+ /*HEIGHT*/
21
+ /*WIDTH*/
22
+ /*IN-BGCOLOR*/
23
+ /*IN-IMAGE*/
24
+ line-height: 100%;
25
+ /*WRAP*/
26
+ }
27
+ .linkcard-internal-wrapper::after {
28
+ /*WRAP-AFTER*/
29
+ }
30
+ .linkcard-internal-wrapper::before {
31
+ /*WRAP-BEFORE*/
32
+ }
33
+ .linkcard-external-wrapper {
34
+ /*LINKCARD-WRAP-MARGIN*/
35
+ /*BORDER*/
36
+ /*PADDING*/
37
+ /*RADIUS*/
38
+ /*SHADOW*/
39
+ /*HEIGHT*/
40
+ /*WIDTH*/
41
+ /*EX-BGCOLOR*/
42
+ /*EX-IMAGE*/
43
+ line-height: 100%;
44
+ /*WRAP*/
45
+ }
46
+ .linkcard-external-wrapper::after {
47
+ /*WRAP-AFTER*/
48
+ }
49
+ .linkcard-external-wrapper::before {
50
+ /*WRAP-BEFORE*/
51
+ }
52
+ .linkcard-this-wrapper {
53
+ /*LINKCARD-WRAP-MARGIN*/
54
+ /*BORDER*/
55
+ /*PADDING*/
56
+ /*RADIUS*/
57
+ /*SHADOW*/
58
+ /*HEIGHT*/
59
+ /*WIDTH*/
60
+ /*TH-BGCOLOR*/
61
+ /*TH-IMAGE*/
62
+ line-height: 100%;
63
+ /*WRAP*/
64
+ }
65
+ .linkcard-this-wrapper::after {
66
+ /*WRAP-AFTER*/
67
+ }
68
+ .linkcard-this-wrapper::before {
69
+ /*WRAP-BEFORE*/
70
+ }
71
+ .linkcard-link {
72
+ text-decoration: none;
73
+ }
74
+ .linkcard-content {
75
+ /*CONTENT-PADDING*/
76
+ /*CONTENT-INSET*/
77
+ /*CONTENT-BGCOLOR*/
78
+ /*CONTENT-HEIGHT*/
79
+ margin: 8px 8px 0 8px;
80
+ word-break: break-all;
81
+ white-space: normal;
82
+ overflow: hidden;
83
+ }
84
+ .linkcard-title {
85
+ /*COLOR-TITLE*/
86
+ /*SIZE-TITLE*/
87
+ font-weight: bold;
88
+ line-height: 20px;
89
+ overflow: hidden;
90
+ word-break: break-all;
91
+ }
92
+ .linkcard-title:hover {
93
+ text-decoration: underline;
94
+ }
95
+ .linkcard-url {
96
+ /*COLOR-URL*/
97
+ /*SIZE-URL*/
98
+ font-weight: normal;
99
+ text-decoration: underline;
100
+ line-height: 12px;
101
+ white-space: nowrap;
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ /*DISPLAY-URL*/
105
+ }
106
+ .linkcard-excerpt {
107
+ /*COLOR-EXCERPT*/
108
+ /*SIZE-EXCERPT*/
109
+ padding: 8px 0 0;
110
+ line-height: 15px;
111
+ overflow: hidden;
112
+ }
113
+ .linkcard-thumbnail {
114
+ max-width: 100px;
115
+ max-height: 100px;
116
+ /* padding: 0 6px; */
117
+ margin: 0 6px;
118
+ /*THUMBNAIL_POSITION*/
119
+ }
120
+ .linkcard-thumbnail-image {
121
+ max-width: 100px;
122
+ max-height: 100px;
123
+ border: 1px solid #222;
124
+ /*THUMBNAIL-RADIUS*/
125
+ /*THUMBNAIL-SHADOW*/
126
+ }
127
+ .linkcard-info {
128
+ margin: 8px;
129
+ /*COLOR-INFO*/
130
+ /*SIZE-INFO*/
131
+ overflow: hidden;
132
+ display: inline /*IMPORTANT*/;
133
+ }
134
+ .linkcard-domain {
135
+ /*COLOR-INFO*/
136
+ /*SIZE-INFO*/
137
+ text-decoration: none;
138
+ display: inline /*IMPORTANT*/;
139
+ }
140
+ .linkcard-domain:hover {
141
+ /*COLOR-INFO*/
142
+ /*SIZE-INFO*/
143
+ text-decoration: underline;
144
+ display: inline /*IMPORTANT*/;
145
+ }
146
+ .linkcard-favicon {
147
+ height: 16px;
148
+ width: 16px;
149
+ margin: 0 4px;
150
+ border: none;
151
+ vertical-align: top;
152
+ display: inline /*IMPORTANT*/;
153
+ }
154
+ .linkcard-hatena {
155
+ margin: 0 0 0 5px;
156
+ padding: 0;
157
+ border: none;
158
+ vertical-align: top;
159
+ display: inline /*IMPORTANT*/;
160
+ }
161
+ .linkcard-name a {
162
+ margin: 0;
163
+ padding: 0;
164
+ float: right;
165
+ /*COLOR-PLUGIN*/
166
+ /*SIZE-PLUGIN*/
167
+ opacity: 0.5;
168
+ text-decoration: none;
169
+ /*CREDIT*/
170
+ }
171
+ .linkcard-sns-hatena {
172
+ margin: 0;
173
+ padding: 0 1px;
174
+ color: #ff6464 /*IMPORTANT*/;
175
+ background-color: #ffefef /*IMPORTANT*/;
176
+ font-size: 9px;
177
+ text-decoration: underline /*IMPORTANT*/;
178
+ font-weight: bold /*IMPORTANT*/;
179
+ white-space: nowrap;
180
+ }
181
+ .linkcard-sns-facebook {
182
+ margin: 0;
183
+ padding: 0 1px;
184
+ color: #ffffff /*IMPORTANT*/;
185
+ background-color: #3864a3 /*IMPORTANT*/;
186
+ font-size: 9px;
187
+ text-decoration: underline /*IMPORTANT*/;
188
+ font-weight: bold /*IMPORTANT*/;
189
+ white-space: nowrap;
190
+ }
191
+ .linkcard-sns-twitter {
192
+ margin: 0;
193
+ padding: 0 1px;
194
+ color: #5ea9dd /*IMPORTANT*/;
195
+ background-color: #f5f8fa /*IMPORTANT*/;
196
+ font-size: 9px;
197
+ text-decoration: underline /*IMPORTANT*/;
198
+ font-weight: bold /*IMPORTANT*/;
199
+ white-space: nowrap;
200
+ }
201
+ .linkcard-sns-google-plus {
202
+ margin: 0;
203
+ padding: 0 1px;
204
+ color: #dd4e42 /*IMPORTANT*/;
205
+ background-color: #ffffff /*IMPORTANT*/;
206
+ font-size: 9px;
207
+ text-decoration: underline /*IMPORTANT*/;
208
+ font-weight: bold /*IMPORTANT*/;
209
+ white-space: nowrap;
210
+ }
211
+ .linkcard-sns-pocket {
212
+ margin: 0;
213
+ padding: 0 1px;
214
+ color: #eeeeee /*IMPORTANT*/;
215
+ background-color: #ee4055 /*IMPORTANT*/;
216
+ font-size: 9px;
217
+ text-decoration: underline /*IMPORTANT*/;
218
+ font-weight: bold /*IMPORTANT*/;
219
+ white-space: nowrap;
220
+ }
221
+ .clear {
222
+ clear: both;
223
+ }
224
+
225
+ blockquote.linkcard-quote {
226
+ background-color: transparent;
227
+ background-image: none;
228
+ padding: 0;
229
+ margin: 0;
230
+ border: none;
231
+ }
232
+
233
+ .hatena-webcard-wrapper {
234
+ /*HATENA-WRAP-MARGIN*/
235
+ /*HEIGHT*/
236
+ /*WIDTH*/
237
+ /*WRAP*/
238
+ }
239
+ .hatena-webcard-wrapper::after {
240
+ /*WRAP-AFTER*/
241
+ }
242
+ .hatena-webcard-wrapper::before {
243
+ /*WRAP-BEFORE*/
244
+ }
245
+ .hatena-webcard-iframe {
246
+ /*STATIC*/
247
+ /*BORDER*/
248
+ /*RADIUS*/
249
+ /*SHADOW*/
250
+ padding: 0;
251
+ margin: 0;
252
+ width: 100%;
253
+ height: 149px;
254
+ }
pz-linkcard.php ADDED
@@ -0,0 +1,797 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Pz-LinkCard
4
+ Plugin URI: http://poporon.poponet.jp/pz-linkcard
5
+ Description: リンクをカード形式で表示します。
6
+ Version: 0.1.2
7
+ Author: poporon
8
+ Author URI: http://poporon.poponet.jp
9
+ License: GPLv2 or later
10
+ */
11
+
12
+ defined('ABSPATH') || die;
13
+
14
+ class Pz_LinkCard {
15
+ public $slug; // slug
16
+ public $text_domain; // as slug
17
+
18
+ public $charset;
19
+
20
+ public $plugin_basename;
21
+ public $plugin_dir_path;
22
+ public $plugin_dir_url;
23
+
24
+ public $options;
25
+ public $defaults;
26
+
27
+ public $plugin_link; // link to plugin page
28
+
29
+ private $db;
30
+
31
+ public function __construct() {
32
+ $this->charset = get_bloginfo('charset');
33
+
34
+ $this->slug = basename(dirname(__FILE__));
35
+ $this->text_domain = $this->slug;
36
+
37
+ $this->plugin_basename = plugin_basename(__FILE__);
38
+ $this->plugin_dir_path = plugin_dir_path(__FILE__);
39
+ $this->plugin_dir_url = plugin_dir_url (__FILE__);
40
+
41
+ $this->defaults = array(
42
+ 'code1' => 'blogcard',
43
+ 'code2' => null,
44
+ 'code3' => null,
45
+ 'code4' => null,
46
+ 'border' => '1bk',
47
+ 'width' => '500px',
48
+ 'content-height' => '108px',
49
+ 'margin-top' => '4px',
50
+ 'margin-bottom' => '16px',
51
+ 'margin-left' => '4px',
52
+ 'margin-right' => '16px',
53
+ 'centering' => null,
54
+ 'radius' => null,
55
+ 'shadow' => '1',
56
+ 'shadow-inset' => null,
57
+ 'special-format' => 'LkC',
58
+ 'use-inline' => null,
59
+ 'use-sitename' => '1',
60
+ 'use-hatena' => null,
61
+ 'display-url' => '1',
62
+ 'display-excerpt' => '1',
63
+ 'trim-count' => 250,
64
+ 'info-position' => '1',
65
+ 'size-info' => '12px',
66
+ 'size-title' => '16px',
67
+ 'size-url' => '9px',
68
+ 'size-excerpt' => '11px',
69
+ 'size-plugin' => '9px',
70
+ 'color-plugin' => '#888',
71
+ 'color-title' => '#111',
72
+ 'color-url' => '#46f',
73
+ 'color-excerpt' => '#333',
74
+ 'color-info' => '#222',
75
+ 'color-plugin' => '#888',
76
+ 'ex-bgcolor' => '#fff',
77
+ 'in-bgcolor' => '#fff',
78
+ 'th-bgcolor' => '#eee',
79
+ 'ex-image' => '',
80
+ 'in-image' => '',
81
+ 'th-image' => '',
82
+ 'ex-info' => null,
83
+ 'in-info' => null,
84
+ 'th-info' => null,
85
+ 'in-target' => null,
86
+ 'ex-target' => '1',
87
+ 'ex-thumbnail' => '0',
88
+ 'in-thumbnail' => '1',
89
+ 'ex-favicon' => '3',
90
+ 'in-favicon' => '1',
91
+ 'favicon-api' => 'http://www.google.com/s2/favicons?domain=%DOMAIN%',
92
+ 'thumbnail-api' => 'http://s.wordpress.com/mshots/v1/%URL%',
93
+ 'thumbnail-position'=> '2',
94
+ 'thumbnail-shadow' => '1',
95
+ 'cache-time' => 365*24*60*60,
96
+ 'style-reset-img' => '1',
97
+ 'style' => null,
98
+ 'css-file' => null,
99
+ 'css-path' => null,
100
+ 'css-url' => null,
101
+ 'use-snscache' => '1',
102
+ 'sns-position' => '2',
103
+ 'sns-twitter' => '1',
104
+ 'sns-facebook' => '1',
105
+ 'sns-hatena' => '1',
106
+ 'link-all' => '1',
107
+ 'blockquote' => null,
108
+ 'nofollow' => null,
109
+ 'plugin-link' => null,
110
+ 'plugin-name' => 'Pz-LinkCard',
111
+ 'plugin-version' => '0.1.2',
112
+ 'plugin-url' => 'http://poporon.poponet.jp/pz-linkcard',
113
+ 'pz-hbc-options' => null,
114
+ 'debug-time' => null,
115
+ 'saved-date' => time()
116
+ );
117
+ $this->options = get_option('Pz_LinkCard_options', $this->defaults );
118
+
119
+ // DB
120
+ global $wpdb;
121
+ $this->db = $wpdb->prefix.'pz_linkcard';
122
+
123
+ // バージョンが上がっていたら、オプションを更新する
124
+ if ($this->options['plugin-version'] < $this->defaults['plugin-version']) {
125
+ $this->Pz_LinkCard_activation();
126
+ }
127
+
128
+ // CSS URLが空だったら生成
129
+ if (isset($this->options['style']) && isset($this->options['style']) == '1' && !isset($this->options['css-url'])) {
130
+ require_once ('pz-linkcard-style.php');
131
+ }
132
+
133
+ // ショートコードの設定
134
+ if ($this->options['code1'] <> '') {
135
+ add_shortcode($this->options['code1'], array($this, 'Pz_LinkCard_ShortCode'));
136
+ }
137
+ if ($this->options['code2'] <> '') {
138
+ add_shortcode($this->options['code2'], array($this, 'Pz_LinkCard_ShortCode'));
139
+ }
140
+ if ($this->options['code3'] <> '') {
141
+ add_shortcode($this->options['code3'], array($this, 'Pz_LinkCard_ShortCode'));
142
+ }
143
+ if ($this->options['code4'] <> '') {
144
+ add_shortcode($this->options['code4'], array($this, 'Pz_LinkCard_ShortCode'));
145
+ }
146
+
147
+ // 管理画面のとき
148
+ if (is_admin()) {
149
+ load_plugin_textdomain ($this->text_domain, false, $this->slug.'/languages' ); // 管理画面のみ日本語化
150
+ register_activation_hook (__FILE__, array($this, 'Pz_LinkCard_activation')); // 有効化したときの処理
151
+ register_deactivation_hook (__FILE__, array($this, 'Pz_LinkCard_deactivation')); // 無効化したときの処理
152
+ add_action ('admin_menu', array($this, 'Pz_LinkCard_add_menu')); // 設定メニュー
153
+ add_action ('admin_enqueue_scripts', array($this, 'Pz_LinkCard_scripts_admin')); // 設定メニュー用スクリプト
154
+ add_filter ('plugin_action_links_'.$this->plugin_basename, array($this, 'Pz_LinkCard_action_links')); // プラグイン画面
155
+
156
+ if ((isset($this->options['style']) ? $this->options['style'] : '') == '') {
157
+ if (is_null($this->options['css-path']) || !file_exists($this->options['css-path'])) {
158
+ require_once ('pz-linkcard-style.php');
159
+ }
160
+ }
161
+ } else {
162
+ if (!isset($this->options['style'])) {
163
+ if (!isset($this->options['css-url'])) {
164
+ require_once ('pz-linkcard-style.php');
165
+ }
166
+ }
167
+ add_action ('wp_enqueue_scripts', array($this, 'Pz_LinkCard_scripts'));
168
+ }
169
+ }
170
+
171
+ public function Pz_LinkCard_scripts_admin($hook) {
172
+ wp_enqueue_style ('wp-color-picker');
173
+ wp_enqueue_script ('colorpicker-script', plugins_url('color-picker.js', __FILE__), array('wp-color-picker'), false, true);
174
+ }
175
+
176
+ public function Pz_LinkCard_scripts($hook) {
177
+ if (!isset($this->options['style'])) {
178
+ wp_enqueue_style ('Pz-LinkCard', $this->options['css-url']);
179
+ } else {
180
+ if (isset($this->options['css-file'])) {
181
+ wp_enqueue_style('Pz-LinkCard', $this->options['css-file']);
182
+ }
183
+ }
184
+ }
185
+
186
+ public function Pz_LinkCard_add_menu() {
187
+ add_management_page (__('LinkCard cache manager', $this->text_domain),__('Pz LkC Cache', $this->text_domain),'manage_options', 'pz-linkcard-cache', array($this, 'Pz_LinkCard_cache_list') );
188
+ add_options_page (__('LinkCard Settings', $this->text_domain),__('Pz LinkCard', $this->text_domain),'manage_options', 'pz-linkcard-settings', array($this, 'Pz_LinkCard_option_page') );
189
+ }
190
+
191
+ public function Pz_LinkCard_activation() {
192
+ $this->options = get_option('Pz_LinkCard_options', $this->defaults);
193
+ $this->options += $this->defaults;
194
+ $this->options['plugin-version'] = $this->defaults['plugin-version'];
195
+ update_option('Pz_LinkCard_options', $this->options);
196
+
197
+ require_once('pz-linkcard-style.php');
198
+
199
+ global $wpdb;
200
+ $wpdb->hide_errors();
201
+ $this->db = $wpdb->prefix.'pz_linkcard';
202
+ $sql = "CREATE TABLE ".$this->db." (
203
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT,
204
+ url_key VARBINARY(255) NOT NULL,
205
+ url VARCHAR(2048) NOT NULL DEFAULT '',
206
+ link_type INT UNSIGNED,
207
+ site_name VARCHAR(100) ,
208
+ domain VARCHAR(253) ,
209
+ title VARCHAR(200) ,
210
+ excerpt VARCHAR(500) ,
211
+ thumbnail VARCHAR(2048) ,
212
+ favicon VARCHAR(2048) ,
213
+ result_code INT ,
214
+ post_id INT UNSIGNED,
215
+ sns_twitter INT ,
216
+ sns_facebook INT ,
217
+ sns_hatena INT ,
218
+ sns_pocket INT ,
219
+ sns_gplus INT ,
220
+ uptime BIGINT UNSIGNED NOT NULL DEFAULT 0,
221
+ nexttime BIGINT UNSIGNED NOT NULL DEFAULT 0,
222
+ regist DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
223
+ PRIMARY KEY ( id ),
224
+ UNIQUE KEY ( url_key )
225
+ ) ".$wpdb->get_charset_collate()." ;";
226
+ require_once(ABSPATH.'wp-admin/includes/upgrade.php');
227
+ dbDelta($sql);
228
+ }
229
+
230
+ public function Pz_LinkCard_deactivation() {
231
+ }
232
+
233
+ public function Pz_LinkCard_cache_list() {
234
+ require_once('pz-linkcard-cacheman.php');
235
+ }
236
+
237
+ public function Pz_LinkCard_option_page() {
238
+ require_once('pz-linkcard-settings.php');
239
+ }
240
+
241
+ public function Pz_LinkCard_action_links($links) {
242
+ $links = array( '<a href="options-general.php?page=pz-linkcard-settings">'.__('Settings', $this->text_domain).'</a>' , '<a href="tools.php?page=pz-linkcard-cache">'.__('Manage', $this->text_domain).'</a>' ) + $links;
243
+ return $links;
244
+ }
245
+
246
+ public function Pz_LinkCard_ShortCode($atts, $content = null ) {
247
+ global $wpdb;
248
+
249
+ $update = false;
250
+ $update_cnt = false;
251
+ $error = false;
252
+
253
+ if (is_user_logged_in()) {
254
+ // 時間計測
255
+ $start_time = microtime(true);
256
+ }
257
+
258
+ // リンク先URL
259
+ $url = isset($atts['url']) ? $atts['url'] : null;
260
+ $url_esc = esc_url($url);
261
+
262
+ // リンク先URLからドメイン名を抽出
263
+ if (preg_match('{https?://(.+?)/}i', $url.'/',$m)) {
264
+ $domain_url = $m[0];
265
+ $domain = $m[1];
266
+ } else {
267
+ $domain_url = null;
268
+ $domain = null;
269
+ $error = true;
270
+ }
271
+
272
+ // 自サイトチェック
273
+ if (preg_match('{'.home_url().'\/.*?}', $url.'/')) {
274
+ if (preg_match('{'.get_permalink().'\/*}',$url)) {
275
+ $link_type = 1; // 自ページ
276
+ } else {
277
+ $link_type = 2; // 自サイト内
278
+ }
279
+ if (isset($this->options['in-target']) ? $this->options['in-target'] : null == '1') {
280
+ $target = ' target="_blank"'; // 新しいページで開く
281
+ } else {
282
+ $target = ''; // 同ページに開く
283
+ }
284
+ $nofollow = '';
285
+ } else {
286
+ $link_type = 0; // 外部サイト
287
+ if (isset($this->options['ex-target']) ? $this->options['ex-target'] : null == '1') {
288
+ $target = ' target="_blank"'; // 新しいページで開く
289
+ } else {
290
+ $target = ''; // 同ページに開く
291
+ }
292
+ $nofollow = isset($this->options['nofollow']) ? ' rel="nofollow"' : '';
293
+ }
294
+
295
+ // URLをキーにしてDBからキャッシュ取得
296
+ if (isset($url)) {
297
+ $data = $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->db WHERE url=%s", $url));
298
+ if (is_wp_error($data) || !isset($data)) {
299
+ $data_id = null;
300
+ $title = null;
301
+ $url_key = null;
302
+ $excerpt = null;
303
+ $site_name = null;
304
+ $result_code = null;
305
+ $sns_twitter = -1;
306
+ $sns_facebook = -1;
307
+ $sns_hatena = -1;
308
+ $uptime = null;
309
+ $nexttime = 0;
310
+ } else {
311
+ $data_id = $data->id;
312
+ $title = $data->title;
313
+ $url_key = $data->url_key;
314
+ $excerpt = $data->excerpt;
315
+ $site_name = $data->site_name;
316
+ $result_code = $data->result_code;
317
+ $sns_twitter = $data->sns_twitter;
318
+ $sns_facebook = $data->sns_facebook;
319
+ $sns_hatena = $data->sns_hatena;
320
+ $uptime = $data->uptime;
321
+ $nexttime = $data->nexttime;
322
+ }
323
+ }
324
+ $thumbnail = null;
325
+ $thumbnail_url = null;
326
+
327
+ if ($link_type) { // 自サイト内はキャッシュがあっても常に取得する
328
+ if (is_null($data_id)) {
329
+ $update = true;
330
+ }
331
+
332
+ if ($link_type == '1') {
333
+ $info = isset($this->options['th-info']) ? $this->options['th-info'] : '' ;
334
+ $wrap_op = '<div class="linkcard-this-wrapper">'; // ラッピング
335
+ $wrap_cl = '</div>';
336
+ } else {
337
+ $info = isset($this->options['in-info']) ? $this->options['in-info'] : '' ;
338
+ $wrap_op = '<div class="linkcard-internal-wrapper">'; // ラッピング
339
+ $wrap_cl = '</div>';
340
+ }
341
+ $site_name = get_bloginfo('name'); // サイト名
342
+
343
+ $id = url_to_postid(strip_tags($url)); // 記事ID
344
+ $post = get_post($id); // 記事情報
345
+ // タイトル取得
346
+ if ($id) {
347
+ if (!$title) {
348
+ $title = $post->post_title; // 記事タイトル
349
+ if (!$excerpt) {
350
+ $excerpt = $post->post_content; // 記事内容
351
+ }
352
+ }
353
+ } else {
354
+ if (!$title) {
355
+ $title = get_bloginfo('name'); // サイト名
356
+ if (!$excerpt) {
357
+ $excerpt = get_bloginfo('description'); // サイト概要
358
+ }
359
+ }
360
+ }
361
+
362
+ $sw_thumbnail = isset($this->options['in-thumbnail']) ? $this->options['in-thumbnail'] : '0' ;
363
+ if ($sw_thumbnail == '1') {
364
+ $thumbnail = get_the_post_thumbnail($id, 'thumbnail' , array('class' => 'linkcard-thumbnail-image'));
365
+ }
366
+ $sw_favicon = isset($this->options['in-favicon']) ? $this->options['in-favicon'] : '0' ;
367
+ if ($sw_favicon == '1') {
368
+ if (function_exists('has_site_icon')) {
369
+ $favicon = '<img class="linkcard-favicon" src="'.get_site_icon_url(16, '', 0).'" />';
370
+ } else {
371
+ $sw_favicon = isset($this->options['ex-favicon']) ? $this->options['ex-favicon'] : '0' ;
372
+ }
373
+ }
374
+
375
+ } else { // 外部サイト
376
+ $wrap_op = '<div class="linkcard-external-wrapper">'; // ラッピング
377
+ $wrap_cl = '</div>';
378
+ $info = isset($this->options['ex-info']) ? $this->options['ex-info'] : '' ;
379
+ $sw_thumbnail = isset($this->options['ex-thumbnail']) ? $this->options['ex-thumbnail'] : '0' ;
380
+ $sw_favicon = isset($this->options['ex-favicon']) ? $this->options['ex-favicon'] : '0' ;
381
+
382
+ if (isset($this->options['use-hatena']) && !is_null($this->options['use-hatena'])) {
383
+ // 「はてなブログカード」をそのまま利用する
384
+ $tag = '<div class="hatena-webcard-wrapper"><iframe src="http://hatenablog.com/embed?url='.$url.'" class="hatena-webcard-iframe" scrolling="no" frameborder="0"></iframe></div>';
385
+ if (isset($this->options['blockquote']) ? $this->options['blockquote'] : null == '1') {
386
+ $tag = '<div class="linkcard"><blockquote class="linkcard-quote">'.$tag.'</blockquote></div>';
387
+ } else {
388
+ $tag = '<div class="linkcard">'.$tag.'</div>';
389
+ }
390
+ return $tag;
391
+
392
+ } elseif (is_null($data_id) || ($result_code <> 200 && $result_code <> 999)) { // キャッシュ無、または前回エラー
393
+ // リンク先サイト取得
394
+ $html = null;
395
+ $error = true;
396
+
397
+ $result = wp_remote_get($url);
398
+
399
+ if (is_wp_error($result)) {
400
+ $error = false;
401
+ $update = true;
402
+
403
+ $result_code = 999;
404
+ } else {
405
+ $result_code = $result['response']['code'];
406
+ if ($result_code >= 200 && $result_code <= 399 ) {
407
+ $error = false;
408
+ $update = true;
409
+
410
+ $html = $result['body'];
411
+ $html = mb_convert_encoding($html, $this->charset, "ASCII,JIS,UTF-7,EUC-JP,SJIS,UTF-8");
412
+
413
+ $tags = null;
414
+
415
+ // HEADタグ
416
+ $head = null;
417
+ if (preg_match('/<head>(.*)<\/head>/si', $html, $m)) {
418
+ $head = $m[1];
419
+ }
420
+
421
+ // TITLEタグ
422
+ if (preg_match('/<\s*title\s*.*>\s*(.*)\s*<\s*\/title\s*>/si', $head, $m)) {
423
+ $tags['title'] = esc_html($m[1]);
424
+ }
425
+
426
+ // // 最初のPタグ(これは全体から)
427
+ // if (preg_match('/<p>\s*(.*)<\/p>/i', $html, $m)) {
428
+ // $tags['first-p'] = esc_html($m[1]);
429
+ // }
430
+
431
+ // metaタグ パース
432
+ $match = null;
433
+ preg_match_all('/\s*meta\s*name="?([^>"]*)"?\s*content="?([^>"]*)"?\s*\/?>/si', $head, $match);
434
+ if (isset($match) && is_array($match) && count($match) == 3) {
435
+ for ($i=0, $to_i=count($match[1]); $i < $to_i; $i++) {
436
+ $tags[$match[1][$i]] = esc_html($match[2][$i]);
437
+ }
438
+ }
439
+
440
+ // OGPパース
441
+ $match = null;
442
+ preg_match_all('/\s*meta\s*property="?([^>"]*)"?\s*content="?([^>"]*)"?\s*\/?>/si', $head, $match);
443
+ if (isset($match) && is_array($match) && count($match) == 3) {
444
+ for ($i=0, $to_i=count($match[1]); $i < $to_i; $i++) {
445
+ $tags[$match[1][$i]] = esc_html($match[2][$i]);
446
+ }
447
+ }
448
+
449
+ // OGPパース(順序逆パターン)
450
+ $match = null;
451
+ preg_match_all('/\s*meta\s*content="?([^>"]*)"?\s*property="?([^>"]*)"?\s*\/?>/si', $head, $match);
452
+ if (isset($match) && is_array($match) && count($match) == 3) {
453
+ for ($i=0, $to_i=count($match[1]); $i < $to_i; $i++) {
454
+ $tags[$match[1][$i]] = esc_html($match[2][$i]);
455
+ }
456
+ }
457
+
458
+ // タイトル
459
+ if (isset($tags['og:title'])) {
460
+ $title = $tags['og:title'];
461
+ } elseif (isset($tags['title'])) {
462
+ $title = $tags['title'];
463
+ }
464
+
465
+ // 抜粋文・概要文
466
+ if (isset($tags['og:description'])) {
467
+ $excerpt = $tags['og:description'];
468
+ } elseif (isset($tags['description'])) {
469
+ $excerpt = $tags['description'];
470
+ } elseif (isset($tags['first-p'])) {
471
+ $excerpt = $tags['first-p'];
472
+ }
473
+
474
+ // // OGPから画像URL取得
475
+ // if ($sw_thumbnail == '1' && isset($tags['og:image'])) {
476
+ // $thumbnail_url = $tags['og:image'];
477
+ // $thumbnail = '<img class="linkcard-thumbnail-image" src="'.$thumbnail_url.'">';
478
+ // }
479
+
480
+ // // サイト名
481
+ if (isset($tags['og:site_name'])) {
482
+ $site_name = $tags['og:site_name'];
483
+ }
484
+
485
+ }
486
+ }
487
+ }
488
+ }
489
+
490
+ // タイトル整形
491
+ if (isset($title)) {
492
+ $title = esc_html($title); // 念のためエスケープ
493
+ $title = mb_strimwidth($title, 0, 200, '...'); // タイトルは無条件で200文字で切る
494
+ }
495
+
496
+ // 抜粋文整形
497
+ if (isset($excerpt)) {
498
+ $excerpt = strip_tags($excerpt); // タグの除去
499
+ $excerpt = preg_replace('/<!--more-->.+/is', '', $excerpt); // moreタグ以降削除
500
+ $excerpt = preg_replace('/\[[^]]*\]/', '', $excerpt); // ショートコードすべて除去
501
+ $excerpt = str_replace(array("\r", "\n"), '', $excerpt); // 改行削除
502
+ $excerpt = esc_html($excerpt); // 念のためエスケープ
503
+ $excerpt = mb_strimwidth($excerpt, 0, 500, '...'); // ここでは500文字で切る
504
+ }
505
+
506
+ // 取得エラーなし・取得または更新あり
507
+ if (!$error && $update && $url) {
508
+ if (!isset($url_key)) {
509
+ $url_key = hash('sha256', esc_url($url), true);
510
+ }
511
+
512
+ // とりあえず更新して見る
513
+ $result = $wpdb->update(
514
+ $this->db,
515
+ array(
516
+ 'id' => $data_id,
517
+ 'url_key' => $url_key,
518
+ 'url' => $url,
519
+ 'site_name' => $site_name,
520
+ 'domain' => $domain,
521
+ 'link_type' => $link_type,
522
+ 'title' => $title,
523
+ 'excerpt' => $excerpt,
524
+ 'result_code' => $result_code,
525
+ 'post_id' => get_the_ID(),
526
+ 'sns_twitter' => $sns_twitter,
527
+ 'sns_facebook' => $sns_facebook,
528
+ 'sns_hatena' => $sns_hatena,
529
+ 'uptime' => current_time('U'),
530
+ 'nexttime' => current_time('U') + 43200 + rand(0, 21600),
531
+ ),
532
+ array(
533
+ 'url_key' => $url_key
534
+ )
535
+ );
536
+ if (!$result) {
537
+ // 更新できなかったら挿入
538
+ $result = $wpdb->insert(
539
+ $this->db,
540
+ array(
541
+ 'url_key' => $url_key,
542
+ 'url' => $url,
543
+ 'site_name' => $site_name,
544
+ 'domain' => $domain,
545
+ 'link_type' => $link_type,
546
+ 'title' => $title,
547
+ 'excerpt' => $excerpt,
548
+ 'result_code' => $result_code,
549
+ 'post_id' => get_the_ID(),
550
+ 'sns_twitter' => $sns_twitter,
551
+ 'sns_facebook' => $sns_facebook,
552
+ 'sns_hatena' => $sns_hatena,
553
+ 'uptime' => current_time('U'),
554
+ 'nexttime' => current_time('U') + 7200 + rand(0, 3600),
555
+ 'regist' => current_time('mysql')
556
+ )
557
+ );
558
+ }
559
+ if ($result) {
560
+ $update = false;
561
+ }
562
+ }
563
+
564
+ // 保存期間満了でソーシャルカウントをリセット
565
+ // if (current_time('U') - $uptime > $this->options['cache-time']) {
566
+ // if (current_time('U') - $uptime > 10) {
567
+ if (current_time('U') > $nexttime && $result_code <= 200) {
568
+ $sns_renew = true;
569
+ $update_cnt = true;
570
+ } else {
571
+ $sns_renew = false;
572
+ }
573
+
574
+ // ソーシャルカウント
575
+ $sns = null;
576
+ $sns_info = null;
577
+ $sns_title = null;
578
+ if (!$error && (isset($this->options['sns-position']) ? $this->options['sns-position'] : null)) {
579
+ $opt = array( 'timeout' => 5 );
580
+
581
+ if (isset($this->options['sns-twitter'])) {
582
+ $count = $sns_twitter;
583
+ $count_before = $count;
584
+ if ($sns_renew || $count < 0) {
585
+ $result = wp_remote_get( 'http://urls.api.twitter.com/1/urls/count.json?url=' .rawurlencode($url), $opt );
586
+ if (!isset($result) || is_wp_error($result)) {
587
+ $count = 0;
588
+ } elseif ($result['response']['code'] <> 200) {
589
+ $count = -1;
590
+ } else {
591
+ $count = json_decode($result['body'])->count - 0;
592
+ }
593
+ if ($count <> $count_before) {
594
+ $sns_twitter = $count;
595
+ $update_cnt = true;
596
+ }
597
+ }
598
+ }
599
+ if (isset($this->options['sns-facebook'])) {
600
+ $count = $sns_facebook;
601
+ $count_before = $count;
602
+ if ($sns_renew || $count < 0) {
603
+ $result = wp_remote_get( 'http://graph.facebook.com/?id=' .rawurlencode($url), $opt );
604
+ if (!isset($result) || is_wp_error($result)) {
605
+ $count = 0;
606
+ } elseif ($result['response']['code'] <> 200) {
607
+ $count = -1;
608
+ } else {
609
+ $json = json_decode($result['body']);
610
+ $count = (isset($json->shares) ? isset($json->shares) : 0) - 0;
611
+ }
612
+ if ($count <> $count_before) {
613
+ $sns_facebook = $count;
614
+ $update_cnt = true;
615
+ }
616
+ }
617
+ }
618
+ if (isset($this->options['sns-hatena'])) {
619
+ $count = $sns_hatena;
620
+ $count_before = $count;
621
+ if ($sns_renew || $count < 0) {
622
+ $result = wp_remote_get( 'http://api.b.st-hatena.com/entry.count?url=' .rawurlencode($url), $opt );
623
+ if (!isset($result) || is_wp_error($result)) {
624
+ $count = 0;
625
+ } elseif ($result['response']['code'] <> 200) {
626
+ $count = -1;
627
+ } else {
628
+ $count = $result['body'] - 0;
629
+ }
630
+ if ($count <> $count_before) {
631
+ $sns_hatena = $count;
632
+ $update_cnt = true;
633
+ }
634
+ }
635
+ }
636
+
637
+ $sns = '<span class="linkcard-share">';
638
+ if ((isset($this->options['link-all']) ? $this->options['link-all'] : null) == '1') {
639
+ if ($sns_twitter > 0) $sns .= ' <span class="linkcard-sns-twitter no_icon">' .$sns_twitter .'&nbsp;tweet' .(($sns_twitter > 1) ? 's' : '').'</span>';
640
+ if ($sns_facebook > 0) $sns .= ' <span class="linkcard-sns-facebook no_icon">' .$sns_facebook .'&nbsp;share' .(($sns_facebook > 1) ? 's' : '').'</span>';
641
+ if ($sns_hatena > 0) $sns .= ' <span class="linkcard-sns-hatena no_icon">' .$sns_hatena .'&nbsp;user' .(($sns_hatena > 1) ? 's' : '').'</span>';
642
+ } else {
643
+ if ($sns_twitter > 0) $sns .= ' <a class="linkcard-sns-twitter no_icon" href="https://twitter.com/intent/tweet?url=' .rawurlencode($url).'&text='.esc_html($title).'" target="_blank">' .$sns_twitter .'&nbsp;tweet' .(($count > 1) ? 's' : '').'</a>';
644
+ if ($sns_facebook > 0) $sns .= ' <a class="linkcard-sns-facebook no_icon" href="https://www.facebook.com/sharer/sharer.php?u="' .rawurlencode($url).' target="_blank">' .$sns_facebook .'&nbsp;share' .(($count > 1) ? 's' : '').'</a>';
645
+ if ($sns_hatena > 0) $sns .= ' <a class="linkcard-sns-hatena no_icon" href="http://b.hatena.ne.jp/entry/' .rawurlencode($url).'" target="_blank">' .$sns_hatena .'&nbsp;user' .(($count > 1) ? 's' : '').'</a>';
646
+ }
647
+ $sns .= '</span>';
648
+
649
+ if ($this->options['sns-position'] == '1') {
650
+ $sns_title = $sns;
651
+ } else {
652
+ $sns_info = $sns;
653
+ }
654
+ }
655
+
656
+ // サムネイル取得
657
+ if (!$this->options['thumbnail-position'] || $error) {
658
+ $thumbnail = null;
659
+ } else {
660
+ if ($sw_thumbnail == '3') {
661
+ // 画像取得
662
+ if (isset($this->options['thumbnail-api'])) {
663
+ $thumbnail = preg_replace('/%DOMAIN_URL%/', $domain_url, $this->options['thumbnail-api'] );
664
+ $thumbnail = preg_replace('/%DOMAIN%/', $domain, $thumbnail);
665
+ $thumbnail = preg_replace('/%URL%/', rawurlencode($url), $thumbnail);
666
+ $thumbnail = '<img class="linkcard-thumbnail-image" src="'.$thumbnail.'">';
667
+ }
668
+ }
669
+ }
670
+
671
+ // ファビコン取得
672
+ if (!isset($this->options['info-position'])) {
673
+ $favicon = null;
674
+ } else{
675
+ if ($sw_favicon == '3') {
676
+ // サイトアイコン取得
677
+ if (isset($this->options['favicon-api'])) {
678
+ $favicon = preg_replace('/%DOMAIN_URL%/', $domain_url, $this->options['favicon-api'] );
679
+ $favicon = preg_replace('/%DOMAIN%/', $domain, $favicon);
680
+ $favicon = preg_replace('/%URL%/', rawurlencode($url), $favicon);
681
+ $favicon = '<img class="linkcard-favicon" src="'.$favicon.'" />';
682
+ }
683
+ }
684
+ }
685
+
686
+ if ($update_cnt) { // ソーシャルカウントのみ更新
687
+ $wpdb->update(
688
+ $this->db,
689
+ array(
690
+ 'sns_twitter' => $sns_twitter,
691
+ 'sns_facebook' => $sns_facebook,
692
+ 'sns_hatena' => $sns_hatena,
693
+ 'uptime' => current_time('U'),
694
+ 'nexttime' => current_time('U') + 43200 + rand(0, 21600),
695
+ ),
696
+ array(
697
+ 'url' => $url
698
+ )
699
+ );
700
+ }
701
+
702
+ // データベースへの保存が終わったので、表示用の編集
703
+
704
+ // タイトル
705
+ if (!isset($title) || $title == '') {
706
+ $title = esc_html($url); // タイトル取得できていなかったらURLをセットする
707
+ $title = mb_strimwidth($title, 0, 200, '...'); // 200文字で切る
708
+ }
709
+
710
+ // パラメータ取得(タイトル・抜粋文)
711
+ switch (isset($this->options['use-inline']) ? $this->options['use-inline'] : null) {
712
+ case '1':
713
+ $title = '';
714
+ $excerpt = isset($content) ? $content : '';
715
+ break;
716
+ case '2':
717
+ $title = isset($content) ? $content : '';
718
+ $excerpt = '';
719
+ break;
720
+ }
721
+ if (isset($atts['title'])) { // titleパラメータ
722
+ $title = $atts['title'];
723
+ $excerpt = '';
724
+ }
725
+ if ($excerpt == '') {
726
+ if (isset($atts['content'])) { // contrentパラメータ
727
+ $excerpt = $atts['content'];
728
+ } elseif (isset($atts['contents'])) { // contentsパラメータ
729
+ $excerpt = $atts['contents'];
730
+ } elseif (isset($atts['description'])) { // descriptionパラメータ
731
+ $excerpt = $atts['description'];
732
+ }
733
+ }
734
+
735
+ // サイト名称を使わない場合、ドメイン名で上書き
736
+ if (is_null($this->options['use-sitename']) || $site_name == '') {
737
+ $site_name = $domain;
738
+ }
739
+
740
+ // 抜粋文非表示の場合、空欄にする
741
+ if (!isset($this->options['display-excerpt']) || is_null($this->options['display-excerpt'])) {
742
+ $excerpt = '';
743
+ } else {
744
+ // 抜粋文の文字数
745
+ $excerpt = mb_strimwidth($excerpt, 0, (isset($this->options['trim-count']) ? $this->options['trim-count'] : 130 ) , '...');
746
+ }
747
+
748
+ // リンク先URL
749
+ $a_op = '<a class="no_icon" href="'.$url.'"'.$target.$nofollow.'>';
750
+ $a_cl = '</a>';
751
+ if ((isset($this->options['link-all']) ? $this->options['link-all'] : null) == '1') {
752
+ $a_op_all = $a_op;
753
+ $a_cl_all = $a_cl;
754
+ $a_op = '';
755
+ $a_cl = '';
756
+ } else {
757
+ $a_op_all = '';
758
+ $a_cl_all = '';
759
+ }
760
+
761
+ // サイト情報
762
+ $domain_info = '<div class="linkcard-info">'.$a_op.'<span class="linkcard-domain">'.$favicon.'&nbsp;'.$site_name.$info.'</span>'.$a_cl.'&nbsp;'.$sns_info.$this->plugin_link.'</div>';
763
+
764
+ // 記事内容
765
+ $content = '<div class="linkcard-content">'.$a_op.'<span class="linkcard-thumbnail">'.$thumbnail.'</span><span class="linkcard-title">'.$title.$a_cl.'</span>'.$sns_title.'<div class="linkcard-url"><cite>'.$a_op.$url.$a_cl.'</cite></div><div class="linkcard-excerpt">'.$excerpt.'</div></div>';
766
+
767
+ // HTMLタグ作成
768
+ switch (isset($this->options['info-position']) ? $this->options['info-position'] : null) {
769
+ case '1':
770
+ $tag = $a_op_all.$wrap_op.$domain_info.$content.'<div class="clear"></div>'.$wrap_cl.$a_cl_all;
771
+ break;
772
+ case '2':
773
+ $tag = $a_op_all.$wrap_op.$content.$domain_info.'<div class="clear"></div>'.$wrap_cl.$a_cl_all;
774
+ break;
775
+ default:
776
+ $tag = $a_op_all.$wrap_op.$content.'<div class="clear"></div>'.$wrap_cl.$a_cl_all;
777
+ }
778
+
779
+ // 引用文扱い
780
+ if (isset($this->options['blockquote']) ? $this->options['blockquote'] : null == '1') {
781
+ $tag = '<div class="linkcard"><blockquote class="linkcard-quote">'.$tag.'</blockquote></div>';
782
+ } else {
783
+ $tag = '<div class="linkcard">'.$tag.'</div>';
784
+ }
785
+
786
+ // 実行時間
787
+ if (is_user_logged_in()) {
788
+ if (isset($this->options['debug-time'])) {
789
+ $end_time = microtime(true);
790
+ $elasped_time = number_format($end_time - $start_time, 8, '.', ',');
791
+ $tag = PHP_EOL.'<!-- Pz-LkC -->'.PHP_EOL.$tag.PHP_EOL.'<!-- /Pz-LkC ('.$elasped_time.'sec) -->'.PHP_EOL;
792
+ }
793
+ }
794
+ return $tag;
795
+ }
796
+ }
797
+ $Pz_LinkCard = new Pz_LinkCard;
readme.txt ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Pz-LinkCard ===
2
+ Contributors: poporon
3
+ Tags: post, internal link, external link, blogcard, linkcard
4
+ Requires at least: 4.3.0
5
+ Tested up to: 4.3.1
6
+ Stable tag: trunk
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ このプラグインはリンク先をブログカード形式で表示するものです。
11
+
12
+ == Description ==
13
+ このプラグインはショートコードでURLを指定することで、リンクをブログカード形式で表示させるものです。
14
+
15
+ ショートコードは複数設定することができ、変更することができます。
16
+
17
+ 外部リンクの場合をクリックすることで「新しいウィンドウ(タブ)」でリンクが開きます。
18
+
19
+ 内部リンクの場合をクリックするとそのままのウィンドウでリンクが開きます。
20
+
21
+
22
+ このプラグインは、有効化したときにDBテーブルを一つ作成します。(プレフィックス+「pz_linkcard」)
23
+
24
+ 外部リンクを設定した場合、記事のページを開いて「初めて表示された」ときに、リンク先のサイトからタイトル・抜粋文を取得してDBへキャッシュします。
25
+
26
+
27
+ カードの枚数分、外部サイトへのアクセスが発生するため、多量のカードを作成すると、サイト全体が重くなる可能性があります。
28
+
29
+ 次回の表示はDBキャッシュから行うので高速に表示を行います。
30
+
31
+ (内部でのDBアクセスが発生しますが、通常は軽微なものです。カード1枚表示のたびに、取得のために1クエリ発行します。更新が発生した場合には挿入・更新のためのクエリが1回発生します。)
32
+
33
+
34
+ ソーシャルカウントについては、「ツイッターのツイート数」「フェイスブックのシェア数」「はてなブックマークのブックマーク数」の3種類に対応しています。
35
+
36
+ それぞれAPIへのJSONリクエストにより値を取得します。
37
+
38
+ これらのアクセスも遅い場合がありますが、取得した値はタイトルや抜粋文と同様、DBへキャッシュを行うため、直近の表示にはAPIアクセスが発生しません。
39
+
40
+ ソーシャルカウントの再取得は、最後の取得から4時間~36時間程度のランダムな時間で行います。
41
+
42
+ この間隔については、改善の余地があります。
43
+
44
+ また、各APIについては、仕様変更やサービス終了に伴い、正常に取得できなくなる場合があります。
45
+
46
+
47
+ サムネイルの取得については、相手サイトへの負担を考慮して、「取得しない」を標準での設定としています。
48
+
49
+ ただし、「HeartRails」様のフリーで使用できるキャプチャ作成APIのアドレスを設定してあるので、「取得しない」→「WebAPIで取得」へ変更することで、キャプチャ付で表示することができます。
50
+
51
+ HeartRails様のキャプチャ機能を使用する場合には、利用規約などを一読されてください。(通常に使用する場合には特に制限は無いかと思われます)
52
+
53
+ http://capture.heartrails.com/
54
+
55
+ 他の画像取得APIの設定については、Pz-HatenaBlogCard もしくは、Pz-LinkCard のページを参考にしてください。
56
+
57
+
58
+ サイトアイコン(ファビコン)についても、同様にWebAPIを使用して取得しています。
59
+
60
+ こちらは標準設定で「WebAPIで取得する」になっており、「Hatena::Favicon」のアドレスを設定しています。
61
+
62
+ これは、リンク先のURLを入力することによって、サイトアイコンの画像が取得できるものです。
63
+
64
+ 公式なサービスでは無いため、仕様変更やサービス終了に伴い、正常に取得できなくなく場合があります。
65
+
66
+
67
+ Pz-HatenaBlogCard との互換性を持たせるため、外部リンクの場合にのみ「はてなブログカード」へ置き換えて表示する機能もあります。
68
+
69
+ こちらの機能については、Pz-LinkCard の機能が活かせないため、非推奨とさせていただきます。Pz-HatenaBlogCard をご利用ください。
70
+
71
+
72
+ Pz-HatenaBlogCard からの設定引き継ぎ機能はありません。この機会に触ったことのなかった設定項目にも触れていただければ幸いです。
73
+
74
+ ショートコードを変えることで、Pz-HatenaBlogCard と併用利用することができますが、通常はリソースの消費が増えるだけなので、推奨はしません。
75
+
76
+
77
+ リンクをクリックした場合、リンク元は記事のサイトになりますが、リンクそのものはショートコード内のため、WordPressピンバックは飛ばないようですのでご了承ください。
78
+
79
+
80
+ 設定項目については、WordPress標準の options に設定内容を保存します。キーは「Pz-LinkCard_options」の1レコードです。
81
+
82
+
83
+ なお、アンインストールを行う際には、キャッシュを保管するDBテーブルと、options内の設定ファイルは削除されます。
84
+
85
+ アンインストール時の削除に関してはプラグインディレクトリ内の uninstall.php で行っています。
86
+
87
+
88
+ まだ成熟したプラグインでは無いので、ご意見やご要望があればありがたくいただきたいと思います。
89
+
90
+ しかしながら、趣味で行っているプログラムであるため、対応能力にも限界があることを了承いただけると幸いです。
91
+
92
+
93
+ == Installation ==
94
+ WordPressダッシュボードからのインストール
95
+ 1. 「プラグイン」→「新規追加」を選びます
96
+ 2. 「Pz-LinkCard」を検索します
97
+ 3. プラグイン名と作者を確認していただき、「今すぐインストール」を押します
98
+ 4. 「有効化する」を選び、有効化します
99
+
100
+ WordPress.org からのダウンロードおよびインストール
101
+ 1. WordPress.orgのプラグイン一覧から「Pz-LinkCard」を検索します
102
+ 2. プラグイン名と作者を確認していただき、ダウンロードします
103
+ 3. WordPressをインストールしているディレクトリ配下の、「/wp-content/plugins」ディレクトリ配下に「pz-linkcard」ディレクトリを作成します
104
+ 4. ダウンロードしたZIPファイルを展開します
105
+ 5. プラグイン一覧から「有効化」を選んで、有効化します
106
+
107
+ 当サイトからのダウンロードおよびインストール
108
+ 1. 当サイト「ぽぽづれ。」へアクセスしてください http://poporon.poponet.jp
109
+ 2. リンクを辿るか、直接プラグインのページを開きます http://poporon.poponet.jp/pz-linkcard
110
+ 3. 下の方にZIPファイルのダウンロードリンクがあるので、ダウンロードします
111
+ 4. WordPressをインストールしているディレクトリ配下の、「/wp-content/plugins」ディレクトリ配下に「pz-linkcard」ディレクトリを作成します
112
+ 5. ダウンロードしたZIPファイルを展開します
113
+ 6. プラグイン一覧から「有効化」を選んで、有効化します
114
+
115
+ 新しいバージョンを有効化したら動作しなくなった場合
116
+ 1. Pz-LinkCard がインストールされているディレクトリ名を変更もしくは削除します
117
+ 2. WordPressダッシュボードに入ると、プラグインが無効化されたというメッセージが表示されます
118
+ 3. 先ほど変更したディレクトリ名を戻します(戻してもプラグインは勝手に有効化されません)
119
+ 4. 当サイトから古い安定版をダウンロードします
120
+ 5. 上書きコピーを行ったあと、有効化を選んで、有効化します
121
+ 6. 不具合が起きた状態や状況、テストサイトであれば、アクセスするためのURLを教えていただけると早急に修正できる場合があります
122
+
123
+ == Frequently asked questions ==
124
+
125
+ = A question that someone might have =
126
+
127
+ An answer to that question.
128
+
129
+ == Screenshots ==
130
+
131
+ 1. "Use shortcode [blogcard]"
132
+ 2. "Display blogcard"
133
+ 3. "Display blogcard with setting"
134
+ 4. "Basic settings"
135
+ 5. "Style settings"
136
+ 6. "External link settings"
137
+ 7. "Internal link settings"
138
+ 8. "Use WebAPI settings"
139
+ 9. "For debug settings"
140
+ 10. "Initializing settings"
141
+
142
+ == Changelog ==
143
+
144
+ = 0.1.2 =
145
+ * 「新しいウィンドウで開く」の設定を追加。
146
+ * カード管理画面のソート順を修正。
147
+ * フェイスブックの表記を「f」から「fb」へ変更。
148
+
149
+ = 0.1.1 =
150
+ * 公開後発見されたバグを修正。
151
+
152
+ = 0.1.0 =
153
+ * 公式プラグインディレクトリでの最初の公開バージョン。
154
+
155
+ = 0.0.1 =
156
+ * 当サイトでの最初の公開バージョン。
157
+
158
+ = 0.0.0 =
159
+ * 途中まで作成していたバージョンを破棄。Pz-HatenaBlogCard ver1.2.5 を元に、DBアクセス部分を移植して、Pz-LinkCardを作成。
160
+ * テストサイトでの動作検証。
161
+ * 当サイトでの本番環境での動作検証。
162
+
163
+ == Upgrade notice ==
uninstall.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH') || !defined('WP_UNINSTALL_PLUGIN')) exit(); ?>
2
+ <?php
3
+
4
+ $slug = basename(dirname(__FILE__));
5
+ $wp_upload_dir = wp_upload_dir();
6
+ $css_dir = $wp_upload_dir['basedir'].'/'.$slug;
7
+ $css_path1 = $css_dir.'/style.css';
8
+ $css_path2 = $css_dir.'/'.$slug.'-style.css';
9
+
10
+ // Delete options
11
+ delete_option('Pz_LinkCard_options');
12
+
13
+ // Delect CSS
14
+ if (file_exists($css_path1)) unlink ($css_path1);
15
+ if (file_exists($css_path2)) unlink ($css_path2);
16
+ if (file_exists($css_dir)) rmdir ($css_dir);
17
+
18
+ // Drop DB-table
19
+ global $wpdb;
20
+ $sql = "DROP TABLE ".$wpdb->prefix.'pz_linkcard';
21
+ $wpdb->query($sql);