SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 5, 2005 5:43:29 GMT
The dropdown option has been implemented but it's still in testing phase hence another URL: www.speedworx.org/ik/test_view.phpOnce everyone is happy it works OK I'll move it to the "correct" URL.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 15, 2005 20:21:43 GMT
How would I replace multiple spaces (all together) with one single space? Pretty please!
|
|
Freiegeister
Morkin Member
'Blasphemy is a victimless crime' - Dawkins
Posts: 1,126
|
Post by Freiegeister on Sept 16, 2005 3:36:48 GMT
How would I replace multiple spaces (all together) with one single space? Pretty please! $newstring = ereg_replace("\x20+", "\x20", $string); Or something like that.
|
|
|
Post by sparrowhawk on Sept 16, 2005 7:40:10 GMT
I love that last bit, "or something like that"! You see, even the regex pros aren't sure! It's a Dark Art, burn him, witch, witch!
|
|
Shendemiar
Morkin Admin
Mmmm, free goo!
Posts: 6,751
|
Post by Shendemiar on Sept 16, 2005 9:22:39 GMT
I love that last bit, "or something like that"! You see, even the regex pros aren't sure! It's a Dark Art, burn him, witch, witch! Indeed! LOL
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 16, 2005 11:34:43 GMT
LOL! I might change my sig to "or something like that" I'll try it tonight and let you know how I get on. There's no PHP command called mulitiple_replace or something like that then?
|
|
|
Post by sparrowhawk on Sept 16, 2005 11:53:16 GMT
there's str_replace, end ereg_replace. between those two, you should have it covered
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 16, 2005 19:45:53 GMT
Thanks, I found this after Googling which works: I guess those /\s/ etc bits are the black art stuff mentioned earlier, is there a website I can learn about it? When I try Googling for black art I get stuff like: "Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk agh burzum-ishi krimpatul." Which seems vaguely familiar However it doesn't do exactly what I want in terms of PHP code
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 16, 2005 19:47:26 GMT
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 16, 2005 19:57:58 GMT
|
|
Freiegeister
Morkin Member
'Blasphemy is a victimless crime' - Dawkins
Posts: 1,126
|
Post by Freiegeister on Sept 17, 2005 1:39:08 GMT
Thanks, I found this after Googling which works: I guess those /\s/ etc bits are the black art stuff mentioned earlier, is there a website I can learn about it? When I try Googling for black art I get stuff like: "Ash nazg durbatulûk, ash nazg gimbatul, ash nazg thrakatulûk agh burzum-ishi krimpatul." Which seems vaguely familiar However it doesn't do exactly what I want in terms of PHP code preg uses the Perl syntax, which I should have used anyway - that's the syntax I learnt originally - back before there was PHP. The regular expression is bracketed with / / The double \s seems superfluous as the + searches for 1 or more anyway. You would be better off using \x20+ as that is exclusively space characters where the other will find any whitespace. Maybe [\t\x20]+ which also looks for tabs?
|
|
Freiegeister
Morkin Member
'Blasphemy is a victimless crime' - Dawkins
Posts: 1,126
|
Post by Freiegeister on Sept 17, 2005 2:17:58 GMT
I love that last bit, "or something like that"! You see, even the regex pros aren't sure! It's a Dark Art, burn him, witch, witch! Indeed! LOL Ha! I haven't actually programmed in PHP for quite a few years so without actually testing what I suggest it's not likely to work, or something like that.
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 17, 2005 4:19:31 GMT
Thanks, I've been reading some good tutorials about regex and am beginning to understand it. Still only an apprentice witch though
|
|
SkulkrinBait
Morkin Admin
Haxx0rs == Suxx0rs! v4
Posts: 6,680
|
Post by SkulkrinBait on Sept 22, 2005 11:08:42 GMT
I'm going to work on a database for us to put our own island details on for reference, should save time updating the island threads. Before I do this I want to setup some security though.
So wait a bit! I'm going on holiday on Tuesday so it wont be done for at least two weeks.
|
|
Freiegeister
Morkin Member
'Blasphemy is a victimless crime' - Dawkins
Posts: 1,126
|
Post by Freiegeister on Nov 24, 2005 5:00:08 GMT
Got a little bored so I converted my Travian map to display Inselkampf. freiegeister.somee.com/inselkampf/map.aspxI populated some islands around 1:58, 1:68 and 1:78. The data format is stored like this: <Location Ocean="1" Group="78" Island="14" Type="1" Pop="2516" Date="22/11/2005" PID="29549" AID="3614"> <Name>Elenil</Name> <Player>Freiegeister</Player> <Alliance>Morkin</Alliance> <StatusNotes /> </Location>
PID is the member id, AID is the alliance ID Type: 1 = Island, 2 = colony I'll try and find time to implement the import soon. The first implementation will accept data in the format: Isle Name ~~24~~ Of Position 1:78:9 Ruler Chaos Score 861 Colony Yes
|
|