Jump to content

General question


karimali831

Recommended Posts

Using this code

 

function islocked($clanID) {
return (getpenaltypoints($clanID) >= 5);
}

 

imposes a ban to a team if they have 5 points or more. I want the value 5 to be set from admin without having to edit this code. So like a textfield in admin where you can input a value and it updates 5 to that value.

 

Any way round this?

Link to comment
Share on other sites

function islocked($clanID) {
return (getpenaltypoints($clanID) >= 5);
}

 

You can substitute 5 with a variable that can get pulled from a form.

 

 

function islocked($clanID) {
return (getpenaltypoints($clanID) >= $number);
}

 

 

Of course you would need to add a form to an administrator control panel and when you submit it, it'd go to that file so it can write to it (and in that file put a $variable = $_POST['variable'] so it could grab it).

Link to comment
Share on other sites

Ok.. beginner and I tried but it's wrong :(

 

function islocked($clanID) {
$ergebnis = safe_query("SELECT cupteamlimit FROM ".PREFIX."settings WHERE cupteamlimit = '$cupteamlimit'");	
while($db = mysql_fetch_array($ergebnis)) {
        $cupteamlimit = $db['cupteamlimit'];

        }
return (getpenaltypoints($clanID) >= $cupteamlimit);
}

 

am I close?

Link to comment
Share on other sites

function islocked($clanID) {
$ergebnis = safe_query("SELECT * FROM ".PREFIX."settings WHERE cupteamlimit");	
while($db = mysql_fetch_array($ergebnis)) {
        $cupteamlimit = $db['cupteamlimit'];

        }
return (getpenaltypoints($clanID) >= $cupteamlimit);
}

 

Ahh fixed :D

Thanks Eagle.

Link to comment
Share on other sites

Perfect, just what I needed. Thanks.

@  thorpe - if you can't read simple questions best not to say nothing.

 

If you can't narrow your question down to the actual issue at hand don't expect to have it answered in a manner you will be satisfied with.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.