Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMFHacks.com Team on August 14, 2006, 01:07:43 PM

Title: CountryFlags
Post by: SMFHacks.com Team on August 14, 2006, 01:07:43 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=417)

CountryFlags v1.1.3

Author: vbgamer45
Original Author: JayBachatero (http://custom.simplemachines.org/mods/index.php?action=profile;u=4365)
Current Version: 2.0
Compatibility: SMF 2.0.x, 1.1.x
 Donate (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W43RKPPZ2KGYE)                          
Homepage: SMFHacks (http://www.smfhacks.com)
Type: Profile (http://custom.simplemachines.org/mods/index.php?action=search;type=10)
Languages: (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.simplemachines.org%2Fsite_images%2Flang%2Fenglish.gif&hash=8ae56bf31900dff4f4e5b493c620cec1)



Introduction

This mod allows your members to select from a list the countries to denote where they live.  This will include a country flag in their posts and profile.

You can select where to ask for their country.  Upon registration, profile page or both.  Also you can make it mandatory.

To enable this mod you must go to Admin > Features and Options > Last set of options.
This was a mod request by James Woodcock.

The credits for this mod go to gobalopper's Location mod.  The flags and idea were taken from his mod.

Flags by famfamfam Flag Icons (http://famfamfam.com/lab/icons/flags)



Features
Select Country Flag on profile
Show Country Flag on post display
Option to require/show on registration



Installation
Any previous versions of this mod MUST be uninstalled BEFORE installing this version.

Simply install the package to install on the SMF Default Core Theme ONLY.

If your theme has its own versions of the language files Modifications.english.php and/or Modifications.english-utf8.php, OR if your using a language other than those supported (listed above) by the mod then you will need to copy the language strings into each custom version of those files.

Useful Links
Manual Installation Of Mods (http://docs.simplemachines.org/index.php?topic=402)
How Do I Modify Files? (http://www.simplemachines.org/community/index.php?topic=24110.0)



Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)



Changelog
Legend:
! = Bugfix
- = Removed
+ = New Feature
o = Update
> = New Language
^ = Initial/New Release

Code: [Select]
Version 3.0
!Fixed an XSS issue on registration for flags update for SMF 2.0.x and SMF 1.1.x Reported by Jaume Llopis

2.0.1
Separated Serbia and Montenegro

12/23/2011 v2.0
!Fixed for SMF 2.0 selecting flag on registration was not saving.
!Added some alt tags for SMF 2.0 version

12/5/2011 v1.1.3
!Fixed missing Antarctica image
!Fixed skipping on Babylon theme if does not  exist.

9/24/2009 - v1.0.3
o Taken over by JBlaze
o Added new flag images
! Fixed version error

8/29/2006 - v1.0.2
! Fixed the bug that I thought I had fixed.

8/28/2006 - v1.0.1
! Fixed error when no flag is selected

8/26/2006 - v1.0
^ Initial release.
Title: Re: CountryFlags
Post by: kezayah on August 14, 2006, 02:35:39 PM
Very good ...
but it doesn't appear when a guest want to register ...  :(
Title: Re: CountryFlags
Post by: James Woodcock on August 14, 2006, 03:26:50 PM
I think he may have fixed that already if you re-download the package.  Also make sure that 'Both' is selected in the options for this mod within the Admin area.
Title: Re: CountryFlags
Post by: JayBachatero on August 14, 2006, 05:49:28 PM
As James said I fixed that and reuploaded the package.  Uninstall the other one delete it and install the new one.  It has the same name.
Title: Re: CountryFlags
Post by: Assistance on August 14, 2006, 06:37:51 PM
hmmm

what would I need to edit to not show the text beside the flag?
search
Quote
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '<br /><br />';
}


remove
, $flags[$message['member']['options']['country']], '" /> '
Title: Re: CountryFlags
Post by: JayBachatero on August 14, 2006, 09:38:41 PM
Replace that with this.
Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /><br /><br />';
}
Title: Re: CountryFlags
Post by: Assistance on August 15, 2006, 12:24:40 AM
whats the difference?
Title: Re: CountryFlags
Post by: JayBachatero on August 15, 2006, 01:22:47 AM
You removed the closing > for img tag.
Title: Re: CountryFlags
Post by: Parijs on August 15, 2006, 07:48:28 AM
Im using the wow dk theme for my smf 1.1 rc2 and I installed this mod and when I go to the Admin, Features & Options section, this is all I see at the bottom.   I cant read anything.  How can I fix this?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi18.photobucket.com%2Falbums%2Fb117%2Fnancie0711%2Ferrorcantsee.jpg&hash=e8f479f0fec61c15f34dbdc348ba4248)
Title: Re: CountryFlags
Post by: zigzag on August 15, 2006, 08:34:30 AM
Hello,
Really nice Mod :D and it works well  except I'm getting this error in my error log whenever someone goes to the registration page, I've tried all the settings on the mod but still get the same error :

Code: [Select]
8: Undefined index: country_flag
File: me\smf\Themes\default\Register.template.php (before sub template - eval?)
Line: 90
This is line 90:

Code: [Select]
// If flags is set for registration show it.
if (!empty($modSettings['country_flag']) && $modSettings['country_flag'] == 2 || $modSettings['country_flag'] == 3)


I've modified the mod ever so slightly so that it shows regions rather than countries but I don't think that's causing it, any ideas on how to fix it? I'm using the default smf theme

<EDIT> I too have the problem where it doesn't show up on the Register page if I use that setting - but I'm not really worried as I only want it to show up under profile.
Title: Re: CountryFlags
Post by: JayBachatero on August 15, 2006, 01:24:01 PM
Parijs add this to the /Themes/wow/languages/Modifications.engligh.php
Code: [Select]
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';

zigzag it seems like you installed the first package that I released.  What you have to do is uninstall that mod.  Delete it and redownload the package that I have there now.  That should fixed the issues that you are having.
Title: Re: CountryFlags
Post by: zigzag on August 15, 2006, 02:23:27 PM
Hi, I've tried that and it's the same, I tried also installing it without the modifications I made to the countries just in case it was something I'd done but I still get the same error and it doesn't show up on the Register.template.php even though the code is there:

Code: [Select]
// If flags is set for registration show it.
if (!empty($modSettings['country_flag']) && $modSettings['country_flag'] == 2 || $modSettings['country_flag'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<b>', $txt['country_flag_label'], ':</b>
</td>
<td>
<select name="country" onchange="showflags()">
<option value=""></option>';

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '">', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>';
Title: Re: CountryFlags
Post by: Parijs on August 15, 2006, 02:45:47 PM
Awesome Jay, thanks that worked...but is there something else I must modify in my wow dk theme files in order for this to show up in peoples profile menues and also on the register page?  cause I got all the settings correct in my Admin Panel but its not showing up.

Parijs
Title: Re: CountryFlags
Post by: JayBachatero on August 15, 2006, 02:53:52 PM
Paris that should be correct.  zigzag I'll look into it when I get home form work tonight.  In the mean time try this file.
Title: Re: CountryFlags
Post by: Parijs on August 15, 2006, 03:07:38 PM
Jay.....can I ask for u to take a look at my admin panel to make sure i got this done correctly?  I can PM u the link to my forum and I will give u admin access.  I hope u dont think I am being forward.  But this Mod would be rockin on my forum as my members are loving all the mods I am adding from u guys.  Pretty please?
Title: Re: CountryFlags
Post by: zigzag on August 15, 2006, 03:55:04 PM
Quote
In the mean time try this file.

Yes that fixed it, no errors and it shows up on the registration page.
Thank you :D
Title: Re: CountryFlags
Post by: Deaks on August 15, 2006, 07:49:29 PM
Jay how do you add a new country to the list?

would it just be as simple as adding
Code: [Select]
'so' => 'Scotland', in the install and add a Scotland flag to the images directory?
Title: Re: CountryFlags
Post by: zigzag on August 15, 2006, 08:05:25 PM
Quote
would it just be as simple as adding
'so' => 'Scotland',
in the install and add a Scotland flag to the images directory?

Hello, Yes it seems to work ok and also in reverse if you want to remove countries from the list.
Title: Re: CountryFlags
Post by: JayBachatero on August 16, 2006, 01:46:46 AM
Paris yea just send me a PM

sloopz that's how you add it.  Scotland is not in the list?
Title: Re: CountryFlags
Post by: James Woodcock on August 16, 2006, 07:29:50 AM
England, Scotland and Wales are not in the list.
Title: Re: CountryFlags
Post by: JayBachatero on August 16, 2006, 12:26:24 PM
Ummm need to add that to the list then.  What are the initials used for these countries?
Title: Re: CountryFlags
Post by: Skipdawg on August 16, 2006, 03:23:15 PM
Oh I like this Jay thanks much. And they way this is done should work just fine for the coming 1.1 RC3 and final too right?
Title: Re: CountryFlags
Post by: JayBachatero on August 16, 2006, 10:17:02 PM
Yea it should work w/o a problem.  All of the mods that I've written lately have been built on RC3.
Title: Re: CountryFlags
Post by: Skipdawg on August 17, 2006, 12:32:20 AM
Yea it should work w/o a problem.  All of the mods that I've written lately have been built on RC3.

Kewlness!  8) ;D ;)
Title: Re: CountryFlags
Post by: ivo2296 on August 17, 2006, 12:57:25 PM
Can we have this mod for the only final version 1.0.7 ?
Soon will come RC3 and the mod could not work, and till smf 1.1 comes it will take a lot of time.
That's why would be nice if we can install the mod on current final version.



Thank you!


P.S. I did on my smf1.0.7 manually, to me now the flags are showing on profiles and posts - just on registration page doesn't run.
Title: Re: CountryFlags
Post by: Polymath on August 17, 2006, 06:29:38 PM
Thanks for this. Everything installed fine in the package manager. It is in the profiles to choose country, but its not showing up in the forum posts.

Im using a theme that runs of the default, but there seems to be the flag missing in the posts. Any idea what the post edit would be?

thanks.

Title: Re: CountryFlags
Post by: JayBachatero on August 17, 2006, 10:33:32 PM
ivo2296 for the Register.template.php you need to look for something else since I did a search for the COPPA stuff.  Everything else should work.

Polymath did you enable it on Admin > Features and Options > Last settings.
Title: Re: CountryFlags
Post by: Polymath on August 18, 2006, 01:36:27 AM
Polymath did you enable it on Admin > Features and Options > Last settings.

Yes I have enabled it. I have also choosen my country in my profile but it don't show up in the posts I have made preiously. I've also done some test posts and it didn't show up. Everything was right when I installed. All things are where they are supposed to be. Sometimes I do have to edit my themes files. It may say install succesfull but maybe cos it installs in the default.

If I know what the post edit is I maybe able to see if its there. I'll work something out.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg.photobucket.com%2Falbums%2Fv253%2FPolymath%2Fflags.jpg&hash=ae3f9a2f8935166c0e3113116ad9039e)
Title: Re: CountryFlags
Post by: JayBachatero on August 18, 2006, 02:40:14 AM
You need to edit Display.template.php for your theme.
Title: Re: CountryFlags
Post by: Polymath on August 18, 2006, 05:53:44 AM
Yep thanks, you were right. I hate finding it and then doing edits to the theme, lol.  Im not that good at it.

All works now though. Thankyou.
Title: Re: CountryFlags
Post by: K_4_kelly on August 19, 2006, 04:00:12 AM
to be honest, I almost installed all the mods been created and shared by you... hehe I like your mods very much, cos it always have a very good and systematic setting/contro panel
Title: Re: CountryFlags
Post by: JayBachatero on August 19, 2006, 12:43:36 PM
Yea I noticed that you have almost all of my mods installed :).  Thanks for the support.  Hey and you don't have to worry about UTF-8 Problems on this mod :P.
Title: Re: CountryFlags
Post by: VegasBoxers on August 19, 2006, 06:09:26 PM
SWEET!  I got the first file downloaded and installed without problem, but the second file country_flags had the following error when I went to install it:
Quote
Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test failed  
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test failed  
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags

It told me NOT to do anything more unless I knew what I was doing, and that is simply not the case.  :D

I also went to the Admin > Features and Options > and I got this:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.german-pride.com%2FCRAP%2Fcountryhelp.png&hash=614040e0a793e651a75315f6c1359fc8)

Any ideas?
Thanks!
VB
Title: Re: CountryFlags
Post by: Gary on August 19, 2006, 06:14:22 PM
A very nice mod Jay. It came as a decent replacement for the Location Mod, that was begining to become a pain in the butt.

-AwwLilMaggie
Title: Re: CountryFlags
Post by: JayBachatero on August 19, 2006, 10:51:44 PM
VegasBoxers you need to manually edit ModSettings.php and also edit Modifications.english.php for your custom theme.

Thanks for the feedback AwwLilMaggie.
Title: Re: CountryFlags
Post by: VegasBoxers on August 20, 2006, 02:59:13 AM
I just realized after I posted that last post, that it was very similar to the one paris on page 1&2 of this thread.

I've got a request into my host to set the permissions for those files for me to update.  The server has control of them right now.  >:(

To modify those 2 files, do I just do like you told paris?
Quote
Parijs add this to the /Themes/wow/languages/Modifications.engligh.php

Code: [Select]
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';

What do I edit on the Modsettings.php file?

Sincerest Thanks!
VB

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.boxer-france.com%2FGalerie_Vos_photos%2F4chiots.jpg&hash=c9b0aa75d0470d2d735d6e8c0cb13bf1)
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 03:14:16 AM
Yea just edit that file.
Title: Re: CountryFlags
Post by: VegasBoxers on August 20, 2006, 03:48:11 AM
What do I edit on the Modsettings.php file?

Sincerest Thanks!
VB

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.boxer-france.com%2FGalerie_Vos_photos%2F4chiots.jpg&hash=c9b0aa75d0470d2d735d6e8c0cb13bf1)
Title: Re: CountryFlags
Post by: Assistance on August 20, 2006, 04:29:55 AM
   <file name="$sourcedir/ModSettings.php">
      <operation>
         <search position="before"><![CDATA[         // Reporting of personal messages?
         array('check', 'enableReportPM'),
]]></search>
         <add><![CDATA[
      '',
         // Show flags
         array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
         array('check', 'country_flag_required'),
         array('check', 'country_flag_show'),
]]></add>
      </operation>
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 06:19:38 AM
I have installed it with no errors, i ckecked Show flags on Display page (Where posts are shown). under features and options and saved.
No flags shown on posts, only shown in registration and in profile.
I have selected flag from my profile, it shows on my profile, i posted but not shows on my post.
I use 11.rc2 Default theme.....  :(
Title: Re: CountryFlags
Post by: Gary on August 20, 2006, 06:41:18 AM
Your theme probably has its own Display.template.php

-AwwLilMaggie
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 06:43:37 AM
Your theme probably has its own Display.template.php

-AwwLilMaggie

My theme is the Default theme of 1.1.rc2    :o
Title: Re: CountryFlags
Post by: Assistance on August 20, 2006, 06:53:49 AM
uninstall then re install

maybe something didnt take
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 06:58:56 AM
this is the part of my Display.template.php

Code: [Select]
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';

// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}

// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';

it should work, i just dont get it  ???  ::)  :-\
Title: Re: CountryFlags
Post by: Assistance on August 20, 2006, 07:34:29 AM
yours
Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}


from the install file
Code: [Select]
// Did they select a flag?
if(isset($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}


try the above see if that works
Title: Re: CountryFlags
Post by: ArkServer on August 20, 2006, 08:07:25 AM
to be honest, I almost installed all the mods been created and shared by you... hehe I like your mods very much, cos it always have a very good and systematic setting/contro panel

Agree, he can create nice mods  :P
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 08:28:54 AM
yours
Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}


from the install file
Code: [Select]
// Did they select a flag?
if(isset($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}


try the above see if that works

I used your code but didnt work, same thing still dont show on post  :(

i ckecked install file it changes the code i had in the first place  ???  :(  ::)
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 09:39:18 AM
mforum use the code that you had to beguin with.  The last code will give an error if users select blank as their flag.  Did you check the settings in Admin > Features and Options > Last one.
Title: Re: CountryFlags
Post by: Assistance on August 20, 2006, 09:48:13 AM
so the installer is wrong?

here is my error now with the above code
( been having problems with this mod actually so i turned it off )

Fatal error: Call to undefined function: countryflag() in
/public_html/smf/Sources/Load.php(1614) : eval()'d code on line 1463

Ask for country flag on: Profile
Require a member to select a location? unchecked
Show flags on Display page (Where posts are shown). checked
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 09:59:43 AM
You are missing the changes on Subs.php.
Title: Re: CountryFlags
Post by: Assistance on August 20, 2006, 10:06:36 AM
my apoligize

ty
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 12:44:50 PM
mforum use the code that you had to beguin with.  The last code will give an error if users select blank as their flag.  Did you check the settings in Admin > Features and Options > Last one.

Yes, to show in posts is checked  :'(
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 12:51:07 PM
Umm do you have any errors in error log?
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 01:08:28 PM
Nop, no errors  :-\
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 01:12:00 PM
Umm can you please PM me a test admin account?
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 01:22:50 PM
I did, thanks  :(
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 01:34:15 PM
Fixed. 

For those of you that have this problem just change
Code: [Select]
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
to
Code: [Select]
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 01:42:56 PM
I did that with no lack  :'(  :'(  :'(
Title: Re: CountryFlags
Post by: JayBachatero on August 20, 2006, 02:05:26 PM
Meh I had it fixed on your board.  Should be good now.
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 02:09:06 PM
YES its perfect now, THANKS  :)
Title: Re: CountryFlags
Post by: Prasad007 on August 21, 2006, 05:57:05 AM
when uploading the file through package manager, i get an error message saying corrupt or invalid file.

smf version 1.1 rc2.
Title: Re: CountryFlags
Post by: kezayah on August 21, 2006, 09:55:39 AM
In member.template.php

Search :
Code: [Select]
<td class="windowbg" align="left">', $member['link'], '</td>
Replace :
Code: [Select]
<td class="windowbg" align="left">', $member['link'], '   ',(empty($member['options']['country']) ? '' : '<img src="' . $settings['default_theme_url'] . '/images/flags2/' . $member['options']['country'] . '.png" style=float: right;" />'),'</td>
In Who.template.php

Search :
Code: [Select]
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
</div>';
}

Add after :
Code: [Select]
if(isset($member['options']['country']) && !empty($member['options']['country']))
{
$flags = CountryFlag();
echo '<img src="', $settings['default_theme_url'], '/images/flags2/', $member['options']['country'], '.png" alt="Country" />';
}
echo '

 8)
Title: Re: CountryFlags
Post by: VegasBoxers on August 21, 2006, 05:57:33 PM
   <file name="$sourcedir/ModSettings.php">
      <operation>
         <search position="before"><![CDATA[         // Reporting of personal messages?
         array('check', 'enableReportPM'),
]]></search>
         <add><![CDATA[
      '',
         // Show flags
         array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
         array('check', 'country_flag_required'),
         array('check', 'country_flag_show'),
]]></add>
      </operation>

Thank you for the reply!  Was that aimed at me?  I'm not sure where that code should be inserted.

The Host got my request to change the permissions/owner on my files.  I used Jay's Code and inserted it into my english settings file.  I now have the check boxes in the admin area.  But I need to modify the Modsettings.php file.  Is that what you wrote above?  Do I just insert that to my Modsettings.php file?

THANKS!
VB
Title: Re: CountryFlags
Post by: JayBachatero on August 21, 2006, 06:04:17 PM
Vegas that was for you.  You need to modify that file.
You need to add this
Code: [Select]
      '',
         // Show flags
         array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
         array('check', 'country_flag_required'),
         array('check', 'country_flag_show'),
after this
Code: [Select]
         array('check', 'enableReportPM'),

Title: Re: CountryFlags
Post by: VegasBoxers on August 21, 2006, 06:47:45 PM
When I opened my modsettings.php file that code was already there.

I've got the options in my Admin panel for it to display on both the profile and on the boards (where posts are viewed.)

I created a test user and it prompted me for a country.  I selected Canada and it showed the Canadian flag.  It works there, but I don't see with in my forum, when I put up a test post.  See it here:

http://www.german-pride.com/SMF/index.php/topic,5.new.html#new

I must be missing something...  What about my display.template.php file in my theme?  Should that be altered?

Got any ideas?

THANKS JAY!

VB
Title: Re: CountryFlags
Post by: VegasBoxers on August 21, 2006, 07:40:39 PM
I was looking at the other posts in this thread, and I don't have the following files that I can find to alter.  Where should they be located?

subs.php
member.template.php

Thanks!
VB
Title: Re: CountryFlags
Post by: JayBachatero on August 21, 2006, 11:41:42 PM
Seems like your theme has a cusom Display.template.php page.  Just make the changes for that template.
Title: Re: CountryFlags
Post by: VegasBoxers on August 22, 2006, 01:21:36 AM
My display.template.php for the theme has that info in it.

The code in my theme's display.template.php file looks like this:
Code: [Select]
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';

// Did they select a flag?
if(isset($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}

                                                // Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';

Isn't that correct?  I'm out of ideas and files to edit.  ???
Thanks for all the help guys, I'm just really frustrated!  :'(
VB
Title: Re: CountryFlags
Post by: JayBachatero on August 22, 2006, 01:55:34 AM
That is the code for Profile page.  Need to look at the one that has the $message var.
Title: Re: CountryFlags
Post by: VegasBoxers on August 22, 2006, 03:17:55 AM
That is the code for Profile page.  Need to look at the one that has the $message var.

I searched through all of my files and I can't find one that comes up with the $message var when I search them with dreamweaver. :(

What file should it be in?  I've got at least 4 different files that I've inserted that
// Did they select a flag?
   if(isset($context['member']['options']['country']))...

code into.  I'm really lost as to where it needs to be.  Would it help if I posted the content of my board's theme index.template.php file? 

I REALLY want to use this mod!

Thanks for not giving up on me Jay!  :D

VB
Title: Re: CountryFlags
Post by: zigzag on August 22, 2006, 06:33:01 AM
Hello,
Will you be updating the mod for the 1.1 RC3 update or will it still run ok on the new release?
Title: Re: CountryFlags
Post by: JayBachatero on August 22, 2006, 01:37:01 PM
Vegas make sure that you have the latests package.

zigzap yes it should worok RC3.
Title: Re: CountryFlags
Post by: zigzag on August 22, 2006, 02:28:13 PM
Hi, Yes it's working fine with RC3  :D
Title: Re: CountryFlags
Post by: VegasBoxers on August 22, 2006, 02:49:07 PM
Vegas make sure that you have the latests package.

Okay, I deleted the old install under the admin panel, and I downloaded your newest version.  I uploaded and attempted to install the new version and I got this:

Quote
Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test failed  
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags

I stopped the install there because of your warning message.  Is there something that I should do to that file?

Thanks!
VB
Title: Re: CountryFlags
Post by: JayBachatero on August 22, 2006, 02:54:54 PM
Maybe something got left behnd from when you were trying to install the older version.  You can manually make the change.
Title: Re: CountryFlags
Post by: VegasBoxers on August 22, 2006, 03:11:37 PM
Is it safe to finish that install then? 

After, I can manually update the file?  It may already be altered from my attempts to get the old version to work.

THANKS!
VB
Title: Re: CountryFlags
Post by: VegasBoxers on August 22, 2006, 10:04:48 PM
THANKS A MILLION FOR STICKING WITH ME THROUGH THIS PROBLEM JAY!!!  You're the best! :D

I uninstalled and deleted the old version of the mod and I uploaded and installed the latest release of this mod.  It loaded without any problems at all.

I tested it by creating a new user and I was prompted to choose a country on the register/agreement page.  I selected Canada and it showed up.  However, when I posted, I still do not have a flag appearing near the avatar.  My display.template.php in my custom theme has the mod in it.

I'm getting ready to cry... :'(  I don't know what I possibly could be missing.

Do you have any ideas?

VB
Title: Re: CountryFlags
Post by: JayBachatero on August 22, 2006, 10:52:02 PM
Post your Display.template.php for your custom theme.
Title: Re: CountryFlags
Post by: VegasBoxers on August 22, 2006, 11:32:06 PM
The display.template.php file is as follows:
Quote
<?php
// Version: 1.1 RC2; Display

function template_main()
{
   global $context, $settings, $options, $txt, $scripturl, $modSettings;

   // Show the anchor for the top and for the first message. If the first message is new, say so.
   echo '
<a name="top"></a>
<a name="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : '';

   // Is this topic also a poll?
   if ($context['is_poll'])
   {
      echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
   <tr>
      <td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
         <img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['smf43'], '
      </td>
   </tr>
   <tr>
      <td width="5%" valign="top" class="windowbg"><b>', $txt['smf21'], ':</b></td>
      <td class="windowbg">
         ', $context['poll']['question'];
      if (!empty($context['poll']['expire_time']))
         echo '
               &nbsp;(', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], ')';

      // Are they not allowed to vote but allowed to view the options?
      if ($context['poll']['show_results'] || !$context['allow_vote'])
      {
         echo '
         <table>
            <tr>
               <td style="padding-top: 2ex;">
                  <table border="0" cellpadding="0" cellspacing="0">';

            // Show each option with its corresponding percentage bar.
         foreach ($context['poll']['options'] as $option)
            echo '
                     <tr>
                        <td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
                        <td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
                     </tr>';

         echo '
                  </table>
               </td>
               <td valign="bottom" style="padding-left: 15px;">';

         // If they are allowed to revote - show them a link!
         if ($context['allow_change_vote'])
            echo '
               <a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />';

         // If we're viewing the results... maybe we want to go back and vote?
         if ($context['poll']['show_results'] && $context['allow_vote'])
            echo '
                  <a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />';

         // If they're allowed to lock the poll, show a link!
         if ($context['poll']['lock'])
            echo '
                  <a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';

         // If they're allowed to edit the poll... guess what... show a link!
         if ($context['poll']['edit'])
            echo '
                  <a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';

         echo '
               </td>
            </tr>', $context['allow_poll_view'] ? '
            <tr>
               <td colspan="2"><b>' . $txt['smf24'] . ': ' . $context['poll']['total_votes'] . '</b></td>
            </tr>' : '', '
         </table><br />';
      }
      // They are allowed to vote! Go to it!
      else
      {
         echo '
         <form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" style="margin: 0px;">
            <table>
               <tr>
                  <td colspan="2">';

         // Show a warning if they are allowed more than one option.
         if ($context['poll']['allowed_warning'])
            echo '
                     ', $context['poll']['allowed_warning'], '
                  </td>
               </tr><tr>
                  <td>';

         // Show each option with its button - a radio likely.
         foreach ($context['poll']['options'] as $option)
            echo '
                     ', $option['vote_button'], ' ', $option['option'], '<br />';

         echo '
                  </td>
                  <td valign="bottom" style="padding-left: 15px;">';

         // Allowed to view the results? (without voting!)
         if ($context['allow_poll_view'])
            echo '
                     <a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewResults">', $txt['smf29'], '</a><br />';

         // Show a link for locking the poll as well...
         if ($context['poll']['lock'])
            echo '
                     <a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '</a><br />';

         // Want to edit it? Click right here......
         if ($context['poll']['edit'])
            echo '
                     <a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';

            echo '
                  </td>
               </tr><tr>
                  <td colspan="2"><input type="submit" value="', $txt['smf23'], '" /></td>
               </tr>
            </table>
            <input type="hidden" name="sc" value="', $context['session_id'], '" />
         </form>';
      }

      echo '
      </td>
   </tr>
</table>';
   }

   // Does this topic have some events linked to it?
   if (!empty($context['calendar_events']))
   {
      echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 3ex;">
      <tr>
            <td class="titlebg" valign="middle" align="left" style="padding-left: 6px;">
                  ', $txt['calendar_linked_events'], '
            </td>
      </tr>
      <tr>
            <td width="5%" valign="top" class="windowbg">
                  <ul>';
      foreach ($context['calendar_events'] as $event)
         echo '
                        <li>
                              <b>', $event['title'] , '</b> ' , ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" >[' . $txt['calendar_shortedit'] . ']</a> ' : '') , ': ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
                        </li>';
      echo '
                  </ul>
            </td>
      </tr>
</table>';
   }

   // Build the normal button array.
   $normal_buttons = array(
      'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
      'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
      'custom' => array(),
      'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'),
      'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
   );

   // Special case for the custom one.
   if ($context['user']['is_logged'] && $settings['show_mark_read'])
      $normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
   elseif ($context['can_add_poll'])
      $normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
   else
      unset($normal_buttons['custom']);

   // Show the page index... "Pages: [1]".
   echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
   <tr>
      <td class="middletext" valign="bottom" style="padding-bottom: 4px;">&nbsp;&nbsp;', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
      <td align="right" style="padding-right: 1ex;">
         <div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '&nbsp;&nbsp;</div>
         <table cellpadding="0" cellspacing="0">
            <tr>
               ', template_button_strip($normal_buttons, 'bottom'), '
            </tr>
         </table>
      </td>
   </tr>
</table>';

   // Show the topic information - icon, subject, etc.
   echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
      <tr class="catbg3">
            <td valign="middle" width="2%" style="padding-left: 6px;">
                  <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
            </td>
            <td width="13%"> ', $txt[29], '</td>
            <td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
                  ', $txt[118], ': ', $context['subject'], ' &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
            </td>
      </tr>';
   if (!empty($settings['display_who_viewing']))
   {
      echo '
      <tr>
            <td colspan="3" class="smalltext">';

      // Show just numbers...?
      if ($settings['display_who_viewing'] == 1)
            echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
      // Or show the actual people viewing the topic?
      else
         echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');

      // Now show how many guests are here too.
      echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
            </td>
      </tr>';
   }

   echo '
</table>';

   echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">';

   // These are some cache image buttons we may want.
   $reply_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
   $modify_button = create_button('modify.gif', 66, 17, 'align="middle"');
   $remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
   $split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"');

// Time to display all the posts
   echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">';

   // Get all the messages...
   while ($message = $context['get_message']())
   {
      echo '
   <tr><td style="padding: 1px 1px 0 1px;">';

      // Show the message anchor and a "new" anchor if this message is new.
      if ($message['id'] != $context['first_message'])
         echo '
      <a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';

      echo '
      <table width="100%" cellpadding="3" cellspacing="0" border="0">
         <tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';

      // Show information about the poster of this message.
      echo '
            <table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
               <tr>
                  <td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
                     <b>', $message['member']['link'], '</b>
                     <div class="smalltext">';

      // Show the member's custom title, if they have one.
      if (isset($message['member']['title']) && $message['member']['title'] != '')
         echo '
                        ', $message['member']['title'], '<br />';

      // Show the member's primary group (like 'Administrator') if they have one.
      if (isset($message['member']['group']) && $message['member']['group'] != '')
         echo '
                        ', $message['member']['group'], '<br />';

      // Don't show these things for guests.
      if (!$message['member']['is_guest'])
      {
         // Show the post group if and only if they have no other group or the option is on, and they are in a post group.
         if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
            echo '
                        ', $message['member']['post_group'], '<br />';
         echo '
                        ', $message['member']['group_stars'], '<br />';

         // Is karma display enabled?  Total or +/-?
         if ($modSettings['karmaMode'] == '1')
            echo '
                        <br />
                        ', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
         elseif ($modSettings['karmaMode'] == '2')
            echo '
                        <br />
                        ', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';

         // Is this user allowed to modify this member's karma?
         if ($message['member']['karma']['allow'])
            echo '
                        <a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
                        <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';

         // Show online and offline buttons?
         if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
            echo '
                        ', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';

         // Show the member's gender icon?
         if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
            echo '
                        ', $txt[231], ': ', $message['member']['gender']['image'], '<br />';

         // Did they select a flag?
   if(isset($context['member']['options']['country']))
   {
      $flags = CountryFlag();
      echo
                        $flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
   }

                                                // Show how many posts they have made.
         echo '
                        ', $txt[26], ': ', $message['member']['posts'], '<br />
                        <br />';   


         // Show avatars, images, etc.?
         if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
            echo '
                        <div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';

         // Show their personal text?
         if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
            echo '
                        ', $message['member']['blurb'], '<br />
                        <br />';

         // This shows the popular messaging icons.
         echo '
                        ', $message['member']['icq']['link'], '
                        ', $message['member']['msn']['link'], '
                        ', $message['member']['aim']['link'], '
                        ', $message['member']['yim']['link'], '<br />';

         // Show the profile, website, email address, and personal message buttons.
         if ($settings['show_profile_buttons'])
         {
            // Don't show the profile button if you're not allowed to view the profile.
            if ($message['member']['can_view_profile'])
               echo '
                        <a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';

            // Don't show an icon if they haven't specified a website.
            if ($message['member']['website']['url'] != '')
               echo '
                        <a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $txt[515] . '" border="0" />' : $txt[515]), '</a>';

            // Don't show the email address if they want it hidden.
            if (empty($message['member']['hide_email']))
               echo '
                        <a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';

            // Since we know this person isn't a guest, you *can* message them.
            if ($context['can_send_pm'])
               echo '
                        <a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
         }
      }
      // Otherwise, show the guest's email.
      elseif (empty($message['member']['hide_email']))
         echo '
                        <br />
                        <br />
                        <a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';

      // Done with the information about the poster... on to the post itself.
      echo '
                     </div>
                  </td>
                  <td valign="top" width="85%" height="100%">
                     <table width="100%" border="0"><tr>
                        <td valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td>
                        <td valign="middle">
                           <div style="font-weight: bold;" id="subject_', $message['id'], '">
                              <a href="', $message['href'], '">', $message['subject'], '</a>
                           </div>';

      // If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
      echo '
                           <div class="smalltext">« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</div></td>
                        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';

      // Can they reply? Have they turned on quick reply?
      if ($context['can_reply'] && !empty($options['display_quick_reply']))
         echo '
               <a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', \'', $context['session_id'], '\'); return false;">', $reply_button, '</a>';

      // So... quick reply is off, but they *can* reply?
      elseif ($context['can_reply'])
         echo '
               <a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', $reply_button, '</a>';

      // Can the user modify the contents of this post?
      if ($message['can_modify'])
         echo '
               <a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';

      // How about... even... remove it entirely?!
      if ($message['can_remove'])
         echo '
               <a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $remove_button, '</a>';

      // What about splitting it off the rest of the topic?
      if ($context['can_split'])
         echo '
               <a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a>';

      // Show a checkbox for quick moderation?
      if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
         echo '
                           <input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';" />';

      // Show the post itself, finally!
      echo '
                        </td>
                     </tr></table>
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
                     <img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
                  </td>
               </tr>';

      // Now for the attachments, signature, ip logged, etc...
      echo '
               <tr>
                  <td valign="bottom" class="smalltext" width="85%">
                     <table width="100%" border="0" style="table-layout: fixed;"><tr>
                        <td colspan="2" class="smalltext" width="100%">';

      // Assuming there are attachments...
      if (!empty($message['attachment']))
      {
         echo '
                           <hr width="100%" size="1" class="hrcolor" />
                           <div style="overflow: auto; width: 100%;">';
         foreach ($message['attachment'] as $attachment)
         {
            if ($attachment['is_image'])
            {
               if ($attachment['thumbnail']['has_thumb'])
                  echo '
                           <a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
               else
                  echo '
                           <img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
            }
            echo '
                              <a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
         }

         echo '
                           </div>';
      }

      echo '
                        </td>
                     </tr><tr>
                        <td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';

      // Show "« Last Edit: Time by Person »" if this post was edited.
      if ($settings['show_modify'] && !empty($message['modified']['name']))
         echo '
                           « <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';

      echo '
                        </td>
                        <td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">';

      // Maybe they want to report this post to the moderator(s)?
      if ($context['can_report_moderator'])
         echo '
                           <a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['rtm1'], '</a> &nbsp;';
      echo '
                           <img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';

      // Show the IP to this user for this post - because you can moderate?
      if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
         echo '
                           <a href="', $scripturl, '?action=trackip;searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
      // Or, should we show it because this is you?
      elseif ($message['can_see_ip'])
         echo '
                           <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
      // Okay, are you at least logged in?  Then we can show something about why IPs are logged...
      elseif (!$context['user']['is_guest'])
         echo '
                           <a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt[511], '</a>';
      // Otherwise, you see NOTHING!
      else
         echo '
                           ', $txt[511];

      echo '
                        </td>
                     </tr></table>';

      // Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

      echo '
                  </td>
               </tr>
            </table>
         </td></tr>
      </table>
   </td></tr>';
   }
   echo '
   <tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
<a name="lastPost"></a>';

   // As before, build the custom button right.
   if ($context['user']['is_logged'] && $settings['show_mark_read'])
      $normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
   elseif ($context['can_add_poll'])
      $normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);

   echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
   <tr>
      <td class="middletext">&nbsp;&nbsp;', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><b>' . $txt['topbottom4'] . '</b></a>' : '', '</td>
      <td align="right" style="padding-right: 1ex;">
         <table cellpadding="0" cellspacing="0">
            <tr>
               ', template_button_strip($normal_buttons, 'top', true), '
            </tr>
         </table>
      </td>
   </tr>
</table>';

   if ($context['show_spellchecking'])
      echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';

echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   quickReplyCollapsed = ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ';

   smf_topic = ', $context['current_topic'], ';
   smf_start = ', $context['start'], ';
   smf_show_modify = ', $settings['show_modify'] ? '1' : '0', ';

   // On quick modify, this is what the body will look like.
   var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="', $context['session_id'], '" /><input type="hidden" name="topic" value="', $context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="', $txt[10], '" onclick="return modify_save(\\\'' . $context['session_id'] . '\\\');" accesskey="s" />&nbsp;&nbsp;', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" />&nbsp;&nbsp;' : '', '<input type="submit" name="cancel" value="', $txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\';

   // And this is the replacement for the subject.
   var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;"  maxlength="80" />\';

   // Restore the message to this after editing.
   var smf_template_body_normal = \'%body%\';
   var smf_template_subject_normal = \'<a href="', $scripturl, '?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\';
   var smf_template_top_subject = "', $txt[118], ': %subject% &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')"

   if (window.XMLHttpRequest)
      showModifyButtons();
// ]]></script>
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 1ex;">
      <tr>';
   if ($settings['linktree_inline'])
         echo '
            <td valign="top">', theme_linktree(), '</td> ';
   echo '
            <td valign="top" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="nav"> ', $context['previous_next'], '&nbsp;&nbsp;</td>
      </tr>
</table>';

   $mod_buttons = array(
      'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
      'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),
      'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
      'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_locked']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
      'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),
      'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start']),
      'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),
   );

   if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
      $mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');

   echo '
   <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">
      <tr>
         ', template_button_strip($mod_buttons, 'bottom') , '
      </tr>
   </table>';

   if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
      echo '
   <input type="hidden" name="sc" value="', $context['session_id'], '" />
   <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
      document.getElementById("quickmodSubmit").style.display = "none";
   // ]]></script>';
   echo '
</form>';

   echo '
<div class="tborder"><div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '">
   <form action="', $scripturl, '" method="get" style="padding:0; margin: 0;">
      <span class="smalltext">' . $txt[160] . ':</span>
      <select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
         <option value="">' . $txt[251] . ':</option>';
   foreach ($context['jump_to'] as $category)
   {
      echo '
         <option value="" disabled="disabled">-----------------------------</option>
         <option value="#', $category['id'], '">', $category['name'], '</option>
         <option value="" disabled="disabled">-----------------------------</option>';
      foreach ($category['boards'] as $board)
         echo '
         <option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ' . str_repeat('==', $board['child_level']) . '=> ' . $board['name'] . '</option>';
   }
   echo '
      </select>&nbsp;
      <input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
   </form>
</div></div>';

   echo '<br />';

   if ($context['can_reply'] && !empty($options['display_quick_reply']))
   {
      echo '
<a name="quickreply"></a>
<table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
      <tr>
            <td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td>
      </tr>
   <tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
      <td class="windowbg" width="25%" valign="top">', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</td>
      <td class="windowbg" width="75%" align="center">
         <form action="', $scripturl, '?action=post2" method="post" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
            <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
            <input type="hidden" name="subject" value="' . $txt['response_prefix'] . $context['subject'] . '" />
            <input type="hidden" name="icon" value="xx" />
            <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
            <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
            <input type="hidden" name="num_replies" value="', $context['num_replies'], '" />
            <textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
            <input type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
            <input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
      if ($context['show_spellchecking'])
         echo '
            <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" />';
      echo '
            <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
            <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
         </form>
      </td>
   </tr>
</table>';

      if ($context['show_spellchecking'])
         echo '
<form name="spell_form" id="spell_form" method="post" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value="" /></form>';
   }
}

?>

THANKS JAY!
VB
Title: Re: CountryFlags
Post by: JayBachatero on August 23, 2006, 12:09:33 AM
Find
Code: [Select]

   if(isset($context['member']['options']['country']))
   {
      $flags = CountryFlag();
      echo
                        $flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
   }

Change to
Code: [Select]
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
Title: Re: CountryFlags
Post by: VegasBoxers on August 24, 2006, 01:33:27 AM
SCORRRRRRRRRRRRRRE!!!!  THANKS A MILLION JAY!!!  I got it! was it my theme that was throwing things off?  I really wish I was PHP literate to be able to problem solve this stuff better.

You and your mods ROCK!

JAY FOR PRESIDENT!!! ;D

VB
Title: Re: CountryFlags
Post by: JayBachatero on August 24, 2006, 01:50:24 AM
yeah that code is for the old one I was using.
Title: Re: CountryFlags
Post by: VegasBoxers on August 24, 2006, 01:56:50 AM
Will there be any problems when I go to RC3 with the theme or this mod?

THANKS!
VB
Title: Re: CountryFlags
Post by: JayBachatero on August 24, 2006, 02:30:13 AM
not everything should be fine.  just need to install mod again.
Title: Re: CountryFlags
Post by: Skipdawg on August 24, 2006, 03:13:15 AM
Confirming just re-install and all is good to go  ;)
Title: Re: CountryFlags
Post by: theurbanline on August 24, 2006, 07:42:04 AM
Hi. This is a great mod which is being used on my forum, though people are asking for flags for the countries of the UK (as someone already suggested in this thread).

The United Kingdom is a country split in to England, Scotland, Wales and Northern Ireland.

Great Britain is all of the above but not Northern Ireland.

Hence the official name of the UK is "The United Kingdom of Great Britain and Northern Ireland" so you could use the codes (or invent 2-letter ones):

UK-ENG
UK-WLS
UK-NIR
UK-SCT

Thanks Jay, I hope you get time to add these to your excellent mod,

G.
Title: Re: CountryFlags
Post by: JayBachatero on August 25, 2006, 12:40:41 AM
I'll try to look into this when I get some time.
Title: Re: CountryFlags
Post by: L.G.S on August 26, 2006, 07:11:50 AM
Hey Jay, I installed your mod and turned it on for Both reg and profiles, but the feature does not appear anywhere?

I checked the default theme, and there is no option to select countries or in the registration either.
Title: Re: CountryFlags
Post by: JayBachatero on August 27, 2006, 12:34:38 AM
Umm did you check on Admin > Features and options?
Title: Re: CountryFlags
Post by: L.G.S on August 28, 2006, 07:06:35 AM
Hey Jay, I installed your mod and turned it on for Both reg and profiles

did it there ^^^
Title: Re: CountryFlags
Post by: JayBachatero on August 28, 2006, 12:00:55 PM
PM me an account to look into it.
Title: Re: CountryFlags
Post by: JayBachatero on August 28, 2006, 01:15:03 PM
The reason as to why it doesn't show it's because that theme modified Register.template.php and Display.template.php.
Title: Re: CountryFlags
Post by: L.G.S on August 28, 2006, 02:05:03 PM
I've tried it in the default theme though.. In the default theme it does not appear anywhere.
Title: Re: CountryFlags
Post by: JayBachatero on August 28, 2006, 03:15:30 PM
Well you did overwrite the default theme files with the ones from that theme ::).
Title: Re: CountryFlags
Post by: L.G.S on August 28, 2006, 04:11:03 PM
What are you talking about..

If I have the package installed fully in the package manager, and I go to my default theme where it was installed, how is my custom theme going to affect it? The custom files used do not change anything if I'm using the SMF default theme anyway.
Title: Re: CountryFlags
Post by: JayBachatero on August 28, 2006, 04:14:34 PM
I just tried to change themes on your site to default theme and the default theme is the one you have now.  The one by m3talc0re.
Title: Re: CountryFlags
Post by: L.G.S on August 28, 2006, 04:57:51 PM
No I mean the SMF default theme, the one that packages are automatically modded to.

On my forum the theme named SMF DEFAULT works just fine.
Title: Re: CountryFlags
Post by: JayBachatero on August 28, 2006, 08:21:01 PM
Umm I tried to switch to that theme and it didn't work.
Title: Re: CountryFlags
Post by: L.G.S on August 29, 2006, 06:56:21 AM
I had TP installed before upgrading and didn't want people to change their theme, it's back now.  I see you have your flag selected in your profile on my forum, how did you do it ?
Title: Re: CountryFlags
Post by: Skipdawg on August 29, 2006, 11:41:20 AM
I had TP installed before upgrading and didn't want people to change their theme, it's back now.  I see you have your flag selected in your profile on my forum, how did you do it ?

You should see the option right there in "forum profile"
Title: Re: CountryFlags
Post by: L.G.S on August 29, 2006, 12:04:11 PM
Ahhhh I've found it, thanks!

Jay, thanks for tryin to help me also, again ;D
Title: Re: CountryFlags
Post by: JayBachatero on August 29, 2006, 12:20:52 PM
I had TP installed before upgrading and didn't want people to change their theme, it's back now.  I see you have your flag selected in your profile on my forum, how did you do it ?
So you telling me that you didn't select a flag in the profile first?

Also edit those two files.  Display and Register templates.
Title: Re: CountryFlags
Post by: L.G.S on August 29, 2006, 12:25:07 PM
No I was saying that I couldn't find the selection area to pick your flag in the profile section.
Title: Re: CountryFlags
Post by: JayBachatero on August 29, 2006, 12:38:20 PM
Oh ok.  Well you just need to make those two changes now.  Register.template.php and Display.template.php.
Title: Re: CountryFlags
Post by: L.G.S on August 29, 2006, 12:45:43 PM
I've removed register.template.php and I've edited display.template.php, thanks.
Title: Re: CountryFlags
Post by: char39 on September 11, 2006, 10:50:58 AM
Is there anywhere I can see this mod in action?  Also, which would I download if I am using 1.0.8 ?

Thanks
Title: Re: CountryFlags
Post by: JayBachatero on September 11, 2006, 12:34:24 PM
This mod is for 1.1 RC2 and up.
Title: Re: CountryFlags
Post by: MiR on September 26, 2006, 05:36:53 AM
In this mod Serbia and Montenegro are one country. But those are 2 different countries.

How to add new country in the mod?

Thank you fro your answer!
Title: Re: CountryFlags
Post by: JayBachatero on September 26, 2006, 02:57:20 PM
Edit the array on Subs.php.  Add the coutnry there and then add the flag with the correct name.
Title: Re: CountryFlags
Post by: MiR on September 26, 2006, 04:40:09 PM
THANK YOU!!!!
Title: Re: CountryFlags
Post by: choloman05 on October 02, 2006, 03:58:35 PM
I've got a little problem- The text "country flag" or "country", whatever it says, isn't showing up on forum profiles or on posts. It used to, and just recently it stopped showing. All you see right now is the colon-":" The flag still shows up fine. This is not urgent, but I'm just wondering if you know what could be causing this and how I could fix it. Thanks.  Can be seen here: www.tarheelforum.com (http://www.tarheelforum.com)
Title: Re: CountryFlags
Post by: JayBachatero on October 02, 2006, 04:03:09 PM
Add the $txt from the default theme's Modification.english.php to Dilberts Modification.english.php.
Title: Re: CountryFlags
Post by: xcrazyxfrogx on October 08, 2006, 09:20:25 PM
plz help i got this while installing

Quote
7. Execute Modification ./Themes/default/Display.template.php Test failed
8. Execute Modification ./Themes/babylon/Display.template.php Test successful

i ignored error it got installed and working good but i cant see flag in Posts i did however in profile and registration i can see both :)
Title: Re: CountryFlags
Post by: JayBachatero on October 08, 2006, 09:28:20 PM
Make the change manually to Display.template.php for default theme.
Title: Re: CountryFlags
Post by: xcrazyxfrogx on October 08, 2006, 09:54:31 PM
i did it before ur posting thanx anyways  :P and its good work from u  :D
Title: Re: CountryFlags
Post by: Geezer on October 09, 2006, 02:04:35 PM
awesome mod Jay, we all love it, just wondered if theres a way for flags to show up in who's online?
Title: Re: CountryFlags
Post by: JayBachatero on October 09, 2006, 02:29:13 PM
In Who.template.php
Code: (find) [Select]
if (!empty($member['ip']))
echo '
(<a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank">' . $member['ip'] . '</a>)';

Code: (add after) [Select]
// Did they select a flag?
if(isset($member['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($member['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $member['options']['country'], '.png" alt="', $flags[$member['options']['country']], '" /> ', $flags[$member['options']['country']], '<br /><br />';
}
Title: Re: CountryFlags
Post by: Geezer on October 09, 2006, 02:45:59 PM
thanks, but code is slightly different in my template, can I still do it and what part do i edit, we do have googlebots &spider mod installed

Code: [Select]
<?php



// The only template in the file.

function template_main()

{

global $context$settings$options$scripturl$txt;

// Display the table header and linktree.

echo '

<div style="padding: 3px;">'
theme_linktree(), '</div>';

$brokendown = array (

'Members' => array(),

'Guests' => array(),

'Spiders' => array(),

);



foreach($context['members'] AS $key => $member)

{

$spider getAgent($member['query']['USER_AGENT'], $context['members'][$key]['name'], $agent$member['id'] == 0);

$context['members'][$key]['agent'] = $agent;

$member['query']['USER_AGENT'] = isset($member['query']['USER_AGENT']) ? $member['query']['USER_AGENT'] : '';

if ( $member['id'] != )

$brokendown['Members'][] = &$context['members'][$key];

else if ( $spider )

$brokendown['Spiders'][] = &$context['members'][$key];

else

$brokendown['Guests'][] = &$context['members'][$key];

}

// echo '<pre>'; print_r($brokendown['Spiders']); echo '</pre>'; return;

foreach($brokendown AS $group => $members)

{

echo '

<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">

<tr>

<td class="catbg">'
$group'</td>

</tr>

</table>

<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">

<tr class="titlebg">

<td width="30%"><a href="' 
$scripturl '?action=who;sort=user'$context['sort_direction'] == 'down' && $context['sort_by'] == 'user' ';asc' '''">'$txt['who_user'], ' '$context['sort_by'] == 'user' '<img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" border="0" />' '''</a></td>

<td style="width: 14ex;"><a href="' 
$scripturl '?action=who;sort=time'$context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ';asc' '''">'$txt['who_time'], ' '$context['sort_by'] == 'time' '<img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" border="0" />' '''</a></td>

<td>'
$txt['who_action'], '</td>

</tr>'
;



// This is used to alternate the color of the background.

$alternate true;



// For every member display their name, time and action (and more for admin).

foreach ($members as $member)

{



// $alternate will either be true or false.  If it's true, use "windowbg2" and otherwise use "windowbg".

echo '

<tr class="windowbg'
$alternate '2' '''">

<td>'
;



// Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.

if (!$member['is_guest'])

{

echo '

<div style="float: right; width: 14ex;">

'
$context['can_send_pm'] ? '<a href="' $member['online']['href'] . '" title="' $member['online']['label'] . '">' ''$settings['use_image_buttons'] ? '<img src="' $member['online']['image_href'] . '" alt="' $member['online']['text'] . '" border="0" align="middle" />' $member['online']['text'], $context['can_send_pm'] ? '</a>' '''

'
$member['icq']['link'], ' '$member['msn']['link'], ' '$member['yim']['link'], ' '$member['aim']['link'], '

</div>'
;

}



echo '

<span'
$member['is_hidden'] ? ' style="font-style: italic;"' '''>'$member['is_guest'] ? $member['name'] : '<a href="' $member['href'] . '" title="' $txt[92] . ' ' $member['name'] . '"' . (empty($member['color']) ? '' ' style="color: ' $member['color'] . '"') . '>' $member['name'] . '</a>''</span>';



if ( !empty($member['ip']) )

echo ' <br /> <span class="smalltext">(<b><a href="' $scripturl '?action=trackip;searchip=' $member['ip'] . '" target="_blank" title="' $member['ip'] . '" class="smalltext2">' $member['ip'] . '</a></b>, <acronym title="' $member['query']['USER_AGENT'] . '">' $member['agent'] . '</acronym>)</span>';



echo '

</td>

<td nowrap="nowrap">'
$member['time'], '</td>

<td>'
$member['action'], '</td>

</tr>



'
;



// Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)

$alternate = !$alternate;

}

echo '</table><br/>';

}

echo '

<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder"><tr><td class="titlebg">

<b>'
$txt[139], ':</b> '$context['page_index'], '

</td></tr></table>'
;



}



function 
getAgent( &$user_agent, &$user_name, &$result$guest )

{

$known_agents = array (

                
//Search Spiders

array (

'agent' => 'WISENutbot',

'spidername' => 'Looksmart spider',

                        
'spider' => true,

),

array (

'agent' => 'MSNBot',

'spidername' => 'MSN spider',

'spider' => true,

),

array (

'agent' => 'W3C_Validator',

'spidername' => 'W3C Validaator',

        'spider' => true,

),

array (

'agent' => 'Googlebot-Image',

'spidername' => 'Google-Image Spider',

'spider' => true,

),

array (

'agent' => 'Googlebot',

'spidername' => 'Google spider',

'spider' => true,

),



array (

'agent' => 'Mediapartners-Google',

'spidername' => 'Google AdSense spider',

'spider' => true,

),



                array (

'agent' => 'Openbot',

'spidername' => 'Openfind spider',

'spider' => true,

                ),

array (

'agent' => 'Yahoo! Slurp',

'spidername' => 'Yahoo spider',

'spider' => true,
),



                array (

'agent' => 'FAST-WebCrawler',

'spider' => true,

                ),

                array (

'agent' => 'Wget',

'spider' => true,

                ),

array (

'agent' => 'Ask Jeeves'

'spider' => true,



),

array (

'agent' => 'Speedy Spider',

'spider' => true,



),

array (

'agent' => 'SurveyBot',

'spider' => true,



),

array (

'agent' => 'IBM_Planetwide',

'spider' => true,



),



                array (

'agent' => 'GigaBot',

'spider' => true,



),

array (

'agent' => 'ia_archiver',

'spider' => true,

),

array (

'agent' => 'FAST-WebCrawler',

'spider' => true,



),

array (

'agent' => 'Inktomi Slurp',

                        
'spider' => true,

),

                

                array (

'agent' => 'appie',

'spidername' => 'Walhello spider',

'spider' => true,

),

 //mobiles

 array (
'agent' => 'Nokia'
 ),
 array (
'agent' => 'Samsung',
 ),
 array (
'agent' => 'Ericsson',
 ),
array (
'agent' => 'Siemens',
 ),
  array (
'agent' => 'Motorola',
),
                
//Browsers

 
array (

'agent' => 'Opera',

),

array (

'agent' => 'Firefox',

),

array (

'agent' => 'Firebird',

),

array (

'agent' => 'Safari'

),

           
array (

'agent' => 'Netscape',

),

array (

'agent' => 'MyIE2'

),

array (

'agent' => 'Konqueror'

),

array (

'agent' => 'Galeon'

),

array (

'agent' => 'KMeleon',

),

                array (

'agent' => 'NG/2.0',

),



                array (

'agent' => 'Gecko',

'name' => 'Mozilla',

         
),

                array (

'agent' => 'MSIE',



                ),

);



foreach( 
$known_agents AS $poss )

if (strpos(strtolower($user_agent), strtolower($poss['agent'])) !== false)

{

if ( $guest && isset($poss['spider']) && $poss['spider'] )

$user_name = isset($poss['spidername']) ? $poss['spidername'] : (isset($poss['name']) ? $poss['name'] : $poss['agent']); 

$result = isset($poss['name']) ? $poss['name'] : $poss['agent']; 

return isset($poss['spider']) && $poss['spider'];

}

$result $user_agent;

return false;

}



?>
Title: Re: CountryFlags
Post by: JayBachatero on October 09, 2006, 02:53:00 PM
This line
Code: [Select]
echo ' <br /> <span class="smalltext">(<b><a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank" title="' . $member['ip'] . '" class="smalltext2">' . $member['ip'] . '</a></b>, <acronym title="' . $member['query']['USER_AGENT'] . '">' . $member['agent'] . '</acronym>)</span>';
Title: Re: CountryFlags
Post by: Geezer on October 09, 2006, 02:59:18 PM
no didnt work, thanks for your help though
Title: Re: CountryFlags
Post by: JayBachatero on October 09, 2006, 03:18:04 PM
Can you PM me a test admin account so that I can look into it?
Title: Re: CountryFlags
Post by: Geezer on October 09, 2006, 04:13:57 PM
Jay thank you so much for your help
Title: Re: CountryFlags
Post by: RebelRose on October 11, 2006, 02:19:18 PM
I just downloaded the mod and when I went to upzip it, a message said corrupt file.
Title: Re: CountryFlags
Post by: JayBachatero on October 11, 2006, 02:36:03 PM
Did you try through package manager?
Title: Re: CountryFlags
Post by: NoxX on October 12, 2006, 05:47:25 PM
hi,

after i apply the mod, this errors are showing  ::)
Code: [Select]
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Code: [Select]
Type  Action  Description
1. Execute Modification install.xml Modification parse error
2. Execute Modification - Modification parse error
3. Extract Tree ./Themes/default/images/flags
did someone know what the problem is?
perhaps some wrong 777 settings or so??

/edit
i found the problem... the "temp" dir was missing in /fourm/packages  :o
Title: Re: CountryFlags
Post by: cotdagoo on October 13, 2006, 08:57:52 PM
for those asking about Wales, Northern Ireland, Scotland flags being added, you can replace the whole CountryFlag() function in Sources/Subs.php with this:

Code: [Select]
function CountryFlag()
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'nire' => 'Northern Ireland', 'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'scot' => 'Scotland', 'sn' => 'Senegal', 'cs' => 'Serbia and Montenegro',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wales' => 'Wales', 'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}

and extract this zip/copy files to your Themes/default/images/flags folder: http://www.multicolouredmirrors.org/flags.zip

cheers
Title: Re: CountryFlags
Post by: choloman05 on October 14, 2006, 06:52:38 PM
Add the $txt from the default theme's Modification.english.php to Dilberts Modification.english.php.

  Sorry to be stupid, but I really don't know what I would be looking for, could you be more specific? (and sorry it took me so long to get back to this.) thanks.
Title: Re: CountryFlags
Post by: JayBachatero on October 14, 2006, 09:21:02 PM
Add that to Modifications.english.php for DilbertMC
Code: [Select]
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';
Title: Re: CountryFlags
Post by: Dirtrocker on October 15, 2006, 02:26:22 AM
1.0.8 doesn't seem to give the option to install this mod.

A lot of mods don't seem to be able to be installed in the new version, is there a reason for that?
Title: Re: CountryFlags
Post by: JayBachatero on October 15, 2006, 02:51:38 AM
1.1 is newer than 1.0.8.  Most mods are being developed for 1.1 only.
Title: Re: CountryFlags
Post by: choloman05 on October 17, 2006, 02:43:25 PM
thanks Jay. And thanks for your quick help.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 22, 2006, 05:04:31 PM
SMF 1.1 RC3 - TP 0.9.5 "Test Site - Non Production"

Ok, so I first i installed on the default theme "worked fine there"... then I copied the flags folder to my custom theme... then I edited the files that needed to be edited for my custom theme and everything seems to work / look fine except for the following... I have the option set for it to show but the flag dont show in posts... registration part profile show everything else is fine but this ;-(

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fuotc.freeyellow.com%2Fnoflaginpost.gif&hash=3d5080a50d7ac56fcb3d67abf1960ca2)
Title: Re: CountryFlags
Post by: JayBachatero on October 22, 2006, 08:57:26 PM
Make sure that you copied and pasted in the right location.  Might be slightly different for your theme.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 22, 2006, 09:06:03 PM
Make sure that you copied and pasted in the right location.  Might be slightly different for your theme.
I'm 100 % positive I copied everything right... which is whats so frustrating...

Edit : Wana take a look if i make an admin name them post back here with what's wrong and what needs to be doneto fix...
Title: Re: CountryFlags
Post by: JayBachatero on October 22, 2006, 09:55:44 PM
Ok PM me admin info.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 22, 2006, 10:18:18 PM
Sent... you can correct the erros if you want... but please post what u found and what you replaced. bec chance are ill have to do this on my production site... like i said everything for this mods fine except the post thing...
Title: Re: CountryFlags
Post by: JayBachatero on October 22, 2006, 10:32:05 PM
I'll look at it later on when I get a chance.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 22, 2006, 10:34:12 PM
I'll look at it later on when I get a chance.
koo...
Title: Re: CountryFlags
Post by: JayBachatero on October 22, 2006, 11:06:28 PM
Ok done.  Not sure what exactly was wrong since it took me a few chances to get it done.  I had to move it around a bit.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 22, 2006, 11:08:47 PM
Ok done.  Not sure what exactly was wrong since it took me a few chances to get it done.  I had to move it around a bit.
Thats cool least it is workin but since this is a test site i may have to call upon u again come production time if i cant figure out what u did by lookin at the file hehe... is the display.template the only file u had to touch to get this to work...
Title: Re: CountryFlags
Post by: JayBachatero on October 23, 2006, 01:09:16 AM
Yea that was the only file that was edited.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 23, 2006, 03:42:51 PM
Yea that was the only file that was edited.
Well it shouldnt be to hard to figure out then assumin all u touched was the code for the flag hhe. shouldbe interesting to see if I can "get" this ;-P if not hope u wont mind helpin me one more time assumin i can get this on my own when im redy to go "production"
Title: Re: CountryFlags
Post by: JayBachatero on October 23, 2006, 10:10:56 PM
Sure no problem just let me know.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 23, 2006, 11:10:51 PM
Sure no problem just let me know.
I actually sent you a PM on this just saying when you can.. I decided to put this on my production forum ahead of schedule bec I wana try to "open" the doors within the next week or two and i still have alot of work to do...
Title: Re: CountryFlags
Post by: JayBachatero on October 23, 2006, 11:17:27 PM
Ok I'll look into it later on.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 25, 2006, 08:20:15 PM
Ok I'll look into it later on.
No rush just wanted to make sure you still have the info I pm'd you for my forum... and wanted to make sure you havent forgotten about me hehe...
Title: Re: CountryFlags
Post by: JayBachatero on October 25, 2006, 08:24:44 PM
Just been busy trying to install Ubuntu on my PC.
Title: Re: CountryFlags
Post by: MoreBloodWine on October 25, 2006, 08:31:58 PM
Just been busy trying to install Ubuntu on my PC.
Kool... like I said no rush hehe... whats Ubuntu just curious bec it has a weird name lol
Title: Re: CountryFlags
Post by: JayBachatero on October 25, 2006, 08:46:56 PM
Ubuntu is a Linux Distro.  Ubuntu.com
Title: Re: CountryFlags
Post by: MoreBloodWine on October 25, 2006, 08:54:00 PM
Ubuntu is a Linux Distro.  Ubuntu.com
Kool.. anyway ima watch tv for a while... just emember no rush on my hing u come first hehe... ttyl and tc just dont forget about me **grins**
Title: Re: CountryFlags
Post by: VegasBoxers on October 31, 2006, 05:41:16 PM
I have the country flag mod installed on my forum, but I have a problem.  Some of my users registered after I installed the mod, and should have selected a country.  Not all did.  So, I would like to know:

1.) Is there something we can add to the Admin's rights to be able to assign a flag to the registered user?

2.) Has anyone designed an error message into the mod that will not allow the user to register until they have selected a country/flag?

Thanks!
VB
Title: Re: CountryFlags
Post by: JayBachatero on October 31, 2006, 06:35:06 PM
You can edit the flag for any member just like you can edit their profile.
Title: Re: CountryFlags
Post by: VegasBoxers on October 31, 2006, 07:33:38 PM
Jay, I can always count on a prompt response from you!  What's a matter, no trick-or-treating for you tonight? ;D

You can edit the flag for any member just like you can edit their profile.

Really?  I have no such choices when I go to alter a profile.  (Including my own!  :o )

Am I missing some code?  Is my theme causing the conflict?

Jay, if you would, go to my SMF by clicking HERE (http://www.german-pride.com/SMF/) and register as TEST USER.  Do not select a flag when you accept the registration agreement.  Then go in to your profile, and you will not see the option for modifying flags.

???  Huh?  I'm not sure...

VB
Title: Re: CountryFlags
Post by: JayBachatero on October 31, 2006, 08:48:46 PM
Change to the default theme.  Check if the option is there.
Title: Re: CountryFlags
Post by: VegasBoxers on October 31, 2006, 11:22:16 PM
Change to the default theme.  Check if the option is there.

The option is there when I revert back to the stock default theme.  How do I alter my german-pride theme to allow these changes?

THANKS!
VB
Title: Re: CountryFlags
Post by: JayBachatero on October 31, 2006, 11:23:31 PM
You need to edit the Profile.template.php for your theme.  Look at the install.xml file for the changes required for that file.
Title: Re: CountryFlags
Post by: VegasBoxers on October 31, 2006, 11:25:17 PM
You need to edit the Profile.template.php for your theme.  Look at the install.xml file for the changes required for that file.

Where do I find the install.xml file?  Is that included in the mod that I downloaded when I installed your Countryflags mod?

THANKS!
VB
Title: Re: CountryFlags
Post by: JayBachatero on October 31, 2006, 11:32:32 PM
Yes is inside the archive.
Title: Re: CountryFlags
Post by: VegasBoxers on November 01, 2006, 12:10:58 AM
Yes is inside the archive.

okay I searched the install.xml file and I found this called out about the profile.template.php file:
Code: [Select]
<file name="$themedir/Profile.template.php">
<operation>
<search position="replace"><![CDATA[ <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
]]></search>
<add><![CDATA[ <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>';

// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<b>', $txt['country_flag_label'], ':</b>
</td>
<td>
<select name="country" onchange="showflags()">
<option value=""></option>';

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '" ', isset($context['member']['options']['country']) &&  $context['member']['options']['country'] == $key ? 'selected="selected"' : '', '>', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/', isset($context['member']['options']['country']) && !empty($context['member']['options']['country']) ? 'flags/' . $context['member']['options']['country'] . '.png': 'blank.gif', '" width="25" height="15" align="top" />
</td>
</tr>';
}

echo '
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[ </tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
]]></search>
<add><![CDATA[ </tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
<td><b>', $txt['country_flag'], ':</b></td>
<td>';

// Did they select a flag?
if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}

echo '
</td>
</tr><tr>
]]></add>
</operation>
</file>

Do I just open the profile.template.php and slap that in there?  Or is there a specific place it needs to be added?

Lastly, can this flag be locked so that members can't try tool fool around and change their countries?

THANKS!
VB
Title: Re: CountryFlags
Post by: JayBachatero on November 01, 2006, 08:22:47 AM
http://docs.simplemachines.org/index.php?topic=402
Title: Re: CountryFlags
Post by: VegasBoxers on November 01, 2006, 11:59:04 AM
http://docs.simplemachines.org/index.php?topic=402

Thanks Jay!  That should be simple enough!  I'll have to give it a shot tonight when I get home.  I'll have to owe you a Snickers bar from my daughter's stash she picked up last night! ;D

VB
Title: Re: CountryFlags
Post by: VegasBoxers on November 01, 2006, 10:59:22 PM
http://docs.simplemachines.org/index.php?topic=402

Thanks Jay!  That should be simple enough!  I'll have to give it a shot tonight when I get home.  I'll have to owe you a Snickers bar from my daughter's stash she picked up last night! ;D

VB

Well, I modified the profile.template.php in my custom theme per the install.xml directions in the mod.  Unfortunately, I don't have the ability to view anything to select their choice of flag under "profile" and then "Forum Profile Information".  Is there an additional template file I need to edit?  I didn't see one.   :(

VB
Title: Re: CountryFlags
Post by: JayBachatero on November 01, 2006, 11:11:39 PM
There are several places that you need to edit in profile.template.php.
Title: Re: CountryFlags
Post by: VegasBoxers on November 01, 2006, 11:25:50 PM
There are several places that you need to edit in profile.template.php.

Yeah, I understand that.  That's what the <search></search> tags were for right? There were like 2 or 3 items that needed to be found and replaced. I used dreamweaver's "Find" function and found and replaced with copying and pasting so as to not make any typo errors. 

Is that not the best way to do it?

VB
Title: Re: CountryFlags
Post by: JayBachatero on November 02, 2006, 08:06:59 AM
I suggest that you don't use dreamweaver for editing.  It messes up php files.
Title: Re: CountryFlags
Post by: MoreBloodWine on November 02, 2006, 11:57:47 AM
Editings the easy part its getting it to show up on posts thats a pain hehe... but I love this mod ;-P
Title: Re: CountryFlags
Post by: VegasBoxers on November 02, 2006, 01:28:34 PM
I suggest that you don't use dreamweaver for editing.  It messes up php files.

Alright, I'll go back and do it again by hand tonight.  That's interesting about Dreamweaver messing up the php files.  I've never heard that before.

Thanks Jay!

VB
Title: Re: CountryFlags
Post by: steve in houston on November 02, 2006, 01:55:46 PM
I suggest that you don't use dreamweaver for editing.  It messes up php files.

Alright, I'll go back and do it again by hand tonight.  That's interesting about Dreamweaver messing up the php files.  I've never heard that before.

Thanks Jay!

VB


every once in a while, dreamweaver will add a bunch of '] to the end of arrays that already end with '] where its doubled and causes errors.
Title: Re: CountryFlags
Post by: Dirtrocker on November 19, 2006, 06:07:50 PM
I'm having a bit of difficulty with the flags mod.
It doesn't seem to be working and it will not uninstall.
I get this error.

Type Action Description
1. Execute Modification install.xml Modification parse error
2. Execute Modification - Modification parse error

I was told to put a file in the Packages directory called Temp and chmod it 777, so I did and still get the same error.

Can someone please tell me how to uninstall it and get it installed correctly?
Thanks.
Title: Re: CountryFlags
Post by: JayBachatero on November 19, 2006, 09:25:55 PM
It should be called temp not Temp.  Also try chmoding it to 755.
Title: Re: CountryFlags
Post by: Dirtrocker on November 20, 2006, 02:42:52 AM
Quote
It should be called temp not Temp.  Also try chmoding it to 755.

Ok, typo on my part.

But support told me to follow the directions on this thread.
http://www.simplemachines.org/community/index.php?topic=28393.msg354086#msg354086

And it says to chmod to 777.
So now I am confused.

Chmod to 755 wouldn't even allow it to do anything.

It still won't uninstall.
Title: Re: CountryFlags
Post by: JayBachatero on November 20, 2006, 11:52:51 AM
I said to try CHMOD 755 cause some hosts don't allow 777.
Title: Re: CountryFlags
Post by: Dirtrocker on November 20, 2006, 08:34:41 PM
Oh ok.
Naw, we can chmod anything to 777.
Even stuff that we shouldn't.  :o

So the chmod isn't a problem.
The problem is uninstalling the mod.
It doesn't seem to want to do it.
Title: Re: CountryFlags
Post by: JayBachatero on November 20, 2006, 08:49:16 PM
Can you uninstall other mods?
Title: Re: CountryFlags
Post by: Dirtrocker on November 21, 2006, 08:26:32 PM
Yes, all the others seem to install and uninstall fine, as long as I use the temp folder thing.
Title: Re: CountryFlags
Post by: JayBachatero on November 21, 2006, 10:09:12 PM
Did you ever remove the file from the server?
Title: Re: CountryFlags
Post by: MoreBloodWine on November 25, 2006, 06:00:32 PM
I'm modifying some of the error messages displayed on my forum in the Errors.english.php file but the error for this mod isnt defined there... So where exactly is the below message defined so I can modify it some...

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.choice-online-gaming.com%2Fimages%2Fflagselecterror.jpg&hash=4e02c65c11bd0c5c4d1685363b5e9a5d)
Title: Re: CountryFlags
Post by: JayBachatero on November 25, 2006, 11:22:46 PM
Modifications.english.php.
Title: Re: CountryFlags
Post by: Dirtrocker on November 26, 2006, 11:56:53 PM
Did you ever remove the file from the server?
No. Should I?
Title: Re: CountryFlags
Post by: origin8or on December 09, 2006, 05:50:56 PM
Is there an update for this for 1.1 ???
Title: Re: CountryFlags
Post by: JayBachatero on December 10, 2006, 10:55:06 PM
This mod should work on 1.1 but I'm going to take some time and look over my mods and make sure that they actually work with 1.1.
Title: Re: CountryFlags
Post by: KGIII on December 11, 2006, 11:35:42 AM
This mod should work on 1.1 but I'm going to take some time and look over my mods and make sure that they actually work with 1.1.

It just threw an error on the default theme here. It may well be that I've got too many MODs installed though.
Title: Re: CountryFlags
Post by: JayBachatero on December 12, 2006, 12:34:31 PM
I just tested this mod and it works fine with 1.1.
Title: Re: CountryFlags
Post by: KGIII on December 12, 2006, 03:41:32 PM
I just tested this mod and it works fine with 1.1.

I suspect it is too many MODs perhaps? Using the default theme, not Babylon, I get errors in ModSettings.php and Display.template.php. On a nice clean install of SMF 1.1 it works famously. I'll poke at it and make it install by doing it manually I suppose.
Title: Re: CountryFlags
Post by: Amon777 on December 13, 2006, 02:11:50 AM
Test Failed at Themes/default/Display.template.php

i use 1.1 , any idea?
Title: Re: CountryFlags
Post by: JayBachatero on December 13, 2006, 10:18:44 AM
I just tested this mod and it works fine with 1.1.

I suspect it is too many MODs perhaps? Using the default theme, not Babylon, I get errors in ModSettings.php and Display.template.php. On a nice clean install of SMF 1.1 it works famously. I'll poke at it and make it install by doing it manually I suppose.
When you have too many mods it's prone to fail in ModSettings.php.

Test Failed at Themes/default/Display.template.php

i use 1.1 , any idea?
What mods do you have installed?
Title: Re: CountryFlags
Post by: Amon777 on December 13, 2006, 12:26:36 PM
Gallery lite and Users online today
Title: Re: CountryFlags
Post by: KGIII on December 13, 2006, 01:21:11 PM
Hmm... I wonder if there might be a safer place to put the code. In my case it is likely a conflict with having put the Custom Profile Field Mod installed. I've still not dug into it but... Hopefully... I'll get time.
Title: Re: CountryFlags
Post by: Amon777 on December 14, 2006, 04:32:30 AM
i like very much this mod ... but i don't know why to do that....maybe because i copied some things from RC3 of the display. to 1.1?
Title: Re: CountryFlags
Post by: JayBachatero on December 14, 2006, 10:43:56 AM
Yea that might be the cause of the problem.
Title: Re: CountryFlags
Post by: Amon777 on December 14, 2006, 11:20:38 AM
Any solution please?
Title: Re: CountryFlags
Post by: emaildrop on December 14, 2006, 09:31:46 PM
which package should I install for my 1.1 smf ?
Title: Re: CountryFlags
Post by: emaildrop on December 14, 2006, 10:55:12 PM
Fixed. 

For those of you that have this problem just change
Code: [Select]
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
to
Code: [Select]
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))

Thank you for your nice mod.
I had a problem though and solved it according to the instruction you gave in other posts as above!
I could not see the country flag in posts but now with the change above every thing seems to be fine
I use smf 1.1 and I installed your package
http://mods.simplemachines.org/index.php?action=download;mod=417;id=17956

Question: Now that I manually fixed this by replacing a set of codes
supposing one day I want to update your mod or uninstall your mod
when I go to click uninstall in package manager will uninstalling be successful?
If not what can I do to avoid problems ?
Title: Re: CountryFlags
Post by: JayBachatero on December 14, 2006, 11:22:38 PM
Yea there is a chance that the uninstall might fail there.  You can just remove it manually if you uninstall.
Title: Re: CountryFlags
Post by: emaildrop on December 15, 2006, 01:24:35 AM
thanks the mod really worth doing some more hard work.
but any Idea? why I had to do it manually to display flags in posts? it is the same with all people here if so couldn't be avoided by just putting the new code in the first place?
So I have to remember what changes I made and in case I want to uninstall I must first resore it to what it was at the time of installation then click uninstall? :'(
Title: Re: CountryFlags
Post by: Amon777 on December 15, 2006, 05:06:28 AM
Finally i installed the mod (display.template.php test failed) and then i copied the display code manually there and it worked...
Title: Re: CountryFlags
Post by: bbmtalk on December 27, 2006, 04:14:06 PM
Tried to install but failed the following test.

3.    Execute Modification    ./Sources/ModSettings.php    Test failed

Any help please? I have SMF 1.1 and TP

Title: Re: CountryFlags
Post by: MrPrise on December 28, 2006, 04:09:07 PM
Nice mod. Can I make a feature request here? ;-) Could you make it to show the flags on the memberlist page too? Thanks for the mod anyway.
Title: Re: CountryFlags
Post by: MrPrise on December 29, 2006, 01:03:21 PM
Well, I did it myself ;-) These are the necessary changes to display the country flags on the memberlist page:

in Memberlist.template.php, in the template_main() add $modSettings in the global line.
Later, before the line
Code: [Select]
// Old style tabs?add this:
Code: [Select]
$colnums=count($context['columns'])+1;
(Note: this is just for our comfort. It counts automatically the colspan value for the tables)

Later there will be four
Code: [Select]
<td colspan="12">
You should change all the 12 in them to ',$colnums,' so the td will look like this:
Code: [Select]
<td colspan="',$colnums,'">
And now the real thing. We are going to add a new column for the table. Find this:
Code: [Select]
<td class="windowbg" align="left">', $member['link'], '</td>
and after that insert these lines:

Code: [Select]
<td class="windowbg" >';
// Did they select a flag?
if(isset($member['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($member['options']['country']))
{
$flags = CountryFlag();
echo '<img src="', $settings['default_theme_url'], '/images/flags/', $member['options']['country'], '.png" alt="', $flags[$member['options']['country']], '" title="', $flags[$member['options']['country']], '" />';
}
echo '</td>


in Sources/Memberlist.php find

Code: [Select]
'realName' => array(
'label' => $txt[35]
),

and after it add that:
Code: [Select]
'location' => array(
'label' => $txt['country_flag'],
'width' => '10'
),

find that:
Code: [Select]
'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),

and after it add that:

Code: [Select]
'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),

Find the line

Code: [Select]
// Select the members from the database.
and before it add these:

Code: [Select]
if ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';
Replace that line

Code: [Select]
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . "
with that

Code: [Select]
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') .
($_REQUEST['sort'] === 'location' ? " LEFT JOIN {$db_prefix}themes AS opt ON (opt.ID_MEMBER = mem.ID_MEMBER)" : '') . "


Before the line

Code: [Select]
// Search for messengers...
insert that:
Code: [Select]
// Search for location.
if (in_array('location', $_POST['fields']))
$fields += array(7 => 'locationTitle', 'location');
            

There is one known bug. If you sort the list by location only those members will be visible who already enter his/her location (country) information. This is because the opt.variable="country" WHERE clause. I'm not an SQL expert, I dont know how to get all the people who has the country value set in the smf_themes table and those who hasn't. Any feedback or fix for that are welcomed!
Title: Re: CountryFlags
Post by: trackman on January 06, 2007, 07:01:56 AM
I'm using a different theme from the default and the flags won't display in the posts even tho I have set the options in the Admin CPanel. I read that you need to edit Display.Template but I don't know what to add into my theme to make it work.

Any help please :(
Title: Re: CountryFlags
Post by: karlbenson on January 06, 2007, 12:17:48 PM
This is a gr8 mod. I never like the flags tho.  On my forum I've switched the ones in here for a set 99% from FamFamFam.com by Mark James.

Preview Screenshot:
http://famfamfam.com/lab/icons/flags/flags_preview_large.png

Attached a zip of them.
Title: Re: CountryFlags
Post by: trackman on January 06, 2007, 02:12:21 PM
I'm using a different theme from the default and the flags won't display in the posts even tho I have set the options in the Admin CPanel. I read that you need to edit Display.Template but I don't know what to add into my theme to make it work.

Any help please :(

Do I add the same code in the default theme into mine :)
Title: Re: CountryFlags
Post by: karlbenson on January 07, 2007, 02:10:49 PM
open up the mod (zip) and look at the changes it make and manually make the edits to the files in your custom theme
Title: Re: CountryFlags
Post by: japanlinked on January 14, 2007, 07:01:51 PM
Hello I have installed your flag mod and am was excited to see it working...but...

When new registers arive it asks for there country selection and the flag shows.

But the flags do not show up in the posts.

Also People who where already registered before the mod have no selection in the profile area.

In admin I have selected both ect.
any help
here is the forum www.japanlinked.com/forum/
Title: Re: CountryFlags
Post by: JayBachatero on January 14, 2007, 09:11:44 PM
I just clicked the link and flags show up for me.
Title: Re: CountryFlags
Post by: japanlinked on January 15, 2007, 06:32:04 AM
The flags shop up in the posts ? I can't see any and as the administrator I have no option to choose one. Only  new users can get the option to select, but after that where do they go I dont see any on the board?
Title: Re: CountryFlags
Post by: japanlinked on January 15, 2007, 10:15:26 AM
HELP! I decided to uninstall and reinstall the flag mod but as soon as I uninstaled it I got a fatal error and can no longer use the forum at all.

I went and manualy tried to delete the mod but now get a parse error as follows:

Parse error: parse error, unexpected T_STRING, expecting ')' in /home/content/J/a/s/JasonLinked/html/forum/Sources/Subs.php on line 3441

I hope you guys can help me I am in dire need of help! Let me know if you need files and where to send them
Title: Re: CountryFlags
Post by: trackman on January 15, 2007, 02:28:51 PM
Help please I have the following text at the top of my Forum page when I installed the mod:

// Country Flag mod $txt['country_flag_label'] = 'Please select your country'; $txt['country_flag_error_required'] = 'You must select the country that you visit us from'; $txt['country_flag_ask'] = 'Ask for country flag on'; $txt['country_flag_disabled'] = 'Don\'t show (Disabled)'; $txt['country_flag_profile'] = 'Profile'; $txt['country_flag_registration'] = 'Registration'; $txt['country_flag_both'] = 'Both'; $txt['country_flag_required'] = 'Require a member to select a location?'; $txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).'; $txt['country_flag'] = 'Country'; >:(
Title: Re: CountryFlags
Post by: txleo on January 18, 2007, 01:46:52 AM
I installed the mod and it worked fine on my board.  I'm using latest version of SMF.
Title: Re: CountryFlags
Post by: RoarinRow on January 18, 2007, 03:41:37 PM
Help please I have the following text at the top of my Forum page when I installed the mod:

// Country Flag mod $txt['country_flag_label'] = 'Please select your country'; $txt['country_flag_error_required'] = 'You must select the country that you visit us from'; $txt['country_flag_ask'] = 'Ask for country flag on'; $txt['country_flag_disabled'] = 'Don\'t show (Disabled)'; $txt['country_flag_profile'] = 'Profile'; $txt['country_flag_registration'] = 'Registration'; $txt['country_flag_both'] = 'Both'; $txt['country_flag_required'] = 'Require a member to select a location?'; $txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).'; $txt['country_flag'] = 'Country'; >:(

you have to open up your Themes/default/languages/modification.english.php file and scroll to the bottom.  Move all that code before the '?>' and make sure there is a semicolon separating this code with the last one in your file.   At least that's what I did.
Title: Re: CountryFlags
Post by: Dhekelian on January 21, 2007, 06:02:24 PM
I installed the mod and it worked fine on my board.  I'm using latest version of SMF.

What version you using? Can you get this working on 1.1.1?
Title: Re: CountryFlags
Post by: txleo on January 22, 2007, 11:11:36 AM
Forum version: SMF 1.1.1




I installed the mod and it worked fine on my board.  I'm using latest version of SMF.

What version you using? Can you get this working on 1.1.1?
Title: Re: CountryFlags
Post by: Dhekelian on January 22, 2007, 11:40:19 AM
I have just installed it, made the settings change to include England and the other home countries, uploaded the flags and now I can't even see my forum, it has disappeared.
Title: Re: CountryFlags
Post by: Dhekelian on January 23, 2007, 01:27:43 PM
I am having real bother not with this mod. I added Eng and some others then three flags started showing in the reg and forum posts so I uninstalled it thinking it was me so I re applied but the same, what gives? Hope you can help.
Title: Re: CountryFlags
Post by: JayBachatero on January 23, 2007, 05:43:24 PM
Post the changes that you made.  Might have a parse error somewhere.
Title: Re: CountryFlags
Post by: Dhekelian on January 23, 2007, 10:01:01 PM
I solved that but got another problem. I kept getting three flags. I looked in the modified entries to find there was multiple text refering to the mod, 3 duplicate blocks of code. I can't work out how it happened. It has taken me all night to do it. I have one other mod installed and that is the streaming 3 one. I using the default template and then set the forum to another template either pirates or Leviathen. I was trouble using both together and have just managed, I just hope it stays like it. If I set a test Admin up would you be so kind as to have a quick look, no hurry if your busy. Thanks.
Title: Re: CountryFlags
Post by: sportographer on January 23, 2007, 11:25:24 PM
Well, I did it myself ;-) These are the necessary changes to display the country flags on the memberlist page:

in Memberlist.template.php, in the template_main() add $modSettings in the global line.
Later, before the line
Code: [Select]
// Old style tabs?add this:
Code: [Select]
$colnums=count($context['columns'])+1;
(Note: this is just for our comfort. It counts automatically the colspan value for the tables)

Later there will be four
Code: [Select]
<td colspan="12">
You should change all the 12 in them to ',$colnums,' so the td will look like this:
Code: [Select]
<td colspan="',$colnums,'">
And now the real thing. We are going to add a new column for the table. Find this:
Code: [Select]
<td class="windowbg" align="left">', $member['link'], '</td>
and after that insert these lines:

Code: [Select]
<td class="windowbg" >';
// Did they select a flag?
if(isset($member['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($member['options']['country']))
{
$flags = CountryFlag();
echo '<img src="', $settings['default_theme_url'], '/images/flags/', $member['options']['country'], '.png" alt="', $flags[$member['options']['country']], '" title="', $flags[$member['options']['country']], '" />';
}
echo '</td>


in Sources/Memberlist.php find

Code: [Select]
'realName' => array(
'label' => $txt[35]
),

and after it add that:
Code: [Select]
'location' => array(
'label' => $txt['country_flag'],
'width' => '10'
),

find that:
Code: [Select]
'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),

and after it add that:

Code: [Select]
'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),

Find the line

Code: [Select]
// Select the members from the database.
and before it add these:

Code: [Select]
if ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';
Replace that line

Code: [Select]
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . "
with that

Code: [Select]
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') .
($_REQUEST['sort'] === 'location' ? " LEFT JOIN {$db_prefix}themes AS opt ON (opt.ID_MEMBER = mem.ID_MEMBER)" : '') . "


Before the line

Code: [Select]
// Search for messengers...
insert that:
Code: [Select]
// Search for location.
if (in_array('location', $_POST['fields']))
$fields += array(7 => 'locationTitle', 'location');
            

There is one known bug. If you sort the list by location only those members will be visible who already enter his/her location (country) information. This is because the opt.variable="country" WHERE clause. I'm not an SQL expert, I dont know how to get all the people who has the country value set in the smf_themes table and those who hasn't. Any feedback or fix for that are welcomed!
followed that but it didnt work =\
Title: Re: CountryFlags
Post by: sportographer on January 23, 2007, 11:28:26 PM
im using black22TP btw, here is my code
memberlist.template.php
Code: [Select]
<?php
// Version: 1.1; Memberlist

// Displays a sortable listing of all members registered on the forum.
function template_main() $modSettings
{
global $context$settings$options$scripturl$txt;

// Show the link tree.
echo '
<div style="padding: 3px;">'
theme_linktree(), '</div>';

// shall we use the tabs?
if (!empty($settings['use_tabs']))
{
// Display links to view all/search.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first">&nbsp;</td>'
;

foreach ($context['sort_links'] as $link)
{
if ($link['selected'])
echo '
<td class="mirrortab_active_first">&nbsp;</td>
<td valign="top" class="mirrortab_active_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>
<td class="mirrortab_active_last">&nbsp;</td>'
;
else
echo '
<td valign="top" class="mirrortab_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>'
;
}

echo '
<td class="mirrortab_last">&nbsp;</td>
</tr>
</table>'
;
}

echo '
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="bordercolor">'
;

// Old style tabs?
$colnums=count($context['columns'])+1;
if (empty(
$settings['use_tabs']))

{
echo '
<tr class="titlebg">
<td colspan=",$colnums">'
;
$links = array();
foreach ($context['sort_links'] as $link)
$links[] = ($link['selected'] ? '<img src="' $settings['images_url'] . '/selected.gif" alt="&gt;" /> ' '') . '<a href="' $scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">' $link['label'] . '</a>';

echo '
'
implode(' | '$links), '
</td>
</tr>'
;
}
echo '
<tr>
<td colspan=",$colnums" class="'
, empty($settings['use_tabs']) ? 'catbg' 'titlebg''">';

// Display page numbers and the a-z links for sorting by name if not a result of a search.
if (!isset($context['old_search']))
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>'
$txt[139], ': '$context['page_index'], '</td>
<td align="right">'
$context['letter_links'] . '</td>
</tr>
</table>'
;
// If this is a result of a search then just show the page numbers.
else
echo '
'
$txt[139], ': '$context['page_index'];

echo '
</td>
</tr>
<tr class="'
, empty($settings['use_tabs']) ? 'titlebg' 'catbg3''">';

// Display each of the column headers of the table.
foreach ($context['columns'] as $column)
{
// We're not able (through the template) to sort the search results right now...
if (isset($context['old_search']))
echo '
<td'
, isset($column['width']) ? ' width="' $column['width'] . '"' '', isset($column['colspan']) ? ' colspan="' $column['colspan'] . '"' '''>
'
$column['label'], '</td>';
// This is a selected solumn, so underline it or some such.
elseif ($column['selected'])
echo '
<td style="width: auto;"' 
. (isset($column['colspan']) ? ' colspan="' $column['colspan'] . '"' '') . ' nowrap="nowrap">
<a href="' 
$column['href'] . '">' $column['label'] . ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" /></a></td>';
// This is just some column... show the link and be done with it.
else
echo '
<td'
, isset($column['width']) ? ' width="' $column['width'] . '"' '', isset($column['colspan']) ? ' colspan="' $column['colspan'] . '"' '''>
'
$column['link'], '</td>';
}
echo '
</tr>'
;

// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
echo '
<tr style="text-align: center;"'
, empty($member['sort_letter']) ? '' ' id="letter' $member['sort_letter'] . '"''>
<td class="windowbg2">
'
$context['can_send_pm'] ? '<a href="' $member['online']['href'] . '" title="' $member['online']['text'] . '">' ''$settings['use_image_buttons'] ? '<img src="' $member['online']['image_href'] . '" alt="' $member['online']['text'] . '" align="middle" />' $member['online']['label'], $context['can_send_pm'] ? '</a>' '''
</td>
<td class="windowbg" align="left">'
$member['link'], '</td>
<td class="windowbg" >'
;
// Did they select a flag?
if(isset($member['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($member['options']['country']))
{

$flags CountryFlag();
echo 
'<img src="'$settings['default_theme_url'], '/images/flags/'$member['options']['country'], '.png" alt="'$flags[$member['options']['country']], '" title="'$flags[$member['options']['country']], '" />';

echo 
'</td>
<td class="windowbg2">'
$member['hide_email'] ? '' '<a href="mailto:' $member['email'] . '"><img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt[69] . '" title="' $txt[69] . ' ' $member['name'] . '" /></a>''</td>
<td class="windowbg">'
$member['website']['url'] != '' '<a href="' $member['website']['url'] . '" target="_blank"><img src="' $settings['images_url'] . '/www.gif" alt="' $member['website']['title'] . '" title="' $member['website']['title'] . '" /></a>' '''</td>
<td class="windowbg2">'
$member['icq']['link'], '</td>
<td class="windowbg2">'
$member['aim']['link'], '</td>
<td class="windowbg2">'
$member['yim']['link'], '</td>
<td class="windowbg2">'
$member['msn']['link'], '</td>
<td class="windowbg" align="left">'
, empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
<td class="windowbg" align="left">'
$member['registered_date'], '</td>
<td class="windowbg2" width="15">'
$member['posts'], '</td>
<td class="windowbg" width="100" align="left">
'
$member['posts'] > '<img src="' $settings['images_url'] . '/bar.gif" width="' $member['post_percent'] . '" height="15" alt="" />' '''
</td>
</tr>'
;
}
// No members?
else
echo '
<tr>
<td colspan=",$colnums" class="windowbg">'
$txt[170], '</td>
</tr>'
;

// Show the page numbers again. (makes 'em easier to find!)
echo '
<tr>
<td class="titlebg" colspan=",$colnums">'
$txt[139], ': '$context['page_index'], '</td>
</tr>
</table>'
;

// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<br />
<a href="'
$scripturl'?action=mlist;sa=search;search='$context['old_search_value'], '">'$txt['mlist_search2'], '</a>';
}

// A page allowing people to search the member list.
function template_search()
{
global $context$settings$options$scripturl$txt;

// Start the submission form for the search!
echo '
<form action="'
$scripturl'?action=mlist;sa=search" method="post" accept-charset="'$context['character_set'], '">';

// Display that link tree...
echo '
<div style="padding: 3px;">'
theme_linktree(), '</div>';

// Display links to view all/search.
if (!empty($settings['use_tabs']))
{
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first">&nbsp;</td>'
;

foreach ($context['sort_links'] as $link)
{
if ($link['selected'])
echo '
<td class="mirrortab_active_first">&nbsp;</td>
<td valign="top" class="mirrortab_active_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>
<td class="mirrortab_active_last">&nbsp;</td>'
;
else
echo '
<td valign="top" class="mirrortab_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>'
;
}

echo '
<td class="mirrortab_last">&nbsp;</td>
</tr>
</table>
<div class="tborder">'
;
}
else
{
echo '
<div class="bordercolor" style="padding: 1px;">
<div class="titlebg" style="padding: 4px 4px 4px 10px;">'
;
$links = array();
foreach ($context['sort_links'] as $link)
$links[] = ($link['selected'] ? '<img src="' $settings['images_url'] . '/selected.gif" alt="&gt;" /> ' '') . '<a href="' $scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">' $link['label'] . '</a>';

echo '
'
implode(' | '$links), '
</div>
</div>
<div class="bordercolor" style="padding: 1px">'
;
}

// Display the input boxes for the form.
echo '

<div class="windowbg" align="center" style="padding-bottom: 1ex;">
<table width="440" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left">
<br />
<b>'
$txt[582], ':</b> <input type="text" name="search" value="'$context['old_search'], '" size="35" /> <input type="submit" name="submit" value="' $txt[182] . '" style="margin-left: 20px;" /><br />
<br />
</td>
</tr>
<tr>
<td align="left">
<label for="fields-email"><input type="checkbox" name="fields[]" id="fields-email" value="email" checked="checked" class="check" /> '
$txt['mlist_search_email'], '</label><br />
<label for="fields-messenger"><input type="checkbox" name="fields[]" id="fields-messenger" value="messenger" class="check" /> '
$txt['mlist_search_messenger'], '</label><br />
<label for="fields-group"><input type="checkbox" name="fields[]" id="fields-group" value="group" class="check" /> '
$txt['mlist_search_group'], '</label>
</td>
<td align="left" valign="top">
<label for="fields-name"><input type="checkbox" name="fields[]" id="fields-name" value="name" checked="checked" class="check" /> '
$txt['mlist_search_name'], '</label><br />
<label for="fields-website"><input type="checkbox" name="fields[]" id="fields-website" value="website" class="check" /> '
$txt['mlist_search_website'], '</label>
</td>
</tr>
</table>
</div>
</div>
</form>'
;
}

?>

memberlist.php

Code: [Select]
<?php
/**********************************************************************************
* Memberlist.php                                                                  *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');

/* This file contains the functions for displaying and searching in the
members list.  It does so with these functions:

void MemberList()
- shows a list of registered members.
- if a subaction is not specified, lists all registered members.
- allows searching for members with the 'search' sub action.
- calls MLAll or MLSearch depending on the sub action.
- uses the Memberlist template with the main sub template.
- requires the view_mlist permission.
- is accessed via ?action=mlist.

void MLAll()
- used to display all members on a page by page basis with sorting.
- called from MemberList().
- can be passed a sort parameter, to order the display of members.
- calls printMemberListRows to retrieve the results of the query.

void MLSearch()
- used to search for members or display search results.
- called by MemberList().
- if variable 'search' is empty displays search dialog box, using the
  search sub template.
- calls printMemberListRows to retrieve the results of the query.

void printMemberListRows(resource request)
- retrieves results of the request passed to it
- puts results of request into the context for the sub template.
*/

// Show a listing of the registered members.
function Memberlist()
{
global $scripturl$txt$modSettings$context$settings;

// Make sure they can view the memberlist.
isAllowedTo('view_mlist');

loadTemplate('Memberlist');

$context['listing_by'] = !empty($_GET['sa']) ? $_GET['sa'] : 'all';

// $subActions array format:
// 'subaction' => array('label', 'function', 'is_selected')
$subActions = array(
'all' => array(&$txt[303], 'MLAll'$context['listing_by'] == 'all'),
'search' => array(&$txt['mlist_search'], 'MLSearch'$context['listing_by'] == 'search'),
);

// Set up the sort links.
$context['sort_links'] = array();
foreach ($subActions as $act => $text)
$context['sort_links'][] = array(
'label' => $text[0],
'action' => $act,
'selected' => $text[2],
);

$context['num_members'] = $modSettings['totalMembers'];

// Set up the columns...
$context['columns'] = array(
'isOnline' => array(
'label' => $txt['online8'],
'width' => '20'
),
'realName' => array(
'label' => $txt[35]

),
'location' => array(
'label' => $txt['country_flag'],
'width' => '10'
),
'emailAddress' => array(
'label' => $txt[307],
'width' => '25'
),
'websiteUrl' => array(
'label' => $txt[96],
'width' => '25'
),
'ICQ' => array(
'label' => $txt[513],
'width' => '25'
),
'AIM' => array(
'label' => $txt[603],
'width' => '25'
),
'YIM' => array(
'label' => $txt[604],
'width' => '25'
),
'MSN' => array(
'label' => $txt['MSN'],
'width' => '25'
),
'ID_GROUP' => array(
'label' => $txt[87]
),
'registered' => array(
'label' => $txt[233]
),
'posts' => array(
'label' => $txt[21],
'width' => '115',
'colspan' => '2'
)
);

$context['linktree'][] = array(
'url' => $scripturl '?action=mlist',
'name' => &$txt[332]
);

$context['can_send_pm'] = allowedTo('pm_send');

// Jump to the sub action.
if (isset($subActions[$context['listing_by']]))
$subActions[$context['listing_by']][1]();
else
$subActions['all'][1]();
}

// List all members, page by page.
function MLAll()
{
global $txt$scripturl$db_prefix$user_info;
global $modSettings$context$func;

// The chunk size for the cached index.
$cache_step_size 500;

// Only use caching if:
// 1. there are at least 2k members,
// 2. the default sorting method (realName) is being used,
// 3. the page shown is high enough to make a DB filesort unprofitable.
$use_cache $modSettings['totalMembers'] > 2000 && (!isset($_REQUEST['sort']) || $_REQUEST['sort'] === 'realName') && isset($_REQUEST['start']) && $_REQUEST['start'] > $cache_step_size;

if ($use_cache)
{
// Maybe there's something cached already.
if (!empty($modSettings['memberlist_cache']))
$memberlist_cache = @unserialize($modSettings['memberlist_cache']);

// Only update the cache if something changed or no cache existed yet.
if (empty($memberlist_cache) || empty($modSettings['memberlist_updated']) || $memberlist_cache['last_update'] < $modSettings['memberlist_updated'])
{
$request db_query("
SELECT realName
FROM 
{$db_prefix}members
WHERE is_activated = 1
ORDER BY realName"
__FILE____LINE__);

$memberlist_cache = array(
'last_update' => time(),
'num_members' => mysql_num_rows($request),
'index' => array(),
);

for ($i 0$n mysql_num_rows($request); $i $n$i += $cache_step_size)
{
mysql_data_seek($request$i);
list($memberlist_cache['index'][$i]) = mysql_fetch_row($request);
}
mysql_data_seek($request$memberlist_cache['num_members'] - 1);
list($memberlist_cache['index'][$i]) = mysql_fetch_row($request);
mysql_free_result($request);

// Now we've got the cache...store it.
updateSettings(array('memberlist_cache' => addslashes(serialize($memberlist_cache))));
}

$context['num_members'] = $memberlist_cache['num_members'];
}

// Without cache we need an extra query to get the amount of members.
else
{
$request db_query("
SELECT COUNT(*)
FROM 
{$db_prefix}members
WHERE is_activated = 1"
__FILE____LINE__);
list ($context['num_members']) = mysql_fetch_row($request);
mysql_free_result($request);
}

// Set defaults for sort (realName) and start. (0)
if (!isset($_REQUEST['sort']) || !isset($context['columns'][$_REQUEST['sort']]))
$_REQUEST['sort'] = 'realName';

if (!is_numeric($_REQUEST['start']))
{
if (preg_match('~^[^\'\\\\/]~' . ($context['utf8'] ? 'u' ''), $func['strtolower']($_REQUEST['start']), $match) === 0)
fatal_error('Hacker?'false);

$_REQUEST['start'] = $match[0];

$request db_query("
SELECT COUNT(*)
FROM 
{$db_prefix}members
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '
$_REQUEST[start]'
AND is_activated = 1"
__FILE____LINE__);
list ($_REQUEST['start']) = mysql_fetch_row($request);
mysql_free_result($request);
}

$context['letter_links'] = '';
for ($i 97$i 123$i++)
$context['letter_links'] .= '<a href="' $scripturl '?action=mlist;sa=all;start=' chr($i) . '#letter' chr($i) . '">' strtoupper(chr($i)) . '</a> ';

// Sort out the column information.
foreach ($context['columns'] as $col => $dummy)
{
$context['columns'][$col]['href'] = $scripturl '?action=mlist;sort=' $col ';start=0';

if (!isset($_REQUEST['desc']) && $col == $_REQUEST['sort'])
$context['columns'][$col]['href'] .= ';desc';

$context['columns'][$col]['link'] = '<a href="' $context['columns'][$col]['href'] . '">' $context['columns'][$col]['label'] . '</a>';
$context['columns'][$col]['selected'] = $_REQUEST['sort'] == $col;
}

$context['sort_by'] = $_REQUEST['sort'];
$context['sort_direction'] = !isset($_REQUEST['desc']) ? 'down' 'up';

// Construct the page index.
$context['page_index'] = constructPageIndex($scripturl '?action=mlist;sort=' $_REQUEST['sort'] . (isset($_REQUEST['desc']) ? ';desc' ''), $_REQUEST['start'], $context['num_members'], $modSettings['defaultMaxMembers']);

// Send the data to the template.
$context['start'] = $_REQUEST['start'] + 1;
$context['end'] = min($_REQUEST['start'] + $modSettings['defaultMaxMembers'], $context['num_members']);

$context['page_title'] = $txt[308] . ' ' $context['start'] . ' ' $txt[311] . ' ' $context['end'];
$context['linktree'][] = array(
'url' => $scripturl '?action=mlist;sort=' $_REQUEST['sort'] . ';start=' $_REQUEST['start'],
'name' => &$context['page_title'],
'extra_after' => ' (' $txt[309] . ' ' $context['num_members'] . ' ' $txt[310] . ')'
);

// List out the different sorting methods...
$sort_methods = array(
'isOnline' => array(
'down' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' '') . ') ASC, realName ASC',
'up' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' '') . ') DESC, realName DESC'
),
'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),
'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),
'emailAddress' => array(
'down' => (allowedTo('moderate_forum') || empty($modSettings['allow_hideEmail'])) ? 'mem.emailAddress ASC' 'mem.hideEmail ASC, mem.emailAddress ASC',
'up' => (allowedTo('moderate_forum') || empty($modSettings['allow_hideEmail'])) ? 'mem.emailAddress DESC' 'mem.hideEmail DESC, mem.emailAddress DESC'
),
'websiteUrl' => array(
'down' => 'LENGTH(mem.websiteURL) > 0 DESC, ISNULL(mem.websiteURL) ASC, mem.websiteURL ASC',
'up' => 'LENGTH(mem.websiteURL) > 0 ASC, ISNULL(mem.websiteURL) DESC, mem.websiteURL DESC'
),
'ICQ' => array(
'down' => 'LENGTH(mem.ICQ) > 0 DESC, ISNULL(mem.ICQ) OR mem.ICQ = 0 ASC, mem.ICQ ASC',
'up' => 'LENGTH(mem.ICQ) > 0 ASC, ISNULL(mem.ICQ) OR mem.ICQ = 0 DESC, mem.ICQ DESC'
),
'AIM' => array(
'down' => 'LENGTH(mem.AIM) > 0 DESC, ISNULL(mem.AIM) ASC, mem.AIM ASC',
'up' => 'LENGTH(mem.AIM) > 0 ASC, ISNULL(mem.AIM) DESC, mem.AIM DESC'
),
'YIM' => array(
'down' => 'LENGTH(mem.YIM) > 0 DESC, ISNULL(mem.YIM) ASC, mem.YIM ASC',
'up' => 'LENGTH(mem.YIM) > 0 ASC, ISNULL(mem.YIM) DESC, mem.YIM DESC'
),
'MSN' => array(
'down' => 'LENGTH(mem.MSN) > 0 DESC, ISNULL(mem.MSN) ASC, mem.MSN ASC',
'up' => 'LENGTH(mem.MSN) > 0 ASC, ISNULL(mem.MSN) DESC, mem.MSN DESC'
),
'registered' => array(
'down' => 'mem.dateRegistered ASC',
'up' => 'mem.dateRegistered DESC'
),
'ID_GROUP' => array(
'down' => 'ISNULL(mg.groupName) ASC, mg.groupName ASC',
'up' => 'ISNULL(mg.groupName) DESC, mg.groupName DESC'
),
'posts' => array(
'down' => 'mem.posts DESC',
'up' => 'mem.posts ASC'
)
);

$limit $_REQUEST['start'];

// Using cache allows to narrow down the list to be retrieved.
if ($use_cache && $_REQUEST['sort'] === 'realName' && !isset($_REQUEST['desc']))
{
$first_offset $_REQUEST['start'] - ($_REQUEST['start'] % $cache_step_size);
$second_offset ceil(($_REQUEST['start'] + $modSettings['defaultMaxMembers']) / $cache_step_size) * $cache_step_size;
$where "mem.realName BETWEEN '" addslashes($memberlist_cache['index'][$first_offset]) . "' AND '" addslashes($memberlist_cache['index'][$second_offset]) . "'";
$limit -= $first_offset;
}

// Reverse sorting is a bit more complicated...
elseif ($use_cache && $_REQUEST['sort'] === 'realName')
{
$first_offset floor(($memberlist_cache['num_members'] - $modSettings['defaultMaxMembers'] - $_REQUEST['start']) / $cache_step_size) * $cache_step_size;
if ($first_offset 0)
$first_offset 0;
$second_offset ceil(($memberlist_cache['num_members'] - $_REQUEST['start']) / $cache_step_size) * $cache_step_size;
$where "mem.realName BETWEEN '" addslashes($memberlist_cache['index'][$first_offset]) . "' AND '" addslashes($memberlist_cache['index'][$second_offset]) . "'";
$limit $second_offset - ($memberlist_cache['num_members'] - $_REQUEST['start']) - ($second_offset $memberlist_cache['num_members'] ? $cache_step_size - ($memberlist_cache['num_members'] % $cache_step_size) : 0);
}
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP 0mem.ID_POST_GROUPmem.ID_GROUP))" : '') . 
(
$_REQUEST['sort'] === 'location' ? " LEFT JOIN {$db_prefix}themes AS opt ON (opt.ID_MEMBER mem.ID_MEMBER)" : '') . "// Select the members from the database.
$request db_query("
SELECT mem.ID_MEMBER
FROM 
{$db_prefix}members AS mem" . ($_REQUEST['sort'] === 'isOnline' "
LEFT JOIN 
{$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)" '') . ($_REQUEST['sort'] === 'ID_GROUP' "
LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" '') . "
WHERE mem.is_activated = 1" 
. (empty($where) ? '' "
AND 
$where") . "
ORDER BY " 
$sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT 
$limit$modSettings[defaultMaxMembers]"__FILE____LINE__);
printMemberListRows($request);
mysql_free_result($request);

// Add anchors at the start of each letter.
if ($_REQUEST['sort'] == 'realName')
{
$last_letter '';
foreach ($context['members'] as $i => $dummy)
{
$this_letter $func['strtolower']($func['substr']($context['members'][$i]['name'], 01));

if ($this_letter != $last_letter && preg_match('~[a-z]~'$this_letter) === 1)
{
$context['members'][$i]['sort_letter'] = htmlspecialchars($this_letter);
$last_letter $this_letter;
}
}
}
}

// Search for members...
function MLSearch()
{
global $txt$scripturl$db_prefix$context$user_info$modSettings;

$context['page_title'] = $txt['mlist_search'];

// They're searching..
if (isset($_REQUEST['search']) && isset($_REQUEST['fields']))
{
$_POST['search'] = trim(isset($_GET['search']) ? $_GET['search'] : $_POST['search']);
$_POST['fields'] = isset($_GET['fields']) ? explode(','$_GET['fields']) : $_POST['fields'];

$context['old_search'] = $_REQUEST['search'];
$context['old_search_value'] = urlencode($_REQUEST['search']);

// No fields?  Use default...
if (empty($_POST['fields']))
$_POST['fields'] = array('name');

// Search for a name?
if (in_array('name'$_POST['fields']))
$fields = array('memberName''realName');
else
$fields = array();
// Search for location.
if (in_array('location'$_POST['fields']))
$fields += array(=> 'locationTitle''location');
// Search for messengers...
if (in_array('messenger'$_POST['fields']) && (!$user_info['is_guest'] || empty($modSettings['guest_hideContacts'])))
$fields += array(=> 'MSN''AIM''ICQ''YIM')
;
// Search for websites.
if (in_array('website'$_POST['fields']))
$fields += array(=> 'websiteTitle''websiteUrl');
// Search for groups.
if (in_array('group'$_POST['fields']))
$fields += array(=> 'IFNULL(groupName, \'\')');
// Search for an email address?
if (in_array('email'$_POST['fields']))
{
$fields += array(=> allowedTo('moderate_forum') ? 'emailAddress' '(hideEmail = 0 AND emailAddress');
$condition allowedTo('moderate_forum') ? '' ')';
}
else
$condition '';

$query $_POST['search'] == '' "= ''" "LIKE '%" strtr($_POST['search'], array('_' => '\\_''%' => '\\%''*' => '%')) . "%'";

$request db_query("
SELECT COUNT(*)
FROM 
{$db_prefix}members AS mem
LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE " 
implode($query OR "$fields) . $query$condition
AND is_activated = 1"
__FILE____LINE__);
list ($numResults) = mysql_fetch_row($request);
mysql_free_result($request);

$context['page_index'] = constructPageIndex($scripturl '?action=mlist;sa=search;search=' $_POST['search'] . ';fields=' implode(','$_POST['fields']), $_REQUEST['start'], $numResults$modSettings['defaultMaxMembers']);

// Find the members from the database.
// !!!SLOW This query is slow.
$request db_query("
SELECT mem.ID_MEMBER
FROM 
{$db_prefix}members AS mem
LEFT JOIN 
{$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN 
{$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE " 
implode($query OR "$fields) . $query$condition
AND is_activated = 1
LIMIT 
$_REQUEST[start]$modSettings[defaultMaxMembers]"__FILE____LINE__);
printMemberListRows($request);
mysql_free_result($request);
}
else
{
$context['sub_template'] = 'search';
$context['old_search'] = isset($_REQUEST['search']) ? htmlspecialchars($_REQUEST['search']) : '';
}

$context['linktree'][] = array(
'url' => $scripturl '?action=mlist;sa=search',
'name' => &$context['page_title']
);
}

function 
printMemberListRows($request)
{
global $scripturl$txt$db_prefix$user_info$modSettings;
global $context$settings$memberContext;

// Get the most posts.
$result db_query("
SELECT MAX(posts)
FROM 
{$db_prefix}members"__FILE____LINE__);
list ($MOST_POSTS) = mysql_fetch_row($result);
mysql_free_result($result);

// Avoid division by zero...
if ($MOST_POSTS == 0)
$MOST_POSTS 1;

$members = array();
while ($row mysql_fetch_assoc($request))
$members[] = $row['ID_MEMBER'];

// Load all the members for display.
loadMemberData($members);

$context['members'] = array();
foreach ($members as $member)
{
if (!loadMemberContext($member))
continue;

$context['members'][$member] = $memberContext[$member];
$context['members'][$member]['post_percent'] = round(($context['members'][$member]['real_posts'] * 100) / $MOST_POSTS);
$context['members'][$member]['registered_date'] = strftime('%Y-%m-%d'$context['members'][$member]['registered_timestamp']);
}
}

?>
[/code[
Title: Re: CountryFlags
Post by: Dhekelian on January 24, 2007, 05:37:59 AM
Hi, I have edited some more files because of the multiple entries but I cannot get rid of the 3 countries entry on the registration page. Could you tell me what file I need to edit. I have looked in the register.template.php and did that I think.
Title: Re: CountryFlags
Post by: linders on February 16, 2007, 02:43:39 PM
Hello,

Just installed this mod/package and it works fine when the default language is English, as it shows:
Country:      "country name" "flag"

When I change the language to Spanish, there is no word to replace "Country" with (i.e., "País" does not appear).

Anything that can be fixed simply?

Thanks.
Title: Re: CountryFlags
Post by: JayBachatero on February 18, 2007, 01:14:46 AM
You need to add the language string to your Modifications.spanish.php file.
Title: Re: CountryFlags
Post by: Iggiecat on February 18, 2007, 03:31:24 PM
I"m worried about installing this mod as i see this error:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Frunepixels.com%2Fuimages3%2Fcountryflagerror.png&hash=4c2f2709387da994c8466691068d7e24)

what would cause this?
Title: Re: CountryFlags
Post by: MoreBloodWine on February 19, 2007, 05:10:18 AM
This installed and is running fine for me on 1.1.1... but your problem might be a conflict of another mod...
Title: Re: CountryFlags
Post by: linders on February 19, 2007, 11:25:21 AM
You need to add the language string to your Modifications.spanish.php file.

Hello/Hola Jay:

Can you post the string exactly so I can copy/paste it into that file?

Thanks, Hubert
Title: Re: CountryFlags
Post by: warhonowicz on February 20, 2007, 05:03:27 AM
I just downloaded the latest version and tried to install it on SMF 1.1.2 with the following mods installed:

1. SMF Links 1.6.3 
2. SMF 1.1.2 Update Package 1.1.2 
3. Merge Double Posts 1.0.6 
4. TinyPortal 0.971 
5. Spam Me Not Mod 1.02 
6. Enhanced Calendar 1.1 
7. Award Mod 1.11

and when I try to install the country flags I get the following error

3. Execute Modification ./Sources/ModSettings.php Test failed

Anyone got this before and found a way around it?
Title: Re: CountryFlags
Post by: JayBachatero on February 21, 2007, 10:47:50 AM
I"m worried about installing this mod as i see this error:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Frunepixels.com%2Fuimages3%2Fcountryflagerror.png&hash=4c2f2709387da994c8466691068d7e24)

what would cause this?

That might be a conflict with another mod.  Might have to manually install this mod.

You need to add the language string to your Modifications.spanish.php file.

Hello/Hola Jay:

Can you post the string exactly so I can copy/paste it into that file?

Thanks, Hubert
You need these strings.  Just need to translate them.
Code: [Select]
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';

I just downloaded the latest version and tried to install it on SMF 1.1.2 with the following mods installed:

1. SMF Links 1.6.3 
2. SMF 1.1.2 Update Package 1.1.2 
3. Merge Double Posts 1.0.6 
4. TinyPortal 0.971 
5. Spam Me Not Mod 1.02 
6. Enhanced Calendar 1.1 
7. Award Mod 1.11

and when I try to install the country flags I get the following error

3. Execute Modification ./Sources/ModSettings.php Test failed

Anyone got this before and found a way around it?
Seems like a conflict with your other mods.  Need to install this mod manually.
Title: Re: CountryFlags
Post by: linders on February 21, 2007, 01:16:15 PM
Hola Jay,

It works fine.

Thanks!!
Hubert
Title: Re: CountryFlags
Post by: 2greedy on February 21, 2007, 08:57:29 PM
Hi everyone dunno if this is the same for evryone but when i installed the mod it wouldn't show the flags in posts, so all i done was goto (themes and settings) in admin then clicked (modify themes) and then clicked (Copy a template from the theme this is based on.)

Find the (Display.template.php) and then click copy! and voila everyting works fine.
 
Title: Re: CountryFlags
Post by: Marianita on February 24, 2007, 11:42:18 AM
Hi, I made a manual installation of this mod,and it looks that everything is ok, but when i select a flag in in the profile , it doesnt take the changes....and refresh with no flag selected...
Any idea???? :(  
Title: Re: CountryFlags
Post by: Marianita on February 25, 2007, 02:56:35 AM
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification.  :(
Title: Re: CountryFlags
Post by: JayBachatero on February 26, 2007, 10:31:14 AM
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification.  :(
Post your Profile.php and Profile.template.php files.
Title: Re: CountryFlags
Post by: trecool999 on February 27, 2007, 01:09:12 PM
All I get is this at the top of every page:

// Country Flag mod $txt['country_flag_label'] = 'Please select your country'; $txt['country_flag_error_required'] = 'You must select the country that you visit us from'; $txt['country_flag_ask'] = 'Ask for country flag on'; $txt['country_flag_disabled'] = 'Don\'t show (Disabled)'; $txt['country_flag_profile'] = 'Profile'; $txt['country_flag_registration'] = 'Registration'; $txt['country_flag_both'] = 'Both'; $txt['country_flag_required'] = 'Require a member to select a location?'; $txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).'; $txt['country_flag'] = 'Country';

I think you messed up somewhere...

Also, when I install V.1.0.2, it tells me it's still 1.0.1... but all tests are succesful...
Title: Re: CountryFlags
Post by: Tanks on February 28, 2007, 05:48:01 AM
Thanks for this mod - intalled on RC3 With TP and works as a charm.. so BIG thank you  ;)
Title: Re: CountryFlags
Post by: JayBachatero on February 28, 2007, 10:10:17 AM
All I get is this at the top of every page:

// Country Flag mod $txt['country_flag_label'] = 'Please select your country'; $txt['country_flag_error_required'] = 'You must select the country that you visit us from'; $txt['country_flag_ask'] = 'Ask for country flag on'; $txt['country_flag_disabled'] = 'Don\'t show (Disabled)'; $txt['country_flag_profile'] = 'Profile'; $txt['country_flag_registration'] = 'Registration'; $txt['country_flag_both'] = 'Both'; $txt['country_flag_required'] = 'Require a member to select a location?'; $txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).'; $txt['country_flag'] = 'Country';

I think you messed up somewhere...

Also, when I install V.1.0.2, it tells me it's still 1.0.1... but all tests are succesful...
Uninstall the mod.  Then upgrade to SMF 1.1.2 and reinstall the mod.
Title: Re: CountryFlags
Post by: fritpa on March 05, 2007, 12:12:04 AM
I have the Spanish language package, what I have to do to see the option in this language package?

One thing is translate the .xml, another thing is see the option in the other language package.

Thanks.
Title: Re: CountryFlags
Post by: Marianita on March 06, 2007, 02:19:18 PM
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification.  :(
Post your Profile.php and Profile.template.php files.

 The files:
Thanks in advance.  :)
Title: Re: CountryFlags
Post by: linders on March 06, 2007, 03:00:32 PM
My country flags work fine.
Will use it in another forum as well!
Title: Re: CountryFlags
Post by: Amanda G on March 07, 2007, 12:12:43 AM
i downloaded this mod and then deleted it becuase i have this on the top of my forum

// Country Flag mod $txt['country_flag_label'] = 'Please select your country'; $txt['country_flag_error_required'] = 'You must select the country that you visit us from'; $txt['country_flag_ask'] = 'Ask for country flag on'; $txt['country_flag_disabled'] = 'Don\'t show (Disabled)'; $txt['country_flag_profile'] = 'Profile'; $txt['country_flag_registration'] = 'Registration'; $txt['country_flag_both'] = 'Both'; $txt['country_flag_required'] = 'Require a member to select a location?'; $txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).'; $txt['country_flag'] = 'Country';

Even after i deleted it its still there? can u PLEASE tell me how to remoce it its really annoying? *and ugly
Title: Re: CountryFlags
Post by: Marianita on March 07, 2007, 05:39:59 PM
i downloaded this mod and then deleted it becuase i have this on the top of my forum

// Country Flag mod $txt['country_flag_label'] = 'Please select your country'; $txt['country_flag_error_required'] = 'You must select the country that you visit us from'; $txt['country_flag_ask'] = 'Ask for country flag on'; $txt['country_flag_disabled'] = 'Don\'t show (Disabled)'; $txt['country_flag_profile'] = 'Profile'; $txt['country_flag_registration'] = 'Registration'; $txt['country_flag_both'] = 'Both'; $txt['country_flag_required'] = 'Require a member to select a location?'; $txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).'; $txt['country_flag'] = 'Country';

Even after i deleted it its still there? can u PLEASE tell me how to remoce it its really annoying? *and ugly

You have to open  Modifications.english.php with a text editor,  go to the end of the file and remove the text  carefully.  :)
Title: Re: CountryFlags
Post by: JayBachatero on March 07, 2007, 07:39:56 PM
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification.  :(
Post your Profile.php and Profile.template.php files.

 The files:
Thanks in advance.  :)
I looked at the files and everything looks ok to me.  Can you pm me a test account?
Title: Re: CountryFlags
Post by: Amanda G on March 07, 2007, 08:18:08 PM
Thanks.. how or where do i find that file?

I so dont understand SMF very well at all. Is this something done in the database? cuase i have no clue where that is. I can ask the board owner she might know how to do that.
Title: Re: CountryFlags
Post by: JayBachatero on March 08, 2007, 11:51:21 PM
That file is in /Themes/default/languages directory.
Title: Re: CountryFlags
Post by: fritpa on March 11, 2007, 11:01:35 PM
I have the Spanish language package, what I have to do to see the option in this language package?

One thing is translate the .xml, another thing is see the option in the other language package.

Thanks.

Can anybody help me with this please.

Thanks you.
Title: Re: CountryFlags
Post by: Yellowrose on March 14, 2007, 11:59:39 AM
Jay I'm getting errors related to your mod.

Quote
8: Undefined index: country_flag_ask
File: /home/texgnome/public_html/DD/Themes/default/Register.template.php (before sub template - eval?)
Line: 152


This is what I have for that section in the file

   
Quote
// If flags is set for registration show it.
line 152-   if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
   {

Using SMF 1.1.2 with Tiny Portal and

1. Admin Notepad 1.0   
2. Users Online Today Mod 1.4.0     
3. SMF Gallery Lite 1.7.1   
 
Title: Re: CountryFlags
Post by: JayBachatero on March 19, 2007, 10:20:00 AM
Change
Code: [Select]
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
to
Code: [Select]
if (!empty($modSettings['country_flag_ask']) && ($modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3))
Title: Re: CountryFlags
Post by: davidjovan on March 20, 2007, 09:20:22 PM
My site forum is @: www.dancehallcelebrities.com/smf111.
After installing your Mod, I have been getting this error message when I try to access the forums.
The error appears when I try to access any of the messages from the main forum after selecting OTHER Themes, with the exception of the Caribbean Sunset Theme. I would greatly appreciate you helping me to get my forum functional again.


Fatal error: Call to undefined function: create_button() in /home/dancehal/public_html/smf111/Sources/Load.php(1726) : eval()'d code on line 238

Installed is:
SMF TinyPortal
SMF Links
SMF Gallery
SMF Arcade

I installed the Mod using the following theme:
TP Wow

The message I got while installing:

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test failed  
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test successful
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful  

Thanks.
I can give you Admin Access for you to try to fix it for me.

 
Title: Solution to fixing CountryFlags Mod
Post by: davidjovan on March 21, 2007, 08:17:27 AM
Your mod is causing so much problems.

For the guys that are having problems, this is what you do:


Worked for me
Title: Re: CountryFlags
Post by: Milos 23 on March 23, 2007, 05:53:50 PM
Hello. Sorry my english is not very good I am from Serbia

Can You help me ?

I have instal this mod : "CountryFlag_1-0-2.tar.gz", All tests are ok and i succesesfully instal this mod. I use theme musiconica and i can't find how to put this flags in my profile. Can You tell me what I must to edit end what I must to edit ? Help  ???
Title: Re: CountryFlags
Post by: folkandfaith on April 02, 2007, 08:24:29 PM
I recently installed this mod but no flags show up on anyones profile.
Title: Re: CountryFlags
Post by: KGIII on April 03, 2007, 09:16:16 AM
For the last two post:

Manual Installation of Mods:
http://docs.simplemachines.org/index.php?topic=402

(I am not sure if folkandfaith are using a theme other than the default but, if so, that is what you are probably looking for.)
Title: Re: CountryFlags
Post by: mymbel on April 07, 2007, 08:02:35 PM
Hi, i installed this mod all manualy, is posible selection the country, is visible the flags, but not save the information de country, when new login that information is not contained again, to that it can have?
my version smf is 1.1.2

Thanks
Title: Re: CountryFlags
Post by: folkandfaith on April 12, 2007, 04:53:15 PM
Where do I go if I wish to edit the flags used? Say I wanted the Betsy Ross instead of the US flag? I know that it is likley a simple operation, just wanting to know where I make the cut and where I upload the new flag at etc... Thanks.

Title: Re: CountryFlags
Post by: folkandfaith on April 12, 2007, 07:19:29 PM
Okay, I found the flags folder.. sorry. Will this change the image for ones personal profile? I mean say I chose the Betsy Ross flag. This will change it on the one that you view in every instance that person from the US posts, will it change it on their personal Profile page or do I do that some place else?

(EDIT)

I deleted the old US flag and inserted a new one and the old version still shows. What gives?  ??? What do I need to do to fix that or change others like that?
Title: Re: CountryFlags
Post by: folkandfaith on April 12, 2007, 10:18:59 PM
It won't let me just delete that image of us.png Is there something that prevents this?
Title: Re: CountryFlags
Post by: folkandfaith on April 13, 2007, 09:22:20 PM
Anyone?
Title: Re: CountryFlags
Post by: littleone on April 13, 2007, 10:52:28 PM
Its your CHMOD settings on the folder.  For some reason alot of the mod folder's CHMOD cannot be changed and nothing inside of them can be deleted.
Title: Re: CountryFlags
Post by: trekkie2444 on April 14, 2007, 03:43:58 PM
Hello Clarice.
Title: Re: CountryFlags
Post by: folkandfaith on April 14, 2007, 10:49:51 PM
Its your CHMOD settings on the folder.  For some reason alot of the mod folder's CHMOD cannot be changed and nothing inside of them can be deleted.

Can other flags /countries then be added or switched out? If so - HOW?
Title: Re: CountryFlags
Post by: trekkie2444 on April 17, 2007, 11:41:35 PM
?
Title: Re: CountryFlags
Post by: folkandfaith on April 20, 2007, 08:31:54 PM
Is there a way to contact the mod creator to ask these questions to perhaps?
Title: Re: CountryFlags
Post by: Amasterfound on April 20, 2007, 11:47:21 PM
Its your CHMOD settings on the folder.  For some reason alot of the mod folder's CHMOD cannot be changed and nothing inside of them can be deleted.

Can other flags /countries then be added or switched out? If so - HOW?
Yes I want to know this too. I have a memeber that is from scottland he wants a scottish flag not the universal UK flag. I would like to add the scottish flag not replace any.
Title: Re: CountryFlags
Post by: husam on April 23, 2007, 09:29:39 PM
I installed this mod and it doesn't show up in the "features and options" page
Title: Re: CountryFlags
Post by: folkandfaith on April 23, 2007, 10:29:27 PM
I am wondering if the mod creator still checks in here at all. It has been over a week I am sure since I first asked these questions. Could htere be someone else affiliated with MSF that can tell us I wonder?
Title: Re: CountryFlags
Post by: william777 on May 03, 2007, 09:58:08 PM
I am a newbie in terms of SMF as well as mods.
Recently, I installed SMF, no problem.
I also downloaded CountryFlag, unzipped in my local drive, then uploaded the Country Flag directory to my server in /public_html/SMF/themes/CountryFlag.
My questions are:
(1) Is that the correct directory to use?
(2) How do I get it to work? I had read almost all the threads here, but had no idea how to go about setting it up.  I had also read the document in http://docs.simplemachines.org/index.php?topic=402, but I do not comprehend it. I do not know PHP.

Can anyone help me in a step by step manner? Thanks in advance.
Title: Re: CountryFlags
Post by: KGIII on May 04, 2007, 10:58:51 AM
Don't unzip it. Go to your administration center. Go to Packages. Click on Download Packages. Click on the Browse link. Point that to the place you downloaded it to on your drive. Click upload. Click apply on the next screen. Click again IF it goes through without errors.
Title: Re: CountryFlags
Post by: folkandfaith on May 04, 2007, 05:18:26 PM
What about changing country flags around or adding new ones? Can this be done? If so how?
Title: Re: CountryFlags
Post by: william777 on May 05, 2007, 02:53:16 AM
Thanks KGIII, it works!!!!! ;D
Title: Re: CountryFlags
Post by: william777 on May 05, 2007, 09:00:02 PM
Another question to you KGIII: do I use the same method in future to install new mods? I am thinking of installing the dilbermc themes.
Title: Re: CountryFlags
Post by: KGIII on May 07, 2007, 08:26:29 PM
If you install themes other than the default then modifications, many of them, will need to be installed manually which can be daunting the first time you try it. But, yes, modifications are installed the same way in the default them. The top of this site, the Docs link, in there you will find some information.
Title: Re: CountryFlags
Post by: folkandfaith on May 08, 2007, 12:51:08 AM
What about changing the flags already in this mod and or adding new countries in it. Can this be done with this mod and if so can someone tell us how to do this?
Title: Re: CountryFlags
Post by: Chucky on May 08, 2007, 07:30:33 AM
I changed this mod so it will display the members flags that they've chosen on the Member Map (Location Mod) rather than from the drop down list.

Is really good.
Title: Re: CountryFlags
Post by: brianjw on May 13, 2007, 08:27:12 PM
I need help. When attempting to install, there was an error.
Quote
1. Execute Modification           ./Sources/Register.php           Test successful
2. Execute Modification           ./Sources/Subs.php           Test successful
3. Execute Modification           ./Sources/ModSettings.php           Test successful
4. Execute Modification           ./Sources/Profile.php           Test successful
5. Execute Modification           ./Themes/default/Register.template.php           Test successful
6. Execute Modification           ./Themes/default/Profile.template.php           Test successful
7. Execute Modification           ./Themes/default/Display.template.php           Test failed
8. Execute Modification           ./Themes/babylon/Display.template.php           Test successful
9. Execute Modification           ./Themes/default/languages/Modifications.english.php           Test successful
10. Extract Tree           ./Themes/default/images/flags
Line 7 is what I need help with. I am using SMF 1.1.2.

Brianjw
Title: Re: CountryFlags
Post by: folkandfaith on May 13, 2007, 11:17:31 PM
Flag mod guy hasn't been seen in about a month or so. I would very much like to hear back from him as I have some questions as I have posted a few times here too. No luck though.
Title: Re: CountryFlags
Post by: Chucky on May 14, 2007, 08:56:37 AM
I need help. When attempting to install, there was an error.
Quote
1. Execute Modification           ./Sources/Register.php           Test successful
2. Execute Modification           ./Sources/Subs.php           Test successful
3. Execute Modification           ./Sources/ModSettings.php           Test successful
4. Execute Modification           ./Sources/Profile.php           Test successful
5. Execute Modification           ./Themes/default/Register.template.php           Test successful
6. Execute Modification           ./Themes/default/Profile.template.php           Test successful
7. Execute Modification           ./Themes/default/Display.template.php           Test failed
8. Execute Modification           ./Themes/babylon/Display.template.php           Test successful
9. Execute Modification           ./Themes/default/languages/Modifications.english.php           Test successful
10. Extract Tree           ./Themes/default/images/flags
Line 7 is what I need help with. I am using SMF 1.1.2.

Brianjw

You'd have to look at your Display.template.php file and check the code it's trying to add/replace. Do this by looking in the xml file in the zipped mod. You've most likely have the code altered that it's trying to locate.
Title: Re: CountryFlags
Post by: Filipina on May 14, 2007, 04:25:52 PM
Thanks for the MOD.  I have SMF 1.1.2 Default theme and it installed without any errors and it works great!
Title: Re: CountryFlags
Post by: brianjw on May 14, 2007, 08:22:22 PM
I need help. When attempting to install, there was an error.
Quote
1. Execute Modification           ./Sources/Register.php           Test successful
2. Execute Modification           ./Sources/Subs.php           Test successful
3. Execute Modification           ./Sources/ModSettings.php           Test successful
4. Execute Modification           ./Sources/Profile.php           Test successful
5. Execute Modification           ./Themes/default/Register.template.php           Test successful
6. Execute Modification           ./Themes/default/Profile.template.php           Test successful
7. Execute Modification           ./Themes/default/Display.template.php           Test failed
8. Execute Modification           ./Themes/babylon/Display.template.php           Test successful
9. Execute Modification           ./Themes/default/languages/Modifications.english.php           Test successful
10. Extract Tree           ./Themes/default/images/flags
Line 7 is what I need help with. I am using SMF 1.1.2.

Brianjw

You'd have to look at your Display.template.php file and check the code it's trying to add/replace. Do this by looking in the xml file in the zipped mod. You've most likely have the code altered that it's trying to locate.
I am using a recent fresh install and haven't modified any files. I do however have some modules installed that could be causing this:
Quote
1. TinyPortal 0.983 [ Uninstall ]
2. Invite 1.13 [ Uninstall ]
3. Custom Action Mod 2.04 [ Uninstall ]
4. Custom Profile Field Mod 3.16 [ Uninstall ]
5. SMF Gallery Lite 1.7.1 [ Uninstall ]
6. Ad Managment 2.3 [ Uninstall ]
7. Bear Tabs 1.0 [ Uninstall ]
8. BBCode Bar For Signature 1.3 [ Uninstall ]
9. SMF Links 1.6.3 [ Uninstall ]
10. YouTube BBC Tag (XHTML Compliant) 1.0 [ Uninstall ]
11. Paid Subscriptions 0.18 [ Uninstall ]
12. AvatarSelect 1.1.2 [ Uninstall ]
13. FontandSizeDropdown1.1 1.1 [ Uninstall ]
14. Streaming 3 4.2.2b [ Uninstall ]
15. K-Detection 2.2 [ Uninstall ]
Thanks for your help so far but for me modifying it myself isn't the case. It could be a module. Who knows :)
Title: Re: CountryFlags
Post by: brianjw on May 16, 2007, 08:07:42 PM
Bump ^ view above post ^
Title: Re: CountryFlags
Post by: TrueSatan on May 16, 2007, 10:25:45 PM
Brian...if you'll post your Display.template.php file I'll have a look at it for you and see if I can put this mod into it...BTW I think Chunky was trying to say that you have modified the file by installing other mods...he/she's quite right.

 If I'm able to fix that file then you'll need to follow this procedure:

Backup your database and files
Install the mod ignoring the error in Display.template.php
Rename the existing Display.template.php and leave it on the server (call it Display.template.php-flag so you know what the file is if you need it at a later date)
Via ftp upload the fixed Display.template.php I'll give you

 Not difficult and it should get your problem over and done...all I need is that file...
Title: Re: CountryFlags
Post by: JayBachatero on May 17, 2007, 01:47:19 AM
I am no longer supporting this mod.  If someone wants to take over this mod please send me a PM.
Title: Re: CountryFlags
Post by: KGIII on May 17, 2007, 02:32:04 AM
This one too I will look at and if there are enough folks wanting it then I will consider taking over the support for it. That's and the other is about all I can handle at the moment.
Title: Re: CountryFlags
Post by: brianjw on May 17, 2007, 06:29:37 PM
Brian...if you'll post your Display.template.php file I'll have a look at it for you and see if I can put this mod into it...BTW I think Chunky was trying to say that you have modified the file by installing other mods...he/she's quite right.

 If I'm able to fix that file then you'll need to follow this procedure:

Backup your database and files
Install the mod ignoring the error in Display.template.php
Rename the existing Display.template.php and leave it on the server (call it Display.template.php-flag so you know what the file is if you need it at a later date)
Via ftp upload the fixed Display.template.php I'll give you

 Not difficult and it should get your problem over and done...all I need is that file...
Ok, I have uploaded and attached the Display.template.php file. I have done what you suggested but will wait to continue the renaming file part until I have the updated display.template.php :)
Title: Re: CountryFlags
Post by: TrueSatan on May 17, 2007, 08:15:01 PM
All done Brian...by the looks of it the package installer stumbled over the file because the following line was different from what it expected to find:

Code: [Select]
// Show the member's gender icon?
The expected was with a bit of spacing to make the code easier to read:

Code: [Select]
// Show the member's gender icon?
 I've added the edit to the file and made that line above have the spacing in it so the mod should now uninstall via the package manager.

 Have fun!
Title: Re: CountryFlags
Post by: bilalghouri on May 18, 2007, 06:47:29 AM
its giving me error when i am installing it.
its giving me error of profile.php
Title: Re: CountryFlags
Post by: TrueSatan on May 18, 2007, 06:53:48 AM
its giving me error when i am installing it.
its giving me error of profile.php

 Do a manual install as with any mod that gives such errors...use the search function on this forum to find the details. Use Daniel15's Package Parser to parse the mod...again the search function will get you the details you need.
Title: Re: CountryFlags
Post by: brianjw on May 18, 2007, 11:25:28 AM
Thanks truesatan your a good person :)

Edit: I will test this in a minute as I was away from home when I originally posted this.


Edit2: It didn't work and I don't think its worth it.
Title: Re: CountryFlags
Post by: Filipina on May 20, 2007, 01:45:39 PM
This one too I will look at and if there are enough folks wanting it then I will consider taking over the support for it. That's and the other is about all I can handle at the moment.

I will just say that everyone at my forums loves the flags... I hope it can be supported for future use :)
Title: Re: CountryFlags
Post by: TrueSatan on May 20, 2007, 02:38:07 PM
Thanks truesatan your a good person :)

Edit: I will test this in a minute as I was away from home when I originally posted this.


Edit2: It didn't work and I don't think its worth it.

 Sorry to hear that you still had problems Brian...certainly this mod isn't the most useful on offer but if you do still want to use it I'd be glad to give further assistance.

 You don't say exactly in what way it didn't work so I can't really take it any further at this point.
Title: Re: CountryFlags
Post by: brianjw on May 20, 2007, 04:12:44 PM
Well it I took the file you had and put it through ftp. Then uploaded the module and no errors no mod. :-\
Title: Re: CountryFlags
Post by: TrueSatan on May 20, 2007, 04:53:53 PM
You do know it's off until you turn it on in Admin>Features and Options I suppose? In that you can set when/where the members are asked to set a location and if it will be shown on posts.

 Sorry if you did know that and I'm telling you something that was already obvious to you but asking is the only way I can know for sure.
Title: Re: CountryFlags
Post by: brianjw on May 20, 2007, 06:07:40 PM
oh great LOL! I didn't know that let me try it. :P
Title: Re: CountryFlags
Post by: brianjw on May 20, 2007, 06:15:54 PM
Ok now the country I selected is showing up twice.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg519.imageshack.us%2Fimg519%2F5026%2Fsn15hr0.th.gif&hash=c63481d2f49574640c61162e28be2a6a) (http://img519.imageshack.us/my.php?image=sn15hr0.gif)
Title: Re: CountryFlags
Post by: TrueSatan on May 20, 2007, 07:14:37 PM
@Brianjw

 Brian,

 Your problem is in the file Display.template.php in your theme directory...the following code seems to be in there twice judging from the display you showed me...

Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}

 You can either take out one instance of it for yourself or if you would like me to do it for you please upload the file here and I'll do it.
Title: Re: CountryFlags
Post by: brianjw on May 20, 2007, 07:44:23 PM
Ill let you do it since you are the helpful coder :)
Title: Re: CountryFlags
Post by: TrueSatan on May 20, 2007, 08:37:01 PM
Hmmm...the problem is in that file but it's a clash between mods rather than a duplication of code...I was looking for the easy answer first.

 Bear Moods seems OK with Country Flags and by the looks of it you are also running the Ads mod so that is the most likely culprit (though I think there's some other mod also added to that file)...

 I've tried a possible fix by commenting out an echo and that might do the trick...I can't test it as I don't know all the mods that are involved in this problem.

 Would you mind listing for me the mods you are using if the attached file doesn't work?

 Please rename your existing file ( make it Display.template.phpold) on your server before uploading this file and if it doesn't work then delete this file from your server and rename your old file back to Display.template.php

 It might be difficult (for me anyway) to solve this one if my quick fix doesn't work.
Title: Re: CountryFlags
Post by: folkandfaith on May 20, 2007, 10:10:15 PM
PLEASE continue to support this mod someone! It's very cool but it needs some work to make it adjustable for folks like if they wish to add another country or flag or replace a new flag in place of another one etc. Please consider fixing these issues and supporting it!!
Title: Re: CountryFlags
Post by: brianjw on May 21, 2007, 06:30:41 PM
TrueSatan, there is a parse error:
Quote
Parse error: parse error, unexpected '<' in .../Themes/default/Display.template.php on line 344
Line 344 in display.template.php was
Code: (Line 344 - Display.template.php) [Select]
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
Thanks,
Brianjw
Title: Re: CountryFlags
Post by: brianjw on May 21, 2007, 06:34:11 PM
Nevermind, after putting the code back as it was with the old display.template.php, the country shows up fine and only 1 time :)
Title: Re: CountryFlags
Post by: TrueSatan on May 21, 2007, 07:44:11 PM
Good! I'm glad it's worked for you and should I be able to help you again it would be my pleasure so to do.
Title: Re: CountryFlags
Post by: brianjw on May 21, 2007, 07:51:58 PM
You would be a good person to take over this mod ;)
Title: Re: CountryFlags
Post by: TrueSatan on May 21, 2007, 08:08:12 PM
Thanks for that Brian but unless I'm mistaken I think it's already been accepted by somebody whose coding know how is highly likely to be better than mine...if memory serves me properly KGIII has offered to take it over.
Title: Re: CountryFlags
Post by: folkandfaith on May 21, 2007, 08:31:21 PM
any chance of an update soon to let us be able to change things in it?
Title: Re: CountryFlags
Post by: softtouch on May 21, 2007, 11:02:47 PM
Any change to let it automatically select the flag based on the IP, like they do at the motorolafans.com forum?
Title: Re: CountryFlags
Post by: brianjw on May 22, 2007, 06:37:47 PM
How is KGIII going to get the permissions to edit the module since only the member who created it can edit their mod?
Title: Re: CountryFlags
Post by: TrueSatan on May 22, 2007, 07:00:16 PM
I can't see where I saw anything about it being taken over so ignore that (I may have muddled it with another mod) but in general a mod can be taken over by another developer if it's originator of the mod allows it to be done...and not if a third party makes a fuss asking for somebody to take over a mod without the originators permission.
Title: Re: CountryFlags
Post by: KGIII on May 22, 2007, 07:36:11 PM
The same way I got TrimURL for instance. ;)

Anyhow... I will mull it over during this week and take a gander at the code some more. It may be viable but I have time limits to consider as well.
Title: Re: CountryFlags
Post by: TrueSatan on May 22, 2007, 08:07:04 PM
You'd be a better chouce for it than me if everything else were equal but if you don't have time etc I'll also consider it...and I'm all too well aware of how much time it can take to look after some of these mods.

 Seeing as it really doesn't get said often enough...thanks for all you're doing...it is appreciated.
Title: Re: CountryFlags ~ Help please. :)
Post by: Marcus J on June 10, 2007, 01:58:22 AM
I have made a major mess up here.  I was installing the SMF arcade and somehow mulched many of my forums .php files.

I used the SMF parser and manually fixed all my problems.  However when I input the mod for country flags it tells me that it's not packaged properly.  I'm not here to argue about that though.  Because the mod was flawless before I made the mistake of not backing up before installing the arcade.  (Not bashing the arcade.  I should have made a backup)

The mod works, but I get this error.

Quote
8: Undefined index: country_flag
File: /home/simju2/public_html/Forum/Themes/default/languages/Who.english.php (eval?)
Line: 269

Also I want to uninstall 1.01 and install 1.02.  However I can't do this right now.  I get this.
Quote
1.     Execute Modification     ./Sources/Register.php     Test successful
2.    Execute Modification    ./Sources/Subs.php    Test successful
3.    Execute Modification    ./Sources/ModSettings.php    Test successful
4.    Execute Modification    ./Sources/Profile.php    Test successful
5.    Execute Modification    ./Themes/default/Register.template.php    Test successful
6.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
7.    Execute Modification    ./Themes/default/Display.template.php    Test successful
8.    Execute Modification    ./Themes/babylon/Display.template.php    Test successful
9.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test failed

I know it's a lot to ask.  But can someone post the modifications the country flag mod makes.  Similar to how the parser does it?  If so I will gladly fix my mess up on my own.

Your humble, and now educated in the need for backing up before installing mods...

-Marcus
Title: Re: CountryFlags
Post by: KGIII on June 10, 2007, 02:45:42 AM
Don't worry too much about the modifications.english.php really. I'm still way too busy. I have watched a lot of TrueSatan's posts and they may be an excellent choice for this one.
Title: Re: CountryFlags
Post by: Marcus J on June 10, 2007, 04:45:31 AM
I wouldn't worry about it, but I don't want to uninstall the mod.  Only to reinstall and have everyone have to pick their flag again.  That's why I wanted the exact changes the package makes when uploaded and installed.  Also I get this (See attached pic)

A small thing, I know... but it drives me nuts!
Title: Re: CountryFlags
Post by: TrueSatan on June 10, 2007, 05:14:47 AM
@ Mookey

 My best advice to you, seeing as you say you have problems in a lot of your files, is to do a rather more complete and more certain repair.

 Begin by backing up both your files and your database. With those backups in place you can reverse anything that comes next so you needn't be afraid to do the rest of these steps.

 Delete your Themes, Sources and Packages directories...get a fresh copy of SMF 1.1.2 installer package and unzip it on your computer...from it replace the files on your server in the forum root with the exception of Settings.php and Settings_bak.php...don't alter these two files at all...this is very important. You don't need install.php from the package so don't add that either. Replace the three directories you deleted with the ones from the installer package.

 This will give you a completely new installation of SMF 1.1.2 running on your existing database...you won't have lost any of your member's records or postings. You will, however, have removed all of the mods and themes you had installed.

 You can now install the mods, themes or even code edits you want to use.

 Doing it this way...a total clearout...will give you an installation that starts off again with a clean set of code that you can be sure won't have any left over residue from the problems you had. I know it sounds drastic but if you don't know what errors you had...and it sounded like that was the case...it is your safest solution.

 Reading between the lines of your posting it sounds as though you don't know what went wrong in your arcade installation. I know you say you fixed all the files that were corrupted but the rest of your posting suggests there may be remaining issues on your forum....the above isn't a difficult thing to do, though it can take some of your time to get back to a forum with all the mods etc you want in place...it will give you a forum that is in good repair.

 If you insist on continuing without doing the above then you could ignore the error reported by the package installer...as KGIII indicated it's isn't a major concern...and, if you wish though it won't do any harm if you don't do it, edit that file manually after the mod installation.

 To edit the mod out of Themes/default/languages/Modifications.english.php find the following code and remove it:

Code: [Select]
// Country Flag mod
$txt['country_flag_label'] = 'Please select your country';
$txt['country_flag_error_required'] = 'You must select the country that you visit us from';
$txt['country_flag_ask'] = 'Ask for country flag on';
$txt['country_flag_disabled'] = 'Don\'t show (Disabled)';
$txt['country_flag_profile'] = 'Profile';
$txt['country_flag_registration'] = 'Registration';
$txt['country_flag_both'] = 'Both';
$txt['country_flag_required'] = 'Require a member to select a location?';
$txt['country_flag_show'] = 'Show flags on Display page (Where posts are shown).';
$txt['country_flag'] = 'Country';

@ KGIII

 It sounds like I'm in the hot seat then...mind you I trust that you'll pipe up if I make any major mistakes.
Title: Re: CountryFlags
Post by: Marcus J on June 10, 2007, 02:22:42 PM
TrueSatan, it might be time for a name change. ;)

You answered a question that I had only thought about asking.  That's exactly what I was looking for.  A clean forum, without losing any of my old posts!  Thank you!

I just have to sort out doing this with TinyPortal installed.  I have many files in the downloads section, and I don't want to lost them.  I will however seek support at the tinyportal site for this.

Combined with your help I'm sure things will be looking up soon.

Thanks again,

-Marcus
Title: Re: CountryFlags
Post by: KGIII on June 10, 2007, 06:10:48 PM
TrueSatan:
http://www.simplemachines.org/community/index.php?topic=106060.msg1094961#msg1094961

You might want to see that topic. Then you could take 'ownership' of it and, yeah, I peek in on the various mod threads from time to time. Some of them exceed my knowledge though. ;)
Title: Re: CountryFlags
Post by: TrueSatan on June 10, 2007, 06:13:55 PM
@Mookey

 The safest way for you to deal with your TP issue would be to have a test forum...get the files on that into an as new clean state...install TP onto that. The files there will now be fully edited for TP (obviously). You can then copy those files onto your main forum and as you already have the TP database changes made all should be OK...obviously you wouldn't overwrite the tp-downloads and tp-images directories and thus you'd preserve your existing files in those directories.

 I expect you'll be told this on the TP forum but I thought it best to tell you here just in case...it's really far easier to do the process than it is to write a posting about it so don't be put off by my reams of text about it.
Title: Re: CountryFlags
Post by: TrueSatan on June 10, 2007, 06:26:17 PM
TrueSatan:
http://www.simplemachines.org/community/index.php?topic=106060.msg1094961#msg1094961

You might want to see that topic. Then you could take 'ownership' of it and, yeah, I peek in on the various mod threads from time to time. Some of them exceed my knowledge though. ;)

 Thanks...will do.

 I'm not inclined to consider vast changes to it, what with v2.0 looming anyway, so I very much doubt that I'll honour requests for automatic flag selection by ip for instance...and those who want a Country Flags mod to provide other than country flags could easily replace the relevant images keeping the image names as before for their new images so I don't see a great need for new code there...mind you adding new items to the country array wouldn't be difficult on a one off custom basis...but then it wouldn't be a Country Flags mod if non country items were to be added to it...other than that I'll be glad to support those using or wanting to use this fine mod...and hope that all concerned will remember that the real thanks should go to the original author of it.
Title: Re: CountryFlags
Post by: KGIII on June 10, 2007, 06:30:26 PM
2.0 final will be a ways away I expect.
Title: Re: CountryFlags
Post by: Perochak on June 22, 2007, 11:16:04 PM
Please Give the Complete Code Change to make the Mod active in the Forum.

And name what files are required to change and where to change and what to change?

Thanks
Title: Re: CountryFlags
Post by: TrueSatan on June 23, 2007, 04:59:37 AM
Please use:

http://server.daniel15.com/smf/package.php (http://server.daniel15.com/smf/package.php)

 ...to give the details you need if you wish to add the mod manually...however it is best to use the SMF package installer unless there is a pressing reason not to do so.
Title: Re: CountryFlags
Post by: brianjw on June 23, 2007, 06:13:51 PM
I have done this cool code modifying with this on my website and it works well. It makes it so the flag appears next to your username in posts.

Example: see screenshot

What to do -
Open the theme you want this on - display.template.php ~
Find
Code: [Select]
<b>', $message['member']['link'], '</b>';
Add After
Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" height="12px" width="20px" title="', $flags[$message['member']['options']['country']], '" /> <br />';
}

Awesome :)
Brianjw
Title: Re: CountryFlags
Post by: TrueSatan on June 23, 2007, 06:27:23 PM
Thanks Brian...it's pretty much a case of following the advice given in the SMF documentation http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

 BTW in answer to a request for automatic sensing of location and addition of flag according to that location...I did some work on this but found that it is far too often likely to give members the wrong flag. Areas such as Europe often have people in one country supplied from ISPs in another country and thus their ip numbers don't relate to their exact location. My own location is in the UK but my ip address sometimes can make it appear that I am in Denmark for instance.
Title: Re: CountryFlags
Post by: hadesflames on June 29, 2007, 01:37:16 PM
update for 1.1.3 coming soon?
Title: Re: CountryFlags
Post by: TrueSatan on June 29, 2007, 01:45:28 PM
update for 1.1.3 coming soon?

 Your posting suggests that you didn't try using the mod before making it!

 The mod is already compatible with SMF 1.1.3
Title: Re: CountryFlags
Post by: hadesflames on June 29, 2007, 04:19:57 PM
i did try using the mod with 1.1.3 and it didnt work for me.
Title: Re: CountryFlags
Post by: Pox on June 29, 2007, 04:57:58 PM
This is awesome! It even works with 1.1.3!

Make sure you get the most up to date fix for the Mod and it should work just fine.

Thanks for this Jay! You rock.
Title: Re: CountryFlags
Post by: TrueSatan on June 29, 2007, 05:47:28 PM
i did try using the mod with 1.1.3 and it didnt work for me.

 Your bug report gives no clue as to what problems occured when you tried to use the mod so there's no advice I can offer you to resolve them.
Title: Re: CountryFlags
Post by: hadesflames on June 30, 2007, 10:11:00 AM
!!Error in Package Installation

At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Execute Modification ./Themes/default/Profile.template.php Test failed
Title: Re: CountryFlags
Post by: TrueSatan on June 30, 2007, 10:27:04 AM
The problem you have quoted is not an issue, a bug or an error with this mod it merely means that another mod you have already installed has edited a file that this mod seeks to edit and thus you will have to perform a manual installation.

 Please read http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)
Title: Re: CountryFlags
Post by: hadesflames on June 30, 2007, 10:30:02 AM
yea i figured that out, but i hadnt before cuzz i just saw the error and i didnt bother reading it ^_^
Title: Re: CountryFlags
Post by: sixu on July 01, 2007, 10:00:53 PM
I have a problem, I have no error messages during installation, it's just that nothing shows up afterward.

It is meant to show up next to the "Karma" link in "features" right? If so, there's nothing there. :(

I'm on tiny portal 0.9.8 and SMF 1.1.3
Title: Re: CountryFlags
Post by: TrueSatan on July 02, 2007, 04:51:11 AM
Quote
It is meant to show up next to the "Karma" link in "features" right?

Wrong! Look in ACP>Features and Options>Basic Features
Title: Re: CountryFlags
Post by: brianjw on July 02, 2007, 07:52:00 AM
TrueSatan is right. You have to turn Countryflags mod on to work ;)
Title: Re: CountryFlags
Post by: folkandfaith on July 03, 2007, 03:24:13 AM
Can we change the flags already in use in it or add other, more decentralised countries yet?
Title: Re: CountryFlags
Post by: TrueSatan on July 03, 2007, 03:59:20 AM
If you wish to make custom edits to the code you have always been able to do so....your "decentralised countries" would appear to come under this heading...likewise you can make custom changes to the flags for your own use.
Title: Re: CountryFlags
Post by: djrichards on July 03, 2007, 10:50:35 AM
When I first installed this mod it worked great and the users of my international forum loved it. However, somewhere along the way with one of the SMF upgrades it ceased to work and doesn't even show up on the options page (The database settings are still in place).

When I reinstall, everything seems to go OK but it doesn't work at all. When I try to uninstall I get erros on numerous files.

Any suggestions?
Title: Re: CountryFlags
Post by: brianjw on July 03, 2007, 11:56:40 AM
You say nothing appears, have you turned on the mod in the Features and options? Extract the zip or targz file (whatever it is) and open the Package-info.xml file - see if it has 1.1.3 listed anywhere in there, if it doesn't.. it hasn't been updated for 1.1.3. You can manually install if you would like by going to the other xml file. And following what file to open up. What to search for and what to add before, after, replace ;)
Title: Re: CountryFlags
Post by: TrueSatan on July 03, 2007, 01:19:34 PM
Please don't do what Brianjw has suggested. This mod is not version specific thus it already supports SMF 1.1.3 and thus the advice given is incorrect and inappropriate. This compatibility with SMF 1.1.3 was stated, by me, in earlier postings above.

@ djrichards

 The SMF 1.1.2 to 1.1.3 upgrade appears to have overwritten some of the edits this mod makes...as you, correctly, say in your posting. Unfortunately the course of action you took to remedy the problem has only made it worse.

 Had you not tried re-installing it might be more likely that uninstalling the SMF upgrade would let you sort this out more easily.

 You should have backed up your files and database prior to adding or removing any mod or theme (especially an SMF upgrade)...had you done so then reverting to the backup would have let you uninstall this mod, install the SMF upgrade and then reinstall this mod...all would then have been well.

 Given the situation you are now in you should follow the advice from the official SMF documentation and do a manual installation of this mod ensuring that you don't have multiple copies of the code from this mod edited into your files. You should then find that it will work properly again.

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

 

 
Title: Re: CountryFlags
Post by: folkandfaith on July 09, 2007, 10:45:12 PM
If you wish to make custom edits to the code you have always been able to do so....your "decentralised countries" would appear to come under this heading...likewise you can make custom changes to the flags for your own use.

Can you tell me how I do these things please? Sorry if it is covered in the previous posts. I didn't see it.
Title: Re: CountryFlags
Post by: TrueSatan on July 10, 2007, 07:29:39 AM
You would need to add suitable lines to the array the mod adds to Subs.php and add any new flags images of size 25x15 px to the flags directory naming them with a two letter designator the same as you specify in your addition to the array.
Title: Re: CountryFlags
Post by: JOSHSKORN on July 16, 2007, 06:16:34 AM
I've installed this mod on my SMF 1.1.3 forums w/ TP 0.9.8.3.  It seems to work fine, BUT, in previous experience w/ this mod before the release of 1.1.3, I was able to click on a country and it showed the flag.  Now, it just flashes it on the screen on the next line instead of next to it and then the image goes away.

Can someone help?  I'll post whatever files are necessary.
Title: Re: CountryFlags
Post by: TrueSatan on July 16, 2007, 07:40:22 AM
I've just set up a fresh install with the configuration you have stated and the problem you report did not replicate in it. I suspect that you have either got corrupt files somewhere (probably in a theme) or a clash with another mod.

 I have seen instances where the upgrade to SMF 1.1.3 has caused problems so that may be at the root of your issue.

 You might try the configuration you report in a fresh test forum for yourself to prove the point if you wish.

 If you have some file corruption then a replacement of the files of your forum might be the best route...you could replace the theme files but to be certain you'd probably be best to replace all the SMF installation files (meaning not replacing directories added by mods such as arcade or gallery or tp-downloads etc)...you must also not replace Settings.php or Settings_bak.php in the forum root. You would replace all the other main SMF directories and files with those from the SMF 1.1.3 installation pack.

 This would not affect your database to no posts would be lost...you would, however, need to add all your mods and themes again.

 This process would give you a completely fresh set of main files.

 I'm quite certain that the mod does work properly with SMF 1.1.3 and TP 0.9.8.3
Title: Re: CountryFlags
Post by: tupaz on July 27, 2007, 02:28:01 PM
i get error when i try to install it :

    Execute Modification     ./Sources/ModSettings.php     Test failed
Title: Re: CountryFlags
Post by: TrueSatan on July 27, 2007, 02:57:33 PM
Your error is a variant on the most common error of all those reported on these pages...it tells you that another mod you have installed has already edited the file in question and that you thus need to do a manual installation of this mod. Please read:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

 The following may also prove helpful:

http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)
Title: Re: CountryFlags
Post by: MoreBloodWine on August 18, 2007, 09:32:30 PM
Hey Jay,
       I know your giving up on a few mods as Ive been reading around but I was curious if you will keeping this one along with with awards and media center mods as it / this mod seems to be widely used by alot of people...
Title: Re: CountryFlags
Post by: asdas2 on August 19, 2007, 01:42:07 AM
Install Actions

Installations actions for "Country Flags":

Installing this package will perform the following actions:  Type Action
Description

1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test failed  
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags
 









please help
Title: Re: CountryFlags
Post by: TrueSatan on August 19, 2007, 06:17:34 AM
Your error is a variant on the most common error of all those reported on these pages...it tells you that another mod you have installed has already edited the file in question and that you thus need to do a manual installation of this mod. Please read:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

http://www.simplemachines.org/community/index.php?topic=34526.0 (http://www.simplemachines.org/community/index.php?topic=34526.0)

The following may also prove helpful:

http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)
Title: Re: CountryFlags
Post by: asdas2 on August 19, 2007, 09:22:37 AM
ERROR: The package-info.xml file is invalid!


Debugging Information
Error message: String could not be parsed as XML
Source: /home/groups/modparser/htdocs/index.php:133
Errors encountered while parsing XML file:
Stack Trace:
#0 /home/groups/modparser/htdocs/index.php(133): SimpleXMLElement->__construct('')
#1 /home/groups/modparser/htdocs/index.php(94): parsePackageInfoXML('/tmp/smf_xml/pa...', 'install', 'all')
#2 /home/groups/modparser/htdocs/index.php(735): parseArchive('/tmp/phppv90R4', 'install', 'all')
#3 {main}

XML File:
Title: Re: CountryFlags
Post by: TrueSatan on August 19, 2007, 10:20:06 AM
Not all mods will work with the package parser (that's why I always say it may prove helpful rather than will prove helpful)...it isn't a requirement that they do so. You'll have to make use of the information in the other two links I gave you to do a manual installation of the mod. The other two links explain the process very well anyway and it's such a common error that you will need to be able to do this kind of editing for yourself.
Title: Re: CountryFlags
Post by: Limun on August 31, 2007, 12:10:46 AM
there is no moer serbia i crna gora (2 new republicss) i addapted this mod
flag of serbia added...
flag of montenegro added...
(old flagof serbia and montenegro removed)

THIS IS ONLY IF YOU HAVE ALREDY INSTALED -CountryFlag_1-0-2- !!!

FIRST UPLOAD THIS TWO FLAGS IN  "Themes\default\images\flags\" (dont change names of flags)

then open Subs.php


Code: [Select]
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'sn' => 'Senegal', 'cs' => 'Serbia and Montenegro',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}

REPLACE WITH

Code: [Select]
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'CĂ´te d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'me' => 'Montenegro',          'ms' => 'Montserrat',
'ma' => 'Morocco',              'mz' => 'Mozambique', 'mm' => 'Myanmar',
'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'sn' => 'Senegal', 'cs' => 'Serbia',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}

AS YOU SEE DIFFERENCE IS IN :
'cs' => 'Serbia and Montenegro',    changed to    'cs' => 'Serbia',
'me' => 'Montenegro',    this is added
(this you can change manualy in Subs.php if you dont want to do that what i writed in "code")

thanks to
JayBachatero for this mod,hope that he dont be angry if i edited his mod !!
Title: Re: CountryFlags
Post by: TrueSatan on August 31, 2007, 04:40:44 AM
I'll add these changes to the next version of this mod...thank you for pointing the problem out and, in particular, for fixing it.
Title: Re: CountryFlags
Post by: Jade Elizabeth on September 09, 2007, 02:57:34 PM
is this going to be made available for 1.1.3?
it sounds great, and id love to have it...
Title: Re: CountryFlags
Post by: TrueSatan on September 09, 2007, 03:20:26 PM
Please stop posting these update requests on umpteen mods, a number of which have been abandoned for some time! Had you bothered to try this one with SMF 1.1.3 you'd have found that it works with that version already. Had you read other postings in this topic you would have known that already.
Title: Re: CountryFlags
Post by: Jade Elizabeth on September 09, 2007, 03:51:47 PM
if it works why do i get

6.    Execute Modification    ./Themes/default/Profile.template.php    Test failed


??
Title: Re: CountryFlags
Post by: TrueSatan on September 09, 2007, 04:13:35 PM
Your error is a variant on the most common error of all those reported on these pages...it tells you that another mod you have installed has already edited the file in question and that you thus need to do a manual installation of this mod. Please read:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

http://www.simplemachines.org/community/index.php?topic=34526.0 (http://www.simplemachines.org/community/index.php?topic=34526.0)

The following may also prove helpful:

http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)

Mirror of the last link:

http://www.smfhacks.com/smf-package-parser.html (http://www.smfhacks.com/smf-package-parser.html)

 Please check the rest of the topic and you will see this answer has been given previously.
Title: Re: CountryFlags
Post by: 2pac on September 21, 2007, 11:21:04 PM
Hi! I was wondering if someone could help me with my Profile.template.php

I did use the search function, but I found nothing that could help me out...

I tried installing it manually, but I have the ultimate profile template on, so Im guessing that's what'smessing me up. I tried copying and pasting the code to the right place, but it looks so different from my test forum and and from the install file that I have no clue what I'm supposed to do..


i believe it may just be this part that's giving me problems:
Quote
                                                echo '</td><td><table cellspacing="0" cellpadding="2" width="100%"><tr><td>';
                                                echo '<div class="largetext"><b>', $context['member']['name'], '</b> <i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</i></div>';
                  echo '<div class="smalltext"><b>', $txt[231], ': </b>'. $context['member']['gender']['name'] .'</div>';
                  echo '<div class="smalltext"><b>', $txt[420], ': </b>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' &nbsp; <img src="' . $settings['images_url'] . '/bdaycake.gif" width="40" alt="" />' : '') .'</div>';
                  echo '<div class="smalltext"><b>', $txt[227], ': </b>', $context['member']['location'] .'</div>';



                                                                                                                                                   

                  echo '<div class="smalltext"><b>', $txt['local_time'], ': </b>', $context['member']['local_time'] .'</div>';
   if (!empty($modSettings['userLanguage']))
                  echo '<div class="smalltext"><b>', $txt['smf225'], ': </b>', $context['member']['language'] .'</div>';



im supposed to put this in there somewhere:
Quote
            </tr><tr>
               <td><b>', $txt[227], ':</b></td>
               <td>', $context['member']['location'], '</td>
            </tr><tr>
               <td><b>', $txt['country_flag'], ':</b></td>
               <td>';

   // Did they select a flag?
   if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
   {
      $flags = CountryFlag();
      echo
                        $flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
   }

      echo '
               </td>
            </tr><tr>


but I have no Idea how... obviously copy and paste didnt work for me... could someone please take a look?














I also have the following installed
Quote
   Mod Name     Version     
1.    Avatars at Index Mod    1.5    [ Uninstall ] [ List Files ] [ Delete ]

3.    Who Voted What?    1.1.3    [ Uninstall ] [ List Files ] [ Delete ]
4.    Ultimate Profile    0.7    [ Apply Mod ] [ List Files ] [ Delete ]   ****manually installed*****
5.    SMFShop    3.0    [ Uninstall ] [ List Files ] [ Delete ]
6.    SMF Shoutbox    1.16    [ Uninstall ] [ List Files ] [ Delete ]

8.    Topic Ratings    1.03    [ Uninstall ] [ List Files ] [ Delete ]
9.    Titled Links    1.1c    [ Uninstall ] [ List Files ] [ Delete ]


if someone could help me, that would be great thanks!
Title: Re: CountryFlags
Post by: 2pac on September 21, 2007, 11:47:30 PM
ok so i got it to show up on the user profile options menu by pasting this in there:
Quote

                  echo '<div class="smalltext"><b>', $txt['country_flag'], '</b></div>';
   // Did they select a flag?
   if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
   {
      $flags = CountryFlag();
      echo
                        $flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
   }


but i have no clue where to go from there... im guessing i would have to edit something else somewhere so it can display on people's profile info. in the posts...


by any chance anybody else have a similar situation and maybe a fix???
Title: Re: CountryFlags
Post by: 2pac on September 22, 2007, 01:31:00 AM
i got the flag to display in the ultimate profile, but i cant get it to display in the profile info. section next to the posts :(
Title: Re: CountryFlags
Post by: TrueSatan on September 22, 2007, 05:35:47 AM
 The Ulimate Profile system isn't an approved mod so you can, and should, anticipate having problems with it...in fact I have some concerns about security with that particular mod (last time I looked at it it allowed use of html in a rather risky way...we use BBC for good reason.) My best advice would be not to use it on a live/production forum...test forums, yes...live/production, no. I'm really not inclined to give a lot of time to support for changes to accommodate an unnofficial system like that that I don't use myself so I'll have to say that you're on your own on this unless you can get the ultimate profile author to support it.
Title: Re: CountryFlags
Post by: 2pac on September 22, 2007, 06:25:43 AM
nevermind, i figured it out. Thanks!
Title: Re: CountryFlags
Post by: JOSHSKORN on September 28, 2007, 12:03:15 AM
I'm doing a TinyPortal article which queries my smf database.  How would I query what the user selected for country flags?  What table do I select from and which field?  Thanks.
Title: Re: CountryFlags
Post by: TrueSatan on September 28, 2007, 04:10:10 AM
This mod doesn't add to the database (doesn't need to.) It uses the existing members table and the location field within it.
Title: Re: CountryFlags
Post by: ajg on September 28, 2007, 09:15:10 PM
sorry for cross posting.  i thought this might get some attention here..

http://www.simplemachines.org/community/index.php?topic=197186.0 (http://www.simplemachines.org/community/index.php?topic=197186.0)

Title: Re: CountryFlags
Post by: TrueSatan on September 29, 2007, 04:19:29 AM
 Thanks...answer given on that link. BTW it would probably have been as well to have asked here as it isn't really a new mod you are requesting.
Title: Re: CountryFlags
Post by: ajg on September 30, 2007, 06:23:33 AM
thanks for the reply truesatan.  fyi, i just made an official request at smfhelper.info

http://www.smfhelper.info/forum/index.php?topic=1733.0 (http://www.smfhelper.info/forum/index.php?topic=1733.0)

cheers!
Title: Re: CountryFlags
Post by: samames on October 06, 2007, 08:21:33 PM
please see attached image for a screen shot of the issue I am facing.
For some reason, when I use the the 'Apollo BB' theme, the "Country" title (on the profile summary page) before the ":" is not visible. Please can somebody tell me what I need to change to fix this issue? And Which file it's in?
Thank you in advance :)
Title: Re: CountryFlags
Post by: samames on October 06, 2007, 08:43:33 PM
Okay, I decided to re-install the mod, so i uninstalled, deleted and then installed the latest version. However this had no affect on the issue I am facing. Though now when i go into my original theme where it was previously working fine i get a load of errors at the top (see screen shot).
please tell me how to make this mod properly functional on my board [as it was previously]
thanks :)
sam
Title: Re: CountryFlags
Post by: TrueSatan on October 06, 2007, 10:36:14 PM
The problem is in your Modifications.english.php in your theme language directory (or if your theme does not have that file it will use the file from the SMF Default theme.)

 The file must have
Code: [Select]
?>...once only and at the end of the file on a line of its own.

 Your file appears to have that code before the lines that show at the top of your scren and not at the end...move it to make the placement correct and all should be well.
Title: Re: CountryFlags
Post by: samames on October 07, 2007, 05:09:07 AM
Thanks for the quick response, that's helped me fix the issue on my original theme where the error was appearing at the top. :)
However I am still facing the first issue I posted about:
please see attached image for a screen shot of the issue I am facing.
For some reason, when I use the the 'Apollo BB' theme, the "Country" title (on the profile summary page) before the ":" is not visible. Please can somebody tell me what I need to change to fix this issue? And Which file it's in?
Thank you in advance :)
Please help :).
Title: Re: CountryFlags
Post by: TrueSatan on October 07, 2007, 09:02:49 AM
Oh how I hate custom themes! It looks like your custom theme's Modifications.english.php file lacks at least one of the lines the mod seeks to add...specifically
Code: [Select]
$txt['country_flag'] = 'Country';
Title: Re: CountryFlags
Post by: perro88 on October 20, 2007, 11:13:38 PM
how about make a countryflag appear at the memberlist page and a option search by country on the memberlist too.?
that would be dificult?
Title: Re: CountryFlags
Post by: Jade Elizabeth on October 21, 2007, 02:34:55 AM
there is such a thing
check the mod list
Title: Re: CountryFlags
Post by: perro88 on October 21, 2007, 02:25:21 PM
there is such a thing
check the mod list
well I think the mod is about location and not country. probably will be easy to change that code to show the country flag and not the location. And the search would be nice too :D
Title: Re: CountryFlags
Post by: mickyjanny on October 28, 2007, 05:22:31 AM
i cant download the mode why?

can any one tell me what can i do to download any mod from this site
Title: Re: CountryFlags
Post by: TrueSatan on October 30, 2007, 05:51:27 AM
Firstly this would appear to be a query that is off topic...it isn't specific to this mod. Secondly you don't say if you are trying to go to the mods pages with your browser or using your forum system for the download...in any event please post to the correct area and somebody may resolve the matter for you.
Title: Re: CountryFlags
Post by: perro88 on October 31, 2007, 07:10:03 PM
What code I need to change to delete a country option and his flag, and to add a new country and his flag? thanks
Title: Re: CountryFlags
Post by: TrueSatan on October 31, 2007, 09:06:15 PM
You would need to edit the array this mod adds to Subs.php and to add the new flag to the flags directory.
Title: Re: CountryFlags
Post by: Sincere on November 02, 2007, 02:58:16 AM
Hello Jay,

During the installation, the mod gives a warning about possible big problem, simply because it cannot find the file
./Themes/babylon/Display.template.php


which is very understandable if you deleted the Babylon style and don't want it.


The mod must querry the DB first to see which styles are installed ;)
Title: Re: CountryFlags
Post by: TrueSatan on November 02, 2007, 06:25:05 AM
@ Sincere

 With Jay's agreement I've taken over this mod.

 The database doesn't need to be queried and you seem to be misunderstanding the normal install process of mods. The errors this mod reports if the Babylon theme is deleted is perfectly proper and correct...the mod is doing as it should. If you deleted the Babylon theme you should expect to see errors from mods that try to install into it...this isn't the only mod that will throw such errors and they are a normal consequence of deletion of the Babylon or Classic theme from an installation.
Title: Re: CountryFlags
Post by: ajg on November 02, 2007, 06:44:20 AM
hi truesatan,

is it possible to hide the country name.  i only want to display the flag in the profile and post area.

tia
Title: Re: CountryFlags
Post by: TrueSatan on November 02, 2007, 07:28:20 AM
@ alving

Yes, certainly Tia...

In Profile.template.php find:

Code: [Select]
</tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
<td><b>', $txt['country_flag'], ':</b></td>
<td>';

// Did they select a flag?
if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}

echo '
</td>
</tr><tr>

...and change it to:

Code: [Select]
</tr><tr>
<td><b>', $txt[227], ':</b></td>
<td>', $context['member']['location'], '</td>
</tr><tr>
<td><b>', $txt['country_flag'], ':</b></td>
<td>';

// Did they select a flag?
if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo
$flags[$context['member']['options']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}

echo '
</td>
</tr><tr>
<td><b>', $txt['local_time'], ':</b></td>
<td>', $context['member']['local_time'], '</td>
</tr><tr>';

In Display.template.php find:

Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}

...and change it to:

Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']], '<br /><br />';
}

 Those changes should do as you requested.
Title: Re: CountryFlags
Post by: Sincere on November 02, 2007, 07:33:17 AM
oops.

yes, I learned something new today  ::)

I appreciate the shared information about how the mod is supposed to work.

I still believe the error message should not be as strong as it is right now when it has no negative effect whatsoever neither on the correct installation and fuction of the mod, nor on the core script or its DB
Title: Re: CountryFlags
Post by: ajg on November 02, 2007, 07:47:05 AM
thanks truesatan!
Title: Re: CountryFlags
Post by: TrueSatan on November 02, 2007, 07:48:14 AM
 It's a difficult one to call...if the automatic installation into the Babylon theme were omitted from the mod script then that error would be eliminated should the Babylon theme be deleted by the user yet those users who benefit from that automatic installation would lose out as a consequence of that change.

 I tend to think that those users who are aware enough to choose to trim down their installation by removal of unwanted Babylon and/or Classic themes are probably aware enough to understand the errors that removal may cause and know that they aren't important ones.

 The error generation is part of the installer system rather than any mod so it would need to be a suggestion made to the core developer team if you want to ask for it to be changed.
Title: Re: CountryFlags
Post by: TrueSatan on November 02, 2007, 07:48:45 AM
thanks truesatan!

My pleasure!
Title: Re: CountryFlags
Post by: perro88 on November 03, 2007, 08:02:14 PM
You would need to edit the array this mod adds to Subs.php and to add the new flag to the flags directory.
thanks mate
Title: Re: CountryFlags
Post by: dxyy on November 21, 2007, 09:07:53 AM
I'm not sure if this was already addressed in this thread, but I got the following error while trying to upload this mod through the package manager:

Quote
The package you tried to upload either is not a valid package or has become corrupted.

I'm using version 1.1.3 if that helps.

Any advice will be appreciated. I hope I can install this mod without having to upgrade to 1.1.4, because I'm afraid some things on the forum will not work if I upgrade. :(
Title: Re: CountryFlags
Post by: TrueSatan on November 21, 2007, 09:20:33 AM
The upgrade to SMF 1.1.4 is strongly advised and shouldn't cause major problems...if some mods don't work you may need to do a little file editing to sort them out but that's the worst that can happen.

 Please try getting the mod again (a fresh copy) using a different browser and with that browser again try to add it to your site...more often than not this will resolve your problem.

 Brianjw's advice is incorrect as this mod does not contain version limiting/checking!
Title: Re: CountryFlags
Post by: dxyy on November 21, 2007, 11:02:01 AM
The upgrade to SMF 1.1.4 is strongly advised and shouldn't cause major problems...if some mods don't work you may need to do a little file editing to sort them out but that's the worst that can happen.

 Please try getting the mod again (a fresh copy) using a different browser and with that browser again try to add it to your site...more often than not this will resolve your problem.

 Brianjw's advice is incorrect as this mod does not contain version limiting/checking!
Thank you, I will try that and let you know how it goes.

I will eventually upgrade my forum, but because of the forum's great importance to my website, I'll need to get help in case something goes wrong. ;)
Title: Re: CountryFlags
Post by: TrueSatan on November 21, 2007, 11:31:12 AM
You can make your upgrade safe and trouble free by first doing proper backup of both your files and database...if you aren't able to manage file editing one way round it would then be to remove all your mods in the order in which you added them (or if you don't know that order try to remove each in turn and if a particular on won't remove without errors leave it in place and remove one that will remove without errors...eventually you should find that all can be removed save those you added via manual edits. Make the upgrade and then re-add the mods.
Title: Re: CountryFlags
Post by: dxyy on November 21, 2007, 11:59:24 AM
Hmm, well I tried with a fresh copy and with another browser, but I got the same error message. :(

I also tried to install one of the older versions of the mod, so just CountryFlags.tar.gz instead of CountryFlag_1-0-2.tar.gz, but that also didn't work.

Any ideas?
         
Title: Re: CountryFlags
Post by: TrueSatan on November 21, 2007, 01:21:30 PM
I have gone to the mods page myself and downloaded it without any problems at all so all seems well there.

 I'll repackage it as a .zip file for you and add it to this post in case your hosting is choking on the archive format....please try this version and report back.
Title: Re: CountryFlags
Post by: dxyy on November 23, 2007, 06:40:17 AM
Can someone please post all the modifications that need to be made to the sources/modsettings.php file.

I have been trying to use this SMF Package Parser (http://www.simplemachines.org/community/index.php?topic=207274.0), but it's been acting funny and showing me the modifications needed for other mods. :(

Thank you in advance! :)
Title: Re: CountryFlags
Post by: TrueSatan on November 23, 2007, 09:17:01 AM
I've taken this mod over with kind permission from Jay Bachatero and will provide a new version shortly once I find out why the Package Parser is playing silly games. All being well the new version will work with the Package Parser.
Title: Re: CountryFlags
Post by: dxyy on November 23, 2007, 11:20:27 AM
I've taken this mod over with kind permission from Jay Bachatero and will provide a new version shortly once I find out why the Package Parser is playing silly games. All being well the new version will work with the Package Parser.
Well, this other thread might help: http://www.simplemachines.org/community/index.php?topic=207274.0
Title: Re: CountryFlags
Post by: TrueSatan on November 23, 2007, 12:52:17 PM
Yes I read it thanks but it doesn't explain why the Package Parser wasn't accepting the current archive format when it should so I'll install the Parser on my own hosting and try to track down the problem.

 New version now available...minor adjustments only and inclusion of an update for changing status of former Yugoslav republics.
Title: Re: CountryFlags
Post by: perro88 on December 23, 2007, 11:06:28 AM
Any Idea how to make a column on the memberlist with the country and it's flag? and maybe a search by country on the memberlist?
Title: Re: CountryFlags
Post by: TrueSatan on December 23, 2007, 01:23:01 PM
These are not features of the mod, and unless you wish to code them yourself and offer the results, aren't something I plan to add to it.
Title: Re: CountryFlags
Post by: perro88 on December 23, 2007, 08:42:38 PM
These are not features of the mod, and unless you wish to code them yourself and offer the results, aren't something I plan to add to it.
ok, thanks. I tried one time but no luck :(
Title: Re: CountryFlags
Post by: au8ust on January 07, 2008, 07:28:02 PM
Thai and Lao traslations

Code: [Select]
<file name="$languagedir/Modifications.thai-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'กรุณาเลือกประเทศของคุณ';
$txt['country_flag_error_required'] = 'กรุณาเลือกประเทศที่คุณอยู่';
$txt['country_flag_ask'] = 'ถามประเทศ';
$txt['country_flag_disabled'] = 'ไม่แสดง';
$txt['country_flag_profile'] = 'ข้อมูลส่วนตัว';
$txt['country_flag_registration'] = 'การลงทะเบียนสมัครสมาชิก';
$txt['country_flag_both'] = 'ทั้งคู่';
$txt['country_flag_required'] = 'ต้องการให้สมาชิกเลือกประเทศ?';
$txt['country_flag_show'] = 'แสดงธงประเทศนั้น ๆ ในหน้ากระทู้.';
$txt['country_flag'] = 'ประเทศ';
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.lao-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'ກະລຸນາເລືອກປະເທດຂອງທ່ານ';
$txt['country_flag_error_required'] = 'ກະລຸນາເລືອກປະເທດທີ່ທ່ານຢູ່';
$txt['country_flag_ask'] = 'ຖາມປະເທດ';
$txt['country_flag_disabled'] = 'ບໍ່ສະແດງ';
$txt['country_flag_profile'] = 'ຂໍ້ມູນສ່ວນຕົວ';
$txt['country_flag_registration'] = 'ການລົງທະບຽນສະມາຊິກ';
$txt['country_flag_both'] = 'ທັງສອງ';
$txt['country_flag_required'] = 'ຕ້ອງການໃຫ້ສະມາຊິກເລືອກປະເທດ?';
$txt['country_flag_show'] = 'ສະແດງທຸງຊາດປະເທດນັ້ນ ໆ ໃນຫນ້າກະທູ້.';
$txt['country_flag'] = 'ປະເທດ';
]]></add>
</operation>
</file>


Also could you make selectable option for displaying flag only? Or maybe only flag and tooltip as country name :)
Title: Re: CountryFlags
Post by: TrueSatan on January 07, 2008, 07:47:06 PM
Thanks for the translations...I'll ponder on your request.
Title: Re: CountryFlags
Post by: Matthew Schenker on January 11, 2008, 03:09:02 PM
How difficult would it be for me to edit this modification so it shows regions (like North America, Europe, Asia, etc) instead of individual countries, and to get it to not display the graphic?  In other words, I want the core functionality of requesting the member to make a choice, but not the specific choices shown in this modification.
Thanks!
Title: Re: CountryFlags
Post by: TrueSatan on January 11, 2008, 04:48:26 PM
Very easy...and further development is via SMF Helper (and we both know you know where that is!) where I showed another member how to do flag changes a while back so if you'll have a look at that first then if you need more help let me know...showing only the text would also be an easy change to make.
Title: Re: CountryFlags
Post by: Matthew Schenker on January 11, 2008, 05:16:12 PM
True Satan,
OK, I'll see you over in SMF Helper!  I thought I'd ask here first, where the modification is posted.  But I should have known that SMF Helper is the place to go!!
Thanks again,
Matt
Title: Re: CountryFlags
Post by: TrueSatan on January 11, 2008, 07:27:54 PM
OK Matthew...the following link is the support topic there for the mod with the development code shown in postings there.

http://www.smfhelper.info/forum/index.php?topic=2121.0 (http://www.smfhelper.info/forum/index.php?topic=2121.0)
Title: Re: CountryFlags
Post by: Sabre™ on February 24, 2008, 02:36:57 PM
Hi mate. :)

If I wanted to make one flag a gif, what would I need to add/change?
Or would it be easier just to make them all gif images?

Thank You
Title: Re: CountryFlags
Post by: lonrot on February 28, 2008, 03:15:04 PM
Hi, I'm using Tiny Portal, and SMF 1.4

The mod installs fine, but then, after setting up the:
"Show flags on Display page (Where posts are shown)."

I realize that the flags won't show up as expected.
Any ideas?
Title: Re: CountryFlags
Post by: Basie on February 28, 2008, 09:33:25 PM
Thanks a lot for this mod, I love it.

But in the next version PLEASE include an option to disable the country names! (so it only shows the flag). :)
Title: Re: CountryFlags
Post by: brianjw on March 01, 2008, 09:20:41 PM
I uploaded the package to my SMF installation and get the message saying it's corrupt or something. Then, when I try to manually install via the Package Parser, that also says it's corrupt. Does anyone have a working version of the mod that is the latest version and works with 1.1.4?
Title: Re: CountryFlags
Post by: Sabre™ on March 01, 2008, 11:13:51 PM
Hey there brian.

Yea mate, mine works fine without a hitch.
I have TP installed also, and have it workin ok on a custom theme.
I've found that I've had to re-grab the file a couple of times with different mods.
The file becomes corrupt through transfer.
Try grabbin it again if you havent already :)

Hi mate.
If I wanted to make one flag a gif, what would I need to add/change?
Or would it be easier just to make them all gif images?
Thank You

Any Ideas peeps?? :)
Title: Re: CountryFlags
Post by: brianjw on March 02, 2008, 08:35:40 AM
Just thought I would point out with personal experience with tar.gz files and zip files. I have found zip files to be the best. For those having the same problem as me, use the zip file attached to this post instead of the tar.gz file. (the mod in the zip hasn't changed at all)
Title: Re: CountryFlags
Post by: Sabre™ on March 05, 2008, 06:02:59 AM
Anyone know how you could move the Country name to display beneath the flag, instead of along side it??
I have added animated gif images, and the names would sit better underneath them.

Thank You in advance :)
Title: Re: CountryFlags
Post by: TrueSatan on March 05, 2008, 11:03:28 AM
Please see post #392 where I had already provided a newer version of the mod having taken it over with kind permission of original developer...redistributing old versions is not helpful! N.B. the new version nis also already in .zip format.

@ionrot...TP shouldn't affect this mod.

@sabre...it's better to leave all the images as .png files.

@seek2501...I've already given details of how to do what you want (though not from the ACP) in an earlier posting.

 
Title: Re: CountryFlags
Post by: Sabre™ on March 05, 2008, 03:25:02 PM
@sabre...it's better to leave all the images as .png files.

Hi buddy.
May I ask why?
To me, the flags are basically a  "looks good"  thing. Visual flavour if you will.
And to me, this
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg137.imageshack.us%2Fimg137%2F5361%2Fslovakiaa01qq6.gif&hash=096984bfd59ffe784dd69dd487a66ac8)

looks alot better than this
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg186.imageshack.us%2Fimg186%2F7505%2Fskpp1.png&hash=30b8b20295352816da30f331a7ddc052)

But I know there is a good reason why youve stated the above, so could you enlighten a dull rag :)

Either way, do you see how I could put the country name under the flag.
It looks cleaner than out to the side.  imo

Thank You mate :)
Title: Re: CountryFlags
Post by: perplexed on March 05, 2008, 03:34:23 PM
lol I think I'm still using 1.0.1 but I also added a bunch of other flags to it. 
Title: Re: CountryFlags
Post by: No.Body on March 05, 2008, 03:45:03 PM

Great mod. I love it!
Title: Re: CountryFlags
Post by: Sabre™ on March 16, 2008, 06:30:03 AM
To display the Country name beneath the flag, instead of beside it, change this code in your   display.template.php

Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}

To

Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.gif" alt="', $flags[$message['member']['options']['country']], '" /><br />
                        ', $flags[$message['member']['options']['country']], '<br />';
}
Title: Re: CountryFlags
Post by: cellax on April 11, 2008, 02:33:49 PM
I prefer this change:

On Display.template.php look for:
Code: [Select]
// Did they select a flag?
                        if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}

replace with:
Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" title="', $flags[$message['member']['options']['country']], '" /><br /><br />';
}

as you can see, now the country name is showed as a tooltip when you go on with the mouse. I like this solution.

thx for this mod
Title: Re: CountryFlags
Post by: Sabre™ on April 11, 2008, 10:23:44 PM
Sounds good.
Do you have a link to where we can see/test it please. :)
Title: Re: CountryFlags
Post by: cellax on April 12, 2008, 07:11:25 AM
Here the link, sorry:
http://www.darkforge.it/board/index.php?topic=773.msg5936#msg5936
Title: Re: CountryFlags
Post by: Sabre™ on April 12, 2008, 08:32:19 AM
Hi cellax  :)
What is it Im looking for?
This is what Im seeing..
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg150.imageshack.us%2Fimg150%2F9219%2F78000043tg3.png&hash=c06e7ffa833779e29b42a744351aa3c3)
EDIT!!!
Scratch that, for some reason it didnt work for me. But then a simple refresh remedied the event lol

Looks great!!
Thank You for the share :)
Title: Re: CountryFlags
Post by: FragaCampos on April 20, 2008, 08:48:14 AM
Hello there, and thank you a lot for this mod :)
I translated it to portuguese, and there are some countries that stayed out of order, ie, the list is not sorted due to the differences between the two languages, of course.
Question: is there a way to sort them out editing the files?
Title: Re: CountryFlags
Post by: perplexed on April 23, 2008, 12:20:04 PM
Hello there, and thank you a lot for this mod :)
I translated it to portuguese, and there are some countries that stayed out of order, ie, the list is not sorted due to the differences between the two languages, of course.
Question: is there a way to sort them out editing the files?

if you have a look in the sources/ subs.php file you will find the list of countries there, and you can add or move some around
Title: Re: CountryFlags
Post by: FragaCampos on April 23, 2008, 03:50:30 PM
Thanks.
I edited the file and when i uploaded it to the server i got this error:

Quote
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/docspt/public_html/Sources/Subs.php on line 3912

I think it's probably i minor error, but i can't see where. Can you peek into my subs.php file and see what's the problem? Thanks in advance.
Title: Re: CountryFlags
Post by: perplexed on April 23, 2008, 03:55:21 PM
try that, you were missing a comma after palestina, that might be the problem.
Title: Re: CountryFlags
Post by: FragaCampos on April 24, 2008, 11:45:25 AM
Thanks a million, quiteperplexed :)
Title: Re: CountryFlags
Post by: perplexed on April 24, 2008, 11:51:06 AM
no worries, I was just able to notice it quite quickly.  You must have missed the comma after changing the name.  Very easy to do :)
Title: Re: CountryFlags
Post by: holly.celeb.fan on April 26, 2008, 07:06:34 AM
Nice ...

working fine
Title: Re: CountryFlags
Post by: FragaCampos on May 01, 2008, 08:05:58 PM
Just a sugestion for this mod:
Would it be difficult to put a column in the "members" panel with the flag of each member? That would be nice :)
Title: Re: CountryFlags
Post by: Nibogo on May 18, 2008, 07:46:07 PM
this mod work with smf 1.1.5??
Title: Re: CountryFlags
Post by: FragaCampos on May 19, 2008, 05:26:13 PM
Yep :)
Title: Re: CountryFlags
Post by: CraigPal on May 21, 2008, 07:05:53 PM
I really like this mod but the text doesn't show up durring registration, or in the profiles - only a colon.
The text doesn't show up in the admin panel either - just two checkboxes and a blank drop down menu.

I've uninstalled and deleted the original and reinstalled using the zip file. I still have the same problem. Does anyone have any idea what could be the problem?
Title: Re: CountryFlags
Post by: Sabre™ on May 21, 2008, 08:31:08 PM
Maybe check your language file.(modifications.english.php)
Make sure the code has been inserted there.
Are your files utf-8?     This could be another reason why you see no text.
Title: Re: CountryFlags
Post by: CraigPal on May 21, 2008, 09:12:38 PM
Maybe check your language file.(modifications.english.php)
Make sure the code has been inserted there.
Are your files utf-8?     This could be another reason why you see no text.

Yes, they were utf-8. I changed it to English and all is well! Thank you!
Title: Re: CountryFlags
Post by: CraigPal on May 21, 2008, 11:49:02 PM
I've been thinking. Would requiring registrants to choose a flag help to thwart spam bots?
Title: Re: CountryFlags
Post by: Nibogo on May 22, 2008, 10:29:15 PM
Works great thanks ;)
Title: Re: CountryFlags
Post by: neil h on May 26, 2008, 03:46:28 AM
When I tried to install the package, I got this in a warning box:
Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Below in the files list, this comes up:
Quote
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

The only other mod I have running is Ad Management 2.3

My version is SMF 1.1.5

Anyone know why this is happening?
Title: Re: CountryFlags
Post by: FragaCampos on May 27, 2008, 08:16:10 AM
I've been thinking. Would requiring registrants to choose a flag help to thwart spam bots?


In principle, yes ;)
Title: Re: CountryFlags
Post by: Babalui on June 03, 2008, 02:59:45 PM
Just a sugestion for this mod:
Would it be difficult to put a column in the "members" panel with the flag of each member? That would be nice :)

I would like to support this idea. I was playing around with this option, but my knowledge is not sufficient. I can't add a new column that will display flags.
Any guidelines for this?
Title: Re: CountryFlags
Post by: schnups on June 15, 2008, 03:38:25 PM
When I tried to install the package, I got this in a warning box:
Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Below in the files list, this comes up:
Quote
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

The only other mod I have running is Ad Management 2.3

My version is SMF 1.1.5

Anyone know why this is happening?

I get the same warning....but I dont have that Mod installed
Title: Re: CountryFlags
Post by: agentx42 on June 21, 2008, 09:02:52 PM
Will this work with the newest version of SMF?  Also how hard is it to install? We are a non-proft and have volunteers with little to no experience setting up or forum. We got it running (somehow)  :) but don't want to muck things up getting too ambitious if installing this is out of our league.
Title: Re: CountryFlags
Post by: blouogies20 on June 22, 2008, 09:38:53 AM
I really like this mod but the text doesn't show up durring registration, or in the profiles - only a colon.
The text doesn't show up in the admin panel either - just two checkboxes and a blank drop down menu.

I've uninstalled and deleted the original and reinstalled using the zip file. I still have the same problem. Does anyone have any idea what could be the problem?

I have the same problem!!!!!!!
I'm gonna attach my modifications.english.php file will you please have a look?  It looks to me that all the edits was done.
Title: Re: CountryFlags
Post by: blouogies20 on June 23, 2008, 02:51:20 PM
My problem is sorted out!!! The problem was the language I have changed it to English.
Title: Re: CountryFlags
Post by: Irythros on June 27, 2008, 07:08:38 AM
Im getting 2 errors while its installed.

1st:
Code: [Select]
8: Undefined index: country_flag
File: /home/*****/public_html/forums/Themes/default/languages/Who.english.php (summary sub template - eval?)
Line: 272

and 2nd:
Code: [Select]
8: Undefined index: country_flag_label
File: /home/*****/public_html/forums/Themes/default/Profile.template.php (forumProfile sub template - eval?)
Line: 1442

Why I am getting the error for the who.template file im not sure because it doesnt give errors on the SMF default yetI get the errors on the custom theme which doesn't touch who.template file. 

While viewing a profile I do not see a Country Flag: entry.  Only : [Flag image].  Im assuming I have to modify the who.template for the variable country_flag_label



Any ideas?
Title: Re: CountryFlags
Post by: Irythros on June 27, 2008, 07:39:01 AM
Both modifications.english[-utf8].php have the required lines in them.

I've also redownloaded the package and resinstalled but have not had any luck.

Edit:
Not a double post, someone else posted with help but the post is gone now <.<
Title: Re: CountryFlags
Post by: digit on June 28, 2008, 07:21:59 AM
Can someone point me to another set of flag images? (I am not a big fan of the default set included with this - otherwise excellent mod)

Thanks in advance

Title: Re: CountryFlags
Post by: dannbass on June 30, 2008, 08:27:36 PM
I've been working on the memberlist option... so far I got to display the flags but the sort up and down is not working... will any coder take a look of what I have so far?

Here is how is looking so far...
Title: Re: CountryFlags
Post by: FragaCampos on July 01, 2008, 10:29:11 AM
Wow, great job! It looks just like what i suggested.
Hope someone can help you on this. I know i can't :P
Title: Re: CountryFlags
Post by: digit on July 11, 2008, 02:31:01 AM
I am starting to like the default set of flags more and more  ;).

Now...  How would I write this in the index.template.php?

if user has selected a flag.....

echo '';

else echo 'Please add your flag!';

Thanks again for an excellent mod!
Title: Re: CountryFlags
Post by: Anub1s on July 11, 2008, 10:19:22 AM
I was thinkning about making 2 mods that run along the same line as this.

one is a forum pets (just a png image of a monster or somthing.)

another for consoles. im just wondering if i could use the structure to make these two mods please
Title: Re: CountryFlags
Post by: dannbass on July 11, 2008, 11:52:08 AM
I was thinkning about making 2 mods that run along the same line as this.

one is a forum pets (just a png image of a monster or somthing.)

another for consoles. im just wondering if i could use the structure to make these two mods please

Sure no problem, just substitute the names in the array for the ones that you want, and then upload the pngs for the pets and consoles... it's very easy.
Title: Re: CountryFlags
Post by: Anub1s on July 15, 2008, 05:15:38 AM
Thanks alot its amazing how one mode can be used in so many different ways.

Anub1s

Title: Re: CountryFlags
Post by: FragaCampos on July 15, 2008, 09:35:50 AM
Can anyone help ♫ ♪♩♬♭♮ ♯ with the sorting of the flags in the member's table? :P
Title: Re: CountryFlags
Post by: tk2012 on July 18, 2008, 08:13:12 PM
Has anyone tried to use this mod on v2.0 b3.1 yet? 

This is a great mod that I've used in 1.1.5, but REALLY want this for the above version.  I'll tell you now I am not a whiz when it comes to this type of thing.  I tried it with the ShinyBlue theme and got all types of Failed responses.  Was wondering if anyone has gotten this to work with the above?

Thanks!
Title: Re: CountryFlags
Post by: AlenNS on July 19, 2008, 10:43:44 AM
Does author of this mod plans some updates, maybe for SMF 2.0 Beta 3.1?
Title: Re: CountryFlags
Post by: Papa on July 31, 2008, 09:48:08 PM
Anyone have this mod packaged up and working for 1.1.5?

Thanks for replys.
Title: Re: CountryFlags
Post by: brianjw on July 31, 2008, 10:33:18 PM
It will work on SMF 1.1.5. The package on the modsite should work.
Title: Re: CountryFlags
Post by: tk2012 on August 01, 2008, 12:27:35 AM
I have it on 1.1.5 and it works fine.  I downloaded it from the modification list.
Title: Re: CountryFlags
Post by: AlenNS on August 01, 2008, 07:12:55 AM
Does developer plans to make it compatible with SMF 2.x? :)
Title: Re: CountryFlags
Post by: shelzmike on August 05, 2008, 01:50:15 PM
When I tried to install the package, I got this in a warning box:
Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Below in the files list, this comes up:
Quote
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

The only other mod I have running is Ad Management 2.3

My version is SMF 1.1.5

Anyone know why this is happening?


Did this ever get resolved? I am getting the same error. Would it possibly be due to file permission issues? Thanks.

Mike
Title: Re: CountryFlags
Post by: CraigPal on August 05, 2008, 02:31:44 PM
Is this mod going to be supported in SMF 2.0? My members love it but I don't see support for 2.0 in the mods repository.


Sorry if this has been answered. I really like the SMF search engine. The problem in this particular forum is that everyone is talking about the same things, giving lists of mods, and such, which makes it a nightmare to sort through and find what you're actually looking for.

Thanks in advance,
Craig

____________
Raw Paleo Diet Group (http://health.groups.yahoo.com/group/rawpaleodiet)
Title: Re: CountryFlags
Post by: CraigPal on August 19, 2008, 12:08:08 PM
Anybody?


__________________
Kubuntu Forums (http://kubuntuway.net/)
Title: Re: CountryFlags
Post by: Joomlamz on August 24, 2008, 04:48:09 PM
when update puty portuguese and brazilian

Code: [Select]
</file>
<file name="$languagedir/Modifications.portuguese.php" error="skip">
<operation>
<search position="after" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s que voc&ecirc; visitar-nos ';
$txt['country_flag_ask'] = 'Pergunte qual e o pa&iacute;s para poder escolher a bandeira';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (com Deficiência)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'requerem um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras e Mostrar na p&aacute;gina (Quando as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.brazilian.php" error="skip">
<operation>
<search position="after" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s que voc&ecirc; visitar-nos ';
$txt['country_flag_ask'] = 'Pergunte ao pa&iacute;s para a bandeira';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (com Deficiência)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Inscri&ccedil;&atilde;o';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'requerem um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras e Mostrar na p&aacute;gina (Quando as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
</operation>
</file>
Title: Re: CountryFlags
Post by: Sabre™ on August 24, 2008, 06:25:59 PM
When I tried to install the package, I got this in a warning box:
Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Below in the files list, this comes up:
Quote
3.     Execute Modification     ./Sources/ModSettings.php     Test failed

The only other mod I have running is Ad Management 2.3

My version is SMF 1.1.5

Anyone know why this is happening?


Did this ever get resolved? I am getting the same error. Would it possibly be due to file permission issues? Thanks.

Mike

Have you tried manually installing the mod?
When there is only one installation error as youve shown, I back that template up, install the mod,  then add the needed code to that template myself.
Use a [PACKAGE PARSER] (http://sleepycode.com/PackageParser/index.php) to install the missing code.
Just upload the mod there, select your smf version, then send file.
You will see all the code added to your templates, but look for the template you need to modify.

There is also the option to ONLY show the files you need to modify in a custom theme.

Hope this helps.
Enjoy :)
Title: Re: CountryFlags
Post by: CraigPal on August 25, 2008, 02:35:37 AM
Does anyone know if this mod will be adapted for use in 2.0?

Thanks again,

Craig

____________
Raw Paleo Diet Group (http://health.groups.yahoo.com/group/rawpaleodiet)
Title: Re: CountryFlags
Post by: Aeoni on September 01, 2008, 03:44:37 PM
I took this mod off my site for around 30 seconds while i fixed something else.

And someone registered...

How can I manually add a flag to someone? There's nothing in the admin section, and they can't do it via profile.

Thanks! :)
Title: Re: CountryFlags
Post by: Sabre™ on September 01, 2008, 07:11:20 PM
There should be an area in your  Features and Options  section in your Admin panel.
In the  Basic Features  tab, scroll all the way down the bottom of the page, and you should see your flag options there.
The  Ask for country flag on  drop down is where you select to show the flag options on Registry and/or on the profile.
Select the profile for now, or keep it on both if you like, then go to their profile and select one.
Title: Re: CountryFlags
Post by: Aeoni on September 02, 2008, 03:56:32 AM
I've checked that. I have selected 'Profile', and the I tried 'Both'

There's nothing in the users profile which lets me choose a flag.

The profile looks like:

Avatar Select
Birthdate
Location (just an input field - not the flag one)
Gender
ICQ,YIM etc
Custom Title
Sig
Website Title - URL
Karma
Title: Re: CountryFlags
Post by: Sabre™ on September 02, 2008, 08:01:27 AM
Are you using a custom theme, or the default?
If you are not using the default theme, you will have to manually install the  profile.template.php  edits, to your custom themes  profile.template.php.

Use a [PACKAGE PARSER] (http://sleepycode.com/PackageParser/index.php) to assist you with manual edits.
1.) Click browse, and upload the mod package to it
2.) Select your SMF version
3.) Select   "Only Theme edits"  then press send file.

This will show you all the edits needed for custom themes.

Good Luck  :)
Title: Re: CountryFlags
Post by: Aeoni on September 02, 2008, 08:34:48 AM
Nice advice, but:

ERROR: The package-info.xml file is invalid!

Debugging Information
Error message: String could not be parsed as XML
Source: /home/sleepy1/public_html/PackageParser/index.php:184
Errors encountered while parsing XML file:
Stack Trace:
#0 /home/sleepy1/public_html/PackageParser/index.php(184): SimpleXMLElement->__construct('')
#1 /home/sleepy1/public_html/PackageParser/index.php(125): parsePackageInfoXML('/home/sleepy1/b...', 'install', 'theme')
#2 /home/sleepy1/public_html/PackageParser/index.php(823): parseArchive('/tmp/phpiMPzEC', 'install', 'theme')
#3 {main}

XML File:


As a side note, I'm using the theme 'Adagio' by Bloc, available at TinyPortal.net, and possibly other places.
The mod is made for SMF Versions: 1.1 RC2, 1.1 RC3, 1.1, 1.1.2 (but it works with 1.1.4, and 1.1.5...normally)

I'm using 1.1.5
Title: Re: CountryFlags
Post by: Sabre™ on September 02, 2008, 09:12:24 AM
Ok.
The package parser/mods have that issue sometimes.

Click [here] (http://custom.simplemachines.org/mods/?mod=417), and look to your right, underneath  "Download this mod".
Use the dropdown box below  "Manual Install Instructions for SMF"  to select your SMF version, then click on submit.

Anything that has  "DEFAULT"  in it, you will need to do the manual edits for, if your custom theme also has that template.
eg.  ./Themes/default/Profile.template.php  or   ./Themes/default/Register.template.php
If your theme doesnt have that template, then you do not need to make those edits, as it will use that template in the default them folder.

I could put the code here for you to copy n paste, but the benefits of you lookin and working through it at an early stage, will be very beneficial for yourself wit future edits.

Remember: Try to backup your forum as often as you can.
If youre manually editing a single template at a time, then back that template up first!

Good luck mate :)
And if any problems occur, someone is always around to help :)
Title: Re: CountryFlags
Post by: Aeoni on September 02, 2008, 09:53:24 AM
*Starts to edit*

OK. Modification.english.php already had the code... *leaves it alone*

*scratches head*

My theme has the following files:

help.css
index.php
index.template.php
settings.template.php
style.css
theme_info.xml
themes.template.php



Therefore, according to your instructions, I don't need to make a single edit....

So it's still broken....

 :(
Title: Re: CountryFlags
Post by: Sabre™ on September 02, 2008, 10:00:45 AM
Did you check to see if the code was in the default profile template?
If it had been inserted correctly upon install.
Any errors in your error log?
Title: Re: CountryFlags
Post by: Aeoni on September 02, 2008, 10:36:28 AM
My error log has around 10 pages of errors per hour... Which really get's on my nerves.... But nothing that relates to this mod.

display.template.php has the code inserted already...
profile.template.php did NOT have the code. Code added...
register.template.php did NOT have the code. Code added...

*upload*

Code: [Select]
Parse error: syntax error, unexpected '<' in .../Themes/default/Profile.template.php on line 1718

1709: // Show age only
1710: echo implode('-', $context['member']['birth_date']);
1711: }
1712: echo '
1713: </td>
1714: </tr><tr>
1715: <td width="40%"><b>', $txt[227], ': </b></td>
1716: <td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td> </tr>'; // If flags is set for registration show it. if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3) { // Call the function that has all the flag info $flags = CountryFlag(); echo ' <script language="JavaScript" type="text/javascript"> function showflags() { document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\'; } </script> <tr> <td width="40%" align="top"> <b>', $txt['country_flag_label'], ':</b> </td> <td> <select name="country" onchange="showflags()"> <option value=""></option>'; // Loop and show the drop down. foreach ($flags as $key => $name) echo ' <option value="', $key, '" ', isset($context['member']['options']['country']) && $context['member']['options']['country'] == $key ? 'selected="selected"' : '', '>', $name, '</option>'; echo ' </select> <img id="flags" src="', $settings['default_theme_url'], '/images/', isset($context['member']['options']['country']) && !empty($context['member']['options']['country']) ? 'flags/' . $context['member']['options']['country'] . '.png': 'blank.gif', '" width="25" height="15" align="top" /> </td> </tr>'; } echo ' <tr> <td width="40%"><b>', $txt[231], ': </b></td>
1717:
1718: <td>';1719: if($context['user']['is_admin'] || !isset($context['member']['gender']['name']))
1720: {
1721:

*uploads originals*

No. That didn't seem to work either...?
Title: Re: CountryFlags
Post by: Sabre™ on September 03, 2008, 08:16:47 AM
10 pages of errors an hour?

Whenever you make any change to the structure of your forum(install a mod etc), you should always check your error log. If you see an error directly after a change, immediately seek to fix it.
If it occurs directly after installing a mod, then seek assistance from that mod creator.
A problem left to sit, could possibly contribute to another error.. etc etc

The issue I see with your code above, is that you have inserted the code as one line, instead of its structure as in the frontpage parser.
This could be due to that parser copying as one line.
You must do the leg work, and adjust the code to how it is displayed there.

For example:
It asks you to replace this in the profile template
Code: [Select]
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
 </tr>
 <tr>
 <td width="40%"><b>', $txt[231], ': </b></td>

with this
Code: [Select]

<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>';
 
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();
 
echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.gif\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">

If you copy n paste from the parser where you get the mod, it will come out like this
Code: [Select]
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td> </tr>'; // If flags is set for registration show it. if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 1 || $modSettings['country_flag_ask'] == 3) { // Call the function that has all the flag info $flags = CountryFlag(); echo ' <script language="JavaScript" type="text/javascript"> function showflags() { document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\'; } </script> <tr> <td width="40%" align="top"> <b>', $txt['country_flag_label'], ':</b>
And wont work.

For manual edits, you must get the characters on each line correct to how it is displayed.
You are doing good in attempting this, now try and finish it. :)
Ive done the first bit for you above, there is one more edit for your profile template.
Add the above, and the final edit, and thats your profile template complete.

I suggest you work through the errors in your log also :-\

Good luck :)
Title: Re: CountryFlags
Post by: Aeoni on September 03, 2008, 08:57:00 AM
 :D <--- see that? It's as near to my face as I can get right now. Apart from the yellowness...

I copied everything from the parser that relied on default templates, then instead of pasting it into the PHP file, as I'd been doing, I pasted it into a new text document. It kept the same formatting as was displayed, so from there I copied it to the PHP file.

Uploaded.

Ta-Da!

It worked. I added the flag through the users profile, went to check a post he'd made, and sure enough, the flag was there.

2 of them....   >:(

I figured if I uploaded ONLY the profile.template it would be how it should be.

And it was. Everyone has a flag on their post, everyone can select a flag at registration.

Many thanks Sabre. Was easy really......    :P

And as for the errors, many of them come from the TP code, I think. ADV Shoutbox provided me with hundreds of errors, as did the normal shoutbox. I took them off and will make do with 10 or so pages an hour  :D
Title: Re: CountryFlags
Post by: Sabre™ on September 03, 2008, 09:02:35 AM
lol
Hurrah!!!
Congratulations mate :)
Good job.

Ask the TP team to help you sift through your errors if you havent already.
Theyre a good group there, and will assist when time permits etc.

Im glad you sorted this issue out mate.
Once again..  congrats, and good job :)
Title: Re: CountryFlags
Post by: spearfish on September 05, 2008, 04:43:49 PM
Hey,
I've got a question concerning this mod - where exactly is the country each user selects stored at?  I couldn't find ANY database queries in the install.xml file.

Can somebody point out where these are stored?

Thanks!



Edit:
I've been able to find the values... disregard this post.
Title: Re: CountryFlags
Post by: runebergen on September 05, 2008, 08:16:21 PM


How can I use this manually?

I want to add a code block to Simple Portal.. But not sure what includes or globals are needed...

Anyone got an idea ? :)
Title: Re: CountryFlags
Post by: AlenNS on September 05, 2008, 08:48:55 PM
When this mod will be ready for SMF 2.0?
Title: Re: CountryFlags
Post by: Abavagada on September 24, 2008, 10:27:19 AM
I've downloaded CountryFlag_1-0-2.tar.gz for use with SMF 1.1.6. When I try to upload, I am told:

An Error Has Occurred!
The package you tried to upload either is not a valid package or has become corrupted.

Has anyone else had this problem? I have tried redownloading it a few times.
Will I have to install this manually?

Thanks
Title: Re: CountryFlags
Post by: minos on September 28, 2008, 02:04:24 PM
hi im having a trouble  i installed this mod on 1.1.6 and nothings wrong but not show de flag whhere post are shown even in the default theme , by  the way mi the doesnt have  displaye template
Title: Re: CountryFlags
Post by: jen2swt on September 28, 2008, 07:31:17 PM
I installed this ok. Only thing I got an error on was the Modsettings.php which I did manually. Everything tested just fine.

Now, I don't have any options in the admin panel to select the use of this nor does it have any options in the profiles.

I am NOT using the default skin, using the DilberMC theme. There is no profile.template.php, and the profile-template.php for the default was changed accordingly.....

What shall I do? A little lost now.

Thanks
Title: Re: CountryFlags
Post by: jen2swt on September 29, 2008, 04:06:44 PM
Does anyone have any thoughts?
Title: Re: CountryFlags
Post by: minos on September 29, 2008, 08:58:57 PM
this version works on my  smf 1.1.6
http://www.simplemachines.org/community/index.php?action=dlattach;topic=260879.0;attach=69945
Title: Re: CountryFlags
Post by: Hunnenkoenig on October 04, 2008, 09:03:27 PM
Really cool mod! Thanks!

I run an MMORPG portal in hungarian language and I modified this mod, so I can let people chose, what game they are playing actually.

Now I would like to give this option to the member list too, so the icons for the games appear also in the member list and people can rearrange the list by clicking on the column "Game".

I tried to do this, but I am not pro in php, so i couldn't finish the task. As I understood, the data should be written in the MySQL table, to be able to show it in the member list and make it possible to rearrange the list by the game icons, but the mod doesn't write anything into the SQL database.

Could somebody tell me, how can I do this?

Thanks in advance!
Title: Re: CountryFlags
Post by: Sabre™ on October 04, 2008, 10:56:16 PM
Maybe start your own thread, as this drifts from the actual function of this mod.
You will possibly receive the assistance you require, if asked in the appropriate board.
Try the "SMF Coding Discussion" board.
Good luck :)
Title: Re: CountryFlags
Post by: Hunnenkoenig on October 05, 2008, 05:38:55 AM
Thanks, I try  :D
Title: Re: CountryFlags
Post by: qubbah on October 16, 2008, 11:51:11 AM
My user ask me how them can search user by country/flag or location?
Any suggestion...
Title: Re: CountryFlags
Post by: Powerbob on October 20, 2008, 07:16:29 AM
It has been asked before, but I will ask here again.
Will this mod be updated for smf 2.0 any time soon? Thanks.
Title: Re: CountryFlags
Post by: Powerbob on October 23, 2008, 04:08:32 AM
Bump 8)
Title: Re: CountryFlags
Post by: AlenNS on October 23, 2008, 08:55:14 AM
That would be great if someone make it compatible...
Title: Re: CountryFlags
Post by: CraigPal on October 24, 2008, 01:44:24 AM
It has been asked before, but I will ask here again.
Will this mod be updated for smf 2.0 any time soon? Thanks.

I've been wondering this too. My members don't want to upgrade to 2.0 if they can't have their flags. We're a very international community.

_________________
Raw Paleo Diet (http://www.rawpaleodiet.com)
Title: Re: CountryFlags
Post by: FragaCampos on October 27, 2008, 03:37:23 PM
For all those who want to add a column with flags in the memberlist, i leave you with the code provided by [SiNaN], here (http://www.simplemachines.org/community/index.php?topic=269806.0).

 8)
Title: Re: CountryFlags
Post by: Sabre™ on October 27, 2008, 03:54:29 PM
Nice share Fraga!!
Cheers mate, will definitely give it a whirl :)
Title: Re: CountryFlags
Post by: FragaCampos on November 06, 2008, 12:06:33 PM
I found a bug in this mod.
When i make it mandatory for new users to choose a country, an error message appears.
But the message should be from $txt['country_flag_error_required'] and what it shows is from $txt['country_flag_required']

I solved this making the two equal, since one of them appears on the admin panel.
But it woul be nice to correct this :P
Title: Re: CountryFlags
Post by: Sabre™ on November 06, 2008, 02:41:45 PM
Nice find bro!!
So for others that may want to fix this, look in your  Register.php  template located in your  sources  dir/file

Find this
Code: [Select]
// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_required', false);
}

And replace with this
Code: [Select]
// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}

Good work fraga  :)
Title: Re: CountryFlags
Post by: FragaCampos on November 07, 2008, 11:37:39 AM
No problem, thank you for solving this ;)
Title: Re: CountryFlags
Post by: nay27uk on November 08, 2008, 08:11:06 AM
hi im using the country flags mod.
I have reworked the profile pages so they look nicer. however i need to center alighn somthing and dont know how, i keep getting template parse errors, can some one in the know help me please.
 
this is the code im strugling with
 
Code: [Select]

 
 // Did they select a flag?
 if(isset($context['member']['options']['country']) && !empty($context['member']['options']['country']))
 {
  $flags = CountryFlag();
  echo
       $flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country"/>';
 }

and this is the part i wish to be centered
 
Code: [Select]
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country"/>';
Does anyone know how i do it please
 
Title: Re: CountryFlags
Post by: nay27uk on November 08, 2008, 08:12:03 AM
Anyone have this mod packaged up and working for 1.1.5?

Thanks for replys.

working on 1.1.7
Title: Re: CountryFlags
Post by: AlenNS on November 08, 2008, 09:24:49 AM
1.1.7?
WTF?

Can someone make this mod for SMF 2.x?
Title: Re: CountryFlags
Post by: Sabre™ on November 08, 2008, 10:14:43 AM
Maybe someone will take over when smf 2 is stable, but converting from 1.x.x to 2 isnt as easy as mixing up a few codes.
It takes time and relearning as the structure is different.

If someone decides to make it compatible for smf 2, it will be announced
Title: Re: CountryFlags
Post by: AlenNS on November 08, 2008, 10:16:16 AM
Ok. Thanks
Title: Re: CountryFlags
Post by: nay27uk on November 08, 2008, 04:21:58 PM
1.1.7?
WTF?

Can someone make this mod for SMF 2.x?

1.1.6 is replace with 1.1.7
Title: Re: CountryFlags
Post by: AlenNS on November 08, 2008, 08:14:23 PM
Didn't know. Sorry
Title: Re: CountryFlags
Post by: SgtMic on December 15, 2008, 02:03:19 AM
Any chance on an update for beta4?
Title: Re: CountryFlags
Post by: Gonzalo on January 04, 2009, 01:46:41 AM
Translation to Spanish

Author Traducción: GonZa-Design (http://www.foro-area51.com.ar/profile/?u=1) o Gonzalo (http://www.simplemachines.org/community/index.php?action=profile;u=171288)



Available languages: spanish, spanish-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8



Download (http://www.4shared.com/file/77835510/1d654ec7/Country_Flags_101_Spanish_by_GonZa-Design.html)



I hope it serves them.

Greetings! GonZa.
Title: Re: CountryFlags
Post by: oldcopy on January 19, 2009, 12:27:47 AM
I am sorry for broken English. Can I do that would be in the registration country's flag had already been set by default. That is, in a field already podstavlyalos value.
Title: Re: CountryFlags
Post by: RoCKeT-88 on January 20, 2009, 06:48:58 PM
Marking for later.
Title: Re: CountryFlags
Post by: 0cm on February 21, 2009, 03:40:31 PM
Hello,

I couldn't get this to work with SMF 2.0 RC1 (errors when performing installation checks). Is there a fix or will there be an update soon? Thanks.
Title: Re: CountryFlags
Post by: AlenNS on February 21, 2009, 06:39:32 PM
This mod isn't made for SMF 2.0, but it would be great if someone could made it compatible.
Title: Re: CountryFlags
Post by: ScarMix on March 30, 2009, 02:39:20 AM
Could this be upgraded to 2.0 RC1, PLEASE  O:)

It's a great mod that many people would like to use  ;)
Title: Re: CountryFlags
Post by: Powerbob on March 31, 2009, 05:43:05 PM
Good idea 8)
Title: Re: CountryFlags
Post by: minos on April 12, 2009, 07:46:36 PM
yeah smf 2 deserve this mod
Title: Re: CountryFlags
Post by: AlenNS on April 12, 2009, 10:17:52 PM
There was some mod for SMF 2.0 but it looks like it is removed.

http://www.simplemachines.org/community/index.php?topic=295043.0
Title: Re: CountryFlags
Post by: TheListener on April 13, 2009, 06:41:23 AM
Is the mod available for 1.1.8?
Title: Re: CountryFlags
Post by: J Dub on May 08, 2009, 11:42:18 AM
Is this mod still being supported? or is there anyone that can help me with it, I have read all 26 pages of this and came close to finding my answers but not close enough to fix the issue I suddenly have.

Cheers
Title: Re: CountryFlags
Post by: FragaCampos on May 08, 2009, 12:25:59 PM
Is the mod available for 1.1.8?

The mod works fine in SMF 1.1.8. Try to install it anyway.
My forum is 1.1.8 (with TP) and everything is ok.
Title: Re: CountryFlags
Post by: Sabre™ on May 08, 2009, 05:28:45 PM
.... is there anyone that can help me with .......  the issue I suddenly have.
Cheers

You would have to mention what the issue is, in order for someone to see if they can be of any assistance lol ;)
Title: Re: CountryFlags
Post by: J Dub on May 08, 2009, 05:34:22 PM
Hi and ty, I have now fixed the most bizzare set of issues ever after a lot of hours of working it out.

In short i made a test forum and the like, for some strange reason the forum decided to use settings from my main one, so when i installed country flags, it semi installed itself there too, I did do a long post with it all in since, but now fixed it and deleted that, yet ty any way :)

.... is there anyone that can help me with .......  the issue I suddenly have.
Cheers

You would have to mention what the issue is, in order for someone to see if they can be of any assistance lol ;)
Title: Re: CountryFlags
Post by: Sabre™ on May 08, 2009, 05:36:44 PM
No probs buddy, glad you've got it all sorted :)
Title: Re: CountryFlags
Post by: J Dub on May 08, 2009, 05:37:59 PM
lol ty, it took hours and was under my nose, yet makes no sense in this world why it did what it did, but its fixed thats what counts :)

No probs buddy, glad you've got it all sorted :)
Title: Re: CountryFlags
Post by: dzinerfusion on June 13, 2009, 09:49:01 PM
hi anyone know where to edit this??/

Code: [Select]
./Sources/Profile.php
Find: [Select]


$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))

Add Before: [Select]


// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];

// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}



I can do all the other edits. I use 2.0 rc1-1
Title: Re: CountryFlags
Post by: M-DVD on June 15, 2009, 10:56:47 PM
hi anyone know where to edit this??/

Code: [Select]
./Sources/Profile.php
Find: [Select]


$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))

Add Before: [Select]


// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];

// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}



I can do all the other edits. I use 2.0 rc1-1

Search in the: Profile-Modify.php :P
Title: Re: CountryFlags
Post by: dzinerfusion on July 16, 2009, 07:07:30 PM
Alright got that, but I can find this in 1.19 or in 2.0rc1.2!!!

For the /default/profile.tamplate.php
Title: Re: CountryFlags
Post by: JeremyB. on July 16, 2009, 08:18:30 PM
Nice mod thanks.
Title: Re: CountryFlags
Post by: TheListener on July 17, 2009, 12:56:22 PM
Managed to start the manual edits but was unable to finish due to being unable to find some text in templates.

These were Themes/default/profile template.php

and

Sources/profile.php
Title: Re: CountryFlags
Post by: trashgeek on July 17, 2009, 06:43:18 PM
I install the mod using spanish language... now I can't see the  option or the flag chooser... can someone tell me how can I fix this...?
Title: Re: CountryFlags
Post by: TheListener on July 19, 2009, 12:06:41 PM
bump due to previos post being 2 days old.
Title: Re: CountryFlags
Post by: Sabre™ on July 19, 2009, 05:36:42 PM
@ milicik
Could you attach your display.template.php?

@ trashgeek
Do you see your options in the admin panel?
Check if the code was added to your language file  (Modifications.english.php), if you are using (Modifications.english-utf8.php), then add it to that template also.

@ TheListener
The three pieces of code you speak of could only have been deleted, altered by another mod, or simply missed.
Download a fresh copy of those templates and find them there to learn the location.
Easy as pie ;)
Title: Re: CountryFlags
Post by: dzinerfusion on July 19, 2009, 10:22:19 PM
@ milicik
Could you attach your display.template.php?

@ trashgeek
Do you see your options in the admin panel?
Check if the code was added to your language file  (Modifications.english.php), if you are using (Modifications.english-utf8.php), then add it to that template also.

@ TheListener
The three pieces of code you speak of could only have been deleted, altered by another mod, or simply missed.
Download a fresh copy of those templates and find them there to learn the location.
Easy as pie ;)

That's the problem, when i downloaded a fresh install of 1.19 , I still cannot find the code to edit the default.profile.template? YOu sure its not in another area?
Title: Re: CountryFlags
Post by: Sabre™ on July 19, 2009, 11:24:45 PM
Yes, they are there for the profile.template, Ive just downloaded a copy to make sure lol

If you guys/gals still have probs, attach those templates and I'll take a look for you :)
Title: Re: CountryFlags
Post by: dzinerfusion on July 20, 2009, 11:38:45 AM
Ok lol, maybe I'm blind  8), but I use 2.0 rc1-1 version, so it might be different, but i'm sure its the same.

Title: Re: CountryFlags
Post by: Sabre™ on July 20, 2009, 05:00:03 PM
Yeah mate its there, just slightly different.
I haven't yet moved onto porting this to smf2, and if I recall correct, someone else is doing it.
I have a half day at school today, so will probably give it a shot then. With only 30 mins before I leave, going over all the templates at the moment to check everything would be a stretch lol
Im no coder, but if I get this to function on smf2 correct with a few extra additions, I'll add my package here.
Title: Re: CountryFlags
Post by: Sabre™ on July 21, 2009, 05:16:01 AM
Okay, here's the package.
The code may need a little clean, but I'll wait for smf2 to go final until I do that and add my extras.

Could somebody confirm that it installs into SMF 2.0 RC1.2?
I haven't updated my test site from RC1-1 yet.

Thanks and enjoy :)

removed
Title: Re: CountryFlags
Post by: TheListener on July 21, 2009, 10:11:35 AM
Went to install the above and got these:

./Sources/Profile-Modify.php     Test failed
      1.    Add Before    ./Sources/Profile-Modify.php    Test failed
*    5.    Execute Modification    ./Themes/default/Profile.template.php    Test failed
      1.    Add After    ./Themes/default/Profile.template.php    Test failed
      2.    Replace    ./Themes/default/Profile.template.php    Test failed

Title: Re: CountryFlags
Post by: dzinerfusion on July 21, 2009, 03:32:53 PM
install perfect :)  Edit** Found a bug, when i select a country fromt he profile, when i click change profile, it resets and it doesnt selcet the country
Title: Re: CountryFlags
Post by: Sabre™ on July 21, 2009, 05:52:00 PM
@ TheListener
You've got a mod using the same area in those two templates.
Put this package through this [Parser] (http://resourcez.biz/PackageParser/) and add it manually.

@ bluesinjid
Which version of smf?
I cant replicate your error, it is working fine for me.
Does it do that also on the register page?
I'm going away on Thursday night so will be offline till next Wednesday, we'll try and sort it out before then.
Title: Re: CountryFlags
Post by: dzinerfusion on July 22, 2009, 08:50:47 AM
I use 2.0 rc1.2, but the error is for already registered members like me, when i go on the profile page to choose my country, i select one in the dropdown ( works good) , than at the bottom, when i click ''Change Profile'', it automatically resets to no country selected.
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 03:51:14 PM
Could you attach your Profile-Modify.php found in your Sources directory, and your themes Profile.template.php.
Still couldn't replicate this on my new fresh test site, 2.0 RC1.2.
I suppose there would be no errors in your log?

@ TheListener
Are you going alright manually adding the code?
If not, attach your templates and I'll go through them :)
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 04:52:28 PM
Er ( gives a guilty look)

I gave up on it.
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 05:01:37 PM
lol ok.
Well if you'd like for me to look at your templates, its no problem, Im online for the next few hours before I fly out.
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 06:49:04 PM
Sabre you hard task master.

I had a look at all the manual edits. The attachments included need your good hands on them.

If you would like a temp admin account to check everything else then I would be extremely grateful.

( gets shotgun ready)
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 07:20:59 PM
lol  just glad to assist ;)
Im gonna need your Profile-Modify.php
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 07:38:54 PM
ok smart alec where will I find it?
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 07:41:22 PM
oops found it
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 07:43:27 PM
In your Sources folder

Your profile.template is done, I cleaned up some dupe code etc..
but will post it when Ive done both, as there is code in your template I think could be better placed, but will see when I lok at your Profile-Modify.php

EDIT:
Warning - while you were typing a new reply has been posted. You may wish to review your post.

lol
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 07:47:07 PM
ok try these after you have installed the package
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 07:48:41 PM
if by package ya mean the mod its already there.  :)

Gawds I hate this bit.
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 07:56:25 PM
OK sorted except theres just a blank space next to the country.
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 07:58:28 PM
Is that after youve selected the one you want and click on save?
Custom or default theme?
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 08:06:12 PM
Rather than try and explain I have included an attachment
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 08:08:10 PM
Does it work ok in the default theme?
Copy the  "flags"  folder to your custom themes  "images"  folder
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 08:29:29 PM
By custom theme I presume ya mean the forums theme.
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 08:36:19 PM
I just checked your forum and they are there (http://www.visionaryhosting.info/Themes/BlackRainV220rc1/images/flags/), so should be displayed
*scratches head
Could you pm me a 'temp admin' account details.
Title: Re: CountryFlags
Post by: Sabre™ on July 22, 2009, 10:05:29 PM
There you go mate, only a couple fixes were needed to other templates.
Enjoy :)
Title: Re: CountryFlags
Post by: TheListener on July 22, 2009, 10:06:27 PM
Thanks bud.

Read ya pm I sent
Title: Re: CountryFlags
Post by: dzinerfusion on July 23, 2009, 06:37:25 PM
Alright here is the ****( you should know)  :P

Title: Re: CountryFlags
Post by: bbmtalk on July 23, 2009, 09:38:22 PM
Okay, here's the package.
The code may need a little clean, but I'll wait for smf2 to go final until I do that and add my extras.

Could somebody confirm that it installs into SMF 2.0 RC1.2?
I haven't updated my test site from RC1-1 yet.

Thanks and enjoy :)

Does this package work with 1.1.10?
Title: Re: CountryFlags
Post by: Sabre™ on July 30, 2009, 06:18:11 AM
@ bluesinjid
Those files are fine.
For a fast fix, would it be possible to get a temp admin account to your site?
Just pm me the details if you like.

@ bbmtalk
It should work fine with that version of smf.
If you have any problems, just post back :)
Title: Re: CountryFlags
Post by: mo. on July 31, 2009, 06:32:13 PM
Okay, here's the package.
The code may need a little clean, but I'll wait for smf2 to go final until I do that and add my extras.

Could somebody confirm that it installs into SMF 2.0 RC1.2?
I haven't updated my test site from RC1-1 yet.

Thanks and enjoy :)

Where can I download this test package for SMF 2.0?  Thanks
Title: Re: CountryFlags
Post by: Sabre™ on July 31, 2009, 07:53:04 PM
It is attached to that post buddy.
[HERE] (http://www.simplemachines.org/community/index.php?topic=106060.msg2169209#msg2169209)
Title: Re: CountryFlags
Post by: mo. on July 31, 2009, 08:33:52 PM
Hi Sabre

Thanks. When I first looked I wasn't registered on this forum and therefore the attachment wasn't visible to guests. I can see it now.

Reason I asked in the first place was that I had also updated Country Flags for SMF 2.0 in readiness for my own site and I wanted to see if I could help in anyway.  Your install2.php is very similar to mine and so there is no need for me to contribute.

Best Regards
Title: Re: CountryFlags
Post by: Sabre™ on July 31, 2009, 09:01:15 PM
My pleasure mate :)
Your code may be cleaner than mine, so Any contribution is Always appreciated.

regards
Title: Re: CountryFlags
Post by: bbmtalk on August 01, 2009, 12:19:29 AM
Hi Sabre, thanks for the mod.

A member has requested to add Scotland flag. Can you help?

Found a solution.

1. Edit Sub.php and add the flag to the array.
2. upload the flag image to "flags" folder in the Default theme images folder. 
Title: Re: CountryFlags
Post by: Sabre™ on August 05, 2009, 06:20:03 AM
Congrats on sorting it out mate :)
I didnt realise the Scottish flag wasnt in there, as the package I use is different to this one, and has many other flags in it, all gifs.
I just thought I'd update the original package for whomsoever wanted it.
Title: Re: CountryFlags
Post by: mark3 on August 16, 2009, 07:09:21 PM
Hi

I would like to put 2 flags in profile. Is this possible?

thanks.
Title: Re: CountryFlags
Post by: Neverhurry on August 22, 2009, 04:10:48 AM
Hi, anybody know where can i find a Flag mod for smf 2.0? Thank you!
Title: Re: CountryFlags
Post by: bbmtalk on September 03, 2009, 01:44:56 PM
I have this flag mod installed and am just wondering if it is possible to display a list of countries with members who have selected their flags on a pag. It is similar to the location mod that displays the map. Unfortunately, the location mod is not compatible with later version of SMF.

Any idea?
Title: Re: CountryFlags
Post by: Sabre™ on September 03, 2009, 04:31:29 PM
Hi

I would like to put 2 flags in profile. Is this possible?

thanks.

You could try duplicating the code for the profile page and see if that works.

Hi, anybody know where can i find a Flag mod for smf 2.0? Thank you!

Until somebody makes an official package, [This update is For SMF 1.1.x & SMF2] (http://www.simplemachines.org/community/index.php?topic=106060.msg2169209#msg2169209)

I have this flag mod installed and am just wondering if it is possible to display a list of countries with members who have selected their flags on a pag. It is similar to the location mod that displays the map. Unfortunately, the location mod is not compatible with later version of SMF.

Any idea?

It should be possible buddy.
Good luck :)
Title: Re: CountryFlags
Post by: bbmtalk on September 03, 2009, 05:09:46 PM
It should be possible buddy.
Good luck :)

Thanks. What file or mod should I look into?
Title: Re: CountryFlags
Post by: Sabre™ on September 03, 2009, 05:22:08 PM
You could probably compare both this mod and the location mod, and make the necessary edits.
I have no knowledge of the location mod, but may have a look at it when time permits.
I currently use the [Member Map] (http://custom.simplemachines.org/mods/index.php?mod=1010) mod, so have no real need for the location mod.

Good luck :)
Title: Re: CountryFlags
Post by: bbmtalk on September 14, 2009, 10:34:50 AM
No success with displaying flags on a page like location mod.

I noticed that in the PM display, the flags are not shown as in the topic view. I tried to edit InstantMessage.template.php and copy the code from Display.template.php but the flag is not showing. Did I do something wrong?

Code: [Select]
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" align="absmiddle" /><br />';
}
Title: Re: CountryFlags
Post by: Arantor on September 20, 2009, 09:56:19 AM
thefley also posted the modifications necessary for this mod so that it could be used on for states rather than countries - please see http://www.simplemachines.org/community/index.php?topic=337017.0
Title: Re: CountryFlags
Post by: Lolafish on September 25, 2009, 12:24:01 AM
Does this package work with 1.1.10?

I haven't been able to get it too, even after making all of the modifications required for this version.  I do get flags listed in posts once the member makes a choice in their profile...but I really need it to work on registration.  I had it working on an older version and custom theme, and I've gone over every single file involved and cannot find any mistakes.  I got rid of some duplicity, but that didn't help either. 

Can someone help for a bit?  I would very much appreciate it. Thanks!
Title: Re: CountryFlags
Post by: JBlaze on September 25, 2009, 12:41:47 AM
Update:

I have taken over this mod from JayBachatero. I will be updating it to work for 2.0 as well as fix some things for the 1.1.x series.
Title: Re: CountryFlags
Post by: JBlaze on September 25, 2009, 01:11:29 AM
Updated:
9/24/2009 - v1.0.3
o Taken over by JBlaze
o Added new flag images
! Fixed version error
Title: Re: CountryFlags
Post by: Qayyom Ashraf on September 25, 2009, 03:36:31 AM
But it is not visible in Posts

any working/live demo?
Title: Re: CountryFlags
Post by: Lolafish on September 25, 2009, 07:59:48 AM
But it is not visible in Posts

Works for me in posts.  Just not on registration. (In v. 1.1.10)

What version are you running it in, and do you have the default or a custom theme?
Title: Re: CountryFlags
Post by: Lolafish on September 25, 2009, 08:00:19 AM
Update:

I have taken over this mod from JayBachatero. I will be updating it to work for 2.0 as well as fix some things for the 1.1.x series.

Okay. Thanks for the update.
Title: Re: CountryFlags
Post by: Sabre™ on September 25, 2009, 08:10:07 AM
Update:

I have taken over this mod from JayBachatero. I will be updating it to work for 2.0 as well as fix some things for the 1.1.x series.

Good man!
Finally the mod is resurrected
Title: Re: CountryFlags
Post by: Paul_Pauline on September 25, 2009, 09:52:53 AM
First off, nice mod !

Two questions  ..........

1.

I see that you have flags for England, Scotland & Wales in the images folder, but they are not listed   in the dropdown menu when members sign up, would it be possible for you to add them ?

2.

It is possible to get animated versions of country flags (Blowing in the wind), if I were to grab these flags and place them in the images folder for the mod, giving them the same name as the original flags & over writing them, would they then show as animated on the board ?

Thanks, Paul.
Title: Re: CountryFlags
Post by: Arantor on September 25, 2009, 09:55:08 AM
JBlaze will have to answer question 1, but with question 2, yes if you put animated versions over the top of the non animated ones (assuming the file names are the same) that would work.
Title: Re: CountryFlags
Post by: Paul_Pauline on September 25, 2009, 10:08:53 AM
Hi !

Thanks for that Arantor.

I'll wait for Jblaze to hopefully get back to me on queston 1, as I don't want to start messing with things I don't understand as I'm very new to all this !

Thanks Paul.
Title: Re: CountryFlags
Post by: JBlaze on September 25, 2009, 01:01:50 PM
To answer your question Paul_Pauline, I will be fixing the country listing in my next update which will inlcude support for 2.0 RC1.2.

All I did for this past update was add new flags from the famfamfam set which look better in my opinion.

For question #2, in order to get waving flags, you would have to modify it so it accepts .gif files rather than .png, which is what I use for the flags.
Title: Re: CountryFlags
Post by: Qayyom Ashraf on September 25, 2009, 11:41:57 PM
But it is not visible in Posts

Works for me in posts.  Just not on registration. (In v. 1.1.10)

What version are you running it in, and do you have the default or a custom theme?

I downloaded the latest version on yesterday, and I am using Default Theme
Title: Re: CountryFlags
Post by: JBlaze on September 26, 2009, 02:23:46 AM
qayyom, make sure that you have enabled it to show in post display by going to the CountryFlags area in admin, and checking "Show flags on Display page (Where posts are shown)."
Title: Re: CountryFlags
Post by: Paul_Pauline on October 08, 2009, 03:05:32 PM
Hi JBlaze !

Hope you can help me out here  ....

I was going to uninstall this mod ready for the new version when you update it !

The mod installed perfectly with no errors and works fine, however when I clicked on uninstall I got the following error warning "./Themes/default/Register.template.php" plus a warning strongly recommending I do not carry on with the "INSTALLATION" This has thrown me as I was trying to uninstall the mod, not install it !

I am very new to this, any help that a dummie would understand would be much appreciated,

Thanks, Paul.
Title: Re: CountryFlags
Post by: JBlaze on October 08, 2009, 03:20:18 PM
Can you attach your Register.template.php?
Title: Re: CountryFlags
Post by: Paul_Pauline on October 08, 2009, 04:27:45 PM
I think this is what you are asking for !

Paul.
Code: [Select]
<?php
// Version: 1.1.10; Register

// Before registering - get their information.
function template_before()
{
global $context$settings$options$scripturl$txt$modSettings;

// Make sure they've agreed to the terms and conditions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function verifyAgree()
{
if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
{
alert("'
$txt['register_passwords_differ_js'], '");
return false;
}'
;

// If they haven't checked the "I agree" box, tell them and don't submit.
if ($context['require_agreement'])
echo '

if (!document.forms.creator.regagree.checked)
{
alert("'
$txt['register_agree'], '");
return false;
}'
;

// Otherwise, let it through.
echo '

return true;
}'
;

if ($context['require_agreement'])
echo '
function checkAgree()
{
document.forms.creator.regSubmit.disabled = isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.email) || isEmptyText(document.forms.creator.passwrd1) || !document.forms.creator.regagree.checked;
setTimeout("checkAgree();", 1000);
}
setTimeout("checkAgree();", 1000);'
;

if ($context['visual_verification'])
{
echo '
function refreshImages()
{
// Make sure we are using a new rand code.
var new_url = new String("'
$context['verificiation_image_href'], '");
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);

// Quick and dirty way of converting decimal to hex
var hexstr = "0123456789abcdef";
for(var i=0; i < 32; i++)
new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);'
;

if ($context['use_graphic_library'])
echo '
document.getElementById("verificiation_image").src = new_url;'
;
else
echo '
document.getElementById("verificiation_image_1").src = new_url + ";letter=1";
document.getElementById("verificiation_image_2").src = new_url + ";letter=2";
document.getElementById("verificiation_image_3").src = new_url + ";letter=3";
document.getElementById("verificiation_image_4").src = new_url + ";letter=4";
document.getElementById("verificiation_image_5").src = new_url + ";letter=5";'
;
<