PortalParts.com Site

 Forum Index > Geeklog > ChatterBlock Plugin Support New Topic Post Reply
 chatterblock - Delete your last post
 |  Printable Version
1000ideen
 May 26 2009 18:45 PM  
Forum Senior
Senior

Status: offline

Registered: 05/23/04
Posts: 44

I received this error as ID1:
Mi 27 Mai 2009 01:39:21 CEST - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: DELETE FROM gl_cb_chatterlog where id=27 AND author_user=


 
Profile Email PM
Quote
gtgillis
 May 27 2009 07:44 AM  
Forum Junior
Junior

Status: offline

Registered: 10/29/03
Posts: 9

Quote by: 1000ideen

I received this error as ID1:
Mi 27 Mai 2009 01:39:21 CEST - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: DELETE FROM gl_cb_chatterlog where id=27 AND author_user=



Yes, I see the problem. Sorry I did not test with all of the options turned on.

I added an IF statement to check if the user is anonymous and will only allow a delete if the users uid is greater than 1.

PHP Formatted Code

cb_chk4deletereq() {
    global $_USER, $_TABLES;
if ($_USER['uid'] >1){
    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);
        }
        }
    }
}

 



Pity for the guilty is treason to the innocent.
 
Profile Email Website PM
Quote
1000ideen
 May 29 2009 09:22 AM  
Forum Senior
Senior

Status: offline

Registered: 05/23/04
Posts: 44

Thanks I tried your last suggestion and it works in the way that the owner can delete the last postings.

I had sent you an email to try to contact you. There are more bugs or alterations which would be necessary. The PMs are irritating and one should be able to turn it off. The sentence "Delete your last post" should not be visible for guests etc.

What does this mean? "Enable users to set individual preferences" I don`t want users to set anything in their "My Account" settings.


 
Profile Email PM
Quote
Blaine
 May 29 2009 09:36 AM  
Forum Admin
Admin

Status: offline

Registered: 03/01/02
Posts: 3576

From the plugins provided help and installation files:

If the site admin has enabled user defined settings, you will see a Chatterblock Settings menu item in your User Functions Block. This will allow you to set your personal preference for a number of settings including:

# Set the Chatterblock Mode for the block
# Number of hours of history to see
# Enable/Disable the popup-alert
# Set the number of lines to see per page in the chatterlog


Site admins can enable user preferences. Then all registered users will have a User Block menu item "Chatterblock Settings" to set their own preferences for Chatterblock mode, amount of history etc ...

If Site admin later disables user preferences, the site defaults will override any existing user settings


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

Status: offline

Registered: 05/23/04
Posts: 44

Site admins can enable user preferences. Then all registered users will have a User Block menu item "Chatterblock Settings"


This does not work. I always have this User Block menu item "Chatterblock Settings" even if I turn it off in the admin settings.


 
Profile Email PM
Quote
Content generated in: 0.20 seconds
New Topic Post Reply



 All times are CDT. The time is now 12:38 AM.
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