Template talk:Water geohash

From Geo Hashing
Jump to: navigation, search

Identifying users as pirates[edit]

I wanted to change the template, so that if the current page was a user page, then the Pirates category would be added. However, there don't seem to be any string-comparison functions in the wiki template langauge, and my PHP fu is weak. Something like this:

{{#if "{{PAGENAME}}" ~ "User:.*"|[[Category:Pirates]]|}}

Anyone? -- Jevanyn

There is a function called rmatch that uses regex. I also got the template to do pretty much what I wanted without it: when the name argument matches the page name, or is blank add the pirate category; otherwise add the geohash achievement category. It does not handle the case of [[User:Whoever|Whoever]], but if a user's name is linkified, you're probably not on the user's page anyway. -- Jevanyn