1 moonchild Mar 06, 2007 08:49
3 moonchild Mar 11, 2007 01:31
I finally managed it. I had to learn something. &.
I changed the function name from GetCountryAbb to country_abb. Here's what I ended up with in the _feedback.php file:
echo $Comment->GetCity();
echo $Comment->GetState();
$country_abb = &$Comment->country_abb();
$Comment->ip_flag($country_abb);
Please come by for a test drive! I need something to replace my sample comments. = P
[url=http://moonchild.ch/blog/index.php?blog=14]The Question[/url]
4 moonchild Mar 11, 2007 17:33
Thanks, guys, for the test comments.
The 3rd-party DB lookup is easiest for now, but I may change it later. It might at least be useful to insert the info retrieved into the user table. The flags are NOT 3rd-party; they're the locale flags. As it is now, if the hostip.com server is down, I guess I'll just get a bunch of default flags. Not a big deal for me, since it's a personal web page and nobody visits me anyway. = <
And, yes, the Swiss flag should be smaller. I made it that way to meet the b2evolution locale submission requirements. (I even made half-and-half flags for Swiss-German, Swiss-French and Swiss-Italian.) But since it apparently wasn't accepted, I'll change it somewhen. It's only a C-priority on my list of things to do.
I've made some progress on this, but I'm pulling my hair out by now. I've got to expose my ignorance and show what I've done so far.
First of all, I managed to get a little function working which returns the two-letter country code from the IP. I put it in the _class_comment.php file.
Now I want to use this to return an "ip_flag" (locale_flag with "locale" replaced by "GetCountryAbb"). I only changed the first few lines, and put $GetCountryAbb = 'us' because "default" didn't give me enough information.
Then, in the skin's _feedback.php, I have this:
The author_location is simply a text field I added to the comments. The flag image from hostip.info works. The GetCountryAbb shows up as it should, as two-letter text. I have a real problem with the last line, which I have tried a million different ways. I really thought would work as shown here, but I get an "undefined function" error.
Here's the link
http://moonchild.ch/blog/index.php?blog=14
But don't be surprised if it's showing weird stuff while I work on it.
Any suggestions would be greatly appreciated! I'm supposed to be having fun, but I'm just getting aggravated!