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? Link to comment https://forums.phpfreaks.com/topic/192855-general-question/ 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. Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015811 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. Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015869 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? Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015874 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). Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015877 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. Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015885 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? Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015888 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. Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015889 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 ? Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015890 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. Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015896 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. Link to comment https://forums.phpfreaks.com/topic/192855-general-question/#findComment-1015897 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.