Lombi 34 Posted December 21, 2011 Report Share Posted December 21, 2011 So I'm doing a wordpress update bot and I'm hitting a problem that I have a couple language barriers (having english/slovenian/slovenian3.3 translations), which makes it difficult to make if statements based on text. So I ask: Is there a possibility to make an if statement based on 3 separate arguments (contains = $document_text = some text) without having to duplicate code? Thanks! Quote Link to post Share on other sites
Lombi 34 Posted December 21, 2011 Author Report Share Posted December 21, 2011 Oh yeah - the arguments aren't "1 AND 2 AND 3" they are "1 OR 2 OR 3" Quote Link to post Share on other sites
a2mateit 395 Posted December 21, 2011 Report Share Posted December 21, 2011 Hey Lombi, I am not sure but I believe this can be achieved with the else if command. I think I read that somewhere on here before. Quote Link to post Share on other sites
Lombi 34 Posted December 21, 2011 Author Report Share Posted December 21, 2011 So the content of the script needs to be stuck in a command? I was really looking for a central way to get contains commands into the if part without having to duplicate the logic... Quote Link to post Share on other sites
a2mateit 395 Posted December 22, 2011 Report Share Posted December 22, 2011 I'm not sure if there is a simpler way or not. One of my bots that does multiple languages had 30 different if/then statements to determine if account creation was successful. Then I discovered that they all had the same footprint in the url if successful. I was super upset when I realized that I could have accomplished the same thing with one if/then statement. Perhaps you can try looking for a simpler footprint, maybe one in the url. You might find something that is constant in all different languages, the url is a good place to start. Still hoping a senior member can clear this up for us. HTHJustin Quote Link to post Share on other sites
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.