Skip to content
Browse files

Fix bad link by providing talk id instead of comment id.

In addition, add a comment hash to the URL so most browsers will automatically
load the page to that comment.
  • Loading branch information...
1 parent db702b3 commit 75ee41b573caa9450740652286aa569777f62e00 @themrwilliams committed Oct 26, 2011
View
3 src/inc/js/site.js
@@ -47,10 +47,11 @@ function deleteComment(cid,rtype){
});
return false;
}
-function commentIsSpam(cid,rtype){
+function commentIsSpam(cid,tid,rtype){
var obj=new Object();
obj.cid = cid;
obj.rtype = rtype;
+ obj.tid = tid;
apiRequest('comment','isspam',obj, function(obj) {
notifications.alert('Thanks for letting us know!'); return false;
});
View
5 src/system/application/libraries/wsactions/comment/Isspam.php
@@ -19,9 +19,10 @@ public function run(){
$cid = $this->xml->action->cid;
$rtype = $this->xml->action->rtype;
+ $tid = $this->xml->action->tid;
- $msg='Spam comment on : ' . $this->CI->config->site_url() . $rtype . '/view/' . $cid;
-
+ $msg='Spam comment on : ' . $this->CI->config->site_url() . $rtype . '/view/' . $tid . "#comment-" . $cid;
+
$admin_emails=$this->CI->user_model->getSiteAdminEmail();
foreach($admin_emails as $user){
mail($user->email,'Suggested spam comment!',$msg,'From: ' . $this->CI->config->item('email_info'));
View
2 src/system/application/views/talk/modules/_talk_comments.php
@@ -68,7 +68,7 @@
<?php endif; ?>
<?php if (
(isset($claimed[0]->userid) && $claimed[0]->userid != 0 && isset($currentUserId) && $currentUserId == $claimed[0]->userid) || $admin): ?>
- <a class="btn-small" href="#" onClick="commentIsSpam(<?php echo $v->ID?>,'talk');return false;">Is Spam</a>
+ <a class="btn-small" href="#" onClick="commentIsSpam(<?php echo $v->ID?>,<?php echo $v->talk_id?>,'talk');return false;">Is Spam</a>
<?php endif; ?>
</p>
<?php if (user_is_admin()): ?>

0 comments on commit 75ee41b

Please sign in to comment.
Something went wrong with that request. Please try again.