chaoswar4u Posted July 7, 2007 Share Posted July 7, 2007 Hi all. I have a few problems in V2 yet to resolve. The problems are listed below. 1) Gangs have the ability to rename there gang to "Blank" nothing so peeps cannot declare war or even click on there gang for details. 2) In the forums people sometimes people forget to place a topic name thus it will there again show a blank box and thus not allowing it to be accessed. Alittle code input to help resolve this would be great. Quote Link to comment Share on other sites More sharing options...
Matty Posted July 7, 2007 Share Posted July 7, 2007 Re: Current V2 Problems (Minor Bugs) Help Required? You could however do it many ways for example... IF(!$gangname){ Echo "I am empty!"; } Orrrr IF(empty($gangname)){ Echo "I am empty!"; } There are a lot of issues with which is faster, some say that !$gangname would be faster that empty(), but in these instances it would be quicker to use empty() 1. It is needed for arrays and (I think) objects 2. empty() is actually FASTER than using just the variable. You might think that it would be slower because it looks like a function, but it is actually a language construct. Apparently it is optimized. It is at least 10% faster, sometimes nearly 20% faster. Quote Link to comment Share on other sites More sharing options...
Dabomstew Posted July 7, 2007 Share Posted July 7, 2007 Re: Current V2 Problems (Minor Bugs) Help Required? There are a lot of issues with which is faster, some say that !$gangname would be faster that empty(), but in these instances it would be quicker to use empty() 1. It is needed for arrays and (I think) objects 2. empty() is actually FASTER than using just the variable. You might think that it would be slower because it looks like a function, but it is actually a language construct. Apparently it is optimized. It is at least 10% faster, sometimes nearly 20% faster. In this case, does it really matter? We're not using it in a loop, we're using it once - both functions will take virtually no time to execute, so there's little to no point in a 10-20% gain if the time is 0.001s to start with. To solve your problems, as Hack3rmatt stated, you should check if the input is empty when its posted, and if so stop them creating their gang/changing gang name/posting a topic. Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted July 7, 2007 Share Posted July 7, 2007 Re: Current V2 Problems (Minor Bugs) Help Required? Dunno, from what I know using !$var is the equivalent of if (!isset($var) && empty($var)), and i dont even see the point in that.. I just use strlen Quote Link to comment Share on other sites More sharing options...
Matty Posted July 8, 2007 Share Posted July 8, 2007 Re: Current V2 Problems (Minor Bugs) Help Required? In this case, does it really matter? We're not using it in a loop, we're using it once - both functions will take virtually no time to execute, so there's little to no point in a 10-20% gain if the time is 0.001s to start with. Yes It does matter, I was telling him alternatives and what to use when, so when he does know how to code better and wants to make his own mod which actually has a loop then he will know what to use and what will give him the best performance, so that his code will be efficient and properly coded. Shame this couldn't be said for somethings though... 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.