Jump to content

Lumbergh

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Lumbergh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Alright, so I have easyban installed on my board (2.1), and I'm modifying it a little. I want to input a time function so that I set the amount of time the user is banned for, and when the time is up it places them into their old group. I have it so that when the user gets banned, it takes mgroup2=mgroup, so that it saves the old group, and it works fine. Now i'm on to the time part... which I can't figure out. [code]<td class="row1" colspan=2 width="40%" valign="top"> For how long? <td class="row2" colspan=2 width="40%" valign="top"> <input type="text" name="banamount">[/code] There is what I have in the template html for easy ban [code] // For how long? if($ibforums->input['banamount']!=0) {   $bantime = $ibforums->input['banamount'];   $unbantime = strtotime($bantime);   $this->ipsclass->DB->query("UPDATE ibf_members SET bantime=$unbantime WHERE id=".$id); }[/code] Thats the little snippet of code I have for the time. Right now the problem is that the banamount isn't seeming to go through. I echo'd the banamount before $bantime etc, and it came up with a blank page, and I can't figure out why. EDIT: Sorry, I forgot to mention that it gives me the same timestamp in ibf_members under bantime, of 1153717200, which is interesting. Is this even the best way to do this? Is my coding all wrong anyway? Thanks for the help!
  2. 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!
×
×
  • Create New...

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.