PortalParts.com Site

 Forum Index > Geeklog > ChatterBlock Plugin Support New Topic Post Reply
 chatterblock - Delete your last post
 |  Printable Version
1000ideen
 October 03 2005 14:56 PM (Read 9655 times)  
Forum Senior
Senior

Status: offline

Registered: 05/23/04
Posts: 44

It happened time and time again that I was able to use "Delete your last post" in the chatterblock here on http://www.portalparts.com not only to delete my own but also other's posts as anonymous user! It was also removed from the Chatterblock Posting History.

'Is this a known bug?


 
Profile Email PM
Quote
Blaine
 October 03 2005 18:50 PM  
Forum Admin
Admin

Status: offline

Registered: 03/01/02
Posts: 3576

I had not noticed as I am usually logged in and am sure this was never the case before. Are you using chatterblock on your site and see the same issue ?


Please consider contributing to support my efforts ..
 
Profile Email Website PM
Quote
1000ideen
 May 16 2009 15:44 PM  
Forum Senior
Senior

Status: offline

Registered: 05/23/04
Posts: 44

Version 3.1 still shows this problem plus when I klick PM and send then it sends something althogh I don`t have PMs installed. The result is that is signals that I have PMs.


 
Profile Email PM
Quote
1000ideen
 May 20 2009 11:53 AM  
Forum Senior
Senior

Status: offline

Registered: 05/23/04
Posts: 44

O.k. I discovered the secret of PMs they are special Chatterblock PMs. Nevertheless the other problem of being able to remove any last posting is persisting.


 
Profile Email PM
Quote
gtgillis
 May 22 2009 11:09 AM  
Forum Junior
Junior

Status: offline

Registered: 10/29/03
Posts: 9

Quote by: 1000ideen

O.k. I discovered the secret of PMs they are special Chatterblock PMs. Nevertheless the other problem of being able to remove any last posting is persisting.



I have confirmed that if the option to delete the last post is turned on the last post is deleted and it does not matter who posted the chatter.

Was the intent of this option so that a user could delete a comment they just made or was it to delete a message you posted last week?

I don't have this turned on myself but a if you want to allow the user to delete his last comment and no one else has posted a message yet you can make the following change.

Edit cb_main.php

find function cb_chk4deletereq()

I edited the two $query lines.


PHP Formatted Code

 cb_chk4deletereq() {
    global $_USER, $_TABLES;
    foreach ($_POST as $key => $value) {
    // Test for request to clear last post or if user has Checked any private messages
        if (substr($key, 0, 11) == 'cb_clrpost_') {
            $id = addslashes(substr($key, 11, strlen($key)-11));
            $query = 'DELETE FROM '.$_TABLES['cb_chatterlog'] .' where id='.$id.' AND author_user='.$_USER['uid'];
            DB_query($query);
        } elseif (substr($key, 0, 7) == 'cb_del_') {
            $id = addslashes(substr($key, 7, strlen($key)-7));
            $query = "DELETE FROM " .$_TABLES['cb_chatterlog']. " WHERE id='" .$id. "'"." AND author_user='".$_USER['uid']."'";
            DB_query($query);
        }
    }
}

 


Down and dirty. All this does is delete the last record IF the author_user=current user ID. If someone entered a comment after the comment you want to delete then nothing is deleted.


Pity for the guilty is treason to the innocent.
 
Profile Email Website PM
Quote
Content generated in: 0.25 seconds
New Topic Post Reply



 All times are CDT. The time is now 03:41 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content