Jump to content

Archived

This topic is now archived and is closed to further replies.

Lumbergh

Invision power board ban system help

Recommended Posts

Alright... I just installed "easyban" on my 2.1 board, which is a little module that allows bans by the click of a button, and I wanted to modify it a little.

I'd like to add a time feature where you can ban a member for a certain amount of time, then after the time is up they get put back into their original usergroup.

I've modified the easyban skin thing to show a text box for time, with name "time". Easy enough.

Now I'm trying to modify the easyban to take the value of time and put it into the mysql database under ibf_members in time, and then set mgroup2 = mgroup so that they're original group is saved. Here is the little snippet of code I have(I have it so that if the user enters 0 it bans them forever... I think):

[code]// For how long?
if($ibforums->input['time']!="0")
{
  $time = time();
  $this->ipsclass->DB->query("INSERT INTO ibf_members VALUES('', '$time', mgroup2)");  
  $this->ipsclass->DB->query("UPDATE ibf_members SET mgroup=mgroup2 WHERE id=".$id);
}[/code]
When I just try it i keep getting this error:

[code]mySQL query error: INSERT INTO ibf_members VALUES('', '1153678576', mgroup2)

SQL error: Column count doesn't match value count at row 1
SQL error code:
Date: Sunday 23rd of July 2006 01:16:16 PM[/code]

Now, keep in mind I'm VERY new to php/mysql, and I'm just trying this to the best of my ability. Am I even going about this the correct way? How do I fix this error? Also, how would I make it so that when the time is up it sets mgroup = mgroup2 so the user is set back into their original group? If you need more of the code, just tell me.

Thanks for the help!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.