Disqus Comment System - Version 2.1.4342

Version Description

Download this release

Release Info

Developer Disqus
Plugin Icon Disqus Comment System
Version 2.1.4342
Comparing to
See all releases

Code changes from version 2.04.3996 to 2.1.4342

Files changed (4) hide show
  1. comments.php +48 -324
  2. disqus.php +35 -27
  3. manage.php +0 -25
  4. readme.txt +2 -2
comments.php CHANGED
@@ -1,340 +1,64 @@
1
-
2
  <?php
3
- global $dsq_response, $dsq_sort;
4
- $site_url = get_option('siteurl');
5
  ?>
6
 
7
  <div id="disqus_thread">
8
  <div id="dsq-content">
9
- <div id="dsq-post-top" style="display: none">
10
- <?php if ( !$dsq_response['thread_locked'] ) : ?>
11
- <div id="dsq-auth">
12
- <div class="dsq-by"><a href="http://disqus.com/" target="_blank"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/dsq-button-120x19.png" alt="discussion by DISQUS" /></a></div>
13
- <div class="dsq-auth-header">
14
- <h3 id="dsq-add-new-comment">Add New Comment</h3>
15
- <span id="dsq-auth-as"><noscript><br />You must have JavaScript enabled to comment.</noscript></span>
16
- </div>
17
- </div>
18
- <?php else : ?>
19
- <span id="dsq-post-add">Comments for this post are closed.</span>
20
- <?php endif ; ?>
21
- </div>
22
- <div style="margin:10px 0">
23
- <a id="dsq-options-toggle" href="#" onclick="Dsq.Thread.toggleOptions(); return false"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/dsq-options-plus.png" alt="" /></a>
24
- </div>
25
-
26
- <div id="dsq-options" style="display:none">
27
- <span id="dsq-auth-wrap"></span>
28
- <div id="dsq-extra-links">
29
- <li>
30
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/bullet-feed.png" alt="" /><strong>Subscribe</strong>:&nbsp;
31
- <a href="http://<?php echo strtolower(get_option('disqus_forum_url')) . '.' . DISQUS_DOMAIN . '/' . $dsq_response['thread_slug'] . '/latest.rss'; ?>">This Thread</a>
32
- </li>
33
- <li>
34
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/bullet-go.png" alt="" /><strong>Go to</strong>:&nbsp;
35
- <a href="<?php echo DISQUS_URL . '/track/'; ?>">My Comments</a>&nbsp;&middot;&nbsp;
36
- <a href="http://<?php echo strtolower(get_option('disqus_forum_url')) . '.' . DISQUS_DOMAIN . '/' . $dsq_response['thread_slug'] . '/'; ?>">Community Page</a>
37
- </li>
38
- </div>
39
- <div class="dsq-extra-meta">
40
- <?php if ( $dsq_response['num_posts'] ) : ?>
41
- Sort thread by:
42
- <select onchange="Dsq.Thread.sortBy(this.value);">
43
- <option value="hot" <?php if(4==$dsq_sort){echo 'selected="selected"';}?>>Hot comments</option>
44
- <option value="best" <?php if(3==$dsq_sort){echo 'selected="selected"';}?>>Best comments</option>
45
- <option value="newest" <?php if(2==$dsq_sort){echo 'selected="selected"';}?>>Newest first</option>
46
- <option value="oldest" <?php if(1==$dsq_sort){echo 'selected="selected"';}?>>Oldest first</option>
47
- </select>
48
- <?php endif ; ?>
49
- </div>
50
- </div>
51
-
52
- <h3 id="dsq-comments-count">
53
- <?php if ( $dsq_response['num_posts'] ) : ?>
54
- Viewing <?php echo $dsq_response['num_posts']; ?> Comment<?php if($dsq_response['num_posts'] != 1) { echo 's'; }; ?>
55
- <?php endif ; ?>
56
- </h3>
57
-
58
- <div id="dsq-alerts">
59
- <p id="dsq-alerts-approve" style="display: none">Thanks. Your comment is awaiting approval by a moderator.</p>
60
- <p id="dsq-alerts-claim" style="display: none">Do you already have an account? <a href="<?php echo DISQUS_URL; ?>/claim/">Log in and claim this comment</a>.</p>
61
- </div>
62
-
63
  <ul id="dsq-comments">
64
- <?php foreach ( $dsq_response['posts'] as $comment ) : ?>
65
- <?php
66
- $dsq_profile_url = DISQUS_URL . '/people/' . $comment['user']['profile'] . '/';
67
- ?>
68
- <?php if ( $comment['killed'] ) : ?>
69
- <li style="margin-left:<?php echo $comment['depth'] * 30; ?>px" class="disqus_commentset"><em>Comment removed.</em></li>
70
- <?php else : ?>
71
- <div id="comment-<?php echo $comment['id']; ?>"></div>
72
- <li id="dsq-comment-<?php echo $comment['id']; ?>" style="margin-left:<?php echo $comment['depth'] * 30; ?>px" class="dsq-comment<?php if($comment['user']['is_creator']) { echo ' special'; } ?><?php if($comment['user']['is_moderator']) { echo ' dsq-moderator'; } ?>">
73
- <ul class="dsq-comment-rate" id="dsq-rate-loading-<?php echo $comment['id']; ?>" style="display: none"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/loading-small.gif" alt="" /></ul>
74
- <ul class="dsq-comment-rate" id="dsq-rate-<?php echo $comment['id']; ?>">
75
- <li id="dsq-rate-up-<?php echo $comment['id']; ?>"><a id="dsq-rate-up-a-<?php echo $comment['id']; ?>" class="dsq-arrows" href="#" title="Rate Up"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/arrow2-up.png" alt="^" /></a></li>
76
- <li id="dsq-rate-down-<?php echo $comment['id']; ?>"><a id="dsq-rate-down-a-<?php echo $comment['id']; ?>" class="dsq-arrows" href="#" title="Rate Down"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/arrow2-down.png" alt="v" /></a></li>
77
- </ul>
78
- <div id="dsq-comment-header-<?php echo $comment['id']; ?>" class="dsq-comment-header">
79
- <div class="dsq-header-avatar" id="dsq-header-avatar-<?php echo $comment['id']; ?>">
80
- <a id="dsq-avatar-<?php echo $comment['id']; ?>" href="<?php echo $dsq_profile_url; ?>" title="Profile">
81
- <img src="<?php echo $comment['user']['avatar_url']; ?>" alt="" />
82
- </a>
83
- <ul id="dsq-menu-<?php echo $comment['id']; ?>" class="dsq-menu" style="display:none">
84
- <?php if ( $comment['parent_id'] ) : ?>
85
- <li><a href="#comment-<?php echo $comment['parent_id']; ?>">Parent</a></li>
86
- <?php endif ; ?>
87
- <li><a href="#comment-<?php echo $comment['id']; ?>">Permalink</a></li>
88
- <li style="display: none">
89
- <a id="dsq-admin-toggle-<?php echo $comment['id']; ?>" class="dsq-admin-toggle" href="#">
90
- Admin<img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/pointer-right.png" alt="" />
91
- </a>
92
- </li>
93
- <li id="dsq-admin-panel-<?php echo $comment['id']; ?>" class="dsq-admin-panel" style="display: none">
94
- <ul>
95
- <li id="dsq-admin-email-<?php echo $comment['id']; ?>" class="dsq-admin-email"></li>
96
- <li id="dsq-admin-ip-<?php echo $comment['id']; ?>" class="dsq-admin-ip"></li>
97
- <li><a id="dsq-remove-<?php echo $comment['id']; ?>" href="#">Remove&nbsp;Post</a></li>
98
- <?php if($comment['user']['id']) : ?>
99
- <li><a id="dsq-block-username-<?php echo $comment['id']; ?>" href="#">Block username</a></li>
100
- <?php endif; ?>
101
- <li><a id="dsq-block-email-<?php echo $comment['id']; ?>" href="#">Block email</a></li>
102
- <li><a id="dsq-block-ip-<?php echo $comment['id']; ?>" href="#">Block IP address</a></li>
103
- </ul>
104
- </li>
105
- </ul>
106
- </div>
107
-
108
- <cite id="dsq-cite-<?php echo $comment['id']; ?>">
109
- <?php if($comment['user']['url']) : ?>
110
- <a id="dsq-author-user-<?php echo $comment['id']; ?>" href="<?php echo $comment['user']['url']; ?>" rel="nofollow">
111
- <?php echo $comment['user']['display_name']; ?>
112
- </a>
113
- <?php else: ?>
114
- <span id="dsq-author-user-<?php echo $comment['id']; ?>">
115
- <?php echo $comment['user']['display_name']; ?>
116
- </span>
117
- <?php endif; ?>
118
- </cite>
119
-
120
- <span class="dsq-header-meta">
121
- <a id="dsq-time-<?php echo $comment['id']; ?>" class="dsq-header-time" href="#comment-<?php echo $comment['id']; ?>" title="Permalink"><?php echo $comment['date_fmt']; ?></a>
122
- <span id="dsq-points-<?php echo $comment['id']; ?>" class="dsq-header-points" style="display: none"><?php echo $comment['points']; ?> point<?php if($comment['points'] != 1) { echo 's'; } ?></span>
123
- </span>
124
- </div>
125
-
126
- <div class="dsq-comment-body">
127
- <p id="dsq-login-<?php echo $comment['id']; ?>" style="display:none">Please <a href="<?php echo DISQUS_URL . '/login/?next=article:' . $dsq_response['thread_id']; ?>">login</a> to rate.</p>
128
- <p id="dsq-comment-alert-<?php echo $comment['id']; ?>" class="dsq-comment-alert" style="display: none">
129
- Do you already have an account? <a href="<?php echo DISQUS_URL . '/claim/';?>">Log in and claim this comment</a>.
130
- </p>
131
- <div id="dsq-comment-message-<?php echo $comment['id']; ?>" class="dsq-comment-message"><?php echo $comment['message']; ?></div>
132
-
133
- <?php if($dsq_response['seesmic_enabled'] && $comment['seesmic']['id']) : ?>
134
-
135
- <div id='<?php echo $comment['seesmic']['id'][0]; ?>_preview'><a href="http://www.seesmic.com/video/<?php echo $comment['seesmic']['id'][0]; ?>" target='_blank' class='see_link'>&nbsp;</a>
136
- <div style='display:block;width:160px; height:120px; border:none; background-image:url(<?php echo $comment['seesmic']['metadata'][0]; ?>)'>
137
- <div id='<?php echo $comment['seesmic']['id'][0]; ?>_hide' class='seePlayOverlay' style='display:none;'>
138
- <img onclick="see_play_video('<?php echo $comment['seesmic']['id'][0]; ?>',false)" src='<?php echo DISQUS_MEDIA_URL; ?>/images/seesmic/stopOverlay.png' width='50' height='50' style='cursor:pointer; cursor:hand; padding-top: 30px; padding-left: 50px' alt="" />
139
- </div>
140
- <div id='<?php echo $comment['seesmic']['id'][0]; ?>_show' class='seePlayOverlay'>
141
- <img onclick="see_play_video('<?php echo $comment['seesmic']['id'][0]; ?>',true)" src='<?php echo DISQUS_MEDIA_URL; ?>/images/seesmic/playOverlay.png' width='50' height='50' style='cursor:pointer; cursor:hand; border:none; padding-top: 30px; padding-left: 50px' alt="" />
142
- </div>
143
- </div>
144
- </div>
145
- <div id='<?php echo $comment['seesmic']['id'][0]; ?>_content' style='display:block; width:100%; padding-top:5px'></div>
146
- <?php endif ; ?>
147
- </div>
148
-
149
- <div class="dsq-comment-footer" id="dsq-comment-footer-<?php echo $comment['id']; ?>">
150
- <?php if ( !$dsq_response['thread_locked'] ) : ?>
151
- <a href="#" id="dsq-reply-link-<?php echo $comment['id'] ?>">reply</a>
152
- <span id="dsq-edit-wrap-<?php echo $comment['id'] ?>" style="display: none">
153
- &nbsp;<a href="#" id="dsq-edit-<?php echo $comment['id'] ?>" style="display: none">edit</a>
154
- </span>
155
- <?php if ( $dsq_response['seesmic_enabled'] ) : ?>
156
- &nbsp;<a id="dsq-post-video-<?php echo $comment['id']; ?>" href="#" style="display: none"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/seesmic/record.png" class="dsq-record-img" alt="" /> record video comment</a>
157
- <?php endif ; ?>
158
- <?php endif ; ?>
159
- <span id="dsq-reblog-wrap-<?php echo $comment['id'] ?>" style="display: none">
160
- &nbsp;<a href="#" id="dsq-reblog-<?php echo $comment['id'] ?>" class="dsq-reblog">reblog</a>
161
- </span>
162
- <span id="dsq-post-report-<?php echo $comment['id'] ?>" style="display: none">
163
- &nbsp;<a id="dsq-post-report-a-<?php echo $comment['id'] ?>" href="#" class="dsq-post-report">flag</a>
164
- </span>
165
- <div id="dsq-reply-<?php echo $comment['id']; ?>"><!-- iframe .dsq-post-reply injected here --></div>
166
- </div>
167
-
168
- <div id="dsq-hidden-data-<?php echo $comment['id']; ?>" style="display:none">
169
- <?php if($comment['user']['id']) : ?>
170
- <span style="display: none" id="dsq-hidden-clout-<?php echo $comment['id']; ?>"><?php echo $comment['user']['points']; ?></span>
171
- <span style="display: none" id="dsq-hidden-userurl-<?php echo $comment['id']; ?>">/people/<?php echo $comment['user']['profile']; ?>/</span>
172
- <span style="display: none" id="dsq-hidden-follow-<?php echo $comment['id']; ?>">/people/<?php echo $comment['user']['profile']; ?>/following/</span>
173
-
174
- <span style="display: none" id="dsq-hidden-blog-<?php echo $comment['id']; ?>"><?php echo $comment['user']['url']; ?></span>
175
- <span style="display: none" id="dsq-hidden-facebook-<?php echo $comment['id']; ?>"><?php echo $comment['user']['service_facebook']; ?></span>
176
- <span style="display: none" id="dsq-hidden-linkedin-<?php echo $comment['id']; ?>"><?php echo $comment['user']['service_linkedin']; ?></span>
177
- <span style="display: none" id="dsq-hidden-twitter-<?php echo $comment['id']; ?>"><?php echo $comment['user']['service_twitter']; ?></span>
178
- <span style="display: none" id="dsq-hidden-delicious-<?php echo $comment['id']; ?>"><?php echo $comment['user']['service_delicious']; ?></span>
179
- <span style="display: none" id="dsq-hidden-flickr-<?php echo $comment['id']; ?>"><?php echo $comment['user']['service_flickr']; ?></span>
180
- <span style="display: none" id="dsq-hidden-tumblr-<?php echo $comment['id']; ?>"><?php echo $comment['user']['service_tumblr']; ?></span>
181
- <?php else : ?>
182
- <span style="display: none" id="dsq-hidden-blog-<?php echo $comment['id']; ?>"><?php echo $comment['user']['url']; ?></span>
183
- <span style="display: none" id="dsq-hidden-userurl-<?php echo $comment['id']; ?>">/people/<?php echo $comment['user']['profile']; ?>/</span>
184
- <span style="display: none" id="dsq-hidden-facebook-<?php echo $comment['id']; ?>"></span>
185
- <span style="display: none" id="dsq-hidden-linkedin-<?php echo $comment['id']; ?>"></span>
186
- <span style="display: none" id="dsq-hidden-twitter-<?php echo $comment['id']; ?>"></span>
187
- <span style="display: none" id="dsq-hidden-delicious-<?php echo $comment['id']; ?>"></span>
188
- <span style="display: none" id="dsq-hidden-flickr-<?php echo $comment['id']; ?>"></span>
189
- <span style="display: none" id="dsq-hidden-tumblr-<?php echo $comment['id']; ?>"></span>
190
- <?php endif; ?>
191
- <span style="display: none" id="dsq-hidden-avatar-<?php echo $comment['id']; ?>"><img src="<?php echo $comment['user']['avatar_url']; ?>" alt="" /></span>
192
- </div>
193
- </li>
194
- <?php endif ; ?>
195
- <?php endforeach; ?>
196
- </ul>
197
- <div id="dsq-pagination">
198
- <?php
199
- if ( $dsq_response['paginate'] && $dsq_response['pages'] > 1 ) {
200
- echo '<a href="#" onclick="Dsq.Thread.appendPage(2); return false">Show more comments...</a>';
201
- } else {
202
- echo '&nbsp;';
203
- }
204
- ?>
205
- </div>
206
- <div id="dsq-post-bottom" style="display: none">
207
- <?php if ( !$dsq_response['thread_locked'] ) : ?>
208
- <div id="dsq-auth">
209
- <div class="dsq-by"><a href="http://disqus.com/" target="_blank"><img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/dsq-button-120x19.png" alt="discussion by DISQUS" /></a></div>
210
- <div class="dsq-auth-header">
211
- <h3 id="dsq-add-new-comment">Add New Comment</h3>
212
- <span id="dsq-auth-as"><noscript><br />You must have JavaScript enabled to comment.</noscript></span>
213
- </div>
214
- </div>
215
- <?php else : ?>
216
- <span id="dsq-post-add">Comments for this post are closed.</span>
217
- <?php endif ; ?>
218
- </div>
219
- <?php if ($dsq_response['linkbacks_enabled'] ) : ?>
220
- <h3>Trackbacks</h3>
221
- <p>(<a href="<?php trackback_url(); ?>" rel="trackback">Trackback URL</a>)</p>
222
- <ul id="dsq-references">
223
- <?php foreach ($comments as $comment) : ?>
224
- <?php $comment_type = get_comment_type(); ?>
225
- <?php if($comment_type != 'comment') { ?>
226
- <li>
227
- <cite><?php comment_author_link(); ?></cite>
228
- <p class="dsq-meta"><?php comment_date(); ?> at <?php comment_time(); ?></p>
229
- <p class="dsq-content"><?php comment_excerpt(); ?></p>
230
- </li>
231
- <?php } ?>
232
- <?php endforeach; ?>
233
- </ul>
234
- <?php endif ; ?>
235
- </div>
236
- </div>
237
-
238
-
239
- <!-- embed_thread_profile.html -->
240
-
241
- <!-- profile -->
242
- <div id="dsq-template-profile" class="dsq-popupdiv" style="display:none">
243
- <div id="dsq-popup-profile">
244
- <div id="dsq-popup-top">
245
- </div>
246
- <div id="dsq-popup-body" class="clearfix">
247
- <div id="dsq-popup-body-padding">
248
- <div id="dsq-popup-header">
249
- <a class="dsq-close-link" href="#" onclick="Dsq.Popup.hidePopup(); return false">close</a>
250
- <span id="dsq-profile-avatar"></span>
251
- <cite>
252
- <span id="dsq-profile-cite"></span>(<a id="dsq-profile-userurl" href="#"></a>)
253
  </cite>
254
  </div>
255
- <div id="dsq-profile-services">
256
- <a id="dsq-profile-clout" class="dsq-profile-badge" href="#"></a>
257
- <ul>
258
- <li style="display:none">
259
- <a id="dsq-service-blog" href="#" target="_blank">
260
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/blog.png" alt="" />
261
- </a>
262
- </li>
263
- <li style="display:none">
264
- <a id="dsq-service-facebook" href="#" target="_blank">
265
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/facebook.png" alt="" />
266
- </a>
267
- </li>
268
- <li style="display:none">
269
- <a id="dsq-service-linkedin" href="#" target="_blank">
270
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/linkedin.png" alt="" />
271
- </a>
272
- </li>
273
- <li style="display:none">
274
- <a id="dsq-service-twitter" href="#" target="_blank">
275
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/twitter.png" alt="" />
276
- </a>
277
- </li>
278
- <li style="display:none">
279
- <a id="dsq-service-delicious" href="#" target="_blank">
280
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/delicious.png" alt="" />
281
- </a>
282
- </li>
283
- <li style="display:none">
284
- <a id="dsq-service-flickr" href="#" target="_blank">
285
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/flickr.png" alt="" />
286
- </a>
287
- </li>
288
- <li style="display:none">
289
- <a id="dsq-service-tumblr" href="#" target="_blank">
290
- <img src="<?php echo DISQUS_MEDIA_URL; ?>/images/embed/services/tumblr.png" alt="" />
291
- </a>
292
- </li>
293
- </ul>
294
- </div>
295
- <div id="dsq-profile-status">
296
- <p class="dsq-profile-label">status via twitter</p>
297
- <p></p>
298
  </div>
299
- <div id="dsq-profile-recentcomments">
300
- <p class="dsq-profile-label">recent comments <span>(<a href="#" id="dsq-profile-follow">follow comments</a>)</span></p>
301
- <ul id="dsq-profile-commentlist"></ul>
302
- </div>
303
- <div class="show-more"><a href="#" id="dsq-profile-showmore">View Profile »</a></div>
304
- <div class="powered-by"><a href="<?php echo DISQUS_URL; ?>">Powered by <span class="disqus">Disqus</span></a>&nbsp;&middot;&nbsp;<a href="<?php echo DISQUS_URL; ?>">Learn more</a></div>
305
- </div> <!-- padding -->
306
- </div> <!-- body -->
307
- <div id="dsq-popup-bottom"></div>
308
- </div>
309
- </div>
310
-
311
- <!-- reblog -->
312
- <div id="dsq-template-reblog" class="dsq-reblogdiv">
313
- <div id="dsq-popup-profile">
314
- <div id="dsq-popup-top">
315
- </div>
316
- <div id="dsq-popup-body" class="clearfix">
317
- <div id="dsq-popup-body-padding">
318
- <div id="dsq-popup-header">
319
- <a class="dsq-close-link" id="dsq-close-reblog" href="#" onclick="Dsq.Popup.hidePopup(); return false">close</a>
320
- <cite>Reblog this comment</cite>
321
- </div>
322
- <div id="dsq-reblog-form">
323
- </div>
324
- <div class="powered-by"><a href="<?php echo DISQUS_URL; ?>">Powered by <span class="disqus">Disqus</span></a>&nbsp;&middot;&nbsp;<a href="http://disqus.com/">Learn more</a></div>
325
- </div> <!-- padding -->
326
- </div> <!-- body -->
327
- <div id="dsq-popup-bottom"></div>
328
  </div>
329
  </div>
330
 
331
- <!-- /embed_thread_profile.html -->
332
-
333
  <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
 
334
  <script type="text/javascript" charset="utf-8">
335
- var disqusMediaUrl = "<?php echo DISQUS_MEDIA_URL; ?>";
336
- var threadEl = document.getElementById('dsq-content');
337
  var disqus_url = '<?php echo get_permalink(); ?> ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  </script>
339
- <script type="text/javascript" src="<?php echo DISQUS_API_URL; ?>/scripts/<?php echo strtolower(get_option('disqus_forum_url')); ?>/disqus.js?t=<?php echo $dsq_response['thread_slug']; ?>"></script>
340
- <script type="text/javascript" src="<?php echo DISQUS_API_URL; ?>/api/v1/embed_reply.js?forum_url=<?php echo $dsq_response['forum_url']; ?>&thread_id=<?php echo $dsq_response['thread_id']; ?>"></script>
 
1
  <?php
2
+ global $dsq_response, $dsq_version;
 
3
  ?>
4
 
5
  <div id="disqus_thread">
6
  <div id="dsq-content">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  <ul id="dsq-comments">
8
+ <?php foreach ( $dsq_response['posts'] as $comment ) : ?>
9
+ <div id="comment-<?php echo $comment['id']; ?>"></div>
10
+
11
+ <li id="dsq-comment-<?php echo $comment['id']; ?>">
12
+ <div id="dsq-comment-header-<?php echo $comment['id']; ?>" class="dsq-comment-header">
13
+ <cite id="dsq-cite-<?php echo $comment['id']; ?>">
14
+ <?php if($comment['user']['url']) : ?>
15
+ <a id="dsq-author-user-<?php echo $comment['id']; ?>" href="<?php echo $comment['user']['url']; ?>" target="_blank" rel="nofollow"><?php echo $comment['user']['display_name']; ?></a>
16
+ <?php else : ?>
17
+ <span id="dsq-author-user-<?php echo $comment['id']; ?>"><?php echo $comment['user']['display_name']; ?></span>
18
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </cite>
20
  </div>
21
+ <div id="dsq-comment-body-<?php echo $comment['id']; ?>" class="dsq-comment-body">
22
+ <div id="dsq-comment-message-<?php echo $comment['id']; ?>" class="dsq-comment-message"><?php echo $comment['message']; ?></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </div>
24
+ </li>
25
+ <?php endforeach; ?>
26
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  </div>
28
  </div>
29
 
 
 
30
  <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
31
+
32
  <script type="text/javascript" charset="utf-8">
 
 
33
  var disqus_url = '<?php echo get_permalink(); ?> ';
34
+ var disqus_container_id = 'disqus_thread';
35
+ var facebookXdReceiverPath = '<?php echo DSQ_PLUGIN_URL . '/xd_receiver.htm' ?>';
36
+ </script>
37
+
38
+ <script type="text/javascript" charset="utf-8">
39
+ var DsqLocal = {
40
+ 'trackbacks': [
41
+ <?php
42
+ $count = 0;
43
+ foreach ($comments as $comment) {
44
+ $comment_type = get_comment_type();
45
+ if ( $comment_type != 'comment' ) {
46
+ if( $count ) { echo ','; }
47
+ ?>
48
+ {
49
+ 'author_name': '<?php echo htmlspecialchars(get_comment_author(), ENT_QUOTES); ?>',
50
+ 'author_url': '<?php echo htmlspecialchars(get_comment_author_url(), ENT_QUOTES); ?>',
51
+ 'date': '<?php comment_date('m/d/Y h:i A'); ?>',
52
+ 'excerpt': '<?php echo htmlspecialchars(get_comment_excerpt(), ENT_QUOTES); ?>'
53
+ }
54
+ <?php
55
+ $count++;
56
+ }
57
+ }
58
+ ?>
59
+ ],
60
+ 'trackback_url': '<?php trackback_url(); ?>'
61
+ };
62
  </script>
63
+
64
+ <script type="text/javascript" charset="utf-8" src="<?php echo DISQUS_API_URL; ?>/scripts/<?php echo strtolower(get_option('disqus_forum_url')); ?>/disqus.js?v=2.0&slug=<?php echo $dsq_response['thread_slug']; ?>&pname=wordpress&pver=<?php echo $dsq_version; ?>"></script>
disqus.php CHANGED
@@ -4,11 +4,13 @@ Plugin Name: DISQUS Comment System
4
  Plugin URI: http://disqus.com/
5
  Description: The DISQUS comment system replaces your WordPress comment system with your comments hosted and powered by DISQUS. Head over to the Comments admin page to set up your DISQUS Comment System.
6
  Author: DISQUS.com <team@disqus.com>
7
- Version: 2.04-3996
8
  Author URI: http://disqus.com/
9
 
10
  */
11
 
 
 
12
  define('DISQUS_URL', 'http://disqus.com');
13
  define('DISQUS_API_URL', DISQUS_URL);
14
  define('DISQUS_DOMAIN', 'disqus.com');
@@ -16,7 +18,30 @@ define('DISQUS_IMPORTER_URL', 'http://import.disqus.net');
16
  define('DISQUS_MEDIA_URL', 'http://media.disqus.com');
17
  define('DISQUS_RSS_PATH', '/latest.rss');
18
 
19
- require_once('lib/api.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  /**
22
  * DISQUS WordPress plugin version.
@@ -24,7 +49,7 @@ require_once('lib/api.php');
24
  * @global string $dsq_version
25
  * @since 1.0
26
  */
27
- $dsq_version = '2.04';
28
  /**
29
  * Response from DISQUS get_thread API call for comments template.
30
  *
@@ -54,11 +79,6 @@ $dsq_cc_script_embedded = false;
54
  */
55
  $dsq_api = new DisqusAPI(get_option('disqus_forum_url'), get_option('disqus_api_key'));
56
 
57
- /**
58
- * Template tags
59
- */
60
- // TODO: Add widget template tags.
61
-
62
 
63
  /**
64
  * Helper functions.
@@ -192,7 +212,7 @@ function dsq_sync_comments($post, $comments) {
192
  */
193
 
194
  function dsq_get_style() {
195
- echo "<link rel=\"stylesheet\" href=\"" . DISQUS_API_URL ."/stylesheets/" . strtolower(get_option('disqus_forum_url')) . "/disqus.css\" type=\"text/css\" media=\"screen\" />";
196
  }
197
 
198
  add_action('wp_head','dsq_get_style');
@@ -259,14 +279,14 @@ function dsq_comment_count() {
259
  // <![CDATA[
260
  (function() {
261
  var links = document.getElementsByTagName('a');
262
- var query = '?';
263
  for(var i = 0; i < links.length; i++) {
264
  if(links[i].href.indexOf('#disqus_thread') >= 0) {
265
  links[i].innerHTML = 'View Comments';
266
- query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
267
  }
268
  }
269
- document.write('<script charset="utf-8" type="text/javascript" src="<?php echo DISQUS_URL ?>/forums/<?php echo strtolower(get_option('disqus_forum_url')); ?>/get_num_replies.js' + query + '"><' + '/script>');
270
  })();
271
  //]]>
272
  </script>
@@ -276,28 +296,17 @@ function dsq_comment_count() {
276
  $dsq_cc_script_embedded = true;
277
  }
278
 
279
- function dsq_get_comments_number($num_comments) {
280
- $replace = get_option('disqus_replace');
281
-
282
- // HACK: Don't allow $num_comments to be 0. If we're only replacing
283
- // closed comments, we don't care about the value. For
284
- // comments_popup_link();
285
- if ( $replace != 'closed' && 0 == $num_comments ) {
286
- return -1;
287
- } else {
288
- return $num_comments;
289
- }
290
- }
291
-
292
  // Mark entries in index to replace comments link.
293
  function dsq_comments_number($comment_text) {
 
 
294
  if ( dsq_can_replace() ) {
295
  ob_start();
296
  the_permalink();
297
  $the_permalink = ob_get_contents();
298
  ob_end_clean();
299
 
300
- return '</a><noscript><a href="http://' . strtolower(get_option('disqus_forum_url')) . '.' . DISQUS_DOMAIN . '/?url=' . $the_permalink .'">View comments</a></noscript><a class="dsq-comment-count" href="' . $the_permalink . '#disqus_thread">Comments</a>';
301
  } else {
302
  return $comment_text;
303
  }
@@ -376,7 +385,6 @@ add_action('admin_notices', 'dsq_check_version');
376
  // Only replace comments if the disqus_forum_url option is set.
377
  add_filter('comments_template', 'dsq_comments_template');
378
  add_filter('comments_number', 'dsq_comments_number');
379
- add_filter('get_comments_number', 'dsq_get_comments_number');
380
  add_filter('bloginfo_url', 'dsq_bloginfo_url');
381
  add_action('loop_start', 'dsq_loop_start');
382
 
4
  Plugin URI: http://disqus.com/
5
  Description: The DISQUS comment system replaces your WordPress comment system with your comments hosted and powered by DISQUS. Head over to the Comments admin page to set up your DISQUS Comment System.
6
  Author: DISQUS.com <team@disqus.com>
7
+ Version: 2.1-4342
8
  Author URI: http://disqus.com/
9
 
10
  */
11
 
12
+ require_once('lib/api.php');
13
+
14
  define('DISQUS_URL', 'http://disqus.com');
15
  define('DISQUS_API_URL', DISQUS_URL);
16
  define('DISQUS_DOMAIN', 'disqus.com');
18
  define('DISQUS_MEDIA_URL', 'http://media.disqus.com');
19
  define('DISQUS_RSS_PATH', '/latest.rss');
20
 
21
+ function dsq_plugin_basename($file) {
22
+ $file = dirname($file);
23
+
24
+ // From WP2.5 wp-includes/plugin.php:plugin_basename()
25
+ $file = str_replace('\\','/',$file); // sanitize for Win32 installs
26
+ $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
27
+ $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir
28
+
29
+ if ( strstr($file, '/') === false ) {
30
+ return $file;
31
+ }
32
+
33
+ $pieces = explode('/', $file);
34
+ return !empty($pieces[count($pieces)-1]) ? $pieces[count($pieces)-1] : $pieces[count($pieces)-2];
35
+ }
36
+
37
+ if ( !defined('WP_CONTENT_URL') ) {
38
+ define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
39
+ }
40
+ if ( !defined('PLUGINDIR') ) {
41
+ define('PLUGINDIR', 'wp-content/plugins'); // Relative to ABSPATH. For back compat.
42
+ }
43
+
44
+ define('DSQ_PLUGIN_URL', WP_CONTENT_URL . '/plugins/' . dsq_plugin_basename(__FILE__));
45
 
46
  /**
47
  * DISQUS WordPress plugin version.
49
  * @global string $dsq_version
50
  * @since 1.0
51
  */
52
+ $dsq_version = '2.1';
53
  /**
54
  * Response from DISQUS get_thread API call for comments template.
55
  *
79
  */
80
  $dsq_api = new DisqusAPI(get_option('disqus_forum_url'), get_option('disqus_api_key'));
81
 
 
 
 
 
 
82
 
83
  /**
84
  * Helper functions.
212
  */
213
 
214
  function dsq_get_style() {
215
+ echo "<link rel=\"stylesheet\" href=\"" . DISQUS_API_URL ."/stylesheets/" . strtolower(get_option('disqus_forum_url')) . "/disqus.css?v=2.0\" type=\"text/css\" media=\"screen\" />";
216
  }
217
 
218
  add_action('wp_head','dsq_get_style');
279
  // <![CDATA[
280
  (function() {
281
  var links = document.getElementsByTagName('a');
282
+ var query = '&';
283
  for(var i = 0; i < links.length; i++) {
284
  if(links[i].href.indexOf('#disqus_thread') >= 0) {
285
  links[i].innerHTML = 'View Comments';
286
+ query += 'wpid' + i + '=' + encodeURIComponent(links[i].getAttribute('wpid')) + '&';
287
  }
288
  }
289
+ document.write('<script charset="utf-8" type="text/javascript" src="<?php echo DISQUS_URL ?>/forums/<?php echo strtolower(get_option('disqus_forum_url')); ?>/get_num_replies_from_wpid.js?v=2.0' + query + '"><' + '/script>');
290
  })();
291
  //]]>
292
  </script>
296
  $dsq_cc_script_embedded = true;
297
  }
298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  // Mark entries in index to replace comments link.
300
  function dsq_comments_number($comment_text) {
301
+ global $post;
302
+
303
  if ( dsq_can_replace() ) {
304
  ob_start();
305
  the_permalink();
306
  $the_permalink = ob_get_contents();
307
  ob_end_clean();
308
 
309
+ return '</a><noscript><a href="http://' . strtolower(get_option('disqus_forum_url')) . '.' . DISQUS_DOMAIN . '/?url=' . $the_permalink .'">View comments</a></noscript><a class="dsq-comment-count" href="' . $the_permalink . '#disqus_thread" wpid="' . $post->ID . '">Comments</a>';
310
  } else {
311
  return $comment_text;
312
  }
385
  // Only replace comments if the disqus_forum_url option is set.
386
  add_filter('comments_template', 'dsq_comments_template');
387
  add_filter('comments_number', 'dsq_comments_number');
 
388
  add_filter('bloginfo_url', 'dsq_bloginfo_url');
389
  add_action('loop_start', 'dsq_loop_start');
390
 
manage.php CHANGED
@@ -1,29 +1,4 @@
1
  <?php
2
- if ( !defined('WP_CONTENT_URL') ) {
3
- define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
4
- }
5
- if ( !defined('PLUGINDIR') ) {
6
- define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
7
- }
8
-
9
- function dsq_plugin_basename($file) {
10
- $file = dirname($file);
11
-
12
- // From WP2.5 wp-includes/plugin.php:plugin_basename()
13
- $file = str_replace('\\','/',$file); // sanitize for Win32 installs
14
- $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
15
- $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir
16
-
17
- if ( strstr($file, '/') === false ) {
18
- return $file;
19
- }
20
-
21
- $pieces = explode('/', $file);
22
- return !empty($pieces[count($pieces)-1]) ? $pieces[count($pieces)-1] : $pieces[count($pieces)-2];
23
- }
24
-
25
- define('DSQ_PLUGIN_URL', WP_CONTENT_URL . '/plugins/' . dsq_plugin_basename(__FILE__));
26
-
27
  global $wp_version;
28
  global $dsq_version;
29
  global $dsq_api;
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  global $wp_version;
3
  global $dsq_version;
4
  global $dsq_api;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: DISQUS.com <team@disqus.com>
3
  Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget
4
  Requires at least: 2.0
5
  Tested up to: 2.7
6
- Stable tag: 2.04.3996
7
 
8
  The DISQUS comment system replaces your WordPress comment system with your comments hosted and powered by DISQUS.
9
 
@@ -43,7 +43,7 @@ The Disqus for WordPress plugin seamlessly integrates using the Disqus API and b
43
  of WordPress
44
 
45
  * Maintain the directory structure of the archive (all extracted files
46
- should exist in 'wp-content/plugins/disqus/'
47
 
48
  2. From your blog administration, click on Comments to change settings
49
  (WordPress 2.0 users can find the settings under Options > Disqus.)
3
  Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget
4
  Requires at least: 2.0
5
  Tested up to: 2.7
6
+ Stable tag: 2.1.4342
7
 
8
  The DISQUS comment system replaces your WordPress comment system with your comments hosted and powered by DISQUS.
9
 
43
  of WordPress
44
 
45
  * Maintain the directory structure of the archive (all extracted files
46
+ should exist in 'wp-content/plugins/disqus-comment-system/'
47
 
48
  2. From your blog administration, click on Comments to change settings
49
  (WordPress 2.0 users can find the settings under Options > Disqus.)