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
https://forums.phpfreaks.com/topic/192855-general-question/
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
https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015877
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
https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015888
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
https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015889
Share on other sites

Archived

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

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