karimali831 Posted February 21, 2010 Share Posted February 21, 2010 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? Quote Link to comment Share on other sites More sharing options...
trq Posted February 21, 2010 Share Posted February 21, 2010 Have you tried to think this process through? The idea is quite simple. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 22, 2010 Author Share Posted February 22, 2010 Yes I did thought about it, why wouldn't I and that's why I'm posting here. Quote Link to comment Share on other sites More sharing options...
trq Posted February 22, 2010 Share Posted February 22, 2010 So, where is the problem? Not sure how to write to a file? Not sure how to read from a file? Not sure how forms work with php? What? Quote Link to comment Share on other sites More sharing options...
The Eagle Posted February 22, 2010 Share Posted February 22, 2010 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). Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 22, 2010 Author Share Posted February 22, 2010 Perfect, just what I needed. Thanks. @ thorpe - if you can't read simple questions best not to say nothing. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 22, 2010 Author Share Posted February 22, 2010 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? Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 22, 2010 Author Share Posted February 22, 2010 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 Thanks Eagle. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 22, 2010 Author Share Posted February 22, 2010 So if I wanted to do the same with if(mysql_num_rows($sql_member2)==3) is that if(mysql_num_rows($sql_member2)==$number) or won't it work ? Quote Link to comment Share on other sites More sharing options...
trq Posted February 22, 2010 Share Posted February 22, 2010 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. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted February 22, 2010 Author Share Posted February 22, 2010 I was satisfied with my answer? That's how this topic is now resolved.. to you I didn't explain properly, some people have quicker minds than others. I'm just a beginner. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.