Related Posts Thumbnails Plugin for WordPress - Version 1.2.7

Version Description

  • Added clean HTML option without plugin CSS, fixed background color change
Download this release

Release Info

Developer marynixie
Plugin Icon 128x128 Related Posts Thumbnails Plugin for WordPress
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.6 to 1.2.7

locale/related-posts-thumbnails-fr_FR.mo CHANGED
Binary file
locale/related-posts-thumbnails-fr_FR.po CHANGED
@@ -19,276 +19,296 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
- #: related-posts-thumbnails.php:311
23
  #@ related-posts-thumbnails
24
  msgid "Related Posts Thumbnails"
25
  msgstr ""
26
 
27
- #: related-posts-thumbnails.php:311
28
  #@ related-posts-thumbnails
29
  msgid "Related Posts Thumbs"
30
  msgstr ""
31
 
32
- #: related-posts-thumbnails.php:317
33
  #@ related-posts-thumbnails
34
  msgid "No access"
35
  msgstr "Accès refusé"
36
 
37
- #: related-posts-thumbnails.php:358
38
  #@ related-posts-thumbnails
39
  msgid "Settings updated"
40
  msgstr "Réglages mis à jour"
41
 
42
- #: related-posts-thumbnails.php:408
43
  #@ related-posts-thumbnails
44
  msgid "Related Posts Thumbnails Settings"
45
  msgstr "Réglages de Related Posts Thumbnails"
46
 
47
- #: related-posts-thumbnails.php:414
48
  #@ related-posts-thumbnails
49
  msgid "General Display Options"
50
  msgstr "Options d'affichage général"
51
 
52
- #: related-posts-thumbnails.php:417
53
  #@ related-posts-thumbnails
54
  msgid "Automatically append to the post content"
55
  msgstr "Rajouter automatiquement au contenu du billet"
56
 
57
- #: related-posts-thumbnails.php:420
58
  #@ related-posts-thumbnails
59
  msgid "Or use <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> in the Loop"
60
  msgstr "Ou utiliser <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> à l'intérieur de la boucle."
61
 
62
- #: related-posts-thumbnails.php:431
63
  #@ related-posts-thumbnails
64
  msgid "Page type"
65
  msgstr "Type de page"
66
 
67
- #: related-posts-thumbnails.php:434
68
  #@ related-posts-thumbnails
69
  msgid "Show on single posts only"
70
  msgstr "Afficher seulement dans les billets uniques"
71
 
72
- #: related-posts-thumbnails.php:597
73
  #@ related-posts-thumbnails
74
  msgid "Categories"
75
  msgstr "Catégories"
76
 
77
- #: related-posts-thumbnails.php:619
78
  #@ related-posts-thumbnails
79
  msgid "All"
80
  msgstr "Toutes "
81
 
82
- #: related-posts-thumbnails.php:457
83
  #@ related-posts-thumbnails
84
  msgid "Top text"
85
  msgstr "Texte de présentation"
86
 
87
- #: related-posts-thumbnails.php:463
88
  #@ related-posts-thumbnails
89
  msgid "Number of similar posts to display"
90
  msgstr "Nombre de billets similaires à afficher"
91
 
92
- #: related-posts-thumbnails.php:469
93
  #@ related-posts-thumbnails
94
  msgid "Default image URL"
95
  msgstr "Adresse URL de l'image par défaut"
96
 
97
- #: related-posts-thumbnails.php:475
98
- #: related-posts-thumbnails.php:487
99
- #: related-posts-thumbnails.php:505
100
  #@ related-posts-thumbnails
101
  msgid "Thumbnails source"
102
  msgstr "Source des miniatures"
103
 
104
- #: related-posts-thumbnails.php:490
105
  #@ related-posts-thumbnails
106
  msgid "Post-thumbnails name"
107
  msgstr "Nom des miniatures des billets"
108
 
109
- #: related-posts-thumbnails.php:498
110
  #@ related-posts-thumbnails
111
  msgid "Your theme has to support post-thumbnails to have more choices"
112
  msgstr "Votre thème doit être compatible avec les miniatures de billets pour avoir plus de choix"
113
 
114
- #: related-posts-thumbnails.php:508
115
  #@ related-posts-thumbnails
116
  msgid "Custom field name"
117
  msgstr "Nom du champ personnalisé"
118
 
119
- #: related-posts-thumbnails.php:514
120
  #@ related-posts-thumbnails
121
  msgid "Size"
122
  msgstr "Taille"
123
 
124
- #: related-posts-thumbnails.php:516
125
  #@ related-posts-thumbnails
126
  msgid "Width"
127
  msgstr "Largeur"
128
 
129
- #: related-posts-thumbnails.php:517
130
  #@ related-posts-thumbnails
131
  msgid "Height"
132
  msgstr "Hauteur"
133
 
134
- #: related-posts-thumbnails.php:530
135
  #@ related-posts-thumbnails
136
  msgid "Style options"
137
  msgstr "Options de style"
138
 
139
- #: related-posts-thumbnails.php:533
140
  #@ related-posts-thumbnails
141
  msgid "Background color"
142
  msgstr "Couleur de fond"
143
 
144
- #: related-posts-thumbnails.php:539
145
  #@ related-posts-thumbnails
146
  msgid "Background color on mouse over"
147
  msgstr "Couleur de fond au passage de la souris"
148
 
149
- #: related-posts-thumbnails.php:545
150
  #@ related-posts-thumbnails
151
  msgid "Border color"
152
  msgstr "Couleur du cadre"
153
 
154
- #: related-posts-thumbnails.php:551
155
  #@ related-posts-thumbnails
156
  msgid "Font color"
157
  msgstr "Couleur de la police de caractères"
158
 
159
- #: related-posts-thumbnails.php:557
160
  #@ related-posts-thumbnails
161
  msgid "Font family"
162
  msgstr "Police de caractères"
163
 
164
- #: related-posts-thumbnails.php:563
165
  #@ related-posts-thumbnails
166
  msgid "Font size"
167
  msgstr "Taille de la police de caractères"
168
 
169
- #: related-posts-thumbnails.php:569
170
  #@ related-posts-thumbnails
171
  msgid "Text maximum length"
172
  msgstr "Taille maximum du texte"
173
 
174
- #: related-posts-thumbnails.php:572
175
  #@ related-posts-thumbnails
176
  msgid "Set 0 for no title"
177
  msgstr "Mettre 0 pour ne pas avoir de titre"
178
 
179
- #: related-posts-thumbnails.php:576
180
  #@ related-posts-thumbnails
181
  msgid "Excerpt maximum length"
182
  msgstr "Taille maximum de l'extrait"
183
 
184
- #: related-posts-thumbnails.php:579
185
  #@ related-posts-thumbnails
186
  msgid "Set 0 for no excerpt"
187
  msgstr "Mettre 0 pour ne pas avoir d'extrait"
188
 
189
- #: related-posts-thumbnails.php:583
190
  #@ related-posts-thumbnails
191
  msgid "Text block height"
192
  msgstr "Hauteur du bloc de texte"
193
 
194
- #: related-posts-thumbnails.php:591
195
  #@ related-posts-thumbnails
196
  msgid "Relation Builder Options"
197
  msgstr "Options du gestionnaire de liens"
198
 
199
- #: related-posts-thumbnails.php:594
200
  #@ related-posts-thumbnails
201
  msgid "Relation based on"
202
  msgstr "Liens basés sur "
203
 
204
- #: related-posts-thumbnails.php:599
205
  #@ related-posts-thumbnails
206
  msgid "Tags"
207
  msgstr ""
208
 
209
- #: related-posts-thumbnails.php:601
210
  #@ related-posts-thumbnails
211
  msgid "Categories and Tags"
212
  msgstr "Catégories et tags"
213
 
214
- #: related-posts-thumbnails.php:608
215
  #@ related-posts-thumbnails
216
  msgid "Save Changes"
217
  msgstr "Sauvegarder les modifications "
218
 
219
- #: related-posts-thumbnails.php:612
220
  #@ related-posts-thumbnails
221
  msgid "If you experience some problems with this plugin please let me know about it on <a href=\"http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/\">Plugin's homepage</a>. If you think this plugin is awesome please vote on <a href=\"http://wordpress.org/extend/plugins/related-posts-thumbnails/\">Wordpress plugin page</a>. Thanks!"
222
  msgstr "Si vous rencontrez des problèmes avec ce plugin, faites le moi savoir à <a href=\"http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/\">la page du plugin</a>. Si vous trouvez ce plugin formidable, n'hésitez pas à aller voter sur <a href=\"http://wordpress.org/extend/plugins/related-posts-thumbnails/\">la page Wordpress du plugin</a>. Merci d'avance !"
223
 
224
- #: related-posts-thumbnails.php:672
225
  msgid "Title:"
226
  msgstr ""
227
 
228
- #: related-posts-thumbnails.php:424
229
  #@ related-posts-thumbnails
230
  msgid "Developer mode"
231
  msgstr "Mode pour développeur"
232
 
233
- #: related-posts-thumbnails.php:427
234
  #@ related-posts-thumbnails
235
  msgid "This will add debugging information in HTML source"
236
  msgstr "Ceci ajoutera des informations de debuggage dans la source HTML"
237
 
238
- #: related-posts-thumbnails.php:325
239
  #@ related-posts-thumbnails
240
  msgid "Wrong date"
241
  msgstr "Date fausse "
242
 
243
- #: related-posts-thumbnails.php:361
244
  #@ related-posts-thumbnails
245
  msgid "Settings update failed"
246
  msgstr "Mise à jour des réglage échouée "
247
 
248
- #: related-posts-thumbnails.php:438
249
  #@ related-posts-thumbnails
250
  msgid "Categories on which related thumbnails will appear"
251
  msgstr "Catégories pour lesquelles les miniatures relatives vont apparaître "
252
 
253
- #: related-posts-thumbnails.php:444
254
  #@ related-posts-thumbnails
255
  msgid "Categories that will appear in related thumbnails"
256
  msgstr "Catégories qui seront incluses dans les miniatures relatives "
257
 
258
- #: related-posts-thumbnails.php:450
259
  #@ related-posts-thumbnails
260
  msgid "Include only posts after"
261
  msgstr "Inclure uniquement les billets après le "
262
 
263
- #: related-posts-thumbnails.php:452
264
  msgid "Year"
265
  msgstr ""
266
 
267
- #: related-posts-thumbnails.php:452
268
  msgid "Month"
269
  msgstr ""
270
 
271
- #: related-posts-thumbnails.php:452
272
  msgid "Day"
273
  msgstr ""
274
 
275
- #: related-posts-thumbnails.php:452
276
  #@ related-posts-thumbnails
277
  msgid "Leave empty for all posts dates"
278
  msgstr "Laisser vide pour prendre en compte toutes les dates de billet "
279
 
280
- #: related-posts-thumbnails.php:521
281
  #@ related-posts-thumbnails
282
  msgid "Theme resize url"
283
  msgstr "URL de redimensionnement par thème "
284
 
285
- #: related-posts-thumbnails.php:524
286
  #@ related-posts-thumbnails
287
  msgid "If your theme resizes images, enter URL to its resizing PHP file"
288
  msgstr "Si votre thème redimensionne les images, entrez l'URL de votre fichier PHP de redimensionnement. "
289
 
290
- #: related-posts-thumbnails.php:603
291
  #@ related-posts-thumbnails
292
  msgid "Random"
293
  msgstr "Au hasard "
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
+ #: related-posts-thumbnails.php:354
23
  #@ related-posts-thumbnails
24
  msgid "Related Posts Thumbnails"
25
  msgstr ""
26
 
27
+ #: related-posts-thumbnails.php:354
28
  #@ related-posts-thumbnails
29
  msgid "Related Posts Thumbs"
30
  msgstr ""
31
 
32
+ #: related-posts-thumbnails.php:360
33
  #@ related-posts-thumbnails
34
  msgid "No access"
35
  msgstr "Accès refusé"
36
 
37
+ #: related-posts-thumbnails.php:403
38
  #@ related-posts-thumbnails
39
  msgid "Settings updated"
40
  msgstr "Réglages mis à jour"
41
 
42
+ #: related-posts-thumbnails.php:464
43
  #@ related-posts-thumbnails
44
  msgid "Related Posts Thumbnails Settings"
45
  msgstr "Réglages de Related Posts Thumbnails"
46
 
47
+ #: related-posts-thumbnails.php:470
48
  #@ related-posts-thumbnails
49
  msgid "General Display Options"
50
  msgstr "Options d'affichage général"
51
 
52
+ #: related-posts-thumbnails.php:473
53
  #@ related-posts-thumbnails
54
  msgid "Automatically append to the post content"
55
  msgstr "Rajouter automatiquement au contenu du billet"
56
 
57
+ #: related-posts-thumbnails.php:476
58
  #@ related-posts-thumbnails
59
  msgid "Or use <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> in the Loop"
60
  msgstr "Ou utiliser <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> à l'intérieur de la boucle."
61
 
62
+ #: related-posts-thumbnails.php:487
63
  #@ related-posts-thumbnails
64
  msgid "Page type"
65
  msgstr "Type de page"
66
 
67
+ #: related-posts-thumbnails.php:490
68
  #@ related-posts-thumbnails
69
  msgid "Show on single posts only"
70
  msgstr "Afficher seulement dans les billets uniques"
71
 
72
+ #: related-posts-thumbnails.php:664
73
  #@ related-posts-thumbnails
74
  msgid "Categories"
75
  msgstr "Catégories"
76
 
77
+ #: related-posts-thumbnails.php:686
78
  #@ related-posts-thumbnails
79
  msgid "All"
80
  msgstr "Toutes "
81
 
82
+ #: related-posts-thumbnails.php:513
83
  #@ related-posts-thumbnails
84
  msgid "Top text"
85
  msgstr "Texte de présentation"
86
 
87
+ #: related-posts-thumbnails.php:519
88
  #@ related-posts-thumbnails
89
  msgid "Number of similar posts to display"
90
  msgstr "Nombre de billets similaires à afficher"
91
 
92
+ #: related-posts-thumbnails.php:525
93
  #@ related-posts-thumbnails
94
  msgid "Default image URL"
95
  msgstr "Adresse URL de l'image par défaut"
96
 
97
+ #: related-posts-thumbnails.php:531
98
+ #: related-posts-thumbnails.php:543
99
+ #: related-posts-thumbnails.php:561
100
  #@ related-posts-thumbnails
101
  msgid "Thumbnails source"
102
  msgstr "Source des miniatures"
103
 
104
+ #: related-posts-thumbnails.php:546
105
  #@ related-posts-thumbnails
106
  msgid "Post-thumbnails name"
107
  msgstr "Nom des miniatures des billets"
108
 
109
+ #: related-posts-thumbnails.php:554
110
  #@ related-posts-thumbnails
111
  msgid "Your theme has to support post-thumbnails to have more choices"
112
  msgstr "Votre thème doit être compatible avec les miniatures de billets pour avoir plus de choix"
113
 
114
+ #: related-posts-thumbnails.php:564
115
  #@ related-posts-thumbnails
116
  msgid "Custom field name"
117
  msgstr "Nom du champ personnalisé"
118
 
119
+ #: related-posts-thumbnails.php:570
120
  #@ related-posts-thumbnails
121
  msgid "Size"
122
  msgstr "Taille"
123
 
124
+ #: related-posts-thumbnails.php:572
125
  #@ related-posts-thumbnails
126
  msgid "Width"
127
  msgstr "Largeur"
128
 
129
+ #: related-posts-thumbnails.php:573
130
  #@ related-posts-thumbnails
131
  msgid "Height"
132
  msgstr "Hauteur"
133
 
134
+ #: related-posts-thumbnails.php:586
135
  #@ related-posts-thumbnails
136
  msgid "Style options"
137
  msgstr "Options de style"
138
 
139
+ #: related-posts-thumbnails.php:600
140
  #@ related-posts-thumbnails
141
  msgid "Background color"
142
  msgstr "Couleur de fond"
143
 
144
+ #: related-posts-thumbnails.php:606
145
  #@ related-posts-thumbnails
146
  msgid "Background color on mouse over"
147
  msgstr "Couleur de fond au passage de la souris"
148
 
149
+ #: related-posts-thumbnails.php:612
150
  #@ related-posts-thumbnails
151
  msgid "Border color"
152
  msgstr "Couleur du cadre"
153
 
154
+ #: related-posts-thumbnails.php:618
155
  #@ related-posts-thumbnails
156
  msgid "Font color"
157
  msgstr "Couleur de la police de caractères"
158
 
159
+ #: related-posts-thumbnails.php:624
160
  #@ related-posts-thumbnails
161
  msgid "Font family"
162
  msgstr "Police de caractères"
163
 
164
+ #: related-posts-thumbnails.php:630
165
  #@ related-posts-thumbnails
166
  msgid "Font size"
167
  msgstr "Taille de la police de caractères"
168
 
169
+ #: related-posts-thumbnails.php:636
170
  #@ related-posts-thumbnails
171
  msgid "Text maximum length"
172
  msgstr "Taille maximum du texte"
173
 
174
+ #: related-posts-thumbnails.php:639
175
  #@ related-posts-thumbnails
176
  msgid "Set 0 for no title"
177
  msgstr "Mettre 0 pour ne pas avoir de titre"
178
 
179
+ #: related-posts-thumbnails.php:643
180
  #@ related-posts-thumbnails
181
  msgid "Excerpt maximum length"
182
  msgstr "Taille maximum de l'extrait"
183
 
184
+ #: related-posts-thumbnails.php:646
185
  #@ related-posts-thumbnails
186
  msgid "Set 0 for no excerpt"
187
  msgstr "Mettre 0 pour ne pas avoir d'extrait"
188
 
189
+ #: related-posts-thumbnails.php:650
190
  #@ related-posts-thumbnails
191
  msgid "Text block height"
192
  msgstr "Hauteur du bloc de texte"
193
 
194
+ #: related-posts-thumbnails.php:658
195
  #@ related-posts-thumbnails
196
  msgid "Relation Builder Options"
197
  msgstr "Options du gestionnaire de liens"
198
 
199
+ #: related-posts-thumbnails.php:661
200
  #@ related-posts-thumbnails
201
  msgid "Relation based on"
202
  msgstr "Liens basés sur "
203
 
204
+ #: related-posts-thumbnails.php:666
205
  #@ related-posts-thumbnails
206
  msgid "Tags"
207
  msgstr ""
208
 
209
+ #: related-posts-thumbnails.php:668
210
  #@ related-posts-thumbnails
211
  msgid "Categories and Tags"
212
  msgstr "Catégories et tags"
213
 
214
+ #: related-posts-thumbnails.php:675
215
  #@ related-posts-thumbnails
216
  msgid "Save Changes"
217
  msgstr "Sauvegarder les modifications "
218
 
219
+ #: related-posts-thumbnails.php:679
220
  #@ related-posts-thumbnails
221
  msgid "If you experience some problems with this plugin please let me know about it on <a href=\"http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/\">Plugin's homepage</a>. If you think this plugin is awesome please vote on <a href=\"http://wordpress.org/extend/plugins/related-posts-thumbnails/\">Wordpress plugin page</a>. Thanks!"
222
  msgstr "Si vous rencontrez des problèmes avec ce plugin, faites le moi savoir à <a href=\"http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/\">la page du plugin</a>. Si vous trouvez ce plugin formidable, n'hésitez pas à aller voter sur <a href=\"http://wordpress.org/extend/plugins/related-posts-thumbnails/\">la page Wordpress du plugin</a>. Merci d'avance !"
223
 
224
+ #: related-posts-thumbnails.php:739
225
  msgid "Title:"
226
  msgstr ""
227
 
228
+ #: related-posts-thumbnails.php:480
229
  #@ related-posts-thumbnails
230
  msgid "Developer mode"
231
  msgstr "Mode pour développeur"
232
 
233
+ #: related-posts-thumbnails.php:483
234
  #@ related-posts-thumbnails
235
  msgid "This will add debugging information in HTML source"
236
  msgstr "Ceci ajoutera des informations de debuggage dans la source HTML"
237
 
238
+ #: related-posts-thumbnails.php:368
239
  #@ related-posts-thumbnails
240
  msgid "Wrong date"
241
  msgstr "Date fausse "
242
 
243
+ #: related-posts-thumbnails.php:406
244
  #@ related-posts-thumbnails
245
  msgid "Settings update failed"
246
  msgstr "Mise à jour des réglage échouée "
247
 
248
+ #: related-posts-thumbnails.php:494
249
  #@ related-posts-thumbnails
250
  msgid "Categories on which related thumbnails will appear"
251
  msgstr "Catégories pour lesquelles les miniatures relatives vont apparaître "
252
 
253
+ #: related-posts-thumbnails.php:500
254
  #@ related-posts-thumbnails
255
  msgid "Categories that will appear in related thumbnails"
256
  msgstr "Catégories qui seront incluses dans les miniatures relatives "
257
 
258
+ #: related-posts-thumbnails.php:506
259
  #@ related-posts-thumbnails
260
  msgid "Include only posts after"
261
  msgstr "Inclure uniquement les billets après le "
262
 
263
+ #: related-posts-thumbnails.php:508
264
  msgid "Year"
265
  msgstr ""
266
 
267
+ #: related-posts-thumbnails.php:508
268
  msgid "Month"
269
  msgstr ""
270
 
271
+ #: related-posts-thumbnails.php:508
272
  msgid "Day"
273
  msgstr ""
274
 
275
+ #: related-posts-thumbnails.php:508
276
  #@ related-posts-thumbnails
277
  msgid "Leave empty for all posts dates"
278
  msgstr "Laisser vide pour prendre en compte toutes les dates de billet "
279
 
280
+ #: related-posts-thumbnails.php:577
281
  #@ related-posts-thumbnails
282
  msgid "Theme resize url"
283
  msgstr "URL de redimensionnement par thème "
284
 
285
+ #: related-posts-thumbnails.php:580
286
  #@ related-posts-thumbnails
287
  msgid "If your theme resizes images, enter URL to its resizing PHP file"
288
  msgstr "Si votre thème redimensionne les images, entrez l'URL de votre fichier PHP de redimensionnement. "
289
 
290
+ #: related-posts-thumbnails.php:670
291
  #@ related-posts-thumbnails
292
  msgid "Random"
293
  msgstr "Au hasard "
294
 
295
+ #: related-posts-thumbnails.php:430
296
+ #@ related-posts-thumbnails
297
+ msgid "Blocks"
298
+ msgstr "Blocs"
299
+
300
+ #: related-posts-thumbnails.php:430
301
+ #@ related-posts-thumbnails
302
+ msgid "List"
303
+ msgstr "Liste "
304
+
305
+ #: related-posts-thumbnails.php:589
306
+ #@ related-posts-thumbnails
307
+ msgid "Output style"
308
+ msgstr "Style de sortie "
309
+
310
+ #: related-posts-thumbnails.php:596
311
+ #@ related-posts-thumbnails
312
+ msgid "Turn off plugin styles"
313
+ msgstr "Désactiver les styles du plugin "
314
+
locale/related-posts-thumbnails-ru_RU.mo CHANGED
Binary file
locale/related-posts-thumbnails-ru_RU.po CHANGED
@@ -22,42 +22,42 @@ msgstr ""
22
  #: related-posts-thumbnails.php:148 related-posts-thumbnails.php:194
23
  #: related-posts-thumbnails.php:231 related-posts-thumbnails.php:232
24
  #: related-posts-thumbnails.php:273 related-posts-thumbnails.php:308
25
- #: related-posts-thumbnails.php:311
26
  msgid "Related Posts Thumbnails"
27
  msgstr ""
28
 
29
  #: related-posts-thumbnails.php:148 related-posts-thumbnails.php:194
30
  #: related-posts-thumbnails.php:231 related-posts-thumbnails.php:232
31
  #: related-posts-thumbnails.php:273 related-posts-thumbnails.php:308
32
- #: related-posts-thumbnails.php:311
33
  msgid "Related Posts Thumbs"
34
  msgstr ""
35
 
36
  #: related-posts-thumbnails.php:154 related-posts-thumbnails.php:200
37
  #: related-posts-thumbnails.php:237 related-posts-thumbnails.php:238
38
  #: related-posts-thumbnails.php:279 related-posts-thumbnails.php:314
39
- #: related-posts-thumbnails.php:317
40
  msgid "No access"
41
  msgstr "Нет доступа"
42
 
43
  #: related-posts-thumbnails.php:170 related-posts-thumbnails.php:222
44
  #: related-posts-thumbnails.php:261 related-posts-thumbnails.php:263
45
  #: related-posts-thumbnails.php:305 related-posts-thumbnails.php:354
46
- #: related-posts-thumbnails.php:358
47
  msgid "Settings updated"
48
  msgstr "Настройки обновлены"
49
 
50
  #: related-posts-thumbnails.php:182 related-posts-thumbnails.php:239
51
  #: related-posts-thumbnails.php:281 related-posts-thumbnails.php:283
52
  #: related-posts-thumbnails.php:326 related-posts-thumbnails.php:404
53
- #: related-posts-thumbnails.php:408
54
  msgid "Related Posts Thumbnails Settings"
55
  msgstr "Настройки миниатюр похожих записей"
56
 
57
  #: related-posts-thumbnails.php:188 related-posts-thumbnails.php:245
58
  #: related-posts-thumbnails.php:287 related-posts-thumbnails.php:289
59
  #: related-posts-thumbnails.php:332 related-posts-thumbnails.php:410
60
- #: related-posts-thumbnails.php:414
61
  msgid "General Display Options"
62
  msgstr "Общие свойства отображения"
63
 
@@ -68,91 +68,91 @@ msgstr "Параметр отображения"
68
  #: related-posts-thumbnails.php:194 related-posts-thumbnails.php:251
69
  #: related-posts-thumbnails.php:300 related-posts-thumbnails.php:302
70
  #: related-posts-thumbnails.php:352 related-posts-thumbnails.php:430
71
- #: related-posts-thumbnails.php:434
72
  msgid "Show on single posts only"
73
  msgstr "Показывать только на отдельной странице"
74
 
75
  #: related-posts-thumbnails.php:198 related-posts-thumbnails.php:280
76
  #: related-posts-thumbnails.php:329 related-posts-thumbnails.php:331
77
  #: related-posts-thumbnails.php:381 related-posts-thumbnails.php:453
78
- #: related-posts-thumbnails.php:457
79
  msgid "Top text"
80
  msgstr "Верхний текст"
81
 
82
  #: related-posts-thumbnails.php:204 related-posts-thumbnails.php:286
83
  #: related-posts-thumbnails.php:335 related-posts-thumbnails.php:337
84
  #: related-posts-thumbnails.php:387 related-posts-thumbnails.php:459
85
- #: related-posts-thumbnails.php:463
86
  msgid "Number of similar posts to display"
87
  msgstr "Количество похожих записей для отображения"
88
 
89
  #: related-posts-thumbnails.php:212 related-posts-thumbnails.php:360
90
  #: related-posts-thumbnails.php:409 related-posts-thumbnails.php:411
91
  #: related-posts-thumbnails.php:461 related-posts-thumbnails.php:519
92
- #: related-posts-thumbnails.php:530
93
  msgid "Style options"
94
  msgstr "Опции стиля"
95
 
96
  #: related-posts-thumbnails.php:215 related-posts-thumbnails.php:363
97
  #: related-posts-thumbnails.php:412 related-posts-thumbnails.php:414
98
  #: related-posts-thumbnails.php:464 related-posts-thumbnails.php:522
99
- #: related-posts-thumbnails.php:533
100
  msgid "Background color"
101
  msgstr "Цвет заднего фона"
102
 
103
  #: related-posts-thumbnails.php:221 related-posts-thumbnails.php:369
104
  #: related-posts-thumbnails.php:418 related-posts-thumbnails.php:420
105
  #: related-posts-thumbnails.php:470 related-posts-thumbnails.php:528
106
- #: related-posts-thumbnails.php:539
107
  msgid "Background color on mouse over"
108
  msgstr "Цвет заднего фона при наведении курсора"
109
 
110
  #: related-posts-thumbnails.php:227 related-posts-thumbnails.php:375
111
  #: related-posts-thumbnails.php:424 related-posts-thumbnails.php:426
112
  #: related-posts-thumbnails.php:476 related-posts-thumbnails.php:534
113
- #: related-posts-thumbnails.php:545
114
  msgid "Border color"
115
  msgstr "Цвет границы"
116
 
117
  #: related-posts-thumbnails.php:233 related-posts-thumbnails.php:381
118
  #: related-posts-thumbnails.php:430 related-posts-thumbnails.php:432
119
  #: related-posts-thumbnails.php:482 related-posts-thumbnails.php:540
120
- #: related-posts-thumbnails.php:551
121
  msgid "Font color"
122
  msgstr "Цвет шрифта"
123
 
124
  #: related-posts-thumbnails.php:239 related-posts-thumbnails.php:387
125
  #: related-posts-thumbnails.php:436 related-posts-thumbnails.php:438
126
  #: related-posts-thumbnails.php:488 related-posts-thumbnails.php:546
127
- #: related-posts-thumbnails.php:557
128
  msgid "Font family"
129
  msgstr "Стиль шрифта"
130
 
131
  #: related-posts-thumbnails.php:245 related-posts-thumbnails.php:393
132
  #: related-posts-thumbnails.php:442 related-posts-thumbnails.php:444
133
  #: related-posts-thumbnails.php:494 related-posts-thumbnails.php:552
134
- #: related-posts-thumbnails.php:563
135
  msgid "Font size"
136
  msgstr "Размер шрифта"
137
 
138
  #: related-posts-thumbnails.php:251 related-posts-thumbnails.php:399
139
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:450
140
  #: related-posts-thumbnails.php:500 related-posts-thumbnails.php:558
141
- #: related-posts-thumbnails.php:569
142
  msgid "Text maximum length"
143
  msgstr "Максимальная длина текста"
144
 
145
  #: related-posts-thumbnails.php:259 related-posts-thumbnails.php:407
146
  #: related-posts-thumbnails.php:464 related-posts-thumbnails.php:472
147
  #: related-posts-thumbnails.php:522 related-posts-thumbnails.php:580
148
- #: related-posts-thumbnails.php:591
149
  msgid "Relation Builder Options"
150
  msgstr "Настройки связей"
151
 
152
  #: related-posts-thumbnails.php:262 related-posts-thumbnails.php:410
153
  #: related-posts-thumbnails.php:467 related-posts-thumbnails.php:475
154
  #: related-posts-thumbnails.php:525 related-posts-thumbnails.php:583
155
- #: related-posts-thumbnails.php:594
156
  msgid "Relation based on"
157
  msgstr "Связи расчитываются на основе"
158
 
@@ -161,21 +161,21 @@ msgstr "Связи расчитываются на основе"
161
  #: related-posts-thumbnails.php:470 related-posts-thumbnails.php:306
162
  #: related-posts-thumbnails.php:478 related-posts-thumbnails.php:356
163
  #: related-posts-thumbnails.php:528 related-posts-thumbnails.php:586
164
- #: related-posts-thumbnails.php:597
165
  msgid "Categories"
166
  msgstr "Категории"
167
 
168
  #: related-posts-thumbnails.php:267 related-posts-thumbnails.php:415
169
  #: related-posts-thumbnails.php:472 related-posts-thumbnails.php:480
170
  #: related-posts-thumbnails.php:530 related-posts-thumbnails.php:588
171
- #: related-posts-thumbnails.php:599
172
  msgid "Tags"
173
  msgstr "Метки"
174
 
175
  #: related-posts-thumbnails.php:269 related-posts-thumbnails.php:417
176
  #: related-posts-thumbnails.php:474 related-posts-thumbnails.php:482
177
  #: related-posts-thumbnails.php:532 related-posts-thumbnails.php:590
178
- #: related-posts-thumbnails.php:601
179
  msgid "Categories and Tags"
180
  msgstr "Категории и метки"
181
 
@@ -186,14 +186,14 @@ msgstr "Настройки миниатюр"
186
  #: related-posts-thumbnails.php:278 related-posts-thumbnails.php:327
187
  #: related-posts-thumbnails.php:376 related-posts-thumbnails.php:378
188
  #: related-posts-thumbnails.php:428 related-posts-thumbnails.php:486
189
- #: related-posts-thumbnails.php:490
190
  msgid "Post-thumbnails name"
191
  msgstr "Название миниатюры"
192
 
193
  #: related-posts-thumbnails.php:286 related-posts-thumbnails.php:335
194
  #: related-posts-thumbnails.php:384 related-posts-thumbnails.php:386
195
  #: related-posts-thumbnails.php:436 related-posts-thumbnails.php:494
196
- #: related-posts-thumbnails.php:498
197
  msgid "Your theme has to support post-thumbnails to have more choices"
198
  msgstr ""
199
  "Для более широкого выбора размеров, ваша тема должна поддерживать post-"
@@ -202,26 +202,28 @@ msgstr ""
202
  #: related-posts-thumbnails.php:291 related-posts-thumbnails.php:292
203
  #: related-posts-thumbnails.php:341 related-posts-thumbnails.php:343
204
  #: related-posts-thumbnails.php:393 related-posts-thumbnails.php:465
205
- #: related-posts-thumbnails.php:469
206
  msgid "Default image URL"
207
  msgstr "Ссылка на картинку по умолчанию, в случае, если нет миниатюры"
208
 
209
  #: related-posts-thumbnails.php:299 related-posts-thumbnails.php:422
210
  #: related-posts-thumbnails.php:479 related-posts-thumbnails.php:487
211
  #: related-posts-thumbnails.php:537 related-posts-thumbnails.php:597
212
- #: related-posts-thumbnails.php:608
213
  msgid "Save Changes"
214
  msgstr "Сохранить изменения"
215
 
216
  #: related-posts-thumbnails.php:248 related-posts-thumbnails.php:297
217
  #: related-posts-thumbnails.php:299 related-posts-thumbnails.php:349
218
  #: related-posts-thumbnails.php:427 related-posts-thumbnails.php:431
 
219
  msgid "Page type"
220
  msgstr "Тип страницы"
221
 
222
  #: related-posts-thumbnails.php:270 related-posts-thumbnails.php:319
223
  #: related-posts-thumbnails.php:321 related-posts-thumbnails.php:371
224
  #: related-posts-thumbnails.php:608 related-posts-thumbnails.php:619
 
225
  msgid "All"
226
  msgstr "Все"
227
 
@@ -234,36 +236,43 @@ msgstr "Все"
234
  #: related-posts-thumbnails.php:471 related-posts-thumbnails.php:483
235
  #: related-posts-thumbnails.php:501 related-posts-thumbnails.php:475
236
  #: related-posts-thumbnails.php:487 related-posts-thumbnails.php:505
 
 
237
  msgid "Thumbnails source"
238
  msgstr "Источник миниатюр"
239
 
240
  #: related-posts-thumbnails.php:345 related-posts-thumbnails.php:394
241
  #: related-posts-thumbnails.php:396 related-posts-thumbnails.php:446
242
  #: related-posts-thumbnails.php:504 related-posts-thumbnails.php:508
 
243
  msgid "Custom field name"
244
  msgstr "Название произвольного поля"
245
 
246
  #: related-posts-thumbnails.php:351 related-posts-thumbnails.php:400
247
  #: related-posts-thumbnails.php:402 related-posts-thumbnails.php:452
248
  #: related-posts-thumbnails.php:510 related-posts-thumbnails.php:514
 
249
  msgid "Size"
250
  msgstr "Размер"
251
 
252
  #: related-posts-thumbnails.php:353 related-posts-thumbnails.php:402
253
  #: related-posts-thumbnails.php:404 related-posts-thumbnails.php:454
254
  #: related-posts-thumbnails.php:512 related-posts-thumbnails.php:516
 
255
  msgid "Width"
256
  msgstr "Ширина"
257
 
258
  #: related-posts-thumbnails.php:354 related-posts-thumbnails.php:403
259
  #: related-posts-thumbnails.php:405 related-posts-thumbnails.php:455
260
  #: related-posts-thumbnails.php:513 related-posts-thumbnails.php:517
 
261
  msgid "Height"
262
  msgstr "Высота"
263
 
264
  #: related-posts-thumbnails.php:426 related-posts-thumbnails.php:483
265
  #: related-posts-thumbnails.php:491 related-posts-thumbnails.php:541
266
  #: related-posts-thumbnails.php:601 related-posts-thumbnails.php:612
 
267
  msgid ""
268
  "If you experience some problems with this plugin please let me know about it "
269
  "on <a href=\"http://wordpress.shaldybina.com/plugins/related-posts-"
@@ -278,102 +287,129 @@ msgstr ""
278
 
279
  #: related-posts-thumbnails.php:290 related-posts-thumbnails.php:292
280
  #: related-posts-thumbnails.php:335 related-posts-thumbnails.php:413
281
- #: related-posts-thumbnails.php:417
282
  msgid "Automatically append to the post content"
283
  msgstr "Автоматически добавлять после записи"
284
 
285
  #: related-posts-thumbnails.php:293 related-posts-thumbnails.php:295
286
  #: related-posts-thumbnails.php:338 related-posts-thumbnails.php:416
287
- #: related-posts-thumbnails.php:420
288
  msgid ""
289
  "Or use <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> in the Loop"
290
  msgstr ""
291
- "Или используйте <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> в цикле "
292
- "темы"
293
 
294
  #: related-posts-thumbnails.php:451 related-posts-thumbnails.php:453
295
  #: related-posts-thumbnails.php:503 related-posts-thumbnails.php:561
296
- #: related-posts-thumbnails.php:572
297
  msgid "Set 0 for no title"
298
  msgstr "Поставьте 0, чтобы не отображать заголовок"
299
 
300
  #: related-posts-thumbnails.php:455 related-posts-thumbnails.php:457
301
  #: related-posts-thumbnails.php:507 related-posts-thumbnails.php:565
302
- #: related-posts-thumbnails.php:576
303
  msgid "Excerpt maximum length"
304
  msgstr "Максимальная длина цитаты"
305
 
306
  #: related-posts-thumbnails.php:458 related-posts-thumbnails.php:460
307
  #: related-posts-thumbnails.php:510 related-posts-thumbnails.php:568
308
- #: related-posts-thumbnails.php:579
309
  msgid "Set 0 for no excerpt"
310
  msgstr "Поставьте 0, чтобы не отображать цитату"
311
 
312
  #: related-posts-thumbnails.php:530 related-posts-thumbnails.php:538
313
  #: related-posts-thumbnails.php:588 related-posts-thumbnails.php:661
314
- #: related-posts-thumbnails.php:672
315
  msgid "Title:"
316
  msgstr "Заголовок:"
317
 
318
  #: related-posts-thumbnails.php:464 related-posts-thumbnails.php:514
319
  #: related-posts-thumbnails.php:572 related-posts-thumbnails.php:583
 
320
  msgid "Text block height"
321
  msgstr "Высота текстового блока"
322
 
323
  #: related-posts-thumbnails.php:342 related-posts-thumbnails.php:420
324
- #: related-posts-thumbnails.php:424
325
  msgid "Developer mode"
326
  msgstr "Режим разработчика"
327
 
328
  #: related-posts-thumbnails.php:345 related-posts-thumbnails.php:423
329
- #: related-posts-thumbnails.php:427
330
  msgid "This will add debugging information in HTML source"
331
  msgstr "Это добавит отладочную информацию в HTML код"
332
 
333
  #: related-posts-thumbnails.php:322 related-posts-thumbnails.php:325
 
334
  msgid "Wrong date"
335
  msgstr " Неправильный формат даты"
336
 
337
  #: related-posts-thumbnails.php:357 related-posts-thumbnails.php:361
 
338
  msgid "Settings update failed"
339
  msgstr "Обновление настроек не удалось"
340
 
341
  #: related-posts-thumbnails.php:434 related-posts-thumbnails.php:438
 
342
  msgid "Categories on which related thumbnails will appear"
343
  msgstr "Категории, в которых будут показаны похожие записи"
344
 
345
  #: related-posts-thumbnails.php:440 related-posts-thumbnails.php:444
 
346
  msgid "Categories that will appear in related thumbnails"
347
  msgstr "Категории, которые будут включены в показ похожих записей"
348
 
349
  #: related-posts-thumbnails.php:446 related-posts-thumbnails.php:450
 
350
  msgid "Include only posts after"
351
  msgstr "Включать только записи после"
352
 
353
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
 
354
  msgid "Year"
355
  msgstr "Год"
356
 
357
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
 
358
  msgid "Month"
359
  msgstr "Месяц"
360
 
361
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
 
362
  msgid "Day"
363
  msgstr "День"
364
 
365
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
 
366
  msgid "Leave empty for all posts dates"
367
  msgstr "Оставьте пустым для всех дат записей"
368
 
369
  #: related-posts-thumbnails.php:592 related-posts-thumbnails.php:603
 
370
  msgid "Random"
371
  msgstr "Произвольно"
372
 
373
- #: related-posts-thumbnails.php:521
374
  msgid "Theme resize url"
375
- msgstr ""
376
 
377
- #: related-posts-thumbnails.php:524
378
  msgid "If your theme resizes images, enter URL to its resizing PHP file"
379
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  #: related-posts-thumbnails.php:148 related-posts-thumbnails.php:194
23
  #: related-posts-thumbnails.php:231 related-posts-thumbnails.php:232
24
  #: related-posts-thumbnails.php:273 related-posts-thumbnails.php:308
25
+ #: related-posts-thumbnails.php:311 related-posts-thumbnails.php:354
26
  msgid "Related Posts Thumbnails"
27
  msgstr ""
28
 
29
  #: related-posts-thumbnails.php:148 related-posts-thumbnails.php:194
30
  #: related-posts-thumbnails.php:231 related-posts-thumbnails.php:232
31
  #: related-posts-thumbnails.php:273 related-posts-thumbnails.php:308
32
+ #: related-posts-thumbnails.php:311 related-posts-thumbnails.php:354
33
  msgid "Related Posts Thumbs"
34
  msgstr ""
35
 
36
  #: related-posts-thumbnails.php:154 related-posts-thumbnails.php:200
37
  #: related-posts-thumbnails.php:237 related-posts-thumbnails.php:238
38
  #: related-posts-thumbnails.php:279 related-posts-thumbnails.php:314
39
+ #: related-posts-thumbnails.php:317 related-posts-thumbnails.php:360
40
  msgid "No access"
41
  msgstr "Нет доступа"
42
 
43
  #: related-posts-thumbnails.php:170 related-posts-thumbnails.php:222
44
  #: related-posts-thumbnails.php:261 related-posts-thumbnails.php:263
45
  #: related-posts-thumbnails.php:305 related-posts-thumbnails.php:354
46
+ #: related-posts-thumbnails.php:358 related-posts-thumbnails.php:403
47
  msgid "Settings updated"
48
  msgstr "Настройки обновлены"
49
 
50
  #: related-posts-thumbnails.php:182 related-posts-thumbnails.php:239
51
  #: related-posts-thumbnails.php:281 related-posts-thumbnails.php:283
52
  #: related-posts-thumbnails.php:326 related-posts-thumbnails.php:404
53
+ #: related-posts-thumbnails.php:408 related-posts-thumbnails.php:464
54
  msgid "Related Posts Thumbnails Settings"
55
  msgstr "Настройки миниатюр похожих записей"
56
 
57
  #: related-posts-thumbnails.php:188 related-posts-thumbnails.php:245
58
  #: related-posts-thumbnails.php:287 related-posts-thumbnails.php:289
59
  #: related-posts-thumbnails.php:332 related-posts-thumbnails.php:410
60
+ #: related-posts-thumbnails.php:414 related-posts-thumbnails.php:470
61
  msgid "General Display Options"
62
  msgstr "Общие свойства отображения"
63
 
68
  #: related-posts-thumbnails.php:194 related-posts-thumbnails.php:251
69
  #: related-posts-thumbnails.php:300 related-posts-thumbnails.php:302
70
  #: related-posts-thumbnails.php:352 related-posts-thumbnails.php:430
71
+ #: related-posts-thumbnails.php:434 related-posts-thumbnails.php:490
72
  msgid "Show on single posts only"
73
  msgstr "Показывать только на отдельной странице"
74
 
75
  #: related-posts-thumbnails.php:198 related-posts-thumbnails.php:280
76
  #: related-posts-thumbnails.php:329 related-posts-thumbnails.php:331
77
  #: related-posts-thumbnails.php:381 related-posts-thumbnails.php:453
78
+ #: related-posts-thumbnails.php:457 related-posts-thumbnails.php:513
79
  msgid "Top text"
80
  msgstr "Верхний текст"
81
 
82
  #: related-posts-thumbnails.php:204 related-posts-thumbnails.php:286
83
  #: related-posts-thumbnails.php:335 related-posts-thumbnails.php:337
84
  #: related-posts-thumbnails.php:387 related-posts-thumbnails.php:459
85
+ #: related-posts-thumbnails.php:463 related-posts-thumbnails.php:519
86
  msgid "Number of similar posts to display"
87
  msgstr "Количество похожих записей для отображения"
88
 
89
  #: related-posts-thumbnails.php:212 related-posts-thumbnails.php:360
90
  #: related-posts-thumbnails.php:409 related-posts-thumbnails.php:411
91
  #: related-posts-thumbnails.php:461 related-posts-thumbnails.php:519
92
+ #: related-posts-thumbnails.php:530 related-posts-thumbnails.php:586
93
  msgid "Style options"
94
  msgstr "Опции стиля"
95
 
96
  #: related-posts-thumbnails.php:215 related-posts-thumbnails.php:363
97
  #: related-posts-thumbnails.php:412 related-posts-thumbnails.php:414
98
  #: related-posts-thumbnails.php:464 related-posts-thumbnails.php:522
99
+ #: related-posts-thumbnails.php:533 related-posts-thumbnails.php:600
100
  msgid "Background color"
101
  msgstr "Цвет заднего фона"
102
 
103
  #: related-posts-thumbnails.php:221 related-posts-thumbnails.php:369
104
  #: related-posts-thumbnails.php:418 related-posts-thumbnails.php:420
105
  #: related-posts-thumbnails.php:470 related-posts-thumbnails.php:528
106
+ #: related-posts-thumbnails.php:539 related-posts-thumbnails.php:606
107
  msgid "Background color on mouse over"
108
  msgstr "Цвет заднего фона при наведении курсора"
109
 
110
  #: related-posts-thumbnails.php:227 related-posts-thumbnails.php:375
111
  #: related-posts-thumbnails.php:424 related-posts-thumbnails.php:426
112
  #: related-posts-thumbnails.php:476 related-posts-thumbnails.php:534
113
+ #: related-posts-thumbnails.php:545 related-posts-thumbnails.php:612
114
  msgid "Border color"
115
  msgstr "Цвет границы"
116
 
117
  #: related-posts-thumbnails.php:233 related-posts-thumbnails.php:381
118
  #: related-posts-thumbnails.php:430 related-posts-thumbnails.php:432
119
  #: related-posts-thumbnails.php:482 related-posts-thumbnails.php:540
120
+ #: related-posts-thumbnails.php:551 related-posts-thumbnails.php:618
121
  msgid "Font color"
122
  msgstr "Цвет шрифта"
123
 
124
  #: related-posts-thumbnails.php:239 related-posts-thumbnails.php:387
125
  #: related-posts-thumbnails.php:436 related-posts-thumbnails.php:438
126
  #: related-posts-thumbnails.php:488 related-posts-thumbnails.php:546
127
+ #: related-posts-thumbnails.php:557 related-posts-thumbnails.php:624
128
  msgid "Font family"
129
  msgstr "Стиль шрифта"
130
 
131
  #: related-posts-thumbnails.php:245 related-posts-thumbnails.php:393
132
  #: related-posts-thumbnails.php:442 related-posts-thumbnails.php:444
133
  #: related-posts-thumbnails.php:494 related-posts-thumbnails.php:552
134
+ #: related-posts-thumbnails.php:563 related-posts-thumbnails.php:630
135
  msgid "Font size"
136
  msgstr "Размер шрифта"
137
 
138
  #: related-posts-thumbnails.php:251 related-posts-thumbnails.php:399
139
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:450
140
  #: related-posts-thumbnails.php:500 related-posts-thumbnails.php:558
141
+ #: related-posts-thumbnails.php:569 related-posts-thumbnails.php:636
142
  msgid "Text maximum length"
143
  msgstr "Максимальная длина текста"
144
 
145
  #: related-posts-thumbnails.php:259 related-posts-thumbnails.php:407
146
  #: related-posts-thumbnails.php:464 related-posts-thumbnails.php:472
147
  #: related-posts-thumbnails.php:522 related-posts-thumbnails.php:580
148
+ #: related-posts-thumbnails.php:591 related-posts-thumbnails.php:658
149
  msgid "Relation Builder Options"
150
  msgstr "Настройки связей"
151
 
152
  #: related-posts-thumbnails.php:262 related-posts-thumbnails.php:410
153
  #: related-posts-thumbnails.php:467 related-posts-thumbnails.php:475
154
  #: related-posts-thumbnails.php:525 related-posts-thumbnails.php:583
155
+ #: related-posts-thumbnails.php:594 related-posts-thumbnails.php:661
156
  msgid "Relation based on"
157
  msgstr "Связи расчитываются на основе"
158
 
161
  #: related-posts-thumbnails.php:470 related-posts-thumbnails.php:306
162
  #: related-posts-thumbnails.php:478 related-posts-thumbnails.php:356
163
  #: related-posts-thumbnails.php:528 related-posts-thumbnails.php:586
164
+ #: related-posts-thumbnails.php:597 related-posts-thumbnails.php:664
165
  msgid "Categories"
166
  msgstr "Категории"
167
 
168
  #: related-posts-thumbnails.php:267 related-posts-thumbnails.php:415
169
  #: related-posts-thumbnails.php:472 related-posts-thumbnails.php:480
170
  #: related-posts-thumbnails.php:530 related-posts-thumbnails.php:588
171
+ #: related-posts-thumbnails.php:599 related-posts-thumbnails.php:666
172
  msgid "Tags"
173
  msgstr "Метки"
174
 
175
  #: related-posts-thumbnails.php:269 related-posts-thumbnails.php:417
176
  #: related-posts-thumbnails.php:474 related-posts-thumbnails.php:482
177
  #: related-posts-thumbnails.php:532 related-posts-thumbnails.php:590
178
+ #: related-posts-thumbnails.php:601 related-posts-thumbnails.php:668
179
  msgid "Categories and Tags"
180
  msgstr "Категории и метки"
181
 
186
  #: related-posts-thumbnails.php:278 related-posts-thumbnails.php:327
187
  #: related-posts-thumbnails.php:376 related-posts-thumbnails.php:378
188
  #: related-posts-thumbnails.php:428 related-posts-thumbnails.php:486
189
+ #: related-posts-thumbnails.php:490 related-posts-thumbnails.php:546
190
  msgid "Post-thumbnails name"
191
  msgstr "Название миниатюры"
192
 
193
  #: related-posts-thumbnails.php:286 related-posts-thumbnails.php:335
194
  #: related-posts-thumbnails.php:384 related-posts-thumbnails.php:386
195
  #: related-posts-thumbnails.php:436 related-posts-thumbnails.php:494
196
+ #: related-posts-thumbnails.php:498 related-posts-thumbnails.php:554
197
  msgid "Your theme has to support post-thumbnails to have more choices"
198
  msgstr ""
199
  "Для более широкого выбора размеров, ваша тема должна поддерживать post-"
202
  #: related-posts-thumbnails.php:291 related-posts-thumbnails.php:292
203
  #: related-posts-thumbnails.php:341 related-posts-thumbnails.php:343
204
  #: related-posts-thumbnails.php:393 related-posts-thumbnails.php:465
205
+ #: related-posts-thumbnails.php:469 related-posts-thumbnails.php:525
206
  msgid "Default image URL"
207
  msgstr "Ссылка на картинку по умолчанию, в случае, если нет миниатюры"
208
 
209
  #: related-posts-thumbnails.php:299 related-posts-thumbnails.php:422
210
  #: related-posts-thumbnails.php:479 related-posts-thumbnails.php:487
211
  #: related-posts-thumbnails.php:537 related-posts-thumbnails.php:597
212
+ #: related-posts-thumbnails.php:608 related-posts-thumbnails.php:675
213
  msgid "Save Changes"
214
  msgstr "Сохранить изменения"
215
 
216
  #: related-posts-thumbnails.php:248 related-posts-thumbnails.php:297
217
  #: related-posts-thumbnails.php:299 related-posts-thumbnails.php:349
218
  #: related-posts-thumbnails.php:427 related-posts-thumbnails.php:431
219
+ #: related-posts-thumbnails.php:487
220
  msgid "Page type"
221
  msgstr "Тип страницы"
222
 
223
  #: related-posts-thumbnails.php:270 related-posts-thumbnails.php:319
224
  #: related-posts-thumbnails.php:321 related-posts-thumbnails.php:371
225
  #: related-posts-thumbnails.php:608 related-posts-thumbnails.php:619
226
+ #: related-posts-thumbnails.php:686
227
  msgid "All"
228
  msgstr "Все"
229
 
236
  #: related-posts-thumbnails.php:471 related-posts-thumbnails.php:483
237
  #: related-posts-thumbnails.php:501 related-posts-thumbnails.php:475
238
  #: related-posts-thumbnails.php:487 related-posts-thumbnails.php:505
239
+ #: related-posts-thumbnails.php:531 related-posts-thumbnails.php:543
240
+ #: related-posts-thumbnails.php:561
241
  msgid "Thumbnails source"
242
  msgstr "Источник миниатюр"
243
 
244
  #: related-posts-thumbnails.php:345 related-posts-thumbnails.php:394
245
  #: related-posts-thumbnails.php:396 related-posts-thumbnails.php:446
246
  #: related-posts-thumbnails.php:504 related-posts-thumbnails.php:508
247
+ #: related-posts-thumbnails.php:564
248
  msgid "Custom field name"
249
  msgstr "Название произвольного поля"
250
 
251
  #: related-posts-thumbnails.php:351 related-posts-thumbnails.php:400
252
  #: related-posts-thumbnails.php:402 related-posts-thumbnails.php:452
253
  #: related-posts-thumbnails.php:510 related-posts-thumbnails.php:514
254
+ #: related-posts-thumbnails.php:570
255
  msgid "Size"
256
  msgstr "Размер"
257
 
258
  #: related-posts-thumbnails.php:353 related-posts-thumbnails.php:402
259
  #: related-posts-thumbnails.php:404 related-posts-thumbnails.php:454
260
  #: related-posts-thumbnails.php:512 related-posts-thumbnails.php:516
261
+ #: related-posts-thumbnails.php:572
262
  msgid "Width"
263
  msgstr "Ширина"
264
 
265
  #: related-posts-thumbnails.php:354 related-posts-thumbnails.php:403
266
  #: related-posts-thumbnails.php:405 related-posts-thumbnails.php:455
267
  #: related-posts-thumbnails.php:513 related-posts-thumbnails.php:517
268
+ #: related-posts-thumbnails.php:573
269
  msgid "Height"
270
  msgstr "Высота"
271
 
272
  #: related-posts-thumbnails.php:426 related-posts-thumbnails.php:483
273
  #: related-posts-thumbnails.php:491 related-posts-thumbnails.php:541
274
  #: related-posts-thumbnails.php:601 related-posts-thumbnails.php:612
275
+ #: related-posts-thumbnails.php:679
276
  msgid ""
277
  "If you experience some problems with this plugin please let me know about it "
278
  "on <a href=\"http://wordpress.shaldybina.com/plugins/related-posts-"
287
 
288
  #: related-posts-thumbnails.php:290 related-posts-thumbnails.php:292
289
  #: related-posts-thumbnails.php:335 related-posts-thumbnails.php:413
290
+ #: related-posts-thumbnails.php:417 related-posts-thumbnails.php:473
291
  msgid "Automatically append to the post content"
292
  msgstr "Автоматически добавлять после записи"
293
 
294
  #: related-posts-thumbnails.php:293 related-posts-thumbnails.php:295
295
  #: related-posts-thumbnails.php:338 related-posts-thumbnails.php:416
296
+ #: related-posts-thumbnails.php:420 related-posts-thumbnails.php:476
297
  msgid ""
298
  "Or use <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> in the Loop"
299
  msgstr ""
300
+ "Или используйте <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> в "
301
+ "цикле темы"
302
 
303
  #: related-posts-thumbnails.php:451 related-posts-thumbnails.php:453
304
  #: related-posts-thumbnails.php:503 related-posts-thumbnails.php:561
305
+ #: related-posts-thumbnails.php:572 related-posts-thumbnails.php:639
306
  msgid "Set 0 for no title"
307
  msgstr "Поставьте 0, чтобы не отображать заголовок"
308
 
309
  #: related-posts-thumbnails.php:455 related-posts-thumbnails.php:457
310
  #: related-posts-thumbnails.php:507 related-posts-thumbnails.php:565
311
+ #: related-posts-thumbnails.php:576 related-posts-thumbnails.php:643
312
  msgid "Excerpt maximum length"
313
  msgstr "Максимальная длина цитаты"
314
 
315
  #: related-posts-thumbnails.php:458 related-posts-thumbnails.php:460
316
  #: related-posts-thumbnails.php:510 related-posts-thumbnails.php:568
317
+ #: related-posts-thumbnails.php:579 related-posts-thumbnails.php:646
318
  msgid "Set 0 for no excerpt"
319
  msgstr "Поставьте 0, чтобы не отображать цитату"
320
 
321
  #: related-posts-thumbnails.php:530 related-posts-thumbnails.php:538
322
  #: related-posts-thumbnails.php:588 related-posts-thumbnails.php:661
323
+ #: related-posts-thumbnails.php:672 related-posts-thumbnails.php:739
324
  msgid "Title:"
325
  msgstr "Заголовок:"
326
 
327
  #: related-posts-thumbnails.php:464 related-posts-thumbnails.php:514
328
  #: related-posts-thumbnails.php:572 related-posts-thumbnails.php:583
329
+ #: related-posts-thumbnails.php:650
330
  msgid "Text block height"
331
  msgstr "Высота текстового блока"
332
 
333
  #: related-posts-thumbnails.php:342 related-posts-thumbnails.php:420
334
+ #: related-posts-thumbnails.php:424 related-posts-thumbnails.php:480
335
  msgid "Developer mode"
336
  msgstr "Режим разработчика"
337
 
338
  #: related-posts-thumbnails.php:345 related-posts-thumbnails.php:423
339
+ #: related-posts-thumbnails.php:427 related-posts-thumbnails.php:483
340
  msgid "This will add debugging information in HTML source"
341
  msgstr "Это добавит отладочную информацию в HTML код"
342
 
343
  #: related-posts-thumbnails.php:322 related-posts-thumbnails.php:325
344
+ #: related-posts-thumbnails.php:368
345
  msgid "Wrong date"
346
  msgstr " Неправильный формат даты"
347
 
348
  #: related-posts-thumbnails.php:357 related-posts-thumbnails.php:361
349
+ #: related-posts-thumbnails.php:406
350
  msgid "Settings update failed"
351
  msgstr "Обновление настроек не удалось"
352
 
353
  #: related-posts-thumbnails.php:434 related-posts-thumbnails.php:438
354
+ #: related-posts-thumbnails.php:494
355
  msgid "Categories on which related thumbnails will appear"
356
  msgstr "Категории, в которых будут показаны похожие записи"
357
 
358
  #: related-posts-thumbnails.php:440 related-posts-thumbnails.php:444
359
+ #: related-posts-thumbnails.php:500
360
  msgid "Categories that will appear in related thumbnails"
361
  msgstr "Категории, которые будут включены в показ похожих записей"
362
 
363
  #: related-posts-thumbnails.php:446 related-posts-thumbnails.php:450
364
+ #: related-posts-thumbnails.php:506
365
  msgid "Include only posts after"
366
  msgstr "Включать только записи после"
367
 
368
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
369
+ #: related-posts-thumbnails.php:508
370
  msgid "Year"
371
  msgstr "Год"
372
 
373
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
374
+ #: related-posts-thumbnails.php:508
375
  msgid "Month"
376
  msgstr "Месяц"
377
 
378
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
379
+ #: related-posts-thumbnails.php:508
380
  msgid "Day"
381
  msgstr "День"
382
 
383
  #: related-posts-thumbnails.php:448 related-posts-thumbnails.php:452
384
+ #: related-posts-thumbnails.php:508
385
  msgid "Leave empty for all posts dates"
386
  msgstr "Оставьте пустым для всех дат записей"
387
 
388
  #: related-posts-thumbnails.php:592 related-posts-thumbnails.php:603
389
+ #: related-posts-thumbnails.php:670
390
  msgid "Random"
391
  msgstr "Произвольно"
392
 
393
+ #: related-posts-thumbnails.php:521 related-posts-thumbnails.php:577
394
  msgid "Theme resize url"
395
+ msgstr "Ссылка на скрипт timthumb"
396
 
397
+ #: related-posts-thumbnails.php:524 related-posts-thumbnails.php:580
398
  msgid "If your theme resizes images, enter URL to its resizing PHP file"
399
+ msgstr "Введите ссылку на скрипт timthumb.php, если ваша тема его поддерживает"
400
+
401
+ #: related-posts-thumbnails.php:589
402
+ msgid "Output style"
403
+ msgstr "Опции вывода"
404
+
405
+ #: related-posts-thumbnails.php:430
406
+ msgid "Blocks"
407
+ msgstr "Блоки"
408
+
409
+ #: related-posts-thumbnails.php:430
410
+ msgid "List"
411
+ msgstr "Список"
412
+
413
+ #: related-posts-thumbnails.php:596
414
+ msgid "Turn off plugin styles"
415
+ msgstr "Отключить стили плагина"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpress.shaldybina.com/donate
4
  Tags: related, posts, thumbnail
5
  Requires at least: 2.9
6
  Tested up to: 3.0
7
- Stable tag: 1.2.6
8
 
9
  Customizable plugin, that nicely displays related posts thumbnails under the post.
10
 
@@ -59,6 +59,9 @@ If there are no images of the specified size in the post, or file does not exist
59
 
60
  == Changelog ==
61
 
 
 
 
62
  = 1.2.6 =
63
  * Fixed relative custom url
64
 
@@ -109,11 +112,14 @@ If there are no images of the specified size in the post, or file does not exist
109
 
110
  == Upgrade Notice ==
111
 
 
 
 
112
  = 1.2.6 =
113
- * Fixed relative custom URL
114
 
115
  = 1.2.5 =
116
- * Fixed selection of categories on plugin settings page
117
 
118
  = 1.2.4 =
119
  Last french version
4
  Tags: related, posts, thumbnail
5
  Requires at least: 2.9
6
  Tested up to: 3.0
7
+ Stable tag: 1.2.7
8
 
9
  Customizable plugin, that nicely displays related posts thumbnails under the post.
10
 
59
 
60
  == Changelog ==
61
 
62
+ = 1.2.7 =
63
+ * Added clean HTML option without plugin CSS, fixed background color change
64
+
65
  = 1.2.6 =
66
  * Fixed relative custom url
67
 
112
 
113
  == Upgrade Notice ==
114
 
115
+ = 1.2.7 =
116
+ Added clean HTML option without plugin CSS, fixed background color change
117
+
118
  = 1.2.6 =
119
+ Fixed relative custom URL
120
 
121
  = 1.2.5 =
122
+ Fixed selection of categories on plugin settings page
123
 
124
  = 1.2.4 =
125
  Last french version
related-posts-thumbnails.php CHANGED
@@ -1,688 +1,746 @@
1
- <?php /*
2
- Plugin Name: Related Posts Thumbnails
3
- Plugin URI: http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/
4
- Description: Showing related posts thumbnails under the post.
5
- Version: 1.2.6
6
- Author: Maria Shaldybina
7
- Author URI: http://shaldybina.com/
8
- */
9
- /* Copyright 2010 Maria I Shaldybina
10
-
11
- This program is free software; you can redistribute it and/or modify
12
- it under the terms of the GNU General Public License as published by
13
- the Free Software Foundation; either version 2 of the License, or
14
- (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
- */
21
- class RelatedPostsThumbnails {
22
- /* Default values. PHP 4 compatible */
23
- var $single_only = '1';
24
- var $auto = '1';
25
- var $top_text = '<h3>Related posts:</h3>';
26
- var $number = 3;
27
- var $relation = 'categories';
28
- var $poststh_name = 'thumbnail';
29
- var $background = '#FFFFFF';
30
- var $hoverbackground = '#EEEEEF';
31
- var $border_color = '#DDDDDD';
32
- var $font_color = '#333333';
33
- var $font_family = 'Arial';
34
- var $font_size = '12';
35
- var $text_length = '100';
36
- var $excerpt_length = '0';
37
- var $custom_field = '';
38
- var $custom_height = '100';
39
- var $custom_width = '100';
40
- var $text_block_height = '75';
41
- var $thsource = 'post-thumbnails';
42
- var $categories_all = '1';
43
- var $devmode = '0';
44
-
45
- function RelatedPostsThumbnails() { // initialization
46
- load_plugin_textdomain( 'related-posts-thumbnails', false, basename( dirname( __FILE__ ) ) . '/locale' );
47
- $this->default_image = WP_PLUGIN_URL . '/related-posts-thumbnails/img/default.png';
48
- if ( get_option( 'relpoststh_auto', $this->auto ) )
49
- add_filter( 'the_content', array( $this, 'auto_show' ) );
50
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
51
- add_shortcode( 'related-posts-thumbnails' , array( $this, 'get_html' ) );
52
- }
53
-
54
- function auto_show( $content ) { // Automatically displaying related posts under post body
55
- return $content . $this->get_html( true );
56
- }
57
-
58
- function get_html( $show_top = false ) { // Getting related posts HTML
59
- if ( $this->is_relpoststh_show() )
60
- return $this->get_thumbnails( $show_top );
61
- return '';
62
- }
63
-
64
- function get_thumbnails( $show_top = false ) { // Retrieve Related Posts HTML for output
65
- $output = '';
66
- $debug = 'Developer mode initialisation;';
67
- $time = microtime(true);
68
- $posts_number = get_option( 'relpoststh_number', $this->number );
69
- if ( $posts_number <= 0 ) // return nothing if this parameter was set to <= 0
70
- return $this->finish_process( $output, $debug . 'Posts number is 0;', $time );
71
- $id = get_the_ID();
72
- $relation = get_option( 'relpoststh_relation', $this->relation );
73
- $poststhname = get_option( 'relpoststh_poststhname', $this->poststhname );
74
- $text_length = get_option( 'relpoststh_textlength', $this->text_length );
75
- $excerpt_length = get_option( 'relpoststh_excerptlength', $this->excerpt_length );
76
- $thsource = get_option( 'relpoststh_thsource', $this->thsource );
77
- $categories_show_all = get_option( 'relpoststh_show_categoriesall',
78
- get_option( 'relpoststh_categoriesall',
79
- $this->categories_all ) );
80
- /* Get random posts according to given rules */
81
- global $wpdb;
82
- $query = "SELECT distinct ID FROM $wpdb->posts ";
83
- $where = " WHERE post_type = 'post' AND post_status = 'publish' AND ID<>" . $id; // not the current post
84
- $startdate = get_option( 'relpoststh_startdate' );
85
- if ( !empty( $startdate ) && preg_match( '/^\d\d\d\d-\d\d-\d\d$/', $startdate ) ) { // If startdate was set
86
- $debug .= "Startdate: $startdate;";
87
- $where .= " AND post_date >= '" . $startdate . "'";
88
- }
89
-
90
- /* Get taxonomy terms */
91
- $join = '';
92
- $whichterm = '';
93
- $select_terms = array();
94
- if ( $categories_show_all != '1') { // if only specific categories were selected
95
- $select_terms = get_option( 'relpoststh_show_categories',
96
- get_option( 'relpoststh_categories' ) );
97
- if ( empty( $select_terms ) ) // if no categories were specified intentionally return nothing
98
- return $this->finish_process( $output, $debug . 'No categories were selected;', $time );
99
- }
100
- $debug .= "Relation: $relation;";
101
- if ( $relation != 'no' ) { // relation was set
102
- if ( !empty( $select_terms ) ) { // intersect categories selected and post's
103
- $debug .= 'With specified categories;';
104
- if ( $relation == 'categories' || $relation == 'both' ) {
105
- $object_terms = wp_get_object_terms( $id, array('category'), array( 'fields' => 'ids' ) );
106
- if ( is_array( $object_terms ) && is_array( $select_terms ) )
107
- $select_terms = array_intersect( $select_terms, $object_terms );
108
- }
109
- if ( $relation == 'tags' || $relation == 'both' ) {
110
- $object_terms = wp_get_object_terms( $id, array( 'post_tag' ), array( 'fields' => 'ids' ) );
111
- $select_terms = array_merge( $select_terms, $object_terms );
112
- }
113
- }
114
- else { // all categories were selected just get everything
115
- if ( $relation == 'categories' )
116
- $taxonomy = array( 'category' );
117
- elseif ( $relation == 'tags' )
118
- $taxonomy = array( 'post_tag' );
119
- else
120
- $taxonomy = array( 'category', 'post_tag' );
121
- $select_terms = wp_get_object_terms( $id, $taxonomy, array( 'fields' => 'ids' ) );
122
- }
123
- if ( !is_array( $select_terms ) || empty( $select_terms ) ) // no terms to get taxonomy
124
- return $this->finish_process( $output, $debug . 'No taxonomy terms to get posts;', $time );
125
- }
126
- if ( !( $relation == 'no' && $categories_show_all == '1' ) ) { // skip join if no relation and show all
127
- $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
128
- $include_terms = "'" . implode( "', '", $select_terms ) . "'";
129
- $whichterm = " AND $wpdb->term_taxonomy.term_id IN ($include_terms) ";
130
- }
131
- $order = " ORDER BY rand() LIMIT " . $posts_number;
132
- $random_posts = $wpdb->get_results( $query . $join . $where . $whichterm . $order );
133
-
134
- /* Get posts by their IDs */
135
- $posts_in = array();
136
- if ( is_array( $random_posts ) && count( $random_posts ) ) {
137
- foreach ( $random_posts as $random_post )
138
- $posts_in[] = $random_post->ID;
139
- }
140
- $posts = array();
141
- $q = new WP_Query;
142
- $posts = $q->query( array( 'caller_get_posts' => true,
143
- 'post__in' => $posts_in,
144
- 'posts_per_page' => $posts_number ) );
145
-
146
- if ( ! ( is_array( $posts ) && count( $posts ) > 0 ) ) { // no posts
147
- $debug .= 'No posts found';
148
- return $this->finish_process( $output, $debug, $time );
149
- }
150
- else
151
- $debug .= 'Found ' . count( $posts ) . ' posts;';
152
-
153
- /* Calculating sizes */
154
- if ( $thsource == 'custom-field' ) {
155
- $debug .= 'Custom sizes;';
156
- $width = get_option( 'relpoststh_customwidth', $this->custom_width );
157
- $height = get_option( 'relpoststh_customheight', $this->custom_height );
158
- }
159
- else { // post-thumbnails source
160
- if ( $poststhname == 'thumbnail' || $poststhname == 'medium' || $poststhname == 'large' ) { // get thumbnail size for basic sizes
161
- $debug .= 'Basic sizes;';
162
- $width = get_option( "{$poststhname}_size_w" );
163
- $height = get_option( "{$poststhname}_size_h" );
164
- }
165
- elseif ( current_theme_supports( 'post-thumbnails' ) ) { // get sizes for theme supported thumbnails
166
- global $_wp_additional_image_sizes;
167
- if ( isset( $_wp_additional_image_sizes[ $poststhname ] ) ) {
168
- $debug .= 'Additional sizes;';
169
- $width = $_wp_additional_image_sizes[ $poststhname ][ 'width' ];
170
- $height = $_wp_additional_image_sizes[ $poststhname ][ 'height' ];
171
- }
172
- else
173
- $debug .= 'No additional sizes;';
174
- }
175
- }
176
- // displaying square if one size is not cropping
177
- if ( $height == 9999 )
178
- $height = $width;
179
- if ( $width == 9999 )
180
- $width = $height;
181
- // theme is not supporting but settings were not changed
182
- if ( empty( $width ) ) {
183
- $debug .= 'Using default width;';
184
- $width = get_option( "thumbnail_size_w" );
185
- }
186
- if ( empty( $height ) ) {
187
- $debug .= 'Using default height;';
188
- $height = get_option( "thumbnail_size_h" );
189
- }
190
- $debug .= 'Got sizes '.$width.'x'.$height.';';
191
- // rendering related posts HTML
192
- if ( $show_top )
193
- $output .= stripslashes( get_option( 'relpoststh_top_text', $this->top_text ) );
194
- $output .= '<div style="clear: both"></div><div style="border: 0pt none ; margin: 0pt; padding: 0pt;">';
195
- foreach( $posts as $post ) {
196
- $image = '';
197
- $url = '';
198
- if ( $thsource == 'custom-field' ) {
199
- $debug .= 'Using custom field;';
200
- $url = get_post_meta( $post->ID, get_option( 'relpoststh_customfield', $this->custom_field ), true );
201
- if (strpos($url, '/wp-content') !== false)
202
- $url = substr($url, strpos($url, '/wp-content'));
203
- $theme_resize_url = get_option( 'relpoststh_theme_resize_url', '' );
204
- if ( !empty( $theme_resize_url ) )
205
- $url = $theme_resize_url . '?src=' . $url . '&w=' . $width . '&h=' . $height . '&zc=1&q=90';
206
- }
207
- else {
208
- $from_post_body = true;
209
- if ( current_theme_supports( 'post-thumbnails' ) ) { // using built in Wordpress feature
210
- $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
211
- $debug .= 'Post-thumbnails enabled in theme;';
212
- if ( $post_thumbnail_id !== false ) { // post has thumbnail
213
- $debug .= 'Post has thumbnail;';
214
- $debug .= 'Postthname: '.$poststhname.';';
215
- $image = wp_get_attachment_image_src( $post_thumbnail_id, $poststhname );
216
- $url = $image[0];
217
- $from_post_body = false;
218
- }
219
- else
220
- $debug .= 'Post has no thumbnail;';
221
- }
222
- if ( $from_post_body ) { // Theme does not support post-thumbnails, or post does not have assigned thumbnail
223
- $debug .= 'Getting image from post body;';
224
- $wud = wp_upload_dir();
225
- preg_match_all( '|<img.*?src=[\'"](' . $wud['baseurl'] . '.*?)[\'"].*?>|i', $post->post_content, $matches ); // searching for the first uploaded image in text
226
- if ( isset( $matches ) ) $image = $matches[1][0];
227
- else
228
- $debug .= 'No image was found;';
229
- if ( strlen( trim( $image ) ) > 0 ) {
230
- $image_sizes = @getimagesize( $image );
231
- if ( $image_sizes === false )
232
- $debug .= 'Unable to determine parsed image size';
233
- if ( $image_sizes !== false && isset( $image_sizes[0] ) && $image_sizes[0] == $width ) { // if this image is the same size as we need
234
- $debug .= 'Image used is the required size;';
235
- $url = $image;
236
- }
237
- else { // if not, search for resized thumbnail according to Wordpress thumbnails naming function
238
- $debug .= 'Changing image according to Wordpress standards;';
239
- $url = preg_replace( '/(-[0-9]+x[0-9]+)?(\.[^\.]*)$/', '-' . $width . 'x' . $height . '$2', $image );
240
- }
241
- }
242
- else
243
- $debug .= 'Found wrong formatted image;';
244
- }
245
- }
246
-
247
- if (strpos($url, '/') === 0)
248
- {
249
- $debug .= 'Relative url: '.$url.';';
250
- $url = get_bloginfo('url') . $url;
251
- }
252
-
253
- $debug .= 'Image URL: '.$url.';';
254
- if ( empty($url) || ( ini_get( 'allow_url_fopen' ) && false === @fopen( $url, 'r' ) ) ) { // parsed URL is empty or no file if can check
255
- $debug .= 'Image is empty or no file. Using default image;';
256
- $url = get_option( 'relpoststh_default_image', $this->default_image );
257
- }
258
-
259
- $title = $this->process_text_cut( $post->post_title, $text_length );
260
- $post_excerpt = ( empty( $post->post_excerpt ) ) ? $post->post_content : $post->post_excerpt;
261
- $excerpt = $this->process_text_cut( $post_excerpt, $excerpt_length );
262
-
263
- if ( !empty($title) && !empty($excerpt) ) {
264
- $title = '<b>' . $title . '</b>';
265
- $excerpt = '<br/>' . $excerpt;
266
- }
267
-
268
- $debug .= 'Using title with size ' . $text_length . '. Using excerpt with size ' . $excerpt_length . ';';
269
- $output .= '<a onmouseout="this.style.backgroundColor=\'' . get_option( 'relpoststh_background', $this->background ) . '\'" onmouseover="this.style.backgroundColor=\'' . get_option( 'relpoststh_hoverbackground', $this->hoverbackground ) . '\'" style="border-right: 1px solid ' . get_option( 'relpoststh_bordercolor', $this->border_color ) . '; border-bottom: medium none; margin: 0pt; padding: 6px; display: block; float: left; text-decoration: none; text-align: left; cursor: pointer;" href="' . get_permalink( $post->ID ) . '">';
270
- $output .= '<div style="border: 0pt none ; margin: 0pt; padding: 0pt; width: ' . $width . 'px; height: ' . ( $height + get_option( 'relpoststh_textblockheight', $this->text_block_height ) ) . 'px;">';
271
- $output .= '<div style="border: 0pt none ; margin: 0pt; padding: 0pt; background: transparent url(' . $url . ') no-repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: ' . $width . 'px; height: ' . $height . 'px;"></div>';
272
- $output .= '<div style="border: 0pt none; margin: 3px 0pt 0pt; padding: 0pt; font-family: ' . get_option( 'relpoststh_fontfamily', $this->font_family ) . '; font-style: normal; font-variant: normal; font-weight: normal; font-size: ' . get_option( 'relpoststh_fontsize', $this->font_size ) . 'px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: ' . get_option( 'relpoststh_fontcolor', $this->font_color ) . ';">' . $title . $excerpt . '</div>';
273
- $output .= '</div>';
274
- $output .= '</a>';
275
-
276
- } // end foreach
277
- $output .= '</div><div style="clear: both"></div>';
278
- return $this->finish_process( $output, $debug, $time );
279
- }
280
-
281
- function finish_process( $output, $debug, $time ) {
282
- $devmode = get_option( 'relpoststh_devmode', $this->devmode );
283
- if ( $devmode ) {
284
- $time = microtime(true) - $time;
285
- $debug .= "Plugin execution time: $time sec;";
286
- $output .= '<!-- '.$debug.' -->';
287
- }
288
- return $output;
289
- }
290
-
291
- function process_text_cut( $text, $length ) {
292
- if ($length == 0)
293
- return '';
294
- else {
295
- $text = strip_shortcodes( strip_tags( $text ) );
296
- return ( ( strlen( $text ) > $length ) ? substr( $text, 0, $length) . '...' : $text );
297
- }
298
- }
299
-
300
- function is_relpoststh_show() { // Checking display options
301
- if ( is_page() || ( ! is_single() && get_option( 'relpoststh_single_only', $this->single_only ) ) ) { // single only
302
- return false;
303
- }
304
- /* Check categories */
305
- $id = get_the_ID();
306
- $categories_all = get_option( 'relpoststh_categoriesall', $this->categories_all );
307
- if ( $categories_all != '1') { // only specific categories were selected
308
- $post_categories = wp_get_object_terms( $id, array( 'category' ), array( 'fields' => 'ids' ) );
309
- $relpoststh_categories = get_option( 'relpoststh_categories' );
310
- if ( !is_array( $relpoststh_categories ) || !is_array( $post_categories ) ) // no categories were selcted or post doesn't belong to any
311
- return false;
312
- $common_categories = array_intersect( $relpoststh_categories, $post_categories );
313
- if ( empty( $common_categories ) ) // post doesn't belong to specified categories
314
- return false;
315
- }
316
- return true;
317
- }
318
-
319
- function admin_menu() {
320
- $page = add_options_page( __( 'Related Posts Thumbnails', 'related-posts-thumbnails' ), __( 'Related Posts Thumbs', 'related-posts-thumbnails' ), 'administrator', 'related-posts-thumbnails', array( $this, 'admin_interface' ) );
321
- }
322
-
323
- function admin_interface() { // Admin interface
324
- if ( $_POST['action'] == 'update' ) {
325
- if ( !current_user_can( 'manage_options' ) ) {
326
- wp_die( __( 'No access', 'related-posts-thumbnails' ) );
327
- }
328
- check_admin_referer( 'related-posts-thumbnails' );
329
- $validation = true;
330
- if ( !empty($_POST['relpoststh_year']) || !empty($_POST['relpoststh_month']) || !empty($_POST['relpoststh_year']) ) { // check date
331
- $set_date = sprintf( '%04d-%02d-%02d', $_POST['relpoststh_year'], $_POST['relpoststh_month'], $_POST['relpoststh_day'] );
332
- if ( checkdate( intval($_POST['relpoststh_month']), intval($_POST['relpoststh_day']), intval($_POST['relpoststh_year']) ) === false ) {
333
- $validation = false;
334
- $error = __( 'Wrong date', 'related-posts-thumbnails' ) . ': ' . sprintf( '%d/%d/%d', $_POST['relpoststh_month'], $_POST['relpoststh_day'], $_POST['relpoststh_year'] );
335
- }
336
- }
337
- else
338
- $set_date = '';
339
- if ( $validation ) {
340
- update_option( 'relpoststh_single_only', $_POST['relpoststh_single_only'] );
341
- update_option( 'relpoststh_auto', $_POST['relpoststh_auto'] );
342
- update_option( 'relpoststh_top_text', $_POST['relpoststh_top_text'] );
343
- update_option( 'relpoststh_number', $_POST['relpoststh_number'] );
344
- update_option( 'relpoststh_relation', $_POST['relpoststh_relation'] );
345
- update_option( 'relpoststh_default_image', $_POST['relpoststh_default_image'] );
346
- update_option( 'relpoststh_poststhname', $_POST['relpoststh_poststhname'] );
347
- update_option( 'relpoststh_background', $_POST['relpoststh_background'] );
348
- update_option( 'relpoststh_hoverbackground', $_POST['relpoststh_hoverbackground'] );
349
- update_option( 'relpoststh_bordercolor', $_POST['relpoststh_bordercolor'] );
350
- update_option( 'relpoststh_fontcolor', $_POST['relpoststh_fontcolor'] );
351
- update_option( 'relpoststh_fontsize', $_POST['relpoststh_fontsize'] );
352
- update_option( 'relpoststh_fontfamily', $_POST['relpoststh_fontfamily'] );
353
- update_option( 'relpoststh_textlength', $_POST['relpoststh_textlength'] );
354
- update_option( 'relpoststh_excerptlength', $_POST['relpoststh_excerptlength'] );
355
- update_option( 'relpoststh_thsource', $_POST['relpoststh_thsource'] );
356
- update_option( 'relpoststh_customfield', $_POST['relpoststh_customfield'] );
357
- update_option( 'relpoststh_theme_resize_url', $_POST['relpoststh_theme_resize_url'] );
358
- update_option( 'relpoststh_customwidth', $_POST['relpoststh_customwidth'] );
359
- update_option( 'relpoststh_customheight', $_POST['relpoststh_customheight'] );
360
- update_option( 'relpoststh_textblockheight', $_POST['relpoststh_textblockheight'] );
361
- update_option( 'relpoststh_categoriesall', $_POST['relpoststh_categoriesall'] );
362
- update_option( 'relpoststh_categories', $_POST['relpoststh_categories'] );
363
- update_option( 'relpoststh_show_categoriesall', $_POST['relpoststh_show_categoriesall'] );
364
- update_option( 'relpoststh_show_categories', $_POST['relpoststh_show_categories'] );
365
- update_option( 'relpoststh_devmode', $_POST['relpoststh_devmode'] );
366
- update_option( 'relpoststh_startdate', $set_date );
367
- echo "<div class='updated fade'><p>" . __( 'Settings updated', 'related-posts-thumbnails' ) ."</p></div>";
368
- }
369
- else {
370
- echo "<div class='error fade'><p>" . __( 'Settings update failed', 'related-posts-thumbnails' ) . '. '. $error . "</p></div>";
371
- }
372
- }
373
- $available_sizes = array( 'thumbnail' => 'thumbnail', 'medium' => 'medium' );
374
- if ( current_theme_supports( 'post-thumbnails' ) ) {
375
- global $_wp_additional_image_sizes;
376
- if ( is_array($_wp_additional_image_sizes ) ) {
377
- $available_sizes = array_merge( $available_sizes, $_wp_additional_image_sizes );
378
- }
379
- }
380
- $relpoststh_single_only = get_option( 'relpoststh_single_only', $this->single_only );
381
- $relpoststh_auto = get_option( 'relpoststh_auto', $this->auto );
382
- $relpoststh_relation = get_option( 'relpoststh_relation', $this->relation );
383
- $relpoststh_thsource = get_option( 'relpoststh_thsource', $this->thsource );
384
- $relpoststh_devmode = get_option( 'relpoststh_devmode', $this->devmode );
385
- $relpoststh_categoriesall = get_option( 'relpoststh_categoriesall', $this->categories_all );
386
- $relpoststh_categories = get_option( 'relpoststh_categories' );
387
- $relpoststh_show_categories = get_option( 'relpoststh_show_categories', get_option( 'relpoststh_categories' ) );
388
- $relpoststh_show_categoriesall = get_option( 'relpoststh_show_categoriesall', $relpoststh_categoriesall );
389
- $relpoststh_startdate = explode( '-', get_option( 'relpoststh_startdate' ) );
390
- $thsources = array( 'post-thumbnails' => 'Post thumbnails', 'custom-field' => 'Custom field' );
391
- $categories = get_categories();
392
- ?>
393
- <script type="text/javascript">
394
- jQuery(document).ready(function($) {
395
- $(".select_all").click(function(){
396
- if (this.checked) {
397
- $(this).parent().find("div.select_specific").hide();
398
- }
399
- else {
400
- $(this).parent().find("div.select_specific").show();
401
- }
402
- });
403
- $('#relpoststh_thsource').change(function(){
404
- if (this.value == 'post-thumbnails') {
405
- $('#relpoststh-post-thumbnails').show();
406
- $('#relpoststh-custom-field').hide();
407
- }
408
- else {
409
- $('#relpoststh-post-thumbnails').hide();
410
- $('#relpoststh-custom-field').show();
411
- }
412
- });
413
- });
414
- </script>
415
- <div class="wrap">
416
- <div class="icon32" id="icon-options-general"><br></div>
417
- <h2><?php _e( 'Related Posts Thumbnails Settings', 'related-posts-thumbnails' ); ?></h2>
418
- <form action="?page=related-posts-thumbnails" method="POST">
419
- <input type="hidden" name="action" value="update" />
420
- <?php wp_nonce_field( 'related-posts-thumbnails' ); ?>
421
- <div class="metabox-holder">
422
- <div class="postbox">
423
- <h3><?php _e( 'General Display Options', 'related-posts-thumbnails' ); ?>:</h3>
424
- <table class="form-table">
425
- <tr valign="top">
426
- <th scope="row"><?php _e( 'Automatically append to the post content', 'related-posts-thumbnails' ); ?>:</th>
427
- <td>
428
- <input type="checkbox" name="relpoststh_auto" id="relpoststh_auto" value="1" <?php if ( $relpoststh_auto ) echo 'checked="checked"'; ?>/>
429
- <label for="relpoststh_auto"><?php _e( 'Or use <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> in the Loop', 'related-posts-thumbnails' ); ?></label><br />
430
- </td>
431
- </tr>
432
- <tr valign="top">
433
- <th scope="row"><?php _e( 'Developer mode', 'related-posts-thumbnails' ); ?>:</th>
434
- <td>
435
- <input type="checkbox" name="relpoststh_devmode" id="relpoststh_devmode" value="1" <?php if ( $relpoststh_devmode ) echo 'checked="checked"'; ?>/>
436
- <label for="relpoststh_devmode"><?php _e( 'This will add debugging information in HTML source', 'related-posts-thumbnails' ); ?></label><br />
437
- </td>
438
- </tr>
439
- <tr valign="top">
440
- <th scope="row"><?php _e( 'Page type', 'related-posts-thumbnails' ); ?>:</th>
441
- <td>
442
- <input type="checkbox" name="relpoststh_single_only" id="relpoststh_single_only" value="1" <?php if ( $relpoststh_single_only ) echo 'checked="checked"'; ?>/>
443
- <label for="relpoststh_single_only"><?php _e( 'Show on single posts only', 'related-posts-thumbnails' ); ?></label><br />
444
- </td>
445
- </tr>
446
- <tr valign="top">
447
- <th scope="row"><?php _e( 'Categories on which related thumbnails will appear', 'related-posts-thumbnails' ); ?>:</th>
448
- <td>
449
- <?php $this->display_categories_list( $relpoststh_categoriesall, $categories, $relpoststh_categories, 'relpoststh_categoriesall', 'relpoststh_categories' ); ?>
450
- </td>
451
- </tr>
452
- <tr valign="top">
453
- <th scope="row"><?php _e( 'Categories that will appear in related thumbnails', 'related-posts-thumbnails' ); ?>:</th>
454
- <td>
455
- <?php $this->display_categories_list( $relpoststh_show_categoriesall, $categories, $relpoststh_show_categories, 'relpoststh_show_categoriesall', 'relpoststh_show_categories' ); ?>
456
- </td>
457
- </tr>
458
- <tr>
459
- <th scope="row"><?php _e( 'Include only posts after', 'related-posts-thumbnails' ); ?>:</th>
460
- <td>
461
- <?php _e( 'Year' ); ?>: <input type="text" name="relpoststh_year" size="4" value="<?php echo $relpoststh_startdate[0]; ?>"> <?php _e( 'Month' ); ?>: <input type="text" name="relpoststh_month" size="2" value="<?php echo $relpoststh_startdate[1]; ?>"> <?php _e( 'Day' ); ?>: <input type="text" name="relpoststh_day" size="2" value="<?php echo $relpoststh_startdate[2]; ?>"> <label for="relpoststh_excerptlength"><?php _e( 'Leave empty for all posts dates', 'related-posts-thumbnails' ); ?></label><br />
462
-
463
- </td>
464
- </tr>
465
- <tr>
466
- <th scope="row"><?php _e( 'Top text', 'related-posts-thumbnails' ); ?>:</th>
467
- <td>
468
- <input type="text" name="relpoststh_top_text" value="<?php echo stripslashes( htmlspecialchars( get_option( 'relpoststh_top_text', $this->top_text ) ) ); ?>" size="50"/>
469
- </td>
470
- </tr>
471
- <tr>
472
- <th scope="row"><?php _e( 'Number of similar posts to display', 'related-posts-thumbnails' ); ?>:</th>
473
- <td>
474
- <input type="text" name="relpoststh_number" value="<?php echo get_option( 'relpoststh_number', $this->number ); ?>" size="2"/>
475
- </td>
476
- </tr>
477
- <tr>
478
- <th scope="row"><?php _e( 'Default image URL', 'related-posts-thumbnails' ); ?>:</th>
479
- <td>
480
- <input type="text" name="relpoststh_default_image" value="<?php echo get_option('relpoststh_default_image', $this->default_image );?>" size="50"/>
481
- </td>
482
- </tr>
483
- <tr>
484
- <th scope="row"><?php _e( 'Thumbnails source', 'related-posts-thumbnails' ); ?>:</th>
485
- <td>
486
- <select name="relpoststh_thsource" id="relpoststh_thsource">
487
- <?php foreach ( $thsources as $name => $title ) : ?>
488
- <option value="<?php echo $name; ?>" <?php if ( $relpoststh_thsource == $name ) echo 'selected'; ?>><?php echo $title; ?></option>
489
- <?php endforeach; ?>
490
- </select>
491
- </td>
492
- </tr>
493
- </table>
494
- </div>
495
- <div class="postbox" id="relpoststh-post-thumbnails" <?php if ( $relpoststh_thsource != 'post-thumbnails' ) : ?> style="display:none" <?php endif; ?>>
496
- <h3><?php _e( 'Thumbnails source', 'related-posts-thumbnails' ); ?>:</h3>
497
- <table class="form-table">
498
- <tr valign="top">
499
- <th scope="row"><?php _e( 'Post-thumbnails name', 'related-posts-thumbnails' ); ?>:</th>
500
- <td>
501
- <select name="relpoststh_poststhname">
502
- <?php foreach ( $available_sizes as $size_name => $size ) : ?>
503
- <option <?php if ( $size_name == get_option('relpoststh_poststhname', $this->poststhname) ) echo 'selected'; ?>><?php echo $size_name; ?></option>
504
- <?php endforeach; ?>
505
- </select>
506
- <?php if ( !current_theme_supports( 'post-thumbnails' ) ) : ?>
507
- (<?php _e( 'Your theme has to support post-thumbnails to have more choices', 'related-posts-thumbnails' ); ?>)
508
- <?php endif; ?>
509
- </td>
510
- </tr>
511
- </table>
512
- </div>
513
- <div class="postbox" id="relpoststh-custom-field" <?php if ( $relpoststh_thsource != 'custom-field' ) : ?> style="display:none" <?php endif; ?>>
514
- <h3><?php _e( 'Thumbnails source', 'related-posts-thumbnails' ); ?>:</h3>
515
- <table class="form-table">
516
- <tr valign="top">
517
- <th scope="row"><?php _e( 'Custom field name', 'related-posts-thumbnails' ); ?>:</th>
518
- <td>
519
- <input type="text" name="relpoststh_customfield" value="<?php echo get_option('relpoststh_customfield', $this->custom_field );?>" size="50"/>
520
- </td>
521
- </tr>
522
- <tr valign="top">
523
- <th scope="row"><?php _e( 'Size', 'related-posts-thumbnails' ); ?>:</th>
524
- <td>
525
- <?php _e( 'Width', 'related-posts-thumbnails' ); ?>: <input type="text" name="relpoststh_customwidth" value="<?php echo get_option('relpoststh_customwidth', $this->custom_width );?>" size="3"/>px x
526
- <?php _e( 'Height', 'related-posts-thumbnails' ); ?>: <input type="text" name="relpoststh_customheight" value="<?php echo get_option('relpoststh_customheight', $this->custom_height );?>" size="3"/>px
527
- </td>
528
- </tr>
529
- <tr valign="top">
530
- <th scope="row"><?php _e( 'Theme resize url', 'related-posts-thumbnails' ); ?>:</th>
531
- <td>
532
- <input type="text" name="relpoststh_theme_resize_url" value="<?php echo get_option('relpoststh_theme_resize_url', '' );?>" size="50"/>
533
- (<?php _e( 'If your theme resizes images, enter URL to its resizing PHP file', 'related-posts-thumbnails' ); ?>)
534
- </td>
535
- </tr>
536
- </table>
537
- </div>
538
- <div class="postbox">
539
- <h3><?php _e( 'Style options', 'related-posts-thumbnails' ); ?>:</h3>
540
- <table class="form-table">
541
- <tr valign="top">
542
- <th scope="row"><?php _e( 'Background color', 'related-posts-thumbnails' ); ?>:</th>
543
- <td>
544
- <input type="text" name="relpoststh_background" value="<?php echo get_option( 'relpoststh_background', $this->background ); ?>" size="7"/>
545
- </td>
546
- </tr>
547
- <tr valign="top">
548
- <th scope="row"><?php _e( 'Background color on mouse over', 'related-posts-thumbnails' ); ?>:</th>
549
- <td>
550
- <input type="text" name="relpoststh_hoverbackground" value="<?php echo get_option( 'relpoststh_hoverbackground', $this->hoverbackground ); ?>" size="7"/>
551
- </td>
552
- </tr>
553
- <tr valign="top">
554
- <th scope="row"><?php _e( 'Border color', 'related-posts-thumbnails' ); ?>:</th>
555
- <td>
556
- <input type="text" name="relpoststh_bordercolor" value="<?php echo get_option( 'relpoststh_bordercolor', $this->border_color )?>" size="7"/>
557
- </td>
558
- </tr>
559
- <tr valign="top">
560
- <th scope="row"><?php _e( 'Font color', 'related-posts-thumbnails' ); ?>:</th>
561
- <td>
562
- <input type="text" name="relpoststh_fontcolor" value="<?php echo get_option( 'relpoststh_fontcolor', $this->font_color ); ?>" size="7"/>
563
- </td>
564
- </tr>
565
- <tr valign="top">
566
- <th scope="row"><?php _e( 'Font family', 'related-posts-thumbnails' ); ?>:</th>
567
- <td>
568
- <input type="text" name="relpoststh_fontfamily" value="<?php echo get_option( 'relpoststh_fontfamily', $this->font_family )?>" size="50"/>
569
- </td>
570
- </tr>
571
- <tr valign="top">
572
- <th scope="row"><?php _e( 'Font size', 'related-posts-thumbnails' ); ?>:</th>
573
- <td>
574
- <input type="text" name="relpoststh_fontsize" value="<?php echo get_option( 'relpoststh_fontsize', $this->font_size )?>" size="7"/>
575
- </td>
576
- </tr>
577
- <tr valign="top">
578
- <th scope="row"><?php _e( 'Text maximum length', 'related-posts-thumbnails' ); ?>:</th>
579
- <td>
580
- <input type="text" name="relpoststh_textlength" value="<?php echo get_option( 'relpoststh_textlength', $this->text_length )?>" size="7"/>
581
- <label for="relpoststh_textlength"><?php _e( 'Set 0 for no title', 'related-posts-thumbnails' ); ?></label><br />
582
- </td>
583
- </tr>
584
- <tr valign="top">
585
- <th scope="row"><?php _e( 'Excerpt maximum length', 'related-posts-thumbnails' ); ?>:</th>
586
- <td>
587
- <input type="text" name="relpoststh_excerptlength" value="<?php echo get_option( 'relpoststh_excerptlength', $this->excerpt_length )?>" size="7"/>
588
- <label for="relpoststh_excerptlength"><?php _e( 'Set 0 for no excerpt', 'related-posts-thumbnails' ); ?></label><br />
589
- </td>
590
- </tr>
591
- <tr valign="top">
592
- <th scope="row"><?php _e( 'Text block height', 'related-posts-thumbnails' ); ?>:</th>
593
- <td>
594
- <input type="text" name="relpoststh_textblockheight" value="<?php echo get_option( 'relpoststh_textblockheight', $this->text_block_height )?>" size="7"/> px
595
- </td>
596
- </tr>
597
- </table>
598
- </div>
599
- <div class="postbox">
600
- <h3><?php _e( 'Relation Builder Options', 'related-posts-thumbnails' ); ?>:</h3>
601
- <table class="form-table">
602
- <tr valign="top">
603
- <th scope="row"><?php _e( 'Relation based on', 'related-posts-thumbnails' ); ?>:</th>
604
- <td>
605
- <input type="radio" name="relpoststh_relation" id="relpoststh_relation_categories" value="categories" <?php if ( $relpoststh_relation == 'categories' ) echo 'checked="checked"'; ?>/>
606
- <label for="relpoststh_relation_categories"><?php _e( 'Categories', 'related-posts-thumbnails' ); ?></label><br />
607
- <input type="radio" name="relpoststh_relation" id="relpoststh_relation_tags" value="tags" <?php if ( $relpoststh_relation == 'tags' ) echo 'checked="checked"'; ?>/>
608
- <label for="relpoststh_relation_tags"><?php _e( 'Tags', 'related-posts-thumbnails' ); ?></label><br />
609
- <input type="radio" name="relpoststh_relation" id="relpoststh_relation_both" value="both" <?php if ( $relpoststh_relation == 'both' ) echo 'checked="checked"'; ?>/>
610
- <label for="relpoststh_relation_both"><?php _e( 'Categories and Tags', 'related-posts-thumbnails' ); ?></label><br />
611
- <input type="radio" name="relpoststh_relation" id="relpoststh_relation_no" value="no" <?php if ( $relpoststh_relation == 'no' ) echo 'checked="checked"'; ?>/>
612
- <label for="relpoststh_relation_no"><?php _e( 'Random', 'related-posts-thumbnails' ); ?></label><br />
613
- </td>
614
- </tr>
615
- </table>
616
- </div>
617
- <input name="Submit" value="<?php _e( 'Save Changes', 'related-posts-thumbnails' ); ?>" type="submit">
618
- </div>
619
- </form>
620
- </div>
621
- <p style="margin-top: 40px;"><small><?php _e('If you experience some problems with this plugin please let me know about it on <a href="http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/">Plugin\'s homepage</a>. If you think this plugin is awesome please vote on <a href="http://wordpress.org/extend/plugins/related-posts-thumbnails/">Wordpress plugin page</a>. Thanks!', 'related-posts-thumbnails' ); ?></small></p>
622
- <?php
623
- }
624
-
625
- function display_categories_list( $categoriesall, $categories, $selected_categories, $all_name, $specific_name ) {
626
- ?>
627
- <input id="<?php echo $all_name; ?>" class="select_all" type="checkbox" name="<?php echo $all_name; ?>" value="1" <?php if ( $categoriesall == '1' ) echo 'checked="checked"'; ?>/>
628
- <label for="<?php echo $all_name; ?>"><?php _e( 'All', 'related-posts-thumbnails' ); ?></label>
629
- <div class="select_specific" <?php if ( $categoriesall == '1' ) : ?> style="display:none" <?php endif; ?>>
630
- <?php foreach ( $categories as $category ) : ?>
631
- <input type="checkbox" name="<?php echo $specific_name; ?>[]" id="<?php echo $specific_name; ?>_<?php echo $category->category_nicename; ?>" value="<?php echo $category->cat_ID; ?>" <?php if ( in_array( $category->cat_ID, (array)$selected_categories ) ) echo 'checked="checked"'; ?>/>
632
- <label for="<?php echo $specific_name; ?>_<?php echo $category->category_nicename; ?>"><?php echo $category->cat_name; ?></label><br />
633
- <?php endforeach; ?>
634
- </div>
635
- <?php
636
- }
637
- }
638
-
639
- add_action( 'init', 'related_posts_thumbnails' );
640
-
641
- function related_posts_thumbnails() {
642
- global $related_posts_thumbnails;
643
- $related_posts_thumbnails = new RelatedPostsThumbnails();
644
- }
645
-
646
- function get_related_posts_thumbnails()
647
- {
648
- global $related_posts_thumbnails;
649
- echo $related_posts_thumbnails->get_html();
650
- }
651
-
652
- /**
653
- * Related Posts Widget, will be displayed on post page
654
- */
655
- class RelatedPostsThumbnailsWidget extends WP_Widget {
656
- function RelatedPostsThumbnailsWidget() {
657
- parent::WP_Widget(false, $name = 'Related Posts Thumbnails');
658
- }
659
-
660
- function widget($args, $instance) {
661
- if ( is_single() && !is_page() ) { // display on post page only
662
- extract( $args );
663
- $title = apply_filters('widget_title', $instance['title']);
664
- echo $before_widget;
665
- if ( $title )
666
- echo $before_title . $title . $after_title;
667
- get_related_posts_thumbnails();
668
- echo $after_widget;
669
- }
670
- }
671
-
672
- function update($new_instance, $old_instance) {
673
- $instance = $old_instance;
674
- $instance['title'] = strip_tags($new_instance['title']);
675
- return $instance;
676
- }
677
-
678
- function form($instance) {
679
- $title = esc_attr($instance['title']);
680
- ?>
681
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
682
- <?php
683
- }
684
-
685
- } // class RelatedPostsThumbnailsWidget
686
-
687
- add_action( 'widgets_init', create_function( '', 'return register_widget("RelatedPostsThumbnailsWidget");' ) );
688
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /*
2
+ Plugin Name: Related Posts Thumbnails
3
+ Plugin URI: http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/
4
+ Description: Showing related posts thumbnails under the post.
5
+ Version: 1.2.7
6
+ Author: Maria Shaldybina
7
+ Author URI: http://shaldybina.com/
8
+ */
9
+ /* Copyright 2010 Maria I Shaldybina
10
+
11
+ This program is free software; you can redistribute it and/or modify
12
+ it under the terms of the GNU General Public License as published by
13
+ the Free Software Foundation; either version 2 of the License, or
14
+ (at your option) any later version.
15
+
16
+ This program is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+ */
21
+ class RelatedPostsThumbnails {
22
+ /* Default values. PHP 4 compatible */
23
+ var $single_only = '1';
24
+ var $auto = '1';
25
+ var $top_text = '<h3>Related posts:</h3>';
26
+ var $number = 3;
27
+ var $relation = 'categories';
28
+ var $poststh_name = 'thumbnail';
29
+ var $background = '#FFFFFF';
30
+ var $hoverbackground = '#EEEEEF';
31
+ var $border_color = '#DDDDDD';
32
+ var $font_color = '#333333';
33
+ var $font_family = 'Arial';
34
+ var $font_size = '12';
35
+ var $text_length = '100';
36
+ var $excerpt_length = '0';
37
+ var $custom_field = '';
38
+ var $custom_height = '100';
39
+ var $custom_width = '100';
40
+ var $text_block_height = '75';
41
+ var $thsource = 'post-thumbnails';
42
+ var $categories_all = '1';
43
+ var $devmode = '0';
44
+ var $output_style = 'div';
45
+
46
+ function RelatedPostsThumbnails() { // initialization
47
+ load_plugin_textdomain( 'related-posts-thumbnails', false, basename( dirname( __FILE__ ) ) . '/locale' );
48
+ $this->default_image = WP_PLUGIN_URL . '/related-posts-thumbnails/img/default.png';
49
+ if ( get_option( 'relpoststh_auto', $this->auto ) )
50
+ add_filter( 'the_content', array( $this, 'auto_show' ) );
51
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
52
+ add_shortcode( 'related-posts-thumbnails' , array( $this, 'get_html' ) );
53
+ }
54
+
55
+ function auto_show( $content ) { // Automatically displaying related posts under post body
56
+ return $content . $this->get_html( true );
57
+ }
58
+
59
+ function get_html( $show_top = false ) { // Getting related posts HTML
60
+ if ( $this->is_relpoststh_show() )
61
+ return $this->get_thumbnails( $show_top );
62
+ return '';
63
+ }
64
+
65
+ function get_thumbnails( $show_top = false ) { // Retrieve Related Posts HTML for output
66
+ $output = '';
67
+ $debug = 'Developer mode initialisation;';
68
+ $time = microtime(true);
69
+ $posts_number = get_option( 'relpoststh_number', $this->number );
70
+ if ( $posts_number <= 0 ) // return nothing if this parameter was set to <= 0
71
+ return $this->finish_process( $output, $debug . 'Posts number is 0;', $time );
72
+ $id = get_the_ID();
73
+ $relation = get_option( 'relpoststh_relation', $this->relation );
74
+ $poststhname = get_option( 'relpoststh_poststhname', $this->poststhname );
75
+ $text_length = get_option( 'relpoststh_textlength', $this->text_length );
76
+ $excerpt_length = get_option( 'relpoststh_excerptlength', $this->excerpt_length );
77
+ $thsource = get_option( 'relpoststh_thsource', $this->thsource );
78
+ $categories_show_all = get_option( 'relpoststh_show_categoriesall',
79
+ get_option( 'relpoststh_categoriesall',
80
+ $this->categories_all ) );
81
+ /* Get random posts according to given rules */
82
+ global $wpdb;
83
+ $query = "SELECT distinct ID FROM $wpdb->posts ";
84
+ $where = " WHERE post_type = 'post' AND post_status = 'publish' AND ID<>" . $id; // not the current post
85
+ $startdate = get_option( 'relpoststh_startdate' );
86
+ if ( !empty( $startdate ) && preg_match( '/^\d\d\d\d-\d\d-\d\d$/', $startdate ) ) { // If startdate was set
87
+ $debug .= "Startdate: $startdate;";
88
+ $where .= " AND post_date >= '" . $startdate . "'";
89
+ }
90
+
91
+ /* Get taxonomy terms */
92
+ $join = '';
93
+ $whichterm = '';
94
+ $select_terms = array();
95
+ if ( $categories_show_all != '1') { // if only specific categories were selected
96
+ $select_terms = get_option( 'relpoststh_show_categories',
97
+ get_option( 'relpoststh_categories' ) );
98
+ if ( empty( $select_terms ) ) // if no categories were specified intentionally return nothing
99
+ return $this->finish_process( $output, $debug . 'No categories were selected;', $time );
100
+ }
101
+ $debug .= "Relation: $relation;";
102
+ if ( $relation != 'no' ) { // relation was set
103
+ if ( !empty( $select_terms ) ) { // intersect categories selected and post's
104
+ $debug .= 'With specified categories;';
105
+ if ( $relation == 'categories' || $relation == 'both' ) {
106
+ $object_terms = wp_get_object_terms( $id, array('category'), array( 'fields' => 'ids' ) );
107
+ if ( is_array( $object_terms ) && is_array( $select_terms ) )
108
+ $select_terms = array_intersect( $select_terms, $object_terms );
109
+ }
110
+ if ( $relation == 'tags' || $relation == 'both' ) {
111
+ $object_terms = wp_get_object_terms( $id, array( 'post_tag' ), array( 'fields' => 'ids' ) );
112
+ $select_terms = array_merge( $select_terms, $object_terms );
113
+ }
114
+ }
115
+ else { // all categories were selected just get everything
116
+ if ( $relation == 'categories' )
117
+ $taxonomy = array( 'category' );
118
+ elseif ( $relation == 'tags' )
119
+ $taxonomy = array( 'post_tag' );
120
+ else
121
+ $taxonomy = array( 'category', 'post_tag' );
122
+ $select_terms = wp_get_object_terms( $id, $taxonomy, array( 'fields' => 'ids' ) );
123
+ }
124
+ if ( !is_array( $select_terms ) || empty( $select_terms ) ) // no terms to get taxonomy
125
+ return $this->finish_process( $output, $debug . 'No taxonomy terms to get posts;', $time );
126
+ }
127
+ if ( !( $relation == 'no' && $categories_show_all == '1' ) ) { // skip join if no relation and show all
128
+ $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
129
+ $include_terms = "'" . implode( "', '", $select_terms ) . "'";
130
+ $whichterm = " AND $wpdb->term_taxonomy.term_id IN ($include_terms) ";
131
+ }
132
+ $order = " ORDER BY rand() LIMIT " . $posts_number;
133
+ $random_posts = $wpdb->get_results( $query . $join . $where . $whichterm . $order );
134
+
135
+ /* Get posts by their IDs */
136
+ $posts_in = array();
137
+ if ( is_array( $random_posts ) && count( $random_posts ) ) {
138
+ foreach ( $random_posts as $random_post )
139
+ $posts_in[] = $random_post->ID;
140
+ }
141
+ $posts = array();
142
+ $q = new WP_Query;
143
+ $posts = $q->query( array( 'caller_get_posts' => true,
144
+ 'post__in' => $posts_in,
145
+ 'posts_per_page' => $posts_number ) );
146
+ if ( ! ( is_array( $posts ) && count( $posts ) > 0 ) ) { // no posts
147
+ $debug .= 'No posts found';
148
+ return $this->finish_process( $output, $debug, $time );
149
+ }
150
+ else
151
+ $debug .= 'Found ' . count( $posts ) . ' posts;';
152
+
153
+ /* Calculating sizes */
154
+ if ( $thsource == 'custom-field' ) {
155
+ $debug .= 'Custom sizes;';
156
+ $width = get_option( 'relpoststh_customwidth', $this->custom_width );
157
+ $height = get_option( 'relpoststh_customheight', $this->custom_height );
158
+ }
159
+ else { // post-thumbnails source
160
+ if ( $poststhname == 'thumbnail' || $poststhname == 'medium' || $poststhname == 'large' ) { // get thumbnail size for basic sizes
161
+ $debug .= 'Basic sizes;';
162
+ $width = get_option( "{$poststhname}_size_w" );
163
+ $height = get_option( "{$poststhname}_size_h" );
164
+ }
165
+ elseif ( current_theme_supports( 'post-thumbnails' ) ) { // get sizes for theme supported thumbnails
166
+ global $_wp_additional_image_sizes;
167
+ if ( isset( $_wp_additional_image_sizes[ $poststhname ] ) ) {
168
+ $debug .= 'Additional sizes;';
169
+ $width = $_wp_additional_image_sizes[ $poststhname ][ 'width' ];
170
+ $height = $_wp_additional_image_sizes[ $poststhname ][ 'height' ];
171
+ }
172
+ else
173
+ $debug .= 'No additional sizes;';
174
+ }
175
+ }
176
+ // displaying square if one size is not cropping
177
+ if ( $height == 9999 )
178
+ $height = $width;
179
+ if ( $width == 9999 )
180
+ $width = $height;
181
+ // theme is not supporting but settings were not changed
182
+ if ( empty( $width ) ) {
183
+ $debug .= 'Using default width;';
184
+ $width = get_option( "thumbnail_size_w" );
185
+ }
186
+ if ( empty( $height ) ) {
187
+ $debug .= 'Using default height;';
188
+ $height = get_option( "thumbnail_size_h" );
189
+ }
190
+ $debug .= 'Got sizes '.$width.'x'.$height.';';
191
+ // rendering related posts HTML
192
+ if ( $show_top )
193
+ $output .= stripslashes( get_option( 'relpoststh_top_text', $this->top_text ) );
194
+ $relpoststh_output_style = get_option( 'relpoststh_output_style', $this->output_style );
195
+ $relpoststh_cleanhtml = get_option( 'relpoststh_cleanhtml', 0 );
196
+ $text_height = get_option( 'relpoststh_textblockheight', $this->text_block_height );
197
+ if ($relpoststh_output_style == 'list') {
198
+ $output .= '<ul id="related_posts_thumbnails"';
199
+ if (!$relpoststh_cleanhtml)
200
+ $output .= ' style="list-style-type:none; list-style-position: inside; padding: 0; margin:0"';
201
+ $output .= '>';
202
+ }
203
+ else
204
+ $output .= '<div style="clear: both"></div><div style="border: 0pt none ; margin: 0pt; padding: 0pt;">';
205
+ foreach( $posts as $post ) {
206
+ $image = '';
207
+ $url = '';
208
+ if ( $thsource == 'custom-field' ) {
209
+ $debug .= 'Using custom field;';
210
+ $url = get_post_meta( $post->ID, get_option( 'relpoststh_customfield', $this->custom_field ), true );
211
+ if (strpos($url, '/wp-content') !== false)
212
+ $url = substr($url, strpos($url, '/wp-content'));
213
+ $theme_resize_url = get_option( 'relpoststh_theme_resize_url', '' );
214
+ if ( !empty( $theme_resize_url ) )
215
+ $url = $theme_resize_url . '?src=' . $url . '&w=' . $width . '&h=' . $height . '&zc=1&q=90';
216
+ }
217
+ else {
218
+ $from_post_body = true;
219
+ if ( current_theme_supports( 'post-thumbnails' ) ) { // using built in Wordpress feature
220
+ $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
221
+ $debug .= 'Post-thumbnails enabled in theme;';
222
+ if ( $post_thumbnail_id !== false ) { // post has thumbnail
223
+ $debug .= 'Post has thumbnail;';
224
+ $debug .= 'Postthname: '.$poststhname.';';
225
+ $image = wp_get_attachment_image_src( $post_thumbnail_id, $poststhname );
226
+ $url = $image[0];
227
+ $from_post_body = false;
228
+ }
229
+ else
230
+ $debug .= 'Post has no thumbnail;';
231
+ }
232
+ if ( $from_post_body ) { // Theme does not support post-thumbnails, or post does not have assigned thumbnail
233
+ $debug .= 'Getting image from post body;';
234
+ $wud = wp_upload_dir();
235
+ preg_match_all( '|<img.*?src=[\'"](' . $wud['baseurl'] . '.*?)[\'"].*?>|i', $post->post_content, $matches ); // searching for the first uploaded image in text
236
+ if ( isset( $matches ) ) $image = $matches[1][0];
237
+ else
238
+ $debug .= 'No image was found;';
239
+ if ( strlen( trim( $image ) ) > 0 ) {
240
+ $image_sizes = @getimagesize( $image );
241
+ if ( $image_sizes === false )
242
+ $debug .= 'Unable to determine parsed image size';
243
+ if ( $image_sizes !== false && isset( $image_sizes[0] ) && $image_sizes[0] == $width ) { // if this image is the same size as we need
244
+ $debug .= 'Image used is the required size;';
245
+ $url = $image;
246
+ }
247
+ else { // if not, search for resized thumbnail according to Wordpress thumbnails naming function
248
+ $debug .= 'Changing image according to Wordpress standards;';
249
+ $url = preg_replace( '/(-[0-9]+x[0-9]+)?(\.[^\.]*)$/', '-' . $width . 'x' . $height . '$2', $image );
250
+ }
251
+ }
252
+ else
253
+ $debug .= 'Found wrong formatted image;';
254
+ }
255
+ }
256
+
257
+ if (strpos($url, '/') === 0)
258
+ {
259
+ $debug .= 'Relative url: '.$url.';';
260
+ $url = get_bloginfo('url') . $url;
261
+ }
262
+
263
+ $debug .= 'Image URL: '.$url.';';
264
+ if ( empty($url) || ( ini_get( 'allow_url_fopen' ) && false === @fopen( $url, 'r' ) ) ) { // parsed URL is empty or no file if can check
265
+ $debug .= 'Image is empty or no file. Using default image;';
266
+ $url = get_option( 'relpoststh_default_image', $this->default_image );
267
+ }
268
+
269
+ $title = $this->process_text_cut( $post->post_title, $text_length );
270
+ $post_excerpt = ( empty( $post->post_excerpt ) ) ? $post->post_content : $post->post_excerpt;
271
+ $excerpt = $this->process_text_cut( $post_excerpt, $excerpt_length );
272
+
273
+ if ( !empty($title) && !empty($excerpt) ) {
274
+ $title = '<b>' . $title . '</b>';
275
+ $excerpt = '<br/>' . $excerpt;
276
+ }
277
+
278
+ $debug .= 'Using title with size ' . $text_length . '. Using excerpt with size ' . $excerpt_length . ';';
279
+ if ($relpoststh_output_style == 'list') {
280
+ $link = get_permalink( $post->ID );
281
+ $output .= '<li ';
282
+ if ( !$relpoststh_cleanhtml )
283
+ $output .= ' style="float: left; padding: 0; margin:0; padding: 5px; display: block; border-right: 1px solid ' . get_option( 'relpoststh_bordercolor', $this->border_color ) . '; background-color: ' . get_option( 'relpoststh_background', $this->background ) . '" onmouseout="this.style.backgroundColor=\'' . get_option( 'relpoststh_background', $this->background ) . '\'" onmouseover="this.style.backgroundColor=\'' . get_option( 'relpoststh_hoverbackground', $this->hoverbackground ) . '\'"';
284
+ $output .= '>';
285
+ $output .= '<a href="' . $link . '" ><img alt="' . $title . '" src="' . $url . '" width="' . $width . '" height="' . $height . '" ';
286
+ if ( !$relpoststh_cleanhtml )
287
+ $output .= 'style="padding: 0px; margin: 0px; border: 0pt none;"';
288
+ $output .= '/></a>';
289
+ if ($text_height != '0')
290
+ {
291
+ $output .= '<a href="' . $link . '"';
292
+ if ( !$relpoststh_cleanhtml )
293
+ $output .= ' style="display: block; width: ' . $width . 'px; overflow: hidden;height: ' . $text_height . 'px;font-family: ' . get_option( 'relpoststh_fontfamily', $this->font_family ) . '; font-style: normal; font-variant: normal; font-weight: normal; font-size: ' . get_option( 'relpoststh_fontsize', $this->font_size ) . 'px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: ' . get_option( 'relpoststh_fontcolor', $this->font_color ) . ';text-decoration: none;"';
294
+ $output .= '>' . $title . $excerpt . '</a></li>';
295
+ }
296
+ }
297
+ else {
298
+ $output .= '<a onmouseout="this.style.backgroundColor=\'' . get_option( 'relpoststh_background', $this->background ) . '\'" onmouseover="this.style.backgroundColor=\'' . get_option( 'relpoststh_hoverbackground', $this->hoverbackground ) . '\'" style="background-color: ' . get_option( 'relpoststh_background', $this->background ) . '; border-right: 1px solid ' . get_option( 'relpoststh_bordercolor', $this->border_color ) . '; border-bottom: medium none; margin: 0pt; padding: 6px; display: block; float: left; text-decoration: none; text-align: left; cursor: pointer;" href="' . get_permalink( $post->ID ) . '">';
299
+ $output .= '<div style="border: 0pt none ; margin: 0pt; padding: 0pt; width: ' . $width . 'px; height: ' . ( $height + $text_height ) . 'px;">';
300
+ $output .= '<div style="border: 0pt none ; margin: 0pt; padding: 0pt; background: transparent url(' . $url . ') no-repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: ' . $width . 'px; height: ' . $height . 'px;"></div>';
301
+ $output .= '<div style="border: 0pt none; margin: 3px 0pt 0pt; padding: 0pt; font-family: ' . get_option( 'relpoststh_fontfamily', $this->font_family ) . '; font-style: normal; font-variant: normal; font-weight: normal; font-size: ' . get_option( 'relpoststh_fontsize', $this->font_size ) . 'px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; color: ' . get_option( 'relpoststh_fontcolor', $this->font_color ) . ';">' . $title . $excerpt . '</div>';
302
+ $output .= '</div>';
303
+ $output .= '</a>';
304
+ }
305
+
306
+ } // end foreach
307
+ if ($relpoststh_output_style == 'list')
308
+ $output .= '</ul>';
309
+ else
310
+ $output .= '</div>';
311
+ $output .= '<div style="clear: both"></div>';
312
+ return $this->finish_process( $output, $debug, $time );
313
+ }
314
+
315
+ function finish_process( $output, $debug, $time ) {
316
+ $devmode = get_option( 'relpoststh_devmode', $this->devmode );
317
+ if ( $devmode ) {
318
+ $time = microtime(true) - $time;
319
+ $debug .= "Plugin execution time: $time sec;";
320
+ $output .= '<!-- '.$debug.' -->';
321
+ }
322
+ return $output;
323
+ }
324
+
325
+ function process_text_cut( $text, $length ) {
326
+ if ($length == 0)
327
+ return '';
328
+ else {
329
+ $text = strip_shortcodes( strip_tags( $text ) );
330
+ return ( ( strlen( $text ) > $length ) ? substr( $text, 0, $length) . '...' : $text );
331
+ }
332
+ }
333
+
334
+ function is_relpoststh_show() { // Checking display options
335
+ if ( is_page() || ( ! is_single() && get_option( 'relpoststh_single_only', $this->single_only ) ) ) { // single only
336
+ return false;
337
+ }
338
+ /* Check categories */
339
+ $id = get_the_ID();
340
+ $categories_all = get_option( 'relpoststh_categoriesall', $this->categories_all );
341
+ if ( $categories_all != '1') { // only specific categories were selected
342
+ $post_categories = wp_get_object_terms( $id, array( 'category' ), array( 'fields' => 'ids' ) );
343
+ $relpoststh_categories = get_option( 'relpoststh_categories' );
344
+ if ( !is_array( $relpoststh_categories ) || !is_array( $post_categories ) ) // no categories were selcted or post doesn't belong to any
345
+ return false;
346
+ $common_categories = array_intersect( $relpoststh_categories, $post_categories );
347
+ if ( empty( $common_categories ) ) // post doesn't belong to specified categories
348
+ return false;
349
+ }
350
+ return true;
351
+ }
352
+
353
+ function admin_menu() {
354
+ $page = add_options_page( __( 'Related Posts Thumbnails', 'related-posts-thumbnails' ), __( 'Related Posts Thumbs', 'related-posts-thumbnails' ), 'administrator', 'related-posts-thumbnails', array( $this, 'admin_interface' ) );
355
+ }
356
+
357
+ function admin_interface() { // Admin interface
358
+ if ( $_POST['action'] == 'update' ) {
359
+ if ( !current_user_can( 'manage_options' ) ) {
360
+ wp_die( __( 'No access', 'related-posts-thumbnails' ) );
361
+ }
362
+ check_admin_referer( 'related-posts-thumbnails' );
363
+ $validation = true;
364
+ if ( !empty($_POST['relpoststh_year']) || !empty($_POST['relpoststh_month']) || !empty($_POST['relpoststh_year']) ) { // check date
365
+ $set_date = sprintf( '%04d-%02d-%02d', $_POST['relpoststh_year'], $_POST['relpoststh_month'], $_POST['relpoststh_day'] );
366
+ if ( checkdate( intval($_POST['relpoststh_month']), intval($_POST['relpoststh_day']), intval($_POST['relpoststh_year']) ) === false ) {
367
+ $validation = false;
368
+ $error = __( 'Wrong date', 'related-posts-thumbnails' ) . ': ' . sprintf( '%d/%d/%d', $_POST['relpoststh_month'], $_POST['relpoststh_day'], $_POST['relpoststh_year'] );
369
+ }
370
+ }
371
+ else
372
+ $set_date = '';
373
+ if ( $validation ) {
374
+ update_option( 'relpoststh_single_only', $_POST['relpoststh_single_only'] );
375
+ update_option( 'relpoststh_output_style', $_POST['relpoststh_output_style'] );
376
+ update_option( 'relpoststh_cleanhtml', $_POST['relpoststh_cleanhtml'] );
377
+ update_option( 'relpoststh_auto', $_POST['relpoststh_auto'] );
378
+ update_option( 'relpoststh_top_text', $_POST['relpoststh_top_text'] );
379
+ update_option( 'relpoststh_number', $_POST['relpoststh_number'] );
380
+ update_option( 'relpoststh_relation', $_POST['relpoststh_relation'] );
381
+ update_option( 'relpoststh_default_image', $_POST['relpoststh_default_image'] );
382
+ update_option( 'relpoststh_poststhname', $_POST['relpoststh_poststhname'] );
383
+ update_option( 'relpoststh_background', $_POST['relpoststh_background'] );
384
+ update_option( 'relpoststh_hoverbackground', $_POST['relpoststh_hoverbackground'] );
385
+ update_option( 'relpoststh_bordercolor', $_POST['relpoststh_bordercolor'] );
386
+ update_option( 'relpoststh_fontcolor', $_POST['relpoststh_fontcolor'] );
387
+ update_option( 'relpoststh_fontsize', $_POST['relpoststh_fontsize'] );
388
+ update_option( 'relpoststh_fontfamily', $_POST['relpoststh_fontfamily'] );
389
+ update_option( 'relpoststh_textlength', $_POST['relpoststh_textlength'] );
390
+ update_option( 'relpoststh_excerptlength', $_POST['relpoststh_excerptlength'] );
391
+ update_option( 'relpoststh_thsource', $_POST['relpoststh_thsource'] );
392
+ update_option( 'relpoststh_customfield', $_POST['relpoststh_customfield'] );
393
+ update_option( 'relpoststh_theme_resize_url', $_POST['relpoststh_theme_resize_url'] );
394
+ update_option( 'relpoststh_customwidth', $_POST['relpoststh_customwidth'] );
395
+ update_option( 'relpoststh_customheight', $_POST['relpoststh_customheight'] );
396
+ update_option( 'relpoststh_textblockheight', $_POST['relpoststh_textblockheight'] );
397
+ update_option( 'relpoststh_categoriesall', $_POST['relpoststh_categoriesall'] );
398
+ update_option( 'relpoststh_categories', $_POST['relpoststh_categories'] );
399
+ update_option( 'relpoststh_show_categoriesall', $_POST['relpoststh_show_categoriesall'] );
400
+ update_option( 'relpoststh_show_categories', $_POST['relpoststh_show_categories'] );
401
+ update_option( 'relpoststh_devmode', $_POST['relpoststh_devmode'] );
402
+ update_option( 'relpoststh_startdate', $set_date );
403
+ echo "<div class='updated fade'><p>" . __( 'Settings updated', 'related-posts-thumbnails' ) ."</p></div>";
404
+ }
405
+ else {
406
+ echo "<div class='error fade'><p>" . __( 'Settings update failed', 'related-posts-thumbnails' ) . '. '. $error . "</p></div>";
407
+ }
408
+ }
409
+ $available_sizes = array( 'thumbnail' => 'thumbnail', 'medium' => 'medium' );
410
+ if ( current_theme_supports( 'post-thumbnails' ) ) {
411
+ global $_wp_additional_image_sizes;
412
+ if ( is_array($_wp_additional_image_sizes ) ) {
413
+ $available_sizes = array_merge( $available_sizes, $_wp_additional_image_sizes );
414
+ }
415
+ }
416
+ $relpoststh_single_only = get_option( 'relpoststh_single_only', $this->single_only );
417
+ $relpoststh_auto = get_option( 'relpoststh_auto', $this->auto );
418
+ $relpoststh_cleanhtml = get_option( 'relpoststh_cleanhtml', 0 );
419
+ $relpoststh_relation = get_option( 'relpoststh_relation', $this->relation );
420
+ $relpoststh_thsource = get_option( 'relpoststh_thsource', $this->thsource );
421
+ $relpoststh_devmode = get_option( 'relpoststh_devmode', $this->devmode );
422
+ $relpoststh_categoriesall = get_option( 'relpoststh_categoriesall', $this->categories_all );
423
+ $relpoststh_categories = get_option( 'relpoststh_categories' );
424
+ $relpoststh_show_categories = get_option( 'relpoststh_show_categories', get_option( 'relpoststh_categories' ) );
425
+ $relpoststh_show_categoriesall = get_option( 'relpoststh_show_categoriesall', $relpoststh_categoriesall );
426
+ $relpoststh_startdate = explode( '-', get_option( 'relpoststh_startdate' ) );
427
+ $relpoststh_output_style = get_option( 'relpoststh_output_style', $this->output_style );
428
+ $thsources = array( 'post-thumbnails' => 'Post thumbnails', 'custom-field' => 'Custom field' );
429
+ $categories = get_categories();
430
+ $output_styles = array('div' => __( 'Blocks', 'related-posts-thumbnails' ), 'list' => __( 'List', 'related-posts-thumbnails' ) );
431
+ ?>
432
+ <script type="text/javascript">
433
+ jQuery(document).ready(function($) {
434
+ $(".select_all").click(function(){
435
+ if (this.checked) {
436
+ $(this).parent().find("div.select_specific").hide();
437
+ }
438
+ else {
439
+ $(this).parent().find("div.select_specific").show();
440
+ }
441
+ });
442
+ $('#relpoststh_thsource').change(function(){
443
+ if (this.value == 'post-thumbnails') {
444
+ $('#relpoststh-post-thumbnails').show();
445
+ $('#relpoststh-custom-field').hide();
446
+ }
447
+ else {
448
+ $('#relpoststh-post-thumbnails').hide();
449
+ $('#relpoststh-custom-field').show();
450
+ }
451
+ });
452
+ $('#relpoststh_output_style').change(function(){
453
+ if (this.value == 'list') {
454
+ $('#relpoststh_cleanhtml').show();
455
+ }
456
+ else {
457
+ $('#relpoststh_cleanhtml').hide();
458
+ }
459
+ });
460
+ });
461
+ </script>
462
+ <div class="wrap">
463
+ <div class="icon32" id="icon-options-general"><br></div>
464
+ <h2><?php _e( 'Related Posts Thumbnails Settings', 'related-posts-thumbnails' ); ?></h2>
465
+ <form action="?page=related-posts-thumbnails" method="POST">
466
+ <input type="hidden" name="action" value="update" />
467
+ <?php wp_nonce_field( 'related-posts-thumbnails' ); ?>
468
+ <div class="metabox-holder">
469
+ <div class="postbox">
470
+ <h3><?php _e( 'General Display Options', 'related-posts-thumbnails' ); ?>:</h3>
471
+ <table class="form-table">
472
+ <tr valign="top">
473
+ <th scope="row"><?php _e( 'Automatically append to the post content', 'related-posts-thumbnails' ); ?>:</th>
474
+ <td>
475
+ <input type="checkbox" name="relpoststh_auto" id="relpoststh_auto" value="1" <?php if ( $relpoststh_auto ) echo 'checked="checked"'; ?>/>
476
+ <label for="relpoststh_auto"><?php _e( 'Or use <b>&lt;?php get_related_posts_thumbnails(); ?&gt;</b> in the Loop', 'related-posts-thumbnails' ); ?></label><br />
477
+ </td>
478
+ </tr>
479
+ <tr valign="top">
480
+ <th scope="row"><?php _e( 'Developer mode', 'related-posts-thumbnails' ); ?>:</th>
481
+ <td>
482
+ <input type="checkbox" name="relpoststh_devmode" id="relpoststh_devmode" value="1" <?php if ( $relpoststh_devmode ) echo 'checked="checked"'; ?>/>
483
+ <label for="relpoststh_devmode"><?php _e( 'This will add debugging information in HTML source', 'related-posts-thumbnails' ); ?></label><br />
484
+ </td>
485
+ </tr>
486
+ <tr valign="top">
487
+ <th scope="row"><?php _e( 'Page type', 'related-posts-thumbnails' ); ?>:</th>
488
+ <td>
489
+ <input type="checkbox" name="relpoststh_single_only" id="relpoststh_single_only" value="1" <?php if ( $relpoststh_single_only ) echo 'checked="checked"'; ?>/>
490
+ <label for="relpoststh_single_only"><?php _e( 'Show on single posts only', 'related-posts-thumbnails' ); ?></label><br />
491
+ </td>
492
+ </tr>
493
+ <tr valign="top">
494
+ <th scope="row"><?php _e( 'Categories on which related thumbnails will appear', 'related-posts-thumbnails' ); ?>:</th>
495
+ <td>
496
+ <?php $this->display_categories_list( $relpoststh_categoriesall, $categories, $relpoststh_categories, 'relpoststh_categoriesall', 'relpoststh_categories' ); ?>
497
+ </td>
498
+ </tr>
499
+ <tr valign="top">
500
+ <th scope="row"><?php _e( 'Categories that will appear in related thumbnails', 'related-posts-thumbnails' ); ?>:</th>
501
+ <td>
502
+ <?php $this->display_categories_list( $relpoststh_show_categoriesall, $categories, $relpoststh_show_categories, 'relpoststh_show_categoriesall', 'relpoststh_show_categories' ); ?>
503
+ </td>
504
+ </tr>
505
+ <tr>
506
+ <th scope="row"><?php _e( 'Include only posts after', 'related-posts-thumbnails' ); ?>:</th>
507
+ <td>
508
+ <?php _e( 'Year' ); ?>: <input type="text" name="relpoststh_year" size="4" value="<?php echo $relpoststh_startdate[0]; ?>"> <?php _e( 'Month' ); ?>: <input type="text" name="relpoststh_month" size="2" value="<?php echo $relpoststh_startdate[1]; ?>"> <?php _e( 'Day' ); ?>: <input type="text" name="relpoststh_day" size="2" value="<?php echo $relpoststh_startdate[2]; ?>"> <label for="relpoststh_excerptlength"><?php _e( 'Leave empty for all posts dates', 'related-posts-thumbnails' ); ?></label><br />
509
+
510
+ </td>
511
+ </tr>
512
+ <tr>
513
+ <th scope="row"><?php _e( 'Top text', 'related-posts-thumbnails' ); ?>:</th>
514
+ <td>
515
+ <input type="text" name="relpoststh_top_text" value="<?php echo stripslashes( htmlspecialchars( get_option( 'relpoststh_top_text', $this->top_text ) ) ); ?>" size="50"/>
516
+ </td>
517
+ </tr>
518
+ <tr>
519
+ <th scope="row"><?php _e( 'Number of similar posts to display', 'related-posts-thumbnails' ); ?>:</th>
520
+ <td>
521
+ <input type="text" name="relpoststh_number" value="<?php echo get_option( 'relpoststh_number', $this->number ); ?>" size="2"/>
522
+ </td>
523
+ </tr>
524
+ <tr>
525
+ <th scope="row"><?php _e( 'Default image URL', 'related-posts-thumbnails' ); ?>:</th>
526
+ <td>
527
+ <input type="text" name="relpoststh_default_image" value="<?php echo get_option('relpoststh_default_image', $this->default_image );?>" size="50"/>
528
+ </td>
529
+ </tr>
530
+ <tr>
531
+ <th scope="row"><?php _e( 'Thumbnails source', 'related-posts-thumbnails' ); ?>:</th>
532
+ <td>
533
+ <select name="relpoststh_thsource" id="relpoststh_thsource">
534
+ <?php foreach ( $thsources as $name => $title ) : ?>
535
+ <option value="<?php echo $name; ?>" <?php if ( $relpoststh_thsource == $name ) echo 'selected'; ?>><?php echo $title; ?></option>
536
+ <?php endforeach; ?>
537
+ </select>
538
+ </td>
539
+ </tr>
540
+ </table>
541
+ </div>
542
+ <div class="postbox" id="relpoststh-post-thumbnails" <?php if ( $relpoststh_thsource != 'post-thumbnails' ) : ?> style="display:none" <?php endif; ?>>
543
+ <h3><?php _e( 'Thumbnails source', 'related-posts-thumbnails' ); ?>:</h3>
544
+ <table class="form-table">
545
+ <tr valign="top">
546
+ <th scope="row"><?php _e( 'Post-thumbnails name', 'related-posts-thumbnails' ); ?>:</th>
547
+ <td>
548
+ <select name="relpoststh_poststhname">
549
+ <?php foreach ( $available_sizes as $size_name => $size ) : ?>
550
+ <option <?php if ( $size_name == get_option('relpoststh_poststhname', $this->poststhname) ) echo 'selected'; ?>><?php echo $size_name; ?></option>
551
+ <?php endforeach; ?>
552
+ </select>
553
+ <?php if ( !current_theme_supports( 'post-thumbnails' ) ) : ?>
554
+ (<?php _e( 'Your theme has to support post-thumbnails to have more choices', 'related-posts-thumbnails' ); ?>)
555
+ <?php endif; ?>
556
+ </td>
557
+ </tr>
558
+ </table>
559
+ </div>
560
+ <div class="postbox" id="relpoststh-custom-field" <?php if ( $relpoststh_thsource != 'custom-field' ) : ?> style="display:none" <?php endif; ?>>
561
+ <h3><?php _e( 'Thumbnails source', 'related-posts-thumbnails' ); ?>:</h3>
562
+ <table class="form-table">
563
+ <tr valign="top">
564
+ <th scope="row"><?php _e( 'Custom field name', 'related-posts-thumbnails' ); ?>:</th>
565
+ <td>
566
+ <input type="text" name="relpoststh_customfield" value="<?php echo get_option('relpoststh_customfield', $this->custom_field );?>" size="50"/>
567
+ </td>
568
+ </tr>
569
+ <tr valign="top">
570
+ <th scope="row"><?php _e( 'Size', 'related-posts-thumbnails' ); ?>:</th>
571
+ <td>
572
+ <?php _e( 'Width', 'related-posts-thumbnails' ); ?>: <input type="text" name="relpoststh_customwidth" value="<?php echo get_option('relpoststh_customwidth', $this->custom_width );?>" size="3"/>px x
573
+ <?php _e( 'Height', 'related-posts-thumbnails' ); ?>: <input type="text" name="relpoststh_customheight" value="<?php echo get_option('relpoststh_customheight', $this->custom_height );?>" size="3"/>px
574
+ </td>
575
+ </tr>
576
+ <tr valign="top">
577
+ <th scope="row"><?php _e( 'Theme resize url', 'related-posts-thumbnails' ); ?>:</th>
578
+ <td>
579
+ <input type="text" name="relpoststh_theme_resize_url" value="<?php echo get_option('relpoststh_theme_resize_url', '' );?>" size="50"/>
580
+ (<?php _e( 'If your theme resizes images, enter URL to its resizing PHP file', 'related-posts-thumbnails' ); ?>)
581
+ </td>
582
+ </tr>
583
+ </table>
584
+ </div>
585
+ <div class="postbox">
586
+ <h3><?php _e( 'Style options', 'related-posts-thumbnails' ); ?>:</h3>
587
+ <table class="form-table">
588
+ <tr>
589
+ <th scope="row"><?php _e( 'Output style', 'related-posts-thumbnails' ); ?>:</th>
590
+ <td>
591
+ <select name="relpoststh_output_style" id="relpoststh_output_style">
592
+ <?php foreach ( $output_styles as $name => $title ) : ?>
593
+ <option value="<?php echo $name; ?>" <?php if ( $relpoststh_output_style == $name ) echo 'selected'; ?>><?php echo $title; ?></option>
594
+ <?php endforeach; ?>
595
+ </select>
596
+ <span id="relpoststh_cleanhtml" style="display: <?php if ($relpoststh_output_style == 'list') echo 'inline'; else echo 'none';?>;"><?php _e( 'Turn off plugin styles', 'related-posts-thumbnails' ); ?> <input type="checkbox" name="relpoststh_cleanhtml" <?php if ( $relpoststh_cleanhtml ) echo 'checked="checked"'; ?> /></span>
597
+ </td>
598
+ </tr>
599
+ <tr valign="top">
600
+ <th scope="row"><?php _e( 'Background color', 'related-posts-thumbnails' ); ?>:</th>
601
+ <td>
602
+ <input type="text" name="relpoststh_background" value="<?php echo get_option( 'relpoststh_background', $this->background ); ?>" size="7"/>
603
+ </td>
604
+ </tr>
605
+ <tr valign="top">
606
+ <th scope="row"><?php _e( 'Background color on mouse over', 'related-posts-thumbnails' ); ?>:</th>
607
+ <td>
608
+ <input type="text" name="relpoststh_hoverbackground" value="<?php echo get_option( 'relpoststh_hoverbackground', $this->hoverbackground ); ?>" size="7"/>
609
+ </td>
610
+ </tr>
611
+ <tr valign="top">
612
+ <th scope="row"><?php _e( 'Border color', 'related-posts-thumbnails' ); ?>:</th>
613
+ <td>
614
+ <input type="text" name="relpoststh_bordercolor" value="<?php echo get_option( 'relpoststh_bordercolor', $this->border_color )?>" size="7"/>
615
+ </td>
616
+ </tr>
617
+ <tr valign="top">
618
+ <th scope="row"><?php _e( 'Font color', 'related-posts-thumbnails' ); ?>:</th>
619
+ <td>
620
+ <input type="text" name="relpoststh_fontcolor" value="<?php echo get_option( 'relpoststh_fontcolor', $this->font_color ); ?>" size="7"/>
621
+ </td>
622
+ </tr>
623
+ <tr valign="top">
624
+ <th scope="row"><?php _e( 'Font family', 'related-posts-thumbnails' ); ?>:</th>
625
+ <td>
626
+ <input type="text" name="relpoststh_fontfamily" value="<?php echo get_option( 'relpoststh_fontfamily', $this->font_family )?>" size="50"/>
627
+ </td>
628
+ </tr>
629
+ <tr valign="top">
630
+ <th scope="row"><?php _e( 'Font size', 'related-posts-thumbnails' ); ?>:</th>
631
+ <td>
632
+ <input type="text" name="relpoststh_fontsize" value="<?php echo get_option( 'relpoststh_fontsize', $this->font_size )?>" size="7"/>
633
+ </td>
634
+ </tr>
635
+ <tr valign="top">
636
+ <th scope="row"><?php _e( 'Text maximum length', 'related-posts-thumbnails' ); ?>:</th>
637
+ <td>
638
+ <input type="text" name="relpoststh_textlength" value="<?php echo get_option( 'relpoststh_textlength', $this->text_length )?>" size="7"/>
639
+ <label for="relpoststh_textlength"><?php _e( 'Set 0 for no title', 'related-posts-thumbnails' ); ?></label><br />
640
+ </td>
641
+ </tr>
642
+ <tr valign="top">
643
+ <th scope="row"><?php _e( 'Excerpt maximum length', 'related-posts-thumbnails' ); ?>:</th>
644
+ <td>
645
+ <input type="text" name="relpoststh_excerptlength" value="<?php echo get_option( 'relpoststh_excerptlength', $this->excerpt_length )?>" size="7"/>
646
+ <label for="relpoststh_excerptlength"><?php _e( 'Set 0 for no excerpt', 'related-posts-thumbnails' ); ?></label><br />
647
+ </td>
648
+ </tr>
649
+ <tr valign="top">
650
+ <th scope="row"><?php _e( 'Text block height', 'related-posts-thumbnails' ); ?>:</th>
651
+ <td>
652
+ <input type="text" name="relpoststh_textblockheight" value="<?php echo get_option( 'relpoststh_textblockheight', $this->text_block_height )?>" size="7"/> px
653
+ </td>
654
+ </tr>
655
+ </table>
656
+ </div>
657
+ <div class="postbox">
658
+ <h3><?php _e( 'Relation Builder Options', 'related-posts-thumbnails' ); ?>:</h3>
659
+ <table class="form-table">
660
+ <tr valign="top">
661
+ <th scope="row"><?php _e( 'Relation based on', 'related-posts-thumbnails' ); ?>:</th>
662
+ <td>
663
+ <input type="radio" name="relpoststh_relation" id="relpoststh_relation_categories" value="categories" <?php if ( $relpoststh_relation == 'categories' ) echo 'checked="checked"'; ?>/>
664
+ <label for="relpoststh_relation_categories"><?php _e( 'Categories', 'related-posts-thumbnails' ); ?></label><br />
665
+ <input type="radio" name="relpoststh_relation" id="relpoststh_relation_tags" value="tags" <?php if ( $relpoststh_relation == 'tags' ) echo 'checked="checked"'; ?>/>
666
+ <label for="relpoststh_relation_tags"><?php _e( 'Tags', 'related-posts-thumbnails' ); ?></label><br />
667
+ <input type="radio" name="relpoststh_relation" id="relpoststh_relation_both" value="both" <?php if ( $relpoststh_relation == 'both' ) echo 'checked="checked"'; ?>/>
668
+ <label for="relpoststh_relation_both"><?php _e( 'Categories and Tags', 'related-posts-thumbnails' ); ?></label><br />
669
+ <input type="radio" name="relpoststh_relation" id="relpoststh_relation_no" value="no" <?php if ( $relpoststh_relation == 'no' ) echo 'checked="checked"'; ?>/>
670
+ <label for="relpoststh_relation_no"><?php _e( 'Random', 'related-posts-thumbnails' ); ?></label><br />
671
+ </td>
672
+ </tr>
673
+ </table>
674
+ </div>
675
+ <input name="Submit" value="<?php _e( 'Save Changes', 'related-posts-thumbnails' ); ?>" type="submit">
676
+ </div>
677
+ </form>
678
+ </div>
679
+ <p style="margin-top: 40px;"><small><?php _e('If you experience some problems with this plugin please let me know about it on <a href="http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/">Plugin\'s homepage</a>. If you think this plugin is awesome please vote on <a href="http://wordpress.org/extend/plugins/related-posts-thumbnails/">Wordpress plugin page</a>. Thanks!', 'related-posts-thumbnails' ); ?></small></p>
680
+ <?php
681
+ }
682
+
683
+ function display_categories_list( $categoriesall, $categories, $selected_categories, $all_name, $specific_name ) {
684
+ ?>
685
+ <input id="<?php echo $all_name; ?>" class="select_all" type="checkbox" name="<?php echo $all_name; ?>" value="1" <?php if ( $categoriesall == '1' ) echo 'checked="checked"'; ?>/>
686
+ <label for="<?php echo $all_name; ?>"><?php _e( 'All', 'related-posts-thumbnails' ); ?></label>
687
+ <div class="select_specific" <?php if ( $categoriesall == '1' ) : ?> style="display:none" <?php endif; ?>>
688
+ <?php foreach ( $categories as $category ) : ?>
689
+ <input type="checkbox" name="<?php echo $specific_name; ?>[]" id="<?php echo $specific_name; ?>_<?php echo $category->category_nicename; ?>" value="<?php echo $category->cat_ID; ?>" <?php if ( in_array( $category->cat_ID, (array)$selected_categories ) ) echo 'checked="checked"'; ?>/>
690
+ <label for="<?php echo $specific_name; ?>_<?php echo $category->category_nicename; ?>"><?php echo $category->cat_name; ?></label><br />
691
+ <?php endforeach; ?>
692
+ </div>
693
+ <?php
694
+ }
695
+ }
696
+
697
+ add_action( 'init', 'related_posts_thumbnails' );
698
+
699
+ function related_posts_thumbnails() {
700
+ global $related_posts_thumbnails;
701
+ $related_posts_thumbnails = new RelatedPostsThumbnails();
702
+ }
703
+
704
+ function get_related_posts_thumbnails()
705
+ {
706
+ global $related_posts_thumbnails;
707
+ echo $related_posts_thumbnails->get_html();
708
+ }
709
+
710
+ /**
711
+ * Related Posts Widget, will be displayed on post page
712
+ */
713
+ class RelatedPostsThumbnailsWidget extends WP_Widget {
714
+ function RelatedPostsThumbnailsWidget() {
715
+ parent::WP_Widget(false, $name = 'Related Posts Thumbnails');
716
+ }
717
+
718
+ function widget($args, $instance) {
719
+ if ( is_single() && !is_page() ) { // display on post page only
720
+ extract( $args );
721
+ $title = apply_filters('widget_title', $instance['title']);
722
+ echo $before_widget;
723
+ if ( $title )
724
+ echo $before_title . $title . $after_title;
725
+ get_related_posts_thumbnails();
726
+ echo $after_widget;
727
+ }
728
+ }
729
+
730
+ function update($new_instance, $old_instance) {
731
+ $instance = $old_instance;
732
+ $instance['title'] = strip_tags($new_instance['title']);
733
+ return $instance;
734
+ }
735
+
736
+ function form($instance) {
737
+ $title = esc_attr($instance['title']);
738
+ ?>
739
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
740
+ <?php
741
+ }
742
+
743
+ } // class RelatedPostsThumbnailsWidget
744
+
745
+ add_action( 'widgets_init', create_function( '', 'return register_widget("RelatedPostsThumbnailsWidget");' ) );
746
+ ?>