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 the mod (https://custom.simplemachines.org/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: (http://www.simplemachines.org/site_images/lang/english.gif)




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


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.

// 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?

(http://i18.photobucket.com/albums/b117/nancie0711/errorcantsee.jpg)
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 :

8: Undefined index: country_flag
File: me\smf\Themes\default\Register.template.php (before sub template - eval?)
Line: 90

This is line 90:

// 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

// 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:

// 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
QuoteIn 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 '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
Quotewould 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
Quote from: Jay The Code Monkey 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.

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
Quote from: Jay The Code Monkey on August 17, 2006, 10:33:32 PM
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.

(http://img.photobucket.com/albums/v253/Polymath/flags.jpg)
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:

(http://www.german-pride.com/CRAP/countryhelp.png)

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


// 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

(http://www.boxer-france.com/Galerie_Vos_photos/4chiots.jpg)
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
Quote from: VegasBoxers on August 20, 2006, 02:59:13 AM
What do I edit on the Modsettings.php file?

Sincerest Thanks!
VB

(http://www.boxer-france.com/Galerie_Vos_photos/4chiots.jpg)
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
Quote from: AwwLilMaggie on August 20, 2006, 06:41:18 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

// 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

// 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
// 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
Quote from: 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

Agree, he can create nice mods  :P
Title: Re: CountryFlags
Post by: mforum on August 20, 2006, 08:28:54 AM
Quote from: Assistance on August 20, 2006, 07:34:29 AM
yours

// 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
// 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
Quote from: Jay The Code Monkey 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.

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

if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))

to

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 :
<td class="windowbg" align="left">', $member['link'], '</td>

Replace :
<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 :
', $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 :
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
Quote from: 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>

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

      '',
         // 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

         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:
// 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
Quote from: Jay The Code Monkey 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.

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
Quote from: Jay The Code Monkey on August 22, 2006, 01:37:01 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:

QuoteInstalling 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


   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

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
Quote from: 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

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
Quote from: 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 ?

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
Quote from: 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 ?
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

Quote7. 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

<?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

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  ::)
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.

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:


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
Quote from: 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.

  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

// 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 ;-(

(http://uotc.freeyellow.com/noflaginpost.gif)
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
Quote from: 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.
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
Quote from: JayBachatero on October 22, 2006, 10:32:05 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
Quote from: 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.
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
Quote from: JayBachatero on October 23, 2006, 01:09:16 AM
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
Quote from: JayBachatero on October 23, 2006, 10:10:56 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
Quote from: JayBachatero on October 23, 2006, 11:17:27 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
Quote from: JayBachatero on October 25, 2006, 08:24:44 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
Quote from: JayBachatero on October 25, 2006, 08:46:56 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

Quote from: JayBachatero on October 31, 2006, 06:35:06 PM
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
Quote from: JayBachatero on October 31, 2006, 08:48:46 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
Quote from: 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.

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
Quote from: JayBachatero on October 31, 2006, 11:32:32 PM
Yes is inside the archive.

okay I searched the install.xml file and I found this called out about the profile.template.php file:
<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
Quote from: JayBachatero on November 01, 2006, 08:22:47 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
Quote from: VegasBoxers on November 01, 2006, 11:59:04 AM
Quote from: JayBachatero on November 01, 2006, 08:22:47 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

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
Quote from: JayBachatero on November 01, 2006, 11:11:39 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
Quote from: JayBachatero on November 02, 2006, 08:06:59 AM
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
Quote from: VegasBoxers on November 02, 2006, 01:28:34 PM
Quote from: JayBachatero on November 02, 2006, 08:06:59 AM
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
QuoteIt 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...

(http://www.choice-online-gaming.com/images/flagselecterror.jpg)
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
Quote from: JayBachatero on November 21, 2006, 10:09:12 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
Quote from: 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.

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
Quote from: JayBachatero on December 12, 2006, 12:34:31 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
Quote from: KGIII on December 12, 2006, 03:41:32 PM
Quote from: JayBachatero on December 12, 2006, 12:34:31 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.
When you have too many mods it's prone to fail in ModSettings.php.

Quote from: Amon777 on December 13, 2006, 02:11:50 AM
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
Quote from: JayBachatero on August 20, 2006, 01:34:15 PM
Fixed. 

For those of you that have this problem just change

if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))

to

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
// Old style tabs?
add this:
$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
<td colspan="12">

You should change all the 12 in them to ',$colnums,' so the td will look like this:
<td colspan="',$colnums,'">

And now the real thing. We are going to add a new column for the table. Find this:
<td class="windowbg" align="left">', $member['link'], '</td>

and after that insert these lines:

<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

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


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


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


and after it add that:

'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),


Find the line

// Select the members from the database.

and before it add these:

if ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';

Replace that line

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

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

// Search for messengers...

insert that:

// 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
Quote from: 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 :(

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
Quote from: 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'; >:(

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
Quote from: 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.

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




Quote from: Dhekelian on January 21, 2007, 06:02:24 PM
Quote from: 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.

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
Quote from: 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
// Old style tabs?
add this:
$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
<td colspan="12">

You should change all the 12 in them to ',$colnums,' so the td will look like this:
<td colspan="',$colnums,'">

And now the real thing. We are going to add a new column for the table. Find this:
<td class="windowbg" align="left">', $member['link'], '</td>

and after that insert these lines:

<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

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


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


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


and after it add that:

'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),


Find the line

// Select the members from the database.

and before it add these:

if ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';

Replace that line

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

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

// Search for messengers...

insert that:

// 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
<?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

<?php
/**********************************************************************************
* Memberlist.php                                                                  *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* 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:

(http://runepixels.com/uimages3/countryflagerror.png)

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
Quote from: JayBachatero on February 18, 2007, 01:14:46 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
Quote from: Iggiecat on February 18, 2007, 03:31:24 PM
I"m worried about installing this mod as i see this error:

(http://runepixels.com/uimages3/countryflagerror.png)

what would cause this?

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

Quote from: linders on February 19, 2007, 11:25:21 AM
Quote from: JayBachatero on February 18, 2007, 01:14:46 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
You need these strings.  Just need to translate them.

// 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';


Quote from: 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?
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
Quote from: 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.  :(
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
Quote from: 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...
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
Quote from: JayBachatero on February 26, 2007, 10:31:14 AM
Quote from: 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.  :(
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
Quote from: Crimson 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

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
Quote from: Marianita on March 06, 2007, 02:19:18 PM
Quote from: JayBachatero on February 26, 2007, 10:31:14 AM
Quote from: 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.  :(
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
Quote from: 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.

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.

Quote8: 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

if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)

to

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
Quote from: 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.

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
Quote from: folkandfaith on April 14, 2007, 10:49:51 PM
Quote from: 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.

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
Quote from: 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

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
Quote from: Chucky on May 14, 2007, 08:56:37 AM
Quote from: 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

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
Quote from: 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...
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:

// Show the member's gender icon?

The expected was with a bit of spacing to make the code easier to read:

// 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
Quote from: 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

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
Quote from: 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.

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
Quote from: 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.

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.

(http://img519.imageshack.us/img519/5026/sn15hr0.th.gif) (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...


// 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.

Quote8: 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:


// 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
Quote from: 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. ;)

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

<b>', $message['member']['link'], '</b>';

Add After

// 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
Quote from: hadesflames on June 29, 2007, 01:37:16 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
Quote from: 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.

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
QuoteIt 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
Quote from: 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.

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


{
$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

{
$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
QuoteMod 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 ?>...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:
Quote from: 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 :)
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 $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
Quote from: Alundra on October 21, 2007, 02:34:55 AM
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:

</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:

</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:


// 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:


// 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
Quote from: alving on November 02, 2007, 07:47:05 AM
thanks truesatan!

My pleasure!
Title: Re: CountryFlags
Post by: perro88 on November 03, 2007, 08:02:14 PM
Quote from: 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.
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
Quote from: 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!
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
Quote from: 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.
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
Quote from: 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.
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


<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 :)

Quote from: Sabre™ on February 24, 2008, 02:36:57 PMHi 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
Quote from: TrueSatan on March 05, 2008, 11:03:28 AM
@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
(http://img137.imageshack.us/img137/5361/slovakiaa01qq6.gif)

looks alot better than this
(http://img186.imageshack.us/img186/7505/skpp1.png)

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

// 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

// 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:
// 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:
// 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..
(http://img150.imageshack.us/img150/9219/78000043tg3.png)
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
Quote from: 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?

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:

QuoteParse 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
Quote from: 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.

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
Quote from: Rawpaleoforum on May 21, 2008, 11:49:02 PM
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
Quote from: 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 :)

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
Quote from: 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?

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
Quote from: Rawpaleoforum 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?

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:

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


and 2nd:

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
Quote from: 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

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
Quote from: 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?


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: Apllicmz on August 24, 2008, 04:48:09 PM
when update puty portuguese and brazilian

</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
Quote from: shelzmike on August 05, 2008, 01:50:15 PM
Quote from: 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?


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*


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
<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

<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
<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
Quote from: 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.

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
// 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
// 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



// 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

$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
Quote from: Papa on July 31, 2008, 09:48:08 PM
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
Quote from: AlenNS on November 08, 2008, 09:24:49 AM
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
Quote from: TheListener on April 13, 2009, 06:41:23 AM
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
Quote from: J Dub on May 08, 2009, 11:42:18 AM
.... 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 :)

Quote from: Sabre™ on May 08, 2009, 05:28:45 PM
Quote from: J Dub on May 08, 2009, 11:42:18 AM
.... 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 :)

Quote from: Sabre™ on May 08, 2009, 05:36:44 PM
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??/

./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
Quote from: bluesinjid on June 13, 2009, 09:49:01 PM
hi anyone know where to edit this??/

./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
Quote from: 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 ;)

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
Quote from: 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 :)

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
Quote from: 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 :)

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
Quote from: mark3 on August 16, 2009, 07:09:21 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.

Quote from: 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!

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)

Quote from: 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?

It should be possible buddy.
Good luck :)
Title: Re: CountryFlags
Post by: bbmtalk on September 03, 2009, 05:09:46 PM
Quote from: Sabre™ on September 03, 2009, 04:31:29 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?

// 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
Quote from: bbmtalk on July 23, 2009, 09:38:22 PM
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
Quote from: qayyom on September 25, 2009, 03:36:31 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
Quote from: 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.

Okay. Thanks for the update.
Title: Re: CountryFlags
Post by: Sabre™ on September 25, 2009, 08:10:07 AM
Quote from: 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.

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
Quote from: Lolafish on September 25, 2009, 07:59:48 AM
Quote from: qayyom on September 25, 2009, 03:36:31 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?

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.
<?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";'
;
echo '
}'
;
}

echo '
// ]]></script>

<form action="'
$scripturl'?action=register2" method="post" accept-charset="'$context['character_set'], '" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
<tr class="titlebg">
<td>'
$txt[97], ' - '$txt[517], '</td>
</tr><tr class="windowbg">
<td width="100%">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td width="40%">
<b>'
$txt[98], ':</b>
<div class="smalltext">'
$txt[520], '</div>
</td>
<td>
<input type="text" name="user" size="20" tabindex="'
$context['tabindex']++, '" maxlength="25" />
</td>
</tr><tr>
<td width="40%">
<b>'
$txt[69], ':</b>
<div class="smalltext">'
$txt[679], '</div>
</td>
<td>
<input type="text" name="email" size="30" tabindex="'
$context['tabindex']++, '" />';

// Are they allowed to hide their email?
if ($context['allow_hide_email'])
echo '
<label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> '
$txt[721], '</label>';

echo '
</td>
</tr><tr>
<td width="40%">
<b>'
$txt[81], ':</b>
</td>
<td>
<input type="password" name="passwrd1" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr><tr>
<td width="40%">
<b>'
$txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr>'
;

if ($context['visual_verification'])
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>'
$txt['visual_verification_label'], ':</b>
<div class="smalltext">'
$txt['visual_verification_description'], '</div>
</td>
<td>'
;
if ($context['use_graphic_library'])
echo '
<img src="'
$context['verificiation_image_href'], '" alt="'$txt['visual_verification_description'], '" id="verificiation_image" /><br />';
else
echo '
<img src="'
$context['verificiation_image_href'], ';letter=1" alt="'$txt['visual_verification_description'], '" id="verificiation_image_1" />
<img src="'
$context['verificiation_image_href'], ';letter=2" alt="'$txt['visual_verification_description'], '" id="verificiation_image_2" />
<img src="'
$context['verificiation_image_href'], ';letter=3" alt="'$txt['visual_verification_description'], '" id="verificiation_image_3" />
<img src="'
$context['verificiation_image_href'], ';letter=4" alt="'$txt['visual_verification_description'], '" id="verificiation_image_4" />
<img src="'
$context['verificiation_image_href'], ';letter=5" alt="'$txt['visual_verification_description'], '" id="verificiation_image_5" />';
echo '
<input type="text" name="visual_verification_code" size="30" tabindex="'
$context['tabindex']++, '" />
<div class="smalltext">
<a href="'
$context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">'$txt['visual_verification_sound'], '</a> | <a href="'$scripturl'?action=register" onclick="refreshImages(); return false;">'$txt['visual_verification_request_new'], '</a>
</div>
</td>
</tr>'
;
}


// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == || $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'">'$name'</option>';

echo '
</select>
<img id="flags" src="'
$settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>'
;
}
// Are there any verification questions to answer?
if (!empty($modSettings['anti_spam_ver_enable']))
{
if (!empty($modSettings['anti_spam_ver_ques_1']))
echo '
<tr valign="top">
<td width="40%">
<b>'
$modSettings['anti_spam_ver_ques_1'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_1" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr>'
;
if (!empty($modSettings['anti_spam_ver_ques_2']))
echo '
<tr valign="top">
<td width="40%">
<b>'
$modSettings['anti_spam_ver_ques_2'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_2" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr>'
;
if (!empty($modSettings['anti_spam_ver_ques_3']))
echo '
<tr valign="top">
<td width="40%">
<b>'
$modSettings['anti_spam_ver_ques_3'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_3" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr>'
;
if (!empty($modSettings['anti_spam_ver_ques_4']))
echo '
<tr valign="top">
<td width="40%">
<b>'
$modSettings['anti_spam_ver_ques_4'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_4" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr>'
;
if (!empty($modSettings['anti_spam_ver_ques_5']))
echo '
<tr valign="top">
<td width="40%">
<b>'
$modSettings['anti_spam_ver_ques_5'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_5" size="30" tabindex="'
$context['tabindex']++, '" />
</td>
</tr>'
;
}

// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
echo '
<tr>
<td colspan="2" align="center" style="padding-top: 1ex;">
<label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="'
$context['tabindex']++, '" class="check" /> <b>'$context['coppa_desc'], '.</b></label>
</td>
</tr>'
;

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

// Require them to agree here?
if ($context['require_agreement'])
echo '
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="5" class="tborder" style="border-top: 0;">
<tr>
<td class="windowbg2" style="padding-top: 8px; padding-bottom: 8px;">
'
$context['agreement'], '
</td>
</tr><tr>
<td align="center" class="windowbg2">
<label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /> <b>'
$txt[585], '</b></label>
</td>
</tr>
</table>'
;

echo '
<br />
<div align="center">
<input type="submit" name="regSubmit" value="'
$txt[97], '" />
</div>
</form>'
;

// Uncheck the agreement thing....
if ($context['require_agreement'])
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.creator.regagree.checked = false;
document.forms.creator.regSubmit.disabled = !document.forms.creator.regagree.checked;
// ]]></script>'
;
}

// After registration... all done ;).
function template_after()
{
global $context$settings$options$txt$scripturl;

// Not much to see here, just a quick... "you're now registered!" or what have you.
echo '
<br />
<table border="0" width="80%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr class="titlebg">
<td>'
$context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">'
$context['description'], '<br /><br /></td>
</tr>
</table>
<br />'
;
}

// Template for giving instructions about COPPA activation.
function template_coppa()
{
global $context$settings$options$txt$scripturl;

// Formulate a nice complicated message!
echo '
<br />
<table width="60%" cellpadding="4" cellspacing="0" border="0" class="tborder" align="center">
<tr class="titlebg">
<td>'
$context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">'
$context['coppa']['body'], '<br /></td>
</tr><tr class="windowbg">
<td align="center">
<a href="'
$scripturl'?action=coppa;form;member='$context['coppa']['id'], '" target="_blank">'$txt['coppa_form_link_popup'], '</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="'$scripturl'?action=coppa;form;dl;member='$context['coppa']['id'], '">'$txt['coppa_form_link_download'], '</a><br /><br />
</td>
</tr><tr class="windowbg">
<td align="left">'
$context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</td>
</tr>'
;

// Can they send by post?
if (!empty($context['coppa']['post']))
{
echo '
<tr class="windowbg">
<td align="left"><b>1) '
$txt['coppa_send_by_post'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
'
$context['coppa']['post'], '
</div>
</td>
</tr>'
;
}

// Can they send by fax??
if (!empty($context['coppa']['fax']))
{
echo '
<tr class="windowbg">
<td align="left"><b>'
, !empty($context['coppa']['post']) ? '2' '1'') '$txt['coppa_send_by_fax'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
'
$context['coppa']['fax'], '
</div>
</td>
</tr>'
;
}

// Offer an alternative Phone Number?
if ($context['coppa']['phone'])
{
echo '
<tr class="windowbg" style="padding-bottom: 1ex;">
<td align="left">'
$context['coppa']['phone'], '</td>
</tr>'
;
}
echo '
</table>
<br />'
;
}

// An easily printable form for giving permission to access the forum for a minor.
function template_coppa_form()
{
global $context$settings$options$txt$scripturl;

// Show the form (As best we can)
echo '
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr>
<td align="left">'
$context['forum_contacts'], '</td>
</tr><tr>
<td align="right">
<i>'
$txt['coppa_form_address'], '</i>: '$context['ul'], '<br />
'
$context['ul'], '<br />
'
$context['ul'], '<br />
'
$context['ul'], '
</td>
</tr><tr>
<td align="right">
<i>'
$txt['coppa_form_date'], '</i>: '$context['ul'], '
<br /><br />
</td>
</tr><tr>
<td align="left">
'
$context['coppa_body'], '
</td>
</tr>
</table>
<br />'
;
}

// Show a window containing the spoken verification code.
function template_verification_sound()
{
global $context$settings$options$txt$scripturl;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css" />
<style type="text/css">'
;

// Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are bigger...)
if ($context['browser']['needs_size_fix'])
echo '
@import('
$settings['default_theme_url'], '/fonts-compat.css);';

// Just show the help text and a "close window" link.
echo '
</style>
</head>
<body style="margin: 1ex;">
<div class="popuptext">'
;
if ($context['browser']['is_ie'])
echo '
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
<param name="AutoStart" value="1" />
<param name="FileName" value="'
$context['verificiation_sound_href'], ';format=.wav" />
</object>'
;
else
echo '
<object type="audio/x-wav" data="'
$context['verificiation_sound_href'], ';format=.wav">
<a href="'
$context['verificiation_sound_href'], ';format=.wav">'$context['verificiation_sound_href'], ';format=.wav</a>
</object>'
;
echo '
<br />
<a href="'
$context['verificiation_sound_href'], ';sound">'$txt['visual_verification_sound_again'], '</a><br />
<a href="javascript:self.close();">'
$txt['visual_verification_sound_close'], '</a><br />
<a href="'
$context['verificiation_sound_href'], ';format=.wav">'$txt['visual_verification_sound_direct'], '</a>
</div>
</body>
</html>'
;
}

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

echo '
<form action="'
$scripturl'?action=regcenter" method="post" accept-charset="'$context['character_set'], '" name="postForm" id="postForm">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function onCheckChange()
{
if (document.forms.postForm.emailActivate.checked || document.forms.postForm.password.value == \'\')
{
document.forms.postForm.emailPassword.disabled = true;
document.forms.postForm.emailPassword.checked = true;
}
else
document.forms.postForm.emailPassword.disabled = false;
}
// ]]></script>
<table border="0" cellspacing="0" cellpadding="4" align="center" width="70%" class="tborder">
<tr class="titlebg">
<td colspan="2" align="center">'
$txt['admin_browse_register_new'], '</td>
</tr>'
;
if (!empty($context['registration_done']))
echo '
<tr class="windowbg2">
<td colspan="2" align="center"><br />
'
$context['registration_done'], '
</td>
</tr><tr class="windowbg2">
<td colspan="2" align="center"><hr /></td>
</tr>'
;
echo '
<tr class="windowbg2">
<th width="50%" align="right">
<label for="user_input">'
$txt['admin_register_username'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_register_username_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="user" id="user_input" size="30" maxlength="25" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="email_input">'
$txt['admin_register_email'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_register_email_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="email" id="email_input" size="30" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_input">'
$txt['admin_register_password'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_register_password_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="password" name="password" id="password_input" size="30" onchange="onCheckChange();" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="group_select">'
$txt['admin_register_group'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_register_group_desc'], '</div>
</th>
<td width="50%" align="left">
<select name="group" id="group_select">'
;

foreach ($context['member_groups'] as $id => $name)
echo '
<option value="'
$id'">'$name'</option>';
echo '
</select><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailPassword_check">'
$txt['admin_register_email_detail'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_register_email_detail_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailPassword" id="emailPassword_check" checked="checked" disabled="disabled" class="check" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailActivate_check">'
$txt['admin_register_email_activate'], ':</label>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailActivate" id="emailActivate_check"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == ' checked="checked"' ''' onclick="onCheckChange();" class="check" /><br />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="right">
<input type="submit" name="regSubmit" value="'
$txt[97], '" />
<input type="hidden" name="sa" value="register" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</form>'
;
}

// Form for editing the agreement shown for people registering to the forum.
function template_edit_agreement()
{
global $context$settings$options$scripturl$txt;

// Just a big box to edit the text file ;).
echo '
<form action="'
$scripturl'?action=regcenter" method="post" accept-charset="'$context['character_set'], '">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="80%" class="tborder">
<tr class="titlebg">
<td align="center">'
$txt['smf11'], '</td>
</tr>'
;

// Warning for if the file isn't writable.
if (!empty($context['warning']))
echo '
<tr class="windowbg2">
<td style="color: red; font-weight: bold;" align="center">
'
$context['warning'], '
</td>
</tr>'
;
echo '
<tr class="windowbg2">
<td align="center" style="padding-bottom: 1ex; padding-top: 2ex;">'
;

// Show the actual agreement in an oversized text box.
echo '
<textarea cols="70" rows="20" name="agreement" style="width: 94%; margin-bottom: 1ex;">'
$context['agreement'], '</textarea><br />
<label for="requireAgreement"><input type="checkbox" name="requireAgreement" id="requireAgreement"'
$context['require_agreement'] ? ' checked="checked"' ''' value="1" /> '$txt[584], '.</label><br />
<br />
<input type="submit" value="'
$txt[10], '" />
<input type="hidden" name="sa" value="agreement" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</form>'
;
}

function 
template_edit_reserved_words()
{
global $context$settings$options$scripturl$txt;

echo '
<form action="'
$scripturl'?action=regcenter" method="post" accept-charset="'$context['character_set'], '">
<table border="0" cellspacing="1" class="bordercolor" align="center" cellpadding="4" width="80%">
<tr class="titlebg">
<td align="center">
'
$txt[341], '
</td>
</tr><tr>
<td class="windowbg2" align="center">
<div style="width: 80%;">
<div style="margin-bottom: 2ex;">'
$txt[342], '</div>
<textarea cols="30" rows="6" name="reserved" style="width: 98%;">'
implode("\n"$context['reserved_words']), '</textarea><br />

<div align="left" style="margin-top: 2ex;">
<label for="matchword"><input type="checkbox" name="matchword" id="matchword" '
$context['reserved_word_options']['match_word'] ? 'checked="checked"' ''' class="check" /> '$txt[726], '</label><br />
<label for="matchcase"><input type="checkbox" name="matchcase" id="matchcase" '
$context['reserved_word_options']['match_case'] ? 'checked="checked"' ''' class="check" /> '$txt[727], '</label><br />
<label for="matchuser"><input type="checkbox" name="matchuser" id="matchuser" '
$context['reserved_word_options']['match_user'] ? 'checked="checked"' ''' class="check" /> '$txt[728], '</label><br />
<label for="matchname"><input type="checkbox" name="matchname" id="matchname" '
$context['reserved_word_options']['match_name'] ? 'checked="checked"' ''' class="check" /> '$txt[729], '</label><br />
</div>

<input type="submit" value="'
$txt[10], '" name="save_reserved_names" style="margin: 1ex;" />
</div>
</td>
</tr>
</table>
<input type="hidden" name="sa" value="reservednames" />
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</form>'
;
}

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

// Javascript for the verification image.
if ($context['use_graphic_library'])
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refreshImages()
{
var imageType = document.getElementById(\'visual_verification_type_select\').value;
document.getElementById(\'verificiation_image\').src = \''
$context['verificiation_image_href'], ';type=\' + imageType;
}
// ]]></script>'
;
}

echo '
<form action="'
$scripturl'?action=regcenter" method="post" accept-charset="'$context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="tborder">
<tr class="titlebg">
<td align="center">'
$txt['settings'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">'
;

// Functions to do some nice box disabling dependant on age restrictions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function checkCoppa()
{
var coppaDisabled = document.getElementById(\'coppaAge_input\').value == 0;
document.getElementById(\'coppaType_select\').disabled = coppaDisabled;

var disableContacts = coppaDisabled || document.getElementById(\'coppaType_select\').options[document.getElementById(\'coppaType_select\').selectedIndex].value != 1;
document.getElementById(\'coppaPost_input\').disabled = disableContacts;
document.getElementById(\'coppaFax_input\').disabled = disableContacts;
document.getElementById(\'coppaPhone_input\').disabled = disableContacts;
}
// ]]></script>'
;
echo '
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2">
<th width="50%" align="right">
<label for="registration_method_select">'
$txt['admin_setting_registration_method'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=registration_method" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="registration_method" id="registration_method_select">
<option value="0"'
, empty($modSettings['registration_method']) ? ' selected="selected"' '''>'$txt['admin_setting_registration_standard'], '</option>
<option value="1"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == ' selected="selected"' '''>'$txt['admin_setting_registration_activate'], '</option>
<option value="2"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == ' selected="selected"' '''>'$txt['admin_setting_registration_approval'], '</option>
<option value="3"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == ' selected="selected"' '''>'$txt['admin_setting_registration_disabled'], '</option>
</select>
</td>
</tr>
<tr class="windowbg2">
<th width="50%" align="right">
<label for="notify_new_registration_check">'
$txt['admin_setting_notify_new_registration'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="notify_new_registration" id="notify_new_registration_check" '
, !empty($modSettings['notify_new_registration']) ? 'checked="checked"' ''' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="send_welcomeEmail_check">'
$txt['admin_setting_send_welcomeEmail'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=send_welcomeEmail" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="send_welcomeEmail" id="send_welcomeEmail_check"'
, !empty($modSettings['send_welcomeEmail']) ? ' checked="checked"' ''' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_strength_select">'
$txt['admin_setting_password_strength'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=password_strength" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="password_strength" id="password_strength_select">
<option value="0"'
, empty($modSettings['password_strength']) ? ' selected="selected"' '''>'$txt['admin_setting_password_strength_low'], '</option>
<option value="1"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == ' selected="selected"' '''>'$txt['admin_setting_password_strength_medium'], '</option>
<option value="2"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == ' selected="selected"' '''>'$txt['admin_setting_password_strength_high'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="visual_verification_type_select">
'
$txt['admin_setting_image_verification_type'], ':<br />
<span class="smalltext" style="font-weight: normal;">
'
$txt['admin_setting_image_verification_type_desc'], '
</span>
</label>
</th>
<td width="50%" align="left">
<select name="visual_verification_type" id="visual_verification_type_select" '
$context['use_graphic_library'] ? 'onchange="refreshImages();"' '''>
<option value="1" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 'selected="selected"' '''>'$txt['admin_setting_image_verification_off'], '</option>
<option value="2" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 'selected="selected"' '''>'$txt['admin_setting_image_verification_vsimple'], '</option>
<option value="3" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 'selected="selected"' '''>'$txt['admin_setting_image_verification_simple'], '</option>
<option value="0" '
, empty($modSettings['disable_visual_verification']) ? 'selected="selected"' '''>'$txt['admin_setting_image_verification_medium'], '</option>
<option value="4" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 'selected="selected"' '''>'$txt['admin_setting_image_verification_high'], '</option>
</select><br />'
;
if ($context['use_graphic_library'])
echo '
<img src="'
$context['verificiation_image_href'], ';type=', empty($modSettings['disable_visual_verification']) ? $modSettings['disable_visual_verification'], '" alt="'$txt['admin_setting_image_verification_sample'], '" id="verificiation_image" /><br />';
else
{
echo '
<span class="smalltext">'
$txt['admin_setting_image_verification_nogd'], '</span>';
}
echo '
</td>
</tr>
</table>
</td>
</tr>
<tr class="titlebg">
<td align="center">'
$txt['anti_spam_ver_title'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2">
<th width="50%" align="right">
<label for="anti_spam_ver_enable_check">'
$txt['anti_spam_ver_enable'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="anti_spam_ver_enable" id="anti_spam_ver_enable_check"'
, !empty($modSettings['anti_spam_ver_enable']) ? ' checked="checked"' ''' class="check" />
</td>
</tr><tr class="windowbg2">
<td colspan="2">'
$txt['anti_spam_ver_descr'], '</td>
</tr><tr class="windowbg2">
<td width="50%" align="center">
<b>'
$txt['anti_spam_ver_ques_col'], '</b>
</td>
<td width="50%" align="center">
<b>'
$txt['anti_spam_ver_ans_col'], '</b>
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_1" id="anti_spam_ver_ques_1_input" value="'
, !empty($modSettings['anti_spam_ver_ques_1']) ? $modSettings['anti_spam_ver_ques_1'] : '''" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_1" id="anti_spam_ver_ans_1_input" value="'
, !empty($modSettings['anti_spam_ver_ans_1']) ? $modSettings['anti_spam_ver_ans_1'] : '''" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_2" id="anti_spam_ver_ques_2_input" value="'
, !empty($modSettings['anti_spam_ver_ques_2']) ? $modSettings['anti_spam_ver_ques_2'] : '''" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_2" id="anti_spam_ver_ans_2_input" value="'
, !empty($modSettings['anti_spam_ver_ans_2']) ? $modSettings['anti_spam_ver_ans_2'] : '''" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_3" id="anti_spam_ver_ques_3_input" value="'
, !empty($modSettings['anti_spam_ver_ques_3']) ? $modSettings['anti_spam_ver_ques_3'] : '''" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_3" id="anti_spam_ver_ans_3_input" value="'
, !empty($modSettings['anti_spam_ver_ans_3']) ? $modSettings['anti_spam_ver_ans_3'] : '''" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_4" id="anti_spam_ver_ques_4_input" value="'
, !empty($modSettings['anti_spam_ver_ques_4']) ? $modSettings['anti_spam_ver_ques_4'] : '''" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_4" id="anti_spam_ver_ans_4_input" value="'
, !empty($modSettings['anti_spam_ver_ans_4']) ? $modSettings['anti_spam_ver_ans_4'] : '''" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_5" id="anti_spam_ver_ques_5_input" value="'
, !empty($modSettings['anti_spam_ver_ques_5']) ? $modSettings['anti_spam_ver_ques_5'] : '''" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_5" id="anti_spam_ver_ans_5_input" value="'
, !empty($modSettings['anti_spam_ver_ans_5']) ? $modSettings['anti_spam_ver_ans_5'] : '''" size="60%" maxlength="60" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="titlebg">
<td align="center">'
$txt['anti_spam_ver_coppa'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaAge_input">'
$txt['admin_setting_coppaAge'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=coppaAge" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_setting_coppaAge_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaAge" id="coppaAge_input" value="'
, !empty($modSettings['coppaAge']) ? $modSettings['coppaAge'] : '''" size="3" maxlength="3" onkeyup="checkCoppa();" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaType_select">'
$txt['admin_setting_coppaType'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=coppaType" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="coppaType" id="coppaType_select" onchange="checkCoppa();">
<option value="0"'
, empty($modSettings['coppaType']) ? ' selected="selected"' '''>'$txt['admin_setting_coppaType_reject'], '</option>
<option value="1"'
, !empty($modSettings['coppaType']) && $modSettings['coppaType'] == ' selected="selected"' '''>'$txt['admin_setting_coppaType_approval'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPost_input">'
$txt['admin_setting_coppaPost'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<textarea name="coppaPost" id="coppaPost_input" rows="4" cols="35">'
$context['coppaPost'], '</textarea>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaFax_input">'
$txt['admin_setting_coppaFax'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaFax" id="coppaFax_input" value="'
, !empty($modSettings['coppaFax']) ? $modSettings['coppaFax'] : '''" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPhone_input">'
$txt['admin_setting_coppaPhone'], '</label> <span style="font-weight: normal;">(<a href="'$scripturl'?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
$txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaPhone" id="coppaPhone_input" value="'
, !empty($modSettings['coppaPhone']) ? $modSettings['coppaPhone'] : '''" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="3" align="right">
<input type="submit" name="save" value="'
$txt[10], '" />
<input type="hidden" name="sa" value="settings" />
</td>
</tr>
</table>'
;

// Handle disabling of some of the input boxes.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

if (empty($modSettings['coppaAge']) || empty($modSettings['coppaType']))
echo '
document.getElementById(\'coppaPost_input\').disabled = true;
document.getElementById(\'coppaFax_input\').disabled = true;
document.getElementById(\'coppaPhone_input\').disabled = true;'
;
if (empty($modSettings['coppaAge']))
echo '
document.getElementById(\'coppaType_select\').disabled = true;'
;

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

?>


Title: Re: CountryFlags
Post by: JBlaze on October 08, 2009, 04:41:58 PM
Edited your post to put it inside code tags.

Now, remove the mod, ignoring the error. Then, once it has been removed, replace your Register.template.php with this one.
Title: Re: CountryFlags
Post by: Paul_Pauline on October 08, 2009, 05:06:40 PM
Hiya !

Many thanks for all you help, I like this mod & the only reason I was uninstalling it was so I could install the updated version when you have had the time to do it, (ie, England, Scotland, Wales in the options to choose from).

I seem to have managed to follow your instructions, and my board hasn't crashed & burned  :)

It's a good job someone knows what they are doing, lol !

Thanks again, Paul.
Title: Re: CountryFlags
Post by: Powerbob on October 16, 2009, 07:29:38 AM
Yes Blaze, your mod in RC2 will be fantastic 8)
Title: Re: CountryFlags
Post by: JBlaze on October 16, 2009, 07:32:19 AM
Quote from: Paul_Pauline on October 08, 2009, 05:06:40 PM
Hiya !

Many thanks for all you help, I like this mod & the only reason I was uninstalling it was so I could install the updated version when you have had the time to do it, (ie, England, Scotland, Wales in the options to choose from).

I seem to have managed to follow your instructions, and my board hasn't crashed & burned  :)

It's a good job someone knows what they are doing, lol !

Thanks again, Paul.

Glad to help :)


Quote from: Powerbob on October 16, 2009, 07:29:38 AM
Yes Blaze, your mod in RC2 will be fantastic 8)
I haven't had a chance to work on it lately, but I should get around to it sometime this week :)
Title: Re: CountryFlags
Post by: Powerbob on October 16, 2009, 07:38:29 AM
Look forward to it mate, thanks. 8)
Title: Re: CountryFlags
Post by: Andrew Evenstar on October 17, 2009, 04:04:57 PM
Hello. I'm using a different theme than the default and I can't get the flags to show up on each post. Is there anyone who can help?

I did check the box in the admin settings.
"Show flags on Display page (Where posts are shown)."

Thanks,
Title: Re: CountryFlags
Post by: Arantor on October 17, 2009, 04:07:37 PM
Does your theme have a custom Display.template.php file? If so, you'll need to go to the mod's main page, select your version, select Parse, and repeat the edits it gives you on your theme's Display.template.php file.
Title: Re: CountryFlags
Post by: Andrew Evenstar on October 18, 2009, 01:14:08 PM
I'm kinda new, but what you mean is open up that text file, find those pieces of code and insert the extra code before/after correct?
Title: Re: CountryFlags
Post by: Arantor on October 18, 2009, 01:17:59 PM
Pretty much, yes. The Parse button shows you the same steps the package manager itself would take.
Title: Re: CountryFlags
Post by: Andrew Evenstar on October 18, 2009, 02:13:27 PM
Thanks for your quick responses and help. I've properly configured it.

I have people from all over the world on my boards and this is VERY helpful.
Title: Re: CountryFlags
Post by: W7 riso on October 26, 2009, 09:19:17 AM
Great Mod... only I have a problem!

I'm using 2 simulair Forums and I exported in phpMyAdmin the Memberlist from my first Forum and imported it into my second Forum all went fine but all Country Flags are missing at the second Forum Memberlist.
(At both Forums the Mod was already installed so I only switched the Memberlist)
How do I get the Flags back? the Flags who were already there at the original Memberlist/ Forum
Do I need to copy more besides the Memberlist? perhaps a Template?
Title: Re: CountryFlags
Post by: JBlaze on October 26, 2009, 01:06:04 PM
Quote from: W7 riso on October 26, 2009, 09:19:17 AM
Great Mod... only I have a problem!

I'm using 2 simulair Forums and I exported in phpMyAdmin the Memberlist from my first Forum and imported it into my second Forum all went fine but all Country Flags are missing at the second Forum Memberlist.
(At both Forums the Mod was already installed so I only switched the Memberlist)
How do I get the Flags back? the Flags who were already there at the original Memberlist/ Forum
Do I need to copy more besides the Memberlist? perhaps a Template?


You will need to re-install the package entirely. You are most likely missing the template/source edits as well as the flags folder that contains the images.
Title: Re: CountryFlags
Post by: W7 riso on October 26, 2009, 01:47:15 PM
Tnx for your quick RE:

The CountryFlags Mod is present and was already present at both Forums!, all is present and the Flags Folder as well.
Perhaps this is missing: ''template/source edits''
Pls tell me how the Mod stores the Flags into the users account where to find a list containing this info.

To clear things up: I have 2 Forums both the same version smf 1.1.10 both with the CountryFlag Mod installed, I only want to copy the Memberlist from Forum one to Forum two, all goes fine only the info on the Flags attached to the Members get lost or is not getting copied, so I have a Memberlist with 1300 Members copied but all Flags are gone...
I need to know the template/ file wich contains that info, pls help.
When a Memberlist get copied it contains:
`members` (`ID_MEMBER`, `memberName`, `dateRegistered`, `posts`, `ID_GROUP`, `lngfile`, `lastLogin`, `realName`, `instantMessages`, `unreadMessages`, `buddy_list`, `pm_ignore_list`, `messageLabels`, `passwd`, `emailAddress`, `personalText`, `gender`, `birthdate`, `websiteTitle`, `websiteUrl`, `location`, `ICQ`, `AIM`, `YIM`, `MSN`, `hideEmail`, `showOnline`, `timeFormat`, `signature`, `timeOffset`, `avatar`, `pm_email_notify`, `karmaBad`, `karmaGood`, `usertitle`, `notifyAnnouncements`, `notifyOnce`, `notifySendBody`, `notifyTypes`, `memberIP`, `memberIP2`, `secretQuestion`, `secretAnswer`, `ID_THEME`, `is_activated`, `validation_code`, `ID_MSG_LAST_VISIT`, `additionalGroups`, `smileySet`, `ID_POST_GROUP`, `totalTimeLoggedIn`, `passwordSalt`, `skype`)
CountryFlags is not at the list! that's the reason why the Flag info gets lost I suppose.

riso
Title: Re: CountryFlags
Post by: JBlaze on October 26, 2009, 01:51:09 PM
Just re-install the package via the Package Manager (http://docs.simplemachines.org/index.php?board=49.0;sort=subject)
Title: Re: CountryFlags
Post by: Arantor on October 26, 2009, 04:34:43 PM
The data is stored in smf_themes against the user's id, where the 'variable' is called country.
Title: Re: CountryFlags
Post by: W7 riso on October 27, 2009, 08:20:35 AM
SOLVED ! ! ! Good Tip:
Quote''The data is stored in smf_themes against the user's id, where the 'variable' is called country''
Tnx Arantor

What did I do:
I copied themes from Forum one(windows7) and the complete Memberlist and copied themes and Memberlist** to Forum two(windows8).
**Memberlist Path changed from windows7 to windows8
(By using PhpMyAdmin)

==================

(By using PHP Editor)
I had to change:
theme_url
theme_dir
images_url
(from Forum one's Path to Path Forum two)

Example (in my case I only had to change windows7 into windows8:

From:
(0, 1, 'theme_url', 'http://shared014.nextfactory.nl/windows7/smf/Themes/default'),
(0, 1, 'images_url', 'http://shared014.nextfactory.nl/windows7/smf/Themes/default/images'),
(0, 1, 'theme_dir', '/home/wininfo/domains/shared014.nextfactory.nl/public_html/windows7/smf/Themes/default'

To:
(0, 1, 'theme_url', 'http://shared014.nextfactory.nl/windows8/smf/Themes/default'),
(0, 1, 'images_url', 'http://shared014.nextfactory.nl/windows8/smf/Themes/default/images'),
(0, 1, 'theme_dir', '/home/wininfo/domains/shared014.nextfactory.nl/public_html/windows8/smf/Themes/default'

All Flags are present now  :D
Tnx

riso
Admin.
Title: Re: CountryFlags
Post by: mcgovery on October 27, 2009, 12:42:51 PM
Does anyone know if there is a mod like this out for v2.0? :)
Title: Re: CountryFlags
Post by: Sabre™ on October 29, 2009, 03:19:02 AM
Jblaze is in the process of updating it for smf2 buddy :)
Title: Re: CountryFlags
Post by: mcgovery on October 29, 2009, 04:21:36 PM
Awsome I look forward to getting this one!
Thanks Sabre.
Title: Re: CountryFlags
Post by: 7s-1k on November 13, 2009, 05:26:34 PM
Quote from: Sabre™ on October 29, 2009, 03:19:02 AM
Jblaze is in the process of updating it for smf2 buddy :)

Great!  :D
Title: Re: CountryFlags
Post by: Powerbob on November 14, 2009, 06:28:27 AM
Quote from: Sabre™ on October 29, 2009, 03:19:02 AM
Jblaze is in the process of updating it for smf2 buddy :)

Me t
Quote from: mcgovery on October 29, 2009, 04:21:36 PM
Awsome I look forward to getting this one!
Thanks Sabre.

Me too 8)
Title: Re: CountryFlags
Post by: Andrew Evenstar on November 15, 2009, 01:11:32 PM
This is easily a top 5, top 10 mod for SMF in my opinion. Thanks so much.
Title: Re: CountryFlags
Post by: 7s-1k on November 16, 2009, 05:10:41 PM
Hopefully including SMF 2.0 RC2 support O:)
Title: Re: CountryFlags
Post by: Powerbob on November 17, 2009, 04:29:22 AM
A lot of people waiting for this in RC2 8)
Title: Re: CountryFlags
Post by: JBlaze on November 17, 2009, 05:47:54 AM
RC2 is coming soon :D
Title: Re: CountryFlags
Post by: 7s-1k on November 17, 2009, 06:12:32 AM
Quote from: JBlaze on November 17, 2009, 05:47:54 AM
RC2 is coming soon :D

Great news! :D
Title: Re: CountryFlags
Post by: Kamali on November 17, 2009, 01:39:31 PM
Quote from: Paul_Pauline on September 25, 2009, 09:52:53 AM
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 ?

Hi, I have a new member from Scotland, can anyone tell me how I can make the Scotland appear in the picklist?  (I am using 1.1.10). 
Title: Re: CountryFlags
Post by: JBlaze on November 17, 2009, 09:34:53 PM
Quote from: Kamali on November 17, 2009, 01:39:31 PM
Quote from: Paul_Pauline on September 25, 2009, 09:52:53 AM
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 ?

Hi, I have a new member from Scotland, can anyone tell me how I can make the Scotland appear in the picklist?  (I am using 1.1.10). 

Those countries will be added when the mod is updated for 2.0 RC2
Title: Re: CountryFlags
Post by: Kamali on November 18, 2009, 03:47:14 AM
They won't be added for 1.1.10 at all then?  That's a huge disappointment, as I will have to uninstall it completely now so that one member won't be disadvantaged over the rest.  Ah well, it was nice while we had it.   :(
Title: Re: CountryFlags
Post by: Arantor on November 18, 2009, 03:48:54 AM
I don't think that's what's being said.

The mod need refitting for 2.0, and when the country is added to one, it can be added to the other (right, JBlaze?)
Title: Re: CountryFlags
Post by: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2
Title: Re: CountryFlags
Post by: Kamali on November 18, 2009, 01:30:30 PM
Sorry for misunderstanding, I thought you meant it would only be updated for 2.0.  I am happy to wait for the update for 1.1.10, now I know you will be doing that as well.  :)
Title: Re: CountryFlags
Post by: 7s-1k on November 19, 2009, 07:25:41 AM
Hope to see the release within a week  ;)
Title: Re: CountryFlags
Post by: Sabre™ on November 19, 2009, 07:35:42 AM
Quote from: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2

I've also updated this for RC2 with all the flags(waving/moving flags) and more, but I haven't managed to figure out how to display the image in the reg.
At this early stage of learning RC2, I cannot see what I'm missing.
I just may wait for your update to look at that.
Title: Re: CountryFlags
Post by: hariS. on November 22, 2009, 04:50:21 PM
(http://img689.imageshack.us/img689/3064/71459268.jpg)

How to fix this ? It's not i this square , like nubmer of post's and rank is
Title: Re: CountryFlags
Post by: JBlaze on November 22, 2009, 07:11:02 PM
Quote from: hariS. on November 22, 2009, 04:50:21 PM
(http://img689.imageshack.us/img689/3064/71459268.jpg)

How to fix this ? It's not i this square , like nubmer of post's and rank is

Can you attach your Display.template.php?



Quote from: Sabre™ on November 19, 2009, 07:35:42 AM
Quote from: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2

I've also updated this for RC2 with all the flags(waving/moving flags) and more, but I haven't managed to figure out how to display the image in the reg.
At this early stage of learning RC2, I cannot see what I'm missing.
I just may wait for your update to look at that.

Let me see what you got :)
Title: Re: CountryFlags
Post by: hariS. on November 23, 2009, 04:05:27 AM
Ofc , here you are
Title: Re: CountryFlags
Post by: Sabre™ on November 23, 2009, 08:15:54 PM
At the moment Jblaze, it is exactly what is inserted into smf1's reg template.
I haven't had time to look at it since then, but I'm going to later on today.
Other things are taking priority at the moment ;)

Off topic: a couple months ago I decided to start installing locally to test, instead of on host sites.
Im using Vertrigo, is there another you'd suggest?  I found a few things Im not liking with this one.
Cheers mate :)

@ hariS
Use your windowbg4 class to fix your issue.
Title: Re: CountryFlags
Post by: Arantor on November 23, 2009, 08:16:54 PM
Quote from: Sabre™ on November 23, 2009, 08:15:54 PM
Off topic: a couple months ago I decided to start installing locally to test, instead of on host sites.
Im using Vertrigo, is there another you'd suggest?  I found a few things Im not liking with this one.
Cheers mate :)

Personally I use manual installs of Apache, MySQL and PHP - takes a little longer to set up but once done, it's good and works like it would on a host (more often than not)
Title: Re: CountryFlags
Post by: JBlaze on November 23, 2009, 08:20:14 PM
Quote from: Sabre™ on November 23, 2009, 08:15:54 PM
Off topic: a couple months ago I decided to start installing locally to test, instead of on host sites.
Im using Vertrigo, is there another you'd suggest?  I found a few things Im not liking with this one.
Cheers mate :)

Don't know what Vertrigo is, but I have a complete webserver on my laptop (Apache, PHP, MySQL and PostgreSQL) for all my local testing.
Title: Re: CountryFlags
Post by: Sabre™ on November 23, 2009, 08:23:02 PM
I'm still a novice at best, and haven't attempted or even looked into that approach.
The 'one click installation' of vertrigo grabbed my attention with it's simplicity.
I'll have a look at attempting your fellas way when time permits.

Cheers guys :)
Title: Re: CountryFlags
Post by: hariS. on November 24, 2009, 04:23:05 AM
Hi

Myy problem is related with this mode called "Country Flag MOD".

The problem is with the position and background of the country picture/text , wich won't appear in the square like nubmer of post does etc.

(http://img134.imageshack.us/img134/2043/59189558.jpg) (This is the picture showing the problem ...

MY website link : www.jeditekodjoa.com

I am using SMF 1.1.10

I am using theme called DSV1 from dzinerstudio.com

MOD's installed

(http://img695.imageshack.us/img695/200/55512877.jpg)


And in the attachment there is file wich you may want to use to fix the problem

I had same problem witch "visual warning mod " and "Sabre" edited my "display.template" file and fixed the problem , know he will fix this problem if I post my problem in this topic , assuming other who have the same problem will see this and fix their , Am I right Sabre ?
Title: Re: CountryFlags
Post by: Sabre™ on November 24, 2009, 04:50:43 AM
See if this works buddy :)
Title: Re: CountryFlags
Post by: hariS. on November 24, 2009, 05:49:09 AM
works ofc , well the problem is with br and divs
Title: Re: CountryFlags
Post by: Sabre™ on November 24, 2009, 05:53:52 AM
Is the way it is displayed ok?
I changed it a little.
Title: Re: CountryFlags
Post by: hariS. on November 24, 2009, 05:58:37 AM
well not really correct but here  :

http://img694.imageshack.us/img694/9622/98910237.jpg

AS you can see there are no lines around the flag/text
Title: Re: CountryFlags
Post by: Sabre™ on November 24, 2009, 07:49:24 AM
Sorry about that <br />, I thought I'd removed it.
To fix your new issue, put the </div> that you removed back.
So it should be
<div class="windowbg4"><img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /><br /> ', $flags[$message['member']['options']['country']], '</div>';
Title: Re: CountryFlags
Post by: perplexed on December 02, 2009, 10:25:50 AM
Quote from: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2

any news on the update for 2.0 RC2?

thanks :)
Title: Re: CountryFlags
Post by: Arantor on December 02, 2009, 11:31:46 AM
Not yet, I'd say, quiteperplexed; it'll be done when it's done and JBlaze will then announce it here.
Title: Re: CountryFlags
Post by: perplexed on December 02, 2009, 12:32:03 PM
thanks Arantor, it's a good mod so I'd love to keep it.  Sorry to be posting about updates in so many threads.  Can you tell I'm upgrading?   :P
Title: Re: CountryFlags
Post by: Arantor on December 02, 2009, 12:34:59 PM
I can very much tell you're upgrading - it's a fantastic thing to be doing...
Title: Re: CountryFlags
Post by: perplexed on December 02, 2009, 12:51:07 PM
lol yeah well I had my testforum upgraded for a while, I was just waiting for some "essential" mods to catch up before I did the live forums.  9mins it took - fantastic pain-free stuff!
Title: Re: CountryFlags
Post by: Powerbob on December 05, 2009, 04:28:28 AM
Well, over 40,000 downloads would tend to make this a very popular mod! That makes a heck of a lot of people waiting......... waiting.

A status report would be nice, perhaps even a Beta to help check for bugs.

Thanks
Bob
Title: Re: CountryFlags
Post by: JBlaze on December 05, 2009, 10:52:42 AM
Sorry folks, I've been extremely busy lately and haven't been able to crank this one out. There are a few showstopping bugs in it right now including the fact that the registration won't work.

I'll keep you all updated or if you want constant updates on all my projects, then go to http://forum.thelulz.com
Title: Re: CountryFlags
Post by: Powerbob on December 05, 2009, 03:53:46 PM
Thanks for the update 8)
Title: Re: CountryFlags
Post by: Sabre™ on December 05, 2009, 05:16:01 PM
JBlaze, are you re-writing the whole mod mate?
I merely changed what needed to be in order to integrate with RC2, and all works fine, except the image not being displayed on the reg page. Admittingly, I still haven't bothered to look at that, as the mod functions flawlessly, and that being the only pitfall it is not anything that needs immediate attention.
I can see there are better ways to code certain areas, and can't wait to see how you've approached them.
Title: Re: CountryFlags
Post by: JBlaze on December 05, 2009, 05:24:35 PM
Yep. I rewrote the code practically from scratch.
Title: Re: CountryFlags
Post by: Sabre™ on December 05, 2009, 05:31:13 PM
Nice!!!
If you need any testers with the ability to not only find bugs, but also offer a solution to fix them, then there are plenty people around. But if you need any others, Im here too! lol ;)
Title: Re: CountryFlags
Post by: SEABOY on December 06, 2009, 12:40:53 AM
For who have problme with the flag show in posts under the avatar display that's coz you are using not the default theme so you need to edit Display.template.php located in your current theme and insert this code


// 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 />';
}
Title: Re: CountryFlags
Post by: SEABOY on December 09, 2009, 08:26:58 AM
can you add wales please to the mod or tell me how i can add wales into my forums
Title: Re: CountryFlags
Post by: JBlaze on December 09, 2009, 08:49:21 AM
Find the array in ./Sources/Subs.php that holds all the country info (should be at the bottom of the file)

Add this after 'wt' => 'Wallis and Futana',

'wales' => 'Wales',
Title: Re: CountryFlags
Post by: SEABOY on December 10, 2009, 10:13:02 AM
Thanks bro...it's working now....thanks alot
Title: Re: CountryFlags
Post by: zeon101 on December 20, 2009, 07:06:40 PM
I hope you can get it working for SMF 2 RC2 soon dude! I would love to have this mod! We'd all appreciate so much!  :D
Title: Re: CountryFlags
Post by: Powerbob on December 21, 2009, 12:43:49 AM
Yep we sure would 8)
Title: Re: CountryFlags
Post by: 7s-1k on December 21, 2009, 05:08:57 PM
Agree  :)
Title: Re: CountryFlags
Post by: Powerbob on January 08, 2010, 05:50:55 AM
Any news yet mate?
Title: Re: CountryFlags
Post by: Powerbob on January 08, 2010, 05:53:08 AM
Quote from: JBlaze on December 05, 2009, 10:52:42 AM
Sorry folks, I've been extremely busy lately and haven't been able to crank this one out. There are a few showstopping bugs in it right now including the fact that the registration won't work.

I'll keep you all updated or if you want constant updates on all my projects, then go to http://forum.thelulz.com

Not working I'm afraid!
Title: Re: CountryFlags
Post by: JBlaze on January 08, 2010, 02:32:21 PM
New link. http://www.jblaze.net
Title: Re: CountryFlags
Post by: 7s-1k on January 08, 2010, 03:56:04 PM
hmm
Title: Re: CountryFlags
Post by: Lamarck on January 08, 2010, 09:04:18 PM
Thank you very much,JBlaze,for working on this mod.I'm looking forward a SMF 2.0 RC2 update.
Title: Re: CountryFlags
Post by: Powerbob on January 09, 2010, 02:01:48 AM
Yep, quite a crowd waiting on this one 8)
Title: Re: CountryFlags
Post by: JBlaze on January 09, 2010, 02:10:12 AM
OK, I got it working awesome now. Only problem is that for some reason it's not showing the flag chosen on the register page. Maybe a couple more days before I release it.
Title: Re: CountryFlags
Post by: Powerbob on January 09, 2010, 02:13:38 AM
Great news 8)
Title: Re: CountryFlags
Post by: Spoogs on January 09, 2010, 02:18:04 AM
Yep knowing that its working is great news....  can patiently await its release 8)
Title: Re: CountryFlags
Post by: Sabre™ on January 09, 2010, 08:58:26 AM
Quote from: JBlaze on January 09, 2010, 02:10:12 AM
OK, I got it working awesome now. Only problem is that for some reason it's not showing the flag chosen on the register page. Maybe a couple more days before I release it.

Be interesting to see your fix, I have that exact problem
Title: Re: CountryFlags
Post by: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2
Title: Re: CountryFlags
Post by: Arantor on January 09, 2010, 07:24:26 PM
2.0 RC1.2 is no longer actively developed by the dev team - 2.0 RC2 is the current 2.0 release.
Title: Re: CountryFlags
Post by: JBlaze on January 09, 2010, 08:29:42 PM
Quote from: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2

Sorry I don't cater to demands.
Title: Re: CountryFlags
Post by: Powerbob on January 10, 2010, 03:01:49 AM
Quote from: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2

Not a polite post at all!
Title: Re: CountryFlags
Post by: Paul_Pauline on January 10, 2010, 09:05:45 AM
It'll be great to see this mod back up again ;D

Hope it will support v 1.1.11 as i'm keeping well away from v 2 until it's completely stable  ::)

Thanks for finding the time to do this ;)
Title: Re: CountryFlags
Post by: FragaCampos on January 10, 2010, 12:12:54 PM
Quote from: Paul_Pauline on January 10, 2010, 09:05:45 AM
It'll be great to see this mod back up again ;D

Hope it will support v 1.1.11 as i'm keeping well away from v 2 until it's completely stable  ::)

Thanks for finding the time to do this ;)


It's working great on 1.1.11...
Title: Re: CountryFlags
Post by: Sabre™ on January 11, 2010, 02:35:23 PM
Quote from: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2

PM me if you like, and I'll do it for you.
Title: Re: CountryFlags
Post by: SN on January 18, 2010, 02:02:01 AM
will this be updated for RC2?
Title: Re: CountryFlags
Post by: JBlaze on January 18, 2010, 02:41:40 AM
Quote from: SN on January 18, 2010, 02:02:01 AM
will this be updated for RC2?

Try reading the last 3 pages of topics and you'll find out.
Title: Re: CountryFlags
Post by: zeon101 on January 23, 2010, 07:49:08 PM
Quote from: JBlaze on January 18, 2010, 02:41:40 AM
Quote from: SN on January 18, 2010, 02:02:01 AM
will this be updated for RC2?

Try reading the last 3 pages of topics and you'll find out.

We did, and you said it would be released in a few days and this was on the 9th. It's now the 24th..
Title: Re: CountryFlags
Post by: Arantor on January 23, 2010, 07:51:49 PM
Well, JBlaze is no longer looking after this mod, it is down to vbgamer if he gets opportunity.
Title: Re: CountryFlags
Post by: vbgamer45 on January 23, 2010, 07:52:43 PM
Will get it updated shortly have this one next on my list tonight.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 23, 2010, 08:26:32 PM
Updated the mod to support SMF 2.0 RC2!
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on January 24, 2010, 04:36:28 AM
Good work mate.
Cheers :)
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Paul_Pauline on January 24, 2010, 08:39:47 AM
Hi.

I was wondering if England, Scotland, Wales had been added to the list for members to choose from when registering, the flags were always in the images folder, but the names were not on the list !

Also would it be a big job to have the flags larger & animated ? A forum I am a member of (powered by IPB) has a similar mod which shows the flags like this, which I personally prefer, be interesting to know what others think ?

Not that I don't appreciate the work you have already done !
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 24, 2010, 09:25:44 AM
Well the issue with graphics would be someone would need to create the flags to make them larger or animated.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on January 24, 2010, 01:00:03 PM
Quote from: Paul_Pauline on January 24, 2010, 08:39:47 AM
Hi.

I was wondering if England, Scotland, Wales had been added to the list for members to choose from when registering, the flags were always in the images folder, but the names were not on the list !

Also would it be a big job to have the flags larger & animated ? A forum I am a member of (powered by IPB) has a similar mod which shows the flags like this, which I personally prefer, be interesting to know what others think ?


Not that I don't appreciate the work you have already done !

      It wouldn't hurt to ask the admin of that board or author of that mod if he/she would share those images.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Paul_Pauline on January 24, 2010, 05:37:25 PM
I will see if I can find anything out.

I know where you can get the animated flags for use on a "personal" website free of charge.
If I were to overwrite the .png flags in the images folder, with .gif flags, giving them the same name would that work ?

Or would I need to search the install files and replace all references to .png, with .gif for them to show ?

Very new to editing files   ::) ::)

Thanks, Paul.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 24, 2010, 05:38:19 PM
You would need to replace the references to .png to .gif
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Paul_Pauline on January 24, 2010, 06:03:19 PM
Thanks for that !

I'll wait till 2 goes gold, then have a play about with a copy of your mod after I have upgraded.

Paul.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: akbora on January 24, 2010, 06:56:16 PM
There are some errors with  load.php
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 24, 2010, 06:57:22 PM
Tested on a clean install should be fine.

Might be interacting with other mods that you have.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Powerbob on January 25, 2010, 04:43:47 AM
Well done and thanks, great mod 8)
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 25, 2010, 08:52:14 AM
Thanks glad to be able to continue support it.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: HorTs on January 25, 2010, 10:35:26 AM
Hi,

It says on the spec that it will only work with the core theme, is there any play to make this available for Curve users?

Thanks.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Spoogs on January 25, 2010, 11:03:07 AM
[Feature Request]
Some of my members would like to know if its possible to have the option for choosing 2 flags.
1 to represent where they were born and the other to represent where they currently live.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 25, 2010, 07:44:11 PM
Quote from: HorTs on January 25, 2010, 10:35:26 AM
Hi,

It says on the spec that it will only work with the core theme, is there any play to make this available for Curve users?

Thanks.
It does work on the curve theme as well
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: RoCKeT-88 on January 28, 2010, 02:05:19 AM
Ok I must be blind I do not see where I turn this on at.  Thanks.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on January 28, 2010, 11:35:21 AM
SMF 1 = Features and options
SMF 2 = Configuration - Modification Settings - Miscellaneous

With regards to the gif images, in one of my packages, the flag folder ended up being around 30mb I think lol  But well worth it.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 28, 2010, 11:37:19 AM
Thanks for the Help Sabre!
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on January 28, 2010, 11:41:35 AM
Anytime mate :)
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: RoCKeT-88 on January 28, 2010, 04:49:09 PM
Quote from: Sabre™ on January 28, 2010, 11:35:21 AM
SMF 1 = Features and options
SMF 2 = Configuration - Modification Settings - Miscellaneous

With regards to the gif images, in one of my packages, the flag folder ended up being around 30mb I think lol  But well worth it.

OK I have it then but I am not seeing any flags displaying any place.  Thanks.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 28, 2010, 05:00:41 PM
It is shown on registration and as an option in the profile depending on your settings that you have set.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: RoCKeT-88 on January 28, 2010, 05:22:29 PM
Ok I must be really blind because I think you need to say exactly where I need to go to make it display in my profile and posts.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on January 28, 2010, 05:51:42 PM
Settings should be under
SMF 1 = Features and options
SMF 2 = Configuration - Modification Settings - Miscellaneous
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: RoCKeT-88 on January 28, 2010, 05:58:49 PM
Yep I have it set idk...strange I have this mod on another forum and i got flags so I will figure it out lol!~
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 04, 2010, 02:22:54 AM
Hey Folks

K banged my head for a few hours read almost all 35 pages tried all of the other fixs and still can not get this to work... It is the same as a few others where on registration it works but they do not show on profile... I am running 2.2 RC2 and am using the Flagrant theme maybe its just my theme but any assistance would be nice please.

And thank you

Joe
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on February 04, 2010, 09:29:55 AM
If your theme has a custom Profile.template.php file the changes will need to be applied to that theme as well.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 04, 2010, 09:37:36 AM
VB

It does not have one one however however I am a newbie to all of this I think I know what I am doing however i could be completely wrong. I thought I had made the approropriate changes but again I am sure I am missing something simple.

Would you be willing to have a look if i have you a admin user and password.

In the end I don't think its a big deal ass 99% of my board will be from Canada however I have put a ton of time into this and would now just like to get it working.

When you have a moment let me know please sir.

Thank you

Joe
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on February 04, 2010, 09:58:16 AM
Did make the changes manually? I don't recommend that unless your theme has the files.

Otherwise I suggest using the package manager to install the mods.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 04, 2010, 10:12:15 AM
Thank you for the help VB

The only place i see the file you speak of is in the default theme not in mine should i uninstall and reinstall?
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on February 04, 2010, 10:15:28 AM
You can try.

Also check that you enabled this setting To enable this mod you must go to Admin > Features and Options > Last set of options.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 04, 2010, 10:18:51 AM
I get a warning when trying to uninstall so I may just leave it and not bother...

I did go into the setting that part is there and again its there when a person registers just not on thier profile
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Snogmarr on February 04, 2010, 12:56:59 PM

If admin creates a registered user;  the pic and text do not appear.

Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 04, 2010, 02:30:21 PM
    Could we remove the word "country" in the posts so it just shows the flag?
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on February 04, 2010, 02:44:36 PM
Remove   $txt['country_flag']   from your display.template.php
disregard..
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 04, 2010, 09:46:23 PM
Quote from: Sabre™ on February 04, 2010, 02:44:36 PM
Remove   $txt['country_flag']   from your display.template.php

       Thanks
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 01:00:18 AM
VB

Got it going :-) I thought it showed in just the profiles but i see it does not... It is now showing up in the post's which is fine, it is however showing up twice LOL

I must have duplicated some code somewhere.

Joe
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 01:16:02 AM
K got it!!

Got the double out and even removed the country text :-)

Thank you for your help folks.

Joe
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 02:38:51 AM
K VB and Sabre a quick question if I may

Could this mod be adapted to show a favorite sports team? Under your name you could have your fav NHL NFL CFL etc team logo the same size as the flags are now. I tried to change a country to a football team name (this part I was successful in doing as i could make the name show up) by changing the text in subs.php and then i tried to replace the country logo it pointed to into a team logo .png but it did not work.

Not something I am asking you to do just wondering if its possible?

Thanks

Joe
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on February 06, 2010, 03:21:52 AM
Yes it is mate.
So what you have done is replace the text for  eg. 'us' => 'United States', and then replaced the United States(us.png) image with your new one?
Lets say it now looks like this   'us' => 'Raiders',  you'd have to keep your Raiders image named as us.png, unless you change it where you changed the name.
eg.   'us' => 'United States',     to      'rd' => 'Raiders',      then the name for the image would be   rd.png
Make sense?  I hope so, cause even I got a little confused reading back! lol ;)
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 04:28:45 AM
No you explained it very well sir

I am pretty sure i did all of that yet it kept going back to the original .png file

I am running a different theme however i am pretty sure i replaced the new .png in both default and in my themes directory

here is what i did

i changed in the subs

'af' => 'Riders'
and then got my new image and called it af.png

however i still got the afgan flag

Sorry i know this is not really what this mod is for but i was just trying to see if it would work

Sorry i was slow on replying i was trying to get my rss feeds working (a who;e new headache lol) im such a rookie with all this stuff I fear i know just enough to be dangerous

Any thoughts?
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on February 06, 2010, 04:37:32 AM
Try clearing your cache and cookies etc..
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 04:58:34 AM
K lemme try

I was able to get it working on default just now but still getting wrong flag on my theme lemme go clear cache etc
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 05:08:28 AM
As mentioned its working on default theme but its not on my theme the text changes but the flag does not.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 05:16:09 AM
Sabre

Im an idiot plus its 4 in the AM here and I am tired, i was having problems with this mod (see above) and while screwing around to get it working I had made a flag folder Twice GRR I have been sending the new .png to the wrong folder... i went searching and just till now did not ralize it.

Sorry!!

I feel like a knob my appologies sir.

Its all working and all good.

Thank you for the assistance.

Joe
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on February 06, 2010, 05:17:22 AM
LOL
Congrats on getting it to work champ!!
Those early hour code sessions get to the best of us ;)
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: riderracer on February 06, 2010, 05:19:58 AM
Agreed

Off to bed now hopefully when i wake up in the AM my rss feeds work LOL

Take care sir and have a wonderful day.

Joe



Quote from: Sabre™ on February 06, 2010, 05:17:22 AM
LOL
Congrats on getting it to work champ!!
Those early hour code sessions get to the best of us ;)
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 07, 2010, 02:31:54 PM
Quote from: Sabre™ on February 04, 2010, 02:44:36 PM
Remove   $txt['country_flag']   from your display.template.php

     Hi and thanks

   I want this ":" removed too and when i remove the text and that my screen just goes blank white  :o
Here is what i have now

<li class="gender">';<img src="',

 

Edit: Used the parser to repair and now have it.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 07, 2010, 03:08:55 PM
    I'm back

  Forgot to mention that before i tried removing that "txt country ", i was getting this error in admin panel from that same line

Undefined variable: flags
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 08, 2010, 10:27:40 PM
   Have 10 errors and all the same one.

Line 284:    

<li class="gender">', ' <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="', $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on February 09, 2010, 10:55:52 AM
What's the error path and line number?
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 09, 2010, 11:01:00 AM
   Always same line: 284

/home/vol13/tbredjkie.co.cc/htdocs/Themes/default/Display.template.php
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Bugo on February 12, 2010, 04:30:37 AM
Russian translation

// 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'] = 'Страна';
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 12, 2010, 09:52:40 AM
Quote from: vbgamer45 on February 09, 2010, 10:55:52 AM
What's the error path and line number?

      Bump!  Still getting this error.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on February 12, 2010, 09:59:14 AM
Attach your display.template
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 12, 2010, 11:03:40 PM
   Hey there Gamer - here ya go. Thanks!
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Stef001 on February 15, 2010, 02:10:26 PM
I have the same problem.

Stef
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on February 15, 2010, 04:21:14 PM
Curlin, I forgot about removing the   :   so when you went to remove it, there was code left over.
To remove the 'country' text and : , remove  ', $txt['country_flag'], ':
I'll remove my previous post to avoid confusion.
Your fixed template is attached.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 16, 2010, 11:24:49 AM
     Thanks for the help Sabre.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Sabre™ on February 16, 2010, 03:55:52 PM
Any time champ :)
Are you still receiving errors in your logs regarding the above line?
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: curlin on February 17, 2010, 10:18:16 PM
Quote from: Sabre™ on February 16, 2010, 03:55:52 PM
Any time champ :)
Are you still receiving errors in your logs regarding the above line?

      Yeah - as a matter of fact i am  :o
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Paul_Pauline on February 26, 2010, 11:17:47 AM
Hi Guyz.

Quick question, sorry if I have missed the answer somewhere earlier  ::)

Is it possible to manually alter existing members profiles so the flags will show ?

Thanks, Paul.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Penelope on March 04, 2010, 05:49:37 PM
Hi all,

I installed this mod on SMF 1.1.11 and it works great!  8) Thanks!  :D It'shows perfect on the profile, post and registration page!  :D

I have a question, i want to show the country flag of a member also on the arcade, but i cannot figure it out i tried almost everything i can think of so that's why this request for help. :)

I use SMF 1.1.11 and E-Arcade.

My question is how to show the country flag on the arcade game highscores page? :)

I have already the layout that is no problem. I only need to make the country flag work. So far it shows nothing :( Anyone can help? :)

For example i tried this underneath code in Themes/default/Arcade.template.php but it shows nothing.

<td>';
// 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 />';
         }
echo '</td>


I hope someone can help me! So it will also show on the arcade highscores, which would be very nice  :)

Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: aussieherps on March 04, 2010, 06:43:09 PM
Can we get the Aboriginal flag added to these codes please!!!!

Thanks
Todd
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on March 04, 2010, 07:15:05 PM
I don't think that's a country
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: aussieherps on March 04, 2010, 08:39:02 PM
It is the first Australian flag................It is also a national flag for all australian indigenous people.
I am aboriginal and want this flag for my community.
and your VBGAMER it is a flag not a country.
Then again so is the union jack but it is there.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Arantor on March 04, 2010, 08:39:40 PM
Union Jack is the flag of the United Kingdom, which is a "country" in its own right.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on March 04, 2010, 08:43:07 PM
I don't know if it would fit in this mod. Since it is CountryFlags
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: aussieherps on March 04, 2010, 08:50:48 PM
Then can you tell me where to add it for my self.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: vbgamer45 on March 04, 2010, 08:54:34 PM
Don't know offhand sorry.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: aussieherps on March 04, 2010, 09:16:05 PM
Can anyone tell me where changes need to be made to add a flag.
Have added the pic of the flag but need to know where to add for selections etc.
Thanks Todd
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Arantor on March 04, 2010, 09:19:28 PM
http://www.simplemachines.org/community/index.php?topic=106060.msg2397129#msg2397129 explains how to add Wales as an entry. I imagine it's something similar.

/me just went back through the thread - if in doubt, have a look.
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: aussieherps on March 04, 2010, 09:31:31 PM
Thanks ARANTOR this will solve my problems.

todd
Title: Re: CountryFlags Updated for SMF 2.0 RC2!
Post by: Penelope on March 05, 2010, 02:20:00 AM
Anyone can help me to show the flag of  a member? :) Can aynbody tell me where the flags are stored, so i can call them? :)

Quote from: Penelope on March 04, 2010, 05:49:37 PM
Hi all,

I installed this mod on SMF 1.1.11 and it works great!  8) Thanks!  :D It'shows perfect on the profile, post and registration page!  :D

I have a question, i want to show the country flag of a member also on the arcade, but i cannot figure it out i tried almost everything i can think of so that's why this request for help. :)

I use SMF 1.1.11 and E-Arcade.

My question is how to show the country flag on the arcade game highscores page? :)

I have already the layout that is no problem. I only need to make the country flag work. So far it shows nothing :( Anyone can help? :)

For example i tried this underneath code in Themes/default/Arcade.template.php but it shows nothing.

<td>';
// 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 />';
         }
echo '</td>


I hope someone can help me! So it will also show on the arcade highscores, which would be very nice  :)


Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on March 08, 2010, 08:28:16 PM
Updated for SMF 2.0 RC3!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Gryzor on March 09, 2010, 06:01:52 AM
Hello!

I managed to install this on my 2.0RC2 (and, of course, now RC3 is out!!!), but although the country list is there in the profile, it doesn't appear on the reg page...

Now, I've tried looking around, and I saw that this problem existed since the dawn of time, but I didn't see anything upon looking - supposedly a newer version of the mod fixed the problem but it seems it still persists?

Thanks for a great mod - it should really be included in the forum distribution by default! :)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: minos on March 09, 2010, 06:29:28 PM
hello, minutes ago i installed this mod but error log gives me a lot of errors

8: Undefined variable: flags
Apply Filter: Only show the errors from this file
Archivo: /home/xxxxxx/public_html/foro/Themes/Extreme6_RC2/Display.template.php (main sub template - eval?)
Línea: 231


and the line 231 is

           <li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="', $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';


how must i do to fix that error?


thanks
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MarcusJ on March 13, 2010, 01:39:56 AM
I'm getting the same error as Minos.

It is trying to show flags on topic view even for members who haven't selected one yet.

Thank you for any help you can provide.

Using SMF 2.0 RC3 with a default based theme, and the following mods.

1.   Custom Form Mod    1.6 
2.   SimplePortal    2.3.1 
3.   Pretty URLs    1.0 
4.   Country Flags    1.1
5.   Tidy Child Boards    1.3     
6.   Google Member Map 3.0    2.0 beta 2     
7.   Aeva Media    1.1     
8.   Downloads System Pro    1.0.14     
9.   Team Page    3.5.4 
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on March 13, 2010, 10:32:44 PM
Fixed updated CountryFlags to fix that issue.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MarcusJ on March 13, 2010, 10:36:59 PM
Hey thank you!
Title: Can I add country field in my search options?
Post by: khurrum on March 30, 2010, 05:54:41 PM
Is it possible that I can add field in my search option for example if i want to search members from India, then how can i select this option in my search.

best regards
Khurrum
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on March 30, 2010, 06:03:12 PM
Not easily sorry
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Forastero on April 02, 2010, 03:49:32 PM
hello i'm getting some errors in my error log

1
http://www.xxxxxxxxx.net/index.php?action=register2
8: Undefined index: country_flag_ask
File: /home/   xxxxxxxxx/public_html/Themes/default/Register.template.php (registration_form sub template - eval?)
Line: 203



2
http://www.xxxxxxxxx.net/index.php?action=register
8: Undefined index: country_flag_ask
File: /home/xxxxxxxxx/public_html/Themes/default/GenericControls.template.php (registration_form sub template - eval?)
Line: 203



how to fix this please help me 
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Siirist on April 02, 2010, 06:00:45 PM
Hello,

Installed this 2 days ago on SMF ver 2.0RC1 without a problem.
Now want to un-install all mods (including this one) and themes due to problems on forum. :-[

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.

3.     Execute Modification     ./Sources/ManageSettings.php       Test failed
1.     Replace                         ./Sources/ManageSettings.php        Test failed

Solution?

Thanks in advance.

Be Well,
Cloud 8)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Snogmarr on April 02, 2010, 07:56:13 PM


as it says if you click on the box  to the left of the error





Find

// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!


'', // 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'),


replace

// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Siirist on April 02, 2010, 08:00:31 PM
Quote from: xnathansxdadx on April 02, 2010, 07:56:13 PM
remove this

as it says if you click on the box  to the left of the error

'', // 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'),

Okay, just did a upgrade again, so it is like a FRESH START!
There are no mods at this point, and we will go slow, one mod at a time.  :)

Be Well,
Cloud 8)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Snogmarr on April 02, 2010, 08:13:56 PM
bit of advice

if you are installing any of the following do them first.
this mod
Sitemap
Ajax chat
membermap
avatar on board index
Thumbnail Topic Mod
Good Post/Bad Post Mod




Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Siirist on April 02, 2010, 08:17:52 PM
Quote from: xnathansxdadx on April 02, 2010, 08:13:56 PM
bit of advice

if you are installing any of the following do them first.
this mod
Sitemap
Ajax chat
membermap
avatar on board index
Thumbnail Topic Mod
Good Post/Bad Post Mod

Cool thanks for the advice

So is Good Post/Bad Post the Mod that has Karma things
with a green arrow up and a red arrow down

Thanks again,
Cloud 8)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Snogmarr on April 02, 2010, 08:25:04 PM
yeah it is

except there is a karma button mod which gives green and red arrows for the karma mod
yet with the karma mod you can change it to whatever you want,,,
i use it as a banning system for the members,,,,,,

Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Siirist on April 02, 2010, 08:28:27 PM
Quote from: xnathansxdadx on April 02, 2010, 08:25:04 PM
yeah it is

except there is a karma button mod which gives green and red arrows for the karma mod
yet with the karma mod you can change it to whatever you want,,,
i use it as a banning system for the members,,,,,,

We are fortunate that we have only banned 4 people in 2 years.
So I will keep it in mind.

Thanks again,
Cloud 8)
Title: Re: CountryFlags
Post by: Lou69 on May 15, 2010, 09:34:17 PM
Quote from: 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

Ahhh ... yes, that is what fixed problem in my 2.0 RC 3 , I am using custom theme and everything worked except instead of flag image all I see was [img] next to 'country'.

Copying Flag folder to custom theme image folder fixed problem.

Country Flags is working perfect in RC3.  Thanks for the great mod!!

Lou
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on May 15, 2010, 10:01:15 PM
Glad you got it working.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Gryzor on May 31, 2010, 03:07:05 AM
I really love this mod... thanks!

One small detail: as one of my users noticed, it'd be nice if the flag also appeared when someone is looking at a user's info page, alongside "Location" maybe...

Could you implement this? Please? :)

Thanks again!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: CommanderMadi on June 08, 2010, 10:31:43 AM
Hi, I installed this mod but I can not find anything in the Admin Center > Features and Options

I have found no options for it there, I am using a different theme away from the default, however in the modification.english.php

the countryflags mod code is there:-
// 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';


Any ideas to help with that?

Thank you!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 08, 2010, 10:35:53 AM
Check your language Server Settings -> Language should be just english

Also if your custom theme has themes/customthemename/languages/modificagtions.english.php needs to be copied there as well.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: CommanderMadi on June 08, 2010, 10:38:41 AM
Language is English and Modifications.english.php contains the content of the countryflags mod.. but the problem, yet, persists
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Arantor on June 08, 2010, 10:41:26 AM
Admin > Maintenance > Routine > Empty the file cache ?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: CommanderMadi on June 08, 2010, 10:52:10 AM
Thanks Arantor for your suggestion but it is still the same!

Edit: Thanks, I found it but in Modification settings after clearing the cache. Thanks Arantor
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 08, 2010, 11:23:57 AM
Glad you got it working
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: aerolite on June 15, 2010, 02:26:59 AM
Why it doesn't show the picture in my forum? it just say CA,PH smethng like that.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 15, 2010, 02:53:18 PM
Mostly likey the images didn't get copied over try manual copy
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: sbt on June 18, 2010, 09:16:19 AM
We had this fixed, now it is erroring on display.template. Have tried making sure everything is lined up,no spaces, etc. works for about a day, then it errors again. We had 100s if not 1000s of them. We have RC3.
8: Undefined index

            // Show the country they hail from!
            if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
                $flags = country_flags();
                echo '
                <li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="',         
            $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 18, 2010, 10:39:30 AM
Which part of that code
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: sbt on June 18, 2010, 11:22:16 AM
Bummer, you need that part huh? Already emptied the logs. It was several different lines but it was always parts of this code. Will repost once it errors again, we are not reopened yet so hopefully one of admin can reget an error on this.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 18, 2010, 11:59:06 AM
Yeah 8: Undefined index doesn't tell me alot.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: sbt on June 18, 2010, 12:02:37 PM
Okay it happened, there are 3 that error like this in two different themes.

8: Undefined index: 
0353:              $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 18, 2010, 12:29:39 PM
Change it to

            if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
{
                $flags = country_flags();
                echo '
                <li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="',         
            $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
}
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: sbt on June 18, 2010, 05:02:23 PM
Thank You, edited the themes and will see if the error happens again.

Question, if we have more than one theme, should the display.template be in every or just default curve?
We have it in every, could that be why if so?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 18, 2010, 05:37:10 PM
Only curve. THemes only include template files if they are different than curve
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: sbt on June 20, 2010, 09:09:22 AM
Okay, Thank You. No errors yet, only admin can access until reopen next Friday but members that tried logging in were doing the errors before this edit. No one has tried logging in yet so will continue to make sure this is working and then will reply after one does, lol.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 20, 2010, 09:12:16 AM
Awesome glad it is better
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: sbt on June 23, 2010, 01:46:41 PM
It is working wonderful. We tried this in our other forum that is open, it was getting the errors too, all is well. Thank You so much.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on June 23, 2010, 01:57:51 PM
Glad you got it working!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: John1 on June 26, 2010, 10:33:53 AM
Good Mod,
I have to usually add this country twice before it saves, the same applies to registration.
If you pick a country and register, it wont show up on your profile.
any help vbgamer, thanks..
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: divecall on July 01, 2010, 10:59:17 AM
I have almost the same problem like @John1:

Fresh Install of SMF 2 RC2 on a local machine (with XAMPP), and this was the first (and only mod until now) what i was installing.

I can choose a country during the registration, but when i post something, i never can see the country flag.

The Mod settings are OK.

Can somebody help me ?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: forumnepali on July 21, 2010, 06:24:21 AM
i have just install this mod and no Error showing but country flag is not showing
please se below ScreenSHot

(http://photo.forumnepali.com/images/laa1279707832d.JPG)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on July 21, 2010, 09:40:58 AM
Checked that it copied over the flags image folder correctly
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: forumnepali on July 21, 2010, 10:08:35 AM
i'am using Castum Theme BY Argentum design by BlocWeb please guide me how to paste that flag image
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on July 21, 2010, 11:01:19 AM
I don't know never used that theme check modsite for manual install info
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: PurpleCrow on July 24, 2010, 07:02:07 PM
I've just installed this onto SMF 2.0 RC3 but I cant find the settings for it, I assumed it would be under profile fields but its not there.

Am I missing something?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: TheListener on July 24, 2010, 07:09:21 PM
Someone didn't read the packaging lol

To enable this mod you must go to Admin > Features and Options > Last set of options.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: PurpleCrow on July 24, 2010, 07:25:29 PM
Quote from: Brack1 on July 24, 2010, 07:09:21 PM
Someone didn't read the packaging lol

To enable this mod you must go to Admin > Features and Options > Last set of options.

Someone wrote it wrong ;) Its Admin > Configuration > Modification Settings > Misc
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: TheListener on July 24, 2010, 07:36:56 PM
 :o

Sack the mods author.

Even better idea is turn him into a frog for xx amount of days.

;D
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on July 24, 2010, 11:30:43 PM
lol :) I didn't write it orginally
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Dharshan on August 06, 2010, 03:48:42 AM
am using SMF 1.1.11 the mod installed correctly.and i have switched on "show flags on display page" but it want display on the post pages..

am using fussilets word theme. the install said everything succesful as the theme takes all settings from the default..
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Masterd on August 06, 2010, 06:10:36 AM
How can I change the pictures of the flags?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Sabre™ on August 06, 2010, 06:21:27 AM
Change them in the flags folder located in your images folder.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Masterd on August 06, 2010, 06:51:15 AM
Thanks for reply. Wich extensions are allowed?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Sabre™ on August 06, 2010, 07:45:40 AM
png, but you can change that in your display, profile and register template edits.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Masterd on August 06, 2010, 09:30:42 AM
Thank you. I will try to change some things.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Dharshan on August 06, 2010, 11:47:18 AM
Quote from: Sabre™ on August 06, 2010, 07:45:40 AM
png, but you can change that in your display, profile and register template edits.

Hi Sabre,

need a lil advice. I'm using SMF 1.1.11 and the mod installs and works fine on the default theme. i have a custom theme. still the country shows on the profile page. but on the post view it does not.

what should i edit? in order to get this fixed
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on August 06, 2010, 02:23:31 PM
You should edit the display.template.php file
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Dharshan on August 07, 2010, 12:14:06 AM
Quote from: vbgamer45 on August 06, 2010, 02:23:31 PM
You should edit the display.template.php file

great it works now!

Thanks a lot
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on August 07, 2010, 05:02:52 PM
Glad you got  it working!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Wally. on August 24, 2010, 08:11:35 PM
Hey I've got a strange issue with the Country Flags mod. Some of the members are showing up with broken links where the country flag should be below their avatar. I checked and it is trying to load a 00.png file but the flag folder doesn't contain a 00.png file.

What I think is happening is that if a user never goes in to edit their profile, no flag shows up. If the user edits their profile and chooses a flag then it shows up fine. But if a user edits their profile and doesn't choose a flag they get this 00.png broken link.

Anyway, I  searched the thread for '00.png' but didn't get any hits. Any help would be appreciated.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Sabre™ on August 24, 2010, 08:19:37 PM
You could either add an image named 00.png into your flags folder, and make that the default image for those that have not yet chosen a flag, or add a blank image with the same name, or remove '00' => '', from your subs.php template.
There should be a check to disable the function displaying if they havent chosen an image, but Im unsure if that is implemented in the package available.
By your comment, it doesn't look like it.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Wally. on August 24, 2010, 08:36:00 PM
Thanks for the quick reply. I'll double check and make sure that I didn't miss a disable option. If not I'll just create a png.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Sabre™ on August 24, 2010, 08:40:51 PM
My pleasure mate :)
No the "disable" option is not selectable, it should be done within the background so nothing should show at all(profile, display templates) if there is nothing chosen.
Until that is implemented, then the best options are to either replace the image, or remove the code.
Good luck :)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MoreBloodWine on August 29, 2010, 12:20:00 AM
You got two blank what I assume are default options which when "clicked" a missing image icon or whatever shows up. Besides that I get this in my servers error log every time those "options" are used.

[Sun Aug 29 00:17:02 2010] [error] [client IP Removed] File does not exist: /Removed/Themes/default/images/flags/00.png
[Sun Aug 29 00:17:01 2010] [error] [client IP Removed] File does not exist: /Removed/Themes/default/images/flags/blank.gif

Edit 9/9/2010: I would also like to suggest that an option be added to show the country flag on PM's. This is easy enough to add in by copying code from Post.template.php to the template for PM's but I think it would be nice that this be a default chooseable option.

Also, a note of curiosity...

Currently the "stuff" displays like this...

<Flag> Country Name

I don't feel that it looks quite right with that formatting...

Might I suggest changing the code so it looks like this on the post page and pm opage should you add that option...

Country Name: <Flag>

This is easy enough to change in the template files if you know what your doing but I feel this would be a better default look / layout to how it's displayed.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MoreBloodWine on September 09, 2010, 06:51:30 AM
bump...
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 09, 2010, 08:30:02 AM
3 posts up you'll find the answer for 00.png

The rest is up to the author
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: jacbier on September 26, 2010, 04:54:52 AM
Thank you for this mod!

Ik have made a Dutch translation.

// Country Flag mod
$txt['country_flag_label'] = 'Selecteer het land waarin je woont <br>(voor het vlaggetje bij je berichten)';
$txt['country_flag_error_required'] = 'Je moet het land selecteren van waaruit je ons bezoekt';
$txt['country_flag_ask'] = 'Vraag om vlag aanzetten';
$txt['country_flag_disabled'] = 'Vlaggen niet laten zien (vlaggen uitgeschakeld)';
$txt['country_flag_profile'] = 'Profiel';
$txt['country_flag_registration'] = 'Registratie';
$txt['country_flag_both'] = 'Beide';
$txt['country_flag_required'] = 'Moet een lid een locatie kiezen?';
$txt['country_flag_show'] = 'Laat de vlaggen zien op de berichtenpagina.';
$txt['country_flag'] = 'Land';
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on September 26, 2010, 01:57:58 PM
Thank you very much for your Dutch translation!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 05:11:20 PM
I'm having a problem with the mod...

I converted my SM to the 2.0 RC3 last night and have gotten around to testing around the board. I had this installed on my older board and now, when I click profiles (any profile), I see this error:

QuoteUnknown column 'mem.country_flag' in 'field list'
File: /home/content/k/y/s/kystormz/html/thepromisedland/Sources/Load.php
Line: 995

When I checked to see if it was installed, it wasn't, but I did have it before. Is there a way to fix this? Because I can't click profiles...
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 05:42:49 PM
you'll have to reinstall the mod... usually while upgrading incompatible mods or versions of mods will be uninstalled.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 05:47:41 PM
When I try to reinstall, it says this:

(Image of error upon reinstall>)
http://i51.tinypic.com/122j3va.png
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 06:24:35 PM
In that case you would have to manually edit those files.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 06:25:58 PM
How do I do that?  ???
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 06:45:27 PM
http://docs.simplemachines.org/index.php?topic=402
http://www.simplemachines.org/community/index.php?topic=24110.0

Then go to the mod's page (http://custom.simplemachines.org/mods/index.php?mod=417) and click the parse button to see the necessary edits.
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 06:57:23 PM
What if I can't find some of the stuff it asks for? I ran a search in my Load.php and couldn't find one line it asked for :o

Like in my FTP, I can't find the "./Themes/default/languages/Modifications.english-utf8.php" :C
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 07:05:35 PM
if you are not using that language you can ignore that edit
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 07:22:52 PM
If that means English, then I am using it. It seems my load.php is missing a lot of things, like:

Quote
            mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,
replace with:
            mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good, mem.country_flag,

I can't find any of what I'm supposed to replace, at least not what this is telling me (http://custom.simplemachines.org/mods/index.php?action=parse). :o
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 07:28:01 PM
based on the screen you u proved you only need to make 2 edits...

Attach the following files and i'll fix this for you later unless someone comes along and does it first.
souces/load.php
themes.default/display.template.php
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 07:33:59 PM
Oh, thank you Spoogs!  :D

Alright, here they are :)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 07:46:59 PM
Those edits are already there

Make sure to do a backup... then go ahead and install the mod ignoring the edits (you should be fine).
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 07:56:46 PM
So I should install despite the warning? If so, alright :>
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 07:59:29 PM
yes
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 08:04:34 PM
It worked!Thank you! I can see my profiles again ^,^ Although, the flags aren't appearing...oh well!

Thanks so much, Spoogs!  :)
:huggles
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 08:08:39 PM
(http://www.skype-emoticons.com/images/emoticon-00148-yes.gif)

Check your settings

Admin>>Configuration>>Modification Settings>>Miscellaneous
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 26, 2010, 08:20:29 PM
Oh, thank you again, Snoogs! :D

I wish I had something to give back :< Well, if I see you need anything I can get, I'll do it! lol

Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Spoogs on September 26, 2010, 08:24:10 PM
No worries.... glad you got it working  8)
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: MagitekElite on September 27, 2010, 01:26:07 AM
I'm back >.>

It seems the problem just wanted to come back at a new time. Now I can't see my forum. The error is:
Quote
Fatal error: Cannot redeclare country_flags() (previously declared in /home/content/k/y/s/kystormz/html/thepromisedland/Sources/Subs.php:4249) in /home/content/k/y/s/kystormz/html/thepromisedland/Sources/Subs.php on line 4425

Whenever I try to install the flag mod on other themes, I get the error. Although I fixed it by reverting back to the old Subs.php, can any help? I added the flags folder, images, documents and all that :<
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: DirtRider on October 04, 2010, 03:06:22 AM
SMF RC3

It would seem that members are not forced to select a country on registration? I have the options ticked in my setup of this mod
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: vbgamer45 on October 04, 2010, 07:15:15 PM
New update!
Version 1.1.2
!Fixed bug with SMF 2.0 not checking for required location on registration
!Fixed error text used on required location for registration for SMF 1.1.x
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Kurakama on November 03, 2010, 01:24:28 AM
upgrade to rc4?
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: whoey on November 04, 2010, 05:48:39 AM
Quote from: Kurakama on November 03, 2010, 01:24:28 AM
upgrade to rc4?
seconded!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: xrunner on November 04, 2010, 10:18:18 AM
3rded! RC4 won't accept the installation -

"The package you are trying to download or install is either corrupt or not compatible with this version of SMF."
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: whoey on November 05, 2010, 07:39:26 AM
I made it smf 2.0-rc4 compatible by editing as follows:

package-info.xml (on lines 23 & 30) replace
for="2.0 RC1 - 2.0 RC3"
with
for="2.0 RC1 - 2.0 RC4"

install-2.xml (lines 164 to 231) replace with:

<file name="$themedir/Profile.template.php">
<operation>
<search position="replace"><![CDATA[ // Always fun - select boxes!
elseif ($field['type'] == 'select')
{
echo '
<select name="', $key, '" id="', $key, '">';

if (isset($field['options']))
{
// Is this some code to generate the options?
if (!is_array($field['options']))
$field['options'] = eval($field['options']);
// Assuming we now have some!
if (is_array($field['options']))
foreach ($field['options'] as $value => $name)
echo '
<option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
}

echo '
</select>';
}]]></search>
<add><![CDATA[ // Always fun - select boxes!
elseif ($field['type'] == 'select')
{
if ($key == 'country_flag')
{
echo '
<script type="text/javascript" language="JavaScript">
function show_country_flags()
{
document.images.flags.src = document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value != \'\' ? \'' . $settings['images_url'] . '/flags/\' + document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value + \'.png\' : \'' . $settings['images_url'] . '/flags/blank.gif\';
}
</script>
<select name="', $key, '" id="', $key, '" onchange="show_country_flags()">';

foreach ($field['options'] as $value => $name)
echo '
<option value="', $value, '" ', isset($context['member']['country_flag']) &&  $context['member']['country_flag'] == $value ? 'selected="selected"' : '', '>', $name, '</option>';

echo '
</select>
<img id="flags" src="', $settings['images_url'], '/', isset($context['member']['country_flag']) && !empty($context['member']['country_flag']) ? 'flags/' . $context['member']['country_flag'] . '.png': 'blank.gif', '" width="25" height="15" align="top" />';
}
else
{
echo '
<select name="', $key, '" id="', $key, '">';

if (isset($field['options']))
{
// Is this some code to generate the options?
if (!is_array($field['options']))
$field['options'] = eval($field['options']);
// Assuming we now have some!
if (is_array($field['options']))
foreach ($field['options'] as $value => $name)
echo '
<option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
}

echo '
</select>';
}
}]]></add>
</operation>
</file>


then resaved/recompressed the archive and uploaded the package... no errors, installed fine.

I also added/changed a few flags, but that's a personal thing I suppose...
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: Lolafish on November 08, 2010, 07:34:03 PM
I've looked around, but don't see anything recent posted about making necessary edits to display country flags in the Member List.

Has anyone done this successfully lately?  Thanks!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: FragaCampos on November 09, 2010, 01:17:55 PM
Don't know exactly where, but the answer to your question is here in this thread. Just search and you'll surely find it.

Quote from: Lolafish on November 08, 2010, 07:34:03 PM
I've looked around, but don't see anything recent posted about making necessary edits to display country flags in the Member List.

Has anyone done this successfully lately?  Thanks!
Title: Re: CountryFlags Updated for SMF 2.0 RC3!
Post by: smitch6 on November 14, 2010, 05:44:48 PM
Hiya i've had this mod on my site for a while and its great i love it but.....
we just updated to 2.0 rc4 and sp 2.3.3 and my coder manually added the mod so it would work
until i went to add a flag for someone now all of them show a white space on the profile editing
and a ? on the forum

have you any ideas please ty
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on November 24, 2010, 09:56:15 AM
i got it all running fine eventually :)

one question how do i add a flag?
where do i upload the jpg to etc and the code etc

many thanks
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on November 25, 2010, 02:28:33 AM
is this thread checked?????????
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Februs on December 03, 2010, 02:26:11 PM
Can I ask if this mod is compatible with 1.1.12 as when I try and install it via Packages and click Apply Mod I just get a blank screen?

Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on December 03, 2010, 02:29:53 PM
Yes it works with SMF 1.1.2
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Februs on December 03, 2010, 02:47:40 PM
Quote from: vbgamer45 on December 03, 2010, 02:29:53 PM
Yes it works with SMF 1.1.2

Any reason why I'm just getting a blank screen when I try and apply the mod?  Should I try installing it manually instead?

Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on December 03, 2010, 02:52:08 PM
Check your forum's error log.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Februs on December 03, 2010, 02:59:47 PM
Quote from: vbgamer45 on December 03, 2010, 02:52:08 PM
Check your forum's error log.

I have:

1024: Undefined XML attribute: name from [path]/Sources/Subs-Package.php on line 861
File: [path]Sources/Subs-Package.php
Line: 2365


1024: Undefined XML attribute: destination from [path]/Sources/Subs-Package.php on line 867
File: [path]Sources/Subs-Package.php
Line: 2365


256: parse_path(): There should never be an empty filename
File: [path]/Sources/Subs-Package.php
Line: 1126


I removed the home path from the above but those seem to be the errors generated when I try and apply the mod.

Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Februs on December 03, 2010, 09:31:28 PM
OK, I worked out the problem was due to package-info.xml not featuring 1.1.12.  So I added it and apart from an error message regarding the babylon theme which I don't have and which I ignored, it seems to installed OK.  Thanks for supporting the mod.

Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on December 04, 2010, 02:15:14 AM
Quote from: smitch6 on November 24, 2010, 09:56:15 AM
i got it all running fine eventually :)

one question how do i add a flag?
where do i upload the jpg to etc and the code etc

many thanks

anyone any ideas on this please
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: sharks on December 04, 2010, 08:35:57 AM
Downloaded the latest version and tried to install it via package manager on SMF 1.1.12 but i get white page and nothing happens. The package refuses to install. What might be the problem? I know it's not my server as other packages install just fine and i'm using a brand new SMF installation.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Paul_Pauline on December 05, 2010, 01:47:43 PM
Sharks, the answer is two posts above yours !!!
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: sharks on December 05, 2010, 03:09:56 PM
OK, thanks. :)

I would like to report a bug: The country flag does not show when viewing PMs from members. Can someone please add it?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on December 05, 2010, 05:22:26 PM
Fixed the mod so it uses a range instead of specific versions so it should install fine on 1.1.2 now and any future 1.1.x versions.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: sharks on December 21, 2010, 11:52:21 AM
Found a bug! When selecting the country Antarctica, the flag doesn't show up!!

Is there a way to fix that without having to uninstall the mod? I cannot uninstall the mod as it gives me error.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on December 21, 2010, 12:06:43 PM
Is there even a flag for Antarctica? If so attach the small image here.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: sharks on December 21, 2010, 01:29:34 PM
Quote from: vbgamer45 on December 21, 2010, 12:06:43 PM
Is there even a flag for Antarctica? If so attach the small image here.

I believe this is the flag:
(http://www.worldlicenceplates.com/flags/xx-anta.gif)
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on December 22, 2010, 01:43:47 PM
i have a double show of the flags?????

any ideas pls
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on December 22, 2010, 01:44:26 PM
sorry should of said i'm running RC4
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Matthew K. on December 22, 2010, 01:49:42 PM
Attach Display.template.php
Quote from: smitch6 on December 22, 2010, 01:44:26 PM
sorry should of said i'm running RC4
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on December 22, 2010, 02:04:33 PM
found it on there and it's all sorted thanks :)
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Dani88 on December 27, 2010, 07:32:55 AM
I is working for me, do not display flags, and I have selected that is required but no, I have to enter the profile and change according to the ip that show to put the country because it does not appear
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: averagejoe77 on December 29, 2010, 11:50:17 AM
I have SMF 2.0 RC4, and I can;t get the flags to show up in the members posts. It is there in the profile, and I can select it in the profile, but it doesn't show up in the post anywhere. The code is there to show it in display.template.php, but it just doesn't show.

Any advice?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on December 29, 2010, 03:00:41 PM
Check your forum's error log and look for any related errors.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: averagejoe77 on December 29, 2010, 03:42:41 PM
Negative, there are no entries in the error log referring to this mod.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on December 29, 2010, 03:44:48 PM
Did you manually install it to that template file
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: averagejoe77 on December 29, 2010, 04:47:00 PM
Nope. I used the package installer. I did have to manually upload the images though.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: sharks on December 30, 2010, 06:47:41 AM
Uploaded the latest package to my fresh SMF 2 RC4 but it keeps saying error with a blank error description box.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: averagejoe77 on January 01, 2011, 09:22:07 PM
Great, your mod has now broken my site.

Whenever people try to post, I get this error:
Call to undefined function CountryFlag() in /home/public_html/forums/Sources/Load.php(2189) : eval()'d code on line 296

What gives here?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: w0rthex on January 02, 2011, 09:52:12 AM
How do I add countries to the list, because the mod is still showing Serbia and Montenegro, and these are separate countries now?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: My LG Cookie Fresh on January 04, 2011, 04:02:09 PM
Thank you very much!
I can't wait to install [My PC is down] :)
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: mortymoose on January 05, 2011, 07:08:41 AM
I have rc4, says I have successfully installed the mod, but cannot see anywhere to "activate" it, under the Features and Options tab....all that I have there are General, Karma,Layout and a signature tab....

Went to the error log, clean nothing to see here.... wonder where on this earth will I find how to "activate" this mod....

Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on January 05, 2011, 08:36:11 AM
Try Modifications Settings
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: mortymoose on January 05, 2011, 09:10:53 AM
Thanks for the assistance, Went to the Modifications setting tabs, get the following message: "There are no modifications installed that have added any settings to this area yet."

Went to the installed packages and see that the package is indeed installed. , see the attached images....

This is getting very confusing for me...

Thanks
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: impreza on January 05, 2011, 04:19:02 PM
Very cool modified
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: live627 on January 07, 2011, 06:38:18 PM
Quote from: mortymoose on January 05, 2011, 09:10:53 AM
Thanks for the assistance, Went to the Modifications setting tabs, get the following message: "There are no modifications installed that have added any settings to this area yet."

Went to the installed packages and see that the package is indeed installed. , see the attached images....

This is getting very confusing for me...

Thanks

try this package
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: afterdk on January 18, 2011, 09:48:30 PM
I'm using smf 2RC4 and Country Flags 1.1.2

Select a country in the registration area doesn't works.
The user have to select the country again in the profile area.



Sorry my english :S
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on January 20, 2011, 05:31:30 PM
yes mine is set to registration and profile and it doesn't show it
even if they choose on registration
really annoying because i want to know where my members are based

there must be a bug with this new version
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: T3CHN0 on January 31, 2011, 10:48:10 AM
this is a great MOD, just installed it.
but there is something i am looking at but can't find away to do it and was wondering
how would i go about adding the option for users time.
say you pick your flag to what country your in and then also have the option
to pick your area code "post code" to display what the time is as well to where you are
this is something all my members would find very usefull as to knowing when we have gaming clan wars
what the time difference is to make sure everyone is there on time.
it might be usefull for other reason as well maybe.
my idea that i want would look something like this
(http://img146.imageshack.us/img146/9305/timeq.jpg)

or even better would be just simply having it show on the main board
under members online something like this
(http://img263.imageshack.us/img263/2299/membersbmp.png)

The reason why I ask here vbgamer45 is because I use most
of your mods and think you would have the know how on how to
do this. if something like this is already out there
then maybe someone could post a link

I think this mod has the potential to have this option
but as there are so many country's it might also be to hard
to create.
As i live in Australia we only have 5 differant time zones
so not to hard if made for Australia only :)

cheers
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: T3CHN0 on January 31, 2011, 10:54:36 AM
Quote from: smitch6 on January 20, 2011, 05:31:30 PM
yes mine is set to registration and profile and it doesn't show it
even if they choose on registration
really annoying because i want to know where my members are based

there must be a bug with this new version

I just installed this on my 2.0 RC3 forum theme black rain
and it works perfect. you might have a coding in your
php file thats stopping it from working.

I can't help you with this but vbgamer45 might be able to.
he could have a look at your php files for you if he has the time
to see where the problem is!!!
just a thought
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: sharks on February 02, 2011, 05:53:17 PM
My cpanel error log is full of these errors:

File does not exist: /home/sharks/forum/Themes/default/images/flags/00.png
File does not exist: /home/sharks/forum/Themes/default/images/flags/aq.png


Where to find and how to fix those missing 00.png and aq.png flags??
I suppose if someone could supply these flag images, then these errors would disappear if the missing flags were placed in the images folder.
I am using SMF 1.1.12 with default theme and latest version of this mod.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: RoCKeT-88 on February 08, 2011, 09:28:20 PM
Alright I have this installed but now I seem to be stupid to find Admin > Features and Options > Last set of options.  Where is this in the admin section exactly?  TY!~
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: DownloadPs3 on February 09, 2011, 08:43:21 PM
Quote from: `Z0mB|e` on February 08, 2011, 09:28:20 PM
Alright I have this installed but now I seem to be stupid to find Admin > Features and Options > Last set of options.  Where is this in the admin section exactly?  TY!~

Along the top bar there should be a tab call admin, click that and then on the side bar (if using 1.1.12) under the section called Confugureation there is an option features and options click that. now scroll to the very bottom and it should be there and it will have boxes for you to check to enable different parts of the mod
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: DownloadPs3 on February 09, 2011, 08:48:46 PM
How do registered users select their country? I cant find if anywhere. I have it set to ask on your profile and registration and its working in the registration part but i cant find it in the profile part please help.
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: RoCKeT-88 on February 09, 2011, 09:13:44 PM
OK I Have 2. RC4 I will look some more I must be stupid ~ LOL
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: DownloadPs3 on February 09, 2011, 10:12:20 PM
Quote from: `Z0mB|e` on February 09, 2011, 09:13:44 PM
OK I Have 2. RC4 I will look some more I must be stupid ~ LOL

Im new at this to, and it should be similar. and did you try registering a new user to see if it let you use flags? i can select them when i register buy not on the profile
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: DownloadPs3 on February 10, 2011, 12:28:19 AM
Ok so i installed a mod call treasury and for what ever reason it messed my entire site up and i had to use my back up and restore it but this caused me to lose all my mods. I installed all of them except this one because it gives me 2 errors:

5.    Execute Modification    ./Themes/default/Register.template.php    Test failed

and

8.    Execute Modification    ./Themes/babylon/Display.template.php    File not found

im not worried about 8 because i got rid of that theme and it gave me that error last tim but it still worked. what do i do here is the file it gives the error for:

Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: xrunner on February 14, 2011, 10:00:01 AM
Won't install in RC5 -

Add Before    ./Sources/Profile-Modify.php    Test successful
      2.    Replace    ./Sources/Profile-Modify.php    Test failed
*    5.    Execute Modification    ./Sources/Subs.php    Test successful
      1.    Add Before    ./Sources/Subs.php    Test successful
*    6.    Execute Modification    ./Themes/default/Display.template.php    Test successful
      1.    Add Before    ./Themes/default/Display.template.php    Test successful
*    7.    Execute Modification    ./Themes/default/Profile.template.php    Test failed
      1.    Replace    ./Themes/default/Profile.template.php    Test failed
*    8.    Execute Modification    ./Themes/default/Register.template.php    Test failed
      1.    Replace    ./Themes/default/Register.template.php    Test failed
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: FragaCampos on April 30, 2011, 04:17:10 PM
I have a request:
Would it be too difficult of a job to put the flags on the page index.php?action=who ?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: richardwbb on April 30, 2011, 11:29:16 PM
Hi,

I managed to install CountryFlags and it is showing in the posts and in the profile page.

However I can't get it to show on the outbox page:
http://deleted/forum/index.php?action=pm;f=outbox

I looked and looked again at the manual installation files and changes:
http://custom.simplemachines.org/mods/index.php?action=parse;mod=417;attach=169077;smf_version=1.1.3

Am I missing something or is it supposed to be?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: Shadaliza on May 04, 2011, 05:45:24 AM
I am running SMF 2.0 RC4, installed and configured the mod without problems. But the flags don't show, instead I see: Country: USA under the profile pic... but no flags... any ideas?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: smitch6 on May 04, 2011, 11:57:45 AM
Quote from: techno489 on January 31, 2011, 10:54:36 AM
Quote from: smitch6 on January 20, 2011, 05:31:30 PM
yes mine is set to registration and profile and it doesn't show it
even if they choose on registration
really annoying because i want to know where my members are based

there must be a bug with this new version

I just installed this on my 2.0 RC3 forum theme black rain
and it works perfect. you might have a coding in your
php file thats stopping it from working.

I can't help you with this but vbgamer45 might be able to.
he could have a look at your php files for you if he has the time
to see where the problem is!!!
just a thought

That'll be great if you/he can as it's quite annoying really lol
brill mod but always have to add it after they join again
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: danialasghar on June 06, 2011, 07:45:49 PM
I have installed this Mod in my Board of smf 2.0 RC5 using theme CoalBlack. When i do install it says successful with no error but after installation complete it start giving me Fatal Error on Forum Profile Page. Please help me

Thanks..
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on June 06, 2011, 08:01:17 PM
What's the error?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: danialasghar on June 06, 2011, 08:07:40 PM
Quote from: vbgamer45 on June 06, 2011, 08:01:17 PM
What's the error?

Fatal error: Call to undefined function country_flags() in /home/grmercha/public_html/Sources/Profile-Modify.php on line 265

Here it is...!
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: danialasghar on June 07, 2011, 06:42:27 AM
no response yet?  :(
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on June 07, 2011, 06:55:17 AM
It sounds like you are missing a file edit if there was a failure on it install you will have to modify a file add that function
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: danialasghar on June 07, 2011, 09:02:06 AM
Quote from: vbgamer45 on June 07, 2011, 06:55:17 AM
It sounds like you are missing a file edit if there was a failure on it install you will have to modify a file add that function

You mean i need to install manually?
Title: Re: CountryFlags Updated for SMF 2.0 RC4!
Post by: vbgamer45 on June 07, 2011, 09:29:46 AM
Yeah looks like you are missing this in your Sources/Subs.php

// Nice big array of countries!
function country_flags()
{
$flags = array(
'00' => '',
'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', 'england' => 'England', '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', 'scotland' => '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', 'wales' => 'Wales', 'eh' => 'Western Sahara',
'ye' => 'Yemen', 'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}


Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 11, 2011, 08:20:12 PM
Added install support for SMF 2.0
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Jorge D. Fuentes on June 26, 2011, 05:53:03 PM
It seems the package installer is missing something in the load.php file that it's looking for.

I get this error on load.php:
-----------
Code: (Find) [Select]

         mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,

Code: (Replace) [Select]

         mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.country_flag,
--------------
I guess it's possible that there's another mod (I've got one that adds the XBLA/PSN items to that same area) that's changing the line, and then when this mod looks for that same line, it doesn't find it.

I also get this error, again for load.php:
-----
Code: (Find) [Select]

         mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,

Code: (Replace) [Select]

         mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good, mem.country_flag,
-----------------

So yeah, I cannot install this... :(
Title: Re: CountryFlags Updated for SMF 2.0
Post by: phill104 on June 29, 2011, 06:07:29 PM
After upgrading to SMF2.0 I installed this package (which was working with smf 1.x.x) and now I am not seeing any configuration options in the back end. In Features and Options I only have General, Layout ans Signatures. Any Ideas?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on July 01, 2011, 06:01:32 PM
It should be under Modifications Settings
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Richardgm on July 08, 2011, 12:02:28 AM
I'm having a problem installing this on 2.0.

I had it installed on 1.X, but for some reason when trying to install on 2.0... I'm alerted to the fact that:

"The following files need to made writable to continue installation:
/home
/home/XXXXXX/public_html/forum/Themes/babylon/images/flags"

However, when I input my FTP information an internal error (500) is given for the entire website.

When I contact my hosts, they tell me that the mod set incorrect permissions for the home directory; which in-turn made my website inoperative.

Is there any way around the mod wanting to rewrite permissions?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: meko me on July 08, 2011, 01:43:53 AM
very nice mod thank you very much sir.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: rica.carv on July 08, 2011, 05:46:42 AM
Portuguese Portugal language update:

<file name="$languagedir/Modifications.portuguese_pt.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Por favor, seleccione o seu pais';
$txt['country_flag_error_required'] = 'Tem de seleccionar o pais onde se encontra actualmente';
$txt['country_flag_ask'] = 'Permitir selecção da bandeira do pais';
$txt['country_flag_disabled'] = 'Não exibir (Desligado)';
$txt['country_flag_profile'] = 'No Perfil';
$txt['country_flag_registration'] = 'No Registo';
$txt['country_flag_both'] = 'Em ambos';
$txt['country_flag_required'] = 'Obrigar o utilizador a escolher uma localização?';
$txt['country_flag_show'] = 'Exibir bandeira do pais no quadro do utilizador (Onde os tópicos são exibidos).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Por favor, seleccione o seu pais';
$txt['country_flag_error_required'] = 'Tem de seleccionar o pais onde se encontra actualmente';
$txt['country_flag_ask'] = 'Permitir selecção da bandeira do pais';
$txt['country_flag_disabled'] = 'Não exibir (Desligado)';
$txt['country_flag_profile'] = 'No Perfil';
$txt['country_flag_registration'] = 'No Registo';
$txt['country_flag_both'] = 'Em ambos';
$txt['country_flag_required'] = 'Obrigar o utilizador a escolher uma localização?';
$txt['country_flag_show'] = 'Exibir bandeira do pais no quadro do utilizador (Onde os tópicos são exibidos).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>


Insert on file languages.xml from the unzipped installation pack.

Anyway, i have an issue with SMF 2.0. The flags doesn't apear on the profile summary, althought they appear on the topics:
Profile example (http://sp-selofan.comlu.com/index.php?action=profile;u=1)
Topic example (http://sp-selofan.comlu.com/index.php?topic=1.msg2#msg2)

I'm struggling through the code, and i can't figure out wich is the problem....
I also wanted to do some modifications, for instance, to manage the appearance of the flags on the topic: Flag only, Flag with country text, and enable or disable the "Country:" (on my case, "Pais:") text on the topics....
Also would like to see the flags on the members list....
Can it be donne???
Or can anyone point me on the right directions???

There's also a small bug, that when someone selects no country AFTER had selected a country, it keeps displaying in the threads page, but it displays "Pais: 00"
Anyone got this issue also???

Many thanks
Title: Re: CountryFlags Updated for SMF 2.0
Post by: stratocaster on July 10, 2011, 01:46:10 AM
Quote from: sharks on February 02, 2011, 05:53:17 PM
My cpanel error log is full of these errors:

File does not exist: /home/sharks/forum/Themes/default/images/flags/00.png
...
Where to find and how to fix those missing 00.png ... flags??
...

Quote from: rica.carv on July 08, 2011, 05:46:42 AM
...
There's also a small bug, that when someone selects no country AFTER had selected a country, it keeps displaying in the threads page, but it displays "Pais: 00"
Anyone got this issue also???
...

I have the same issue.

/Themes/default/images/flags/00.png  (many of these logs)

Thanks...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: rica.carv on July 10, 2011, 12:51:18 PM
Well, the 00.png couldn't exist really, since it's no flag at all for the mod.
I've got to dig on the code, to see if i can came up with anything that overrides the 00.png display....

00.png issue solved...
I've changed the code, so that if the user selected no country, it won't display any flag line at all....

Now, more dig, to see if i can set options for the formating of the country line....
Title: Re: CountryFlags Updated for SMF 2.0
Post by: phill104 on July 19, 2011, 09:42:00 AM
After updating a forum from 1.x to 2.x we lost all the flag data for exisiting users. I cannot seem to find it in the DB, I think I must be going blind. Where is it so I can restore?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: jacbier on July 20, 2011, 06:13:00 PM
Quote from: phill104 on July 19, 2011, 09:42:00 AM
After updating a forum from 1.x to 2.x we lost all the flag data for exisiting users. I cannot seem to find it in the DB, I think I must be going blind. Where is it so I can restore?

Is the directory Flags still intact on the server?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on July 28, 2011, 12:12:26 PM
Hi vbgamer45

I am installing this mod in a fresh SMF forum installation and i'm getting this error:

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.

When i scroll further down to see what the problem is:
8.    Execute Modification    ./Themes/babylon/Display.template.php    File not found

I think you should change the "File not found" requirement to "Skipping file" if the babylon theme is not available, as i have purposefully deleted it from my Themes folder. The absence of the Babylon theme should not generate any installation errors. I hope you understand my point.
The problem is that if i insist and continue to install it, it will give me the same error when uninstalling this mod, since i have forcefully installed your mod.
I would like to avoid any confusions in the future, in case i need to uninstall this mod at a later time. So, please fix the package.xml (i suppose that's where the bug should be?) and make it "skipping file" if babylon theme is absent. Thank you! :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on July 28, 2011, 12:27:52 PM
Good idea but it is save to ignore does not cause any harm
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on July 29, 2011, 11:26:06 AM
Hi vbgamer45!
Is necessary to make some changes in all install.xml files like:
-after 'mn' => 'Mongolia',   add   'me' => 'Montenegro',
-'cs' => 'Serbia and Montenegro'   change to  'rs' => 'Serbia',
-both flags exists in flags folder
Remark: Serbia and Montenegro country (State Union) no longer exists.

Please insert translation for croatian and serbian :

Croatian
<file name="$languagedir/Modifications.croatian.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahtijeva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gdje je poruka prikazana).';
$txt['country_flag'] = 'Drzava';


Croatian UTF-8

<file name="$languagedir/Modifications.croatian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahtijeva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gdje je poruka prikazana).';
$txt['country_flag'] = 'Drzava';


Serbian

<file name="$languagedir/Modifications.serbian.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahteva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gde je poruka prikazana).';
$txt['country_flag'] = 'Drzava';


Serbian UTF-8

<file name="$languagedir/Modifications.serbian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahtijeva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gdje je poruka prikazana).';
$txt['country_flag'] = 'Drzava';


Best regards,Branko
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on July 29, 2011, 12:33:49 PM
Thanks for the translation
Title: Re: Can view on Post, but not on Profile
Post by: Plutuss on August 02, 2011, 09:37:58 AM

On SMF 2 RC 4,

It installed fine without errors or warnings.

But while I can select the flag in the profile, which does indeed show nicely in the post view, it does not show at all in the profile view. The code seems to be in profile.template too.

Any history of this issue?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on August 02, 2011, 11:29:55 AM
Would suggest to upgrade 2.0 final and see if that helps
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 02, 2011, 07:26:29 PM
Quote from: vbgamer45 on July 29, 2011, 12:33:49 PM
Thanks for the translation
You're welcome, vbgamer45  whenever you need it.
Please remember, and changes in xml also.Its very important.

Best regards
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Plutuss on August 04, 2011, 07:50:21 PM
Is the flag supposed to show in the Profile Summary too? If not, what code could I add to make it appear? SMF 2 :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 05, 2011, 05:28:50 AM
Of course, Summary and Forum Profile Information also. First check the default theme, if it's okay ( all visible) then look (via FTP)  in Themes/[your_theme]/Profile.template.php 

Find // Always fun - select boxes!
elseif ($field['type'] == 'select')
{
echo '
<select name="', $key, '" id="', $key, '">';


and Replace with         // Always fun - select boxes!
         elseif ($field['type'] == 'select')
         {
            if ($key == 'country_flag')
            {
               echo '
                        <script type="text/javascript" language="JavaScript">
                           function show_country_flags()
                           {
                              document.images.flags.src = document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value != \'\' ? \'' . $settings['images_url'] . '/flags/\' + document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value + \'.png\' : \'' . $settings['images_url'] . '/flags/blank.gif\';
                           }
                        </script>
                        <select name="', $key, '" id="', $key, '" onchange="show_country_flags()">';
                       
                     foreach ($field['options'] as $value => $name)
                        echo '
                           <option value="', $value, '" ', isset($context['member']['country_flag']) &&  $context['member']['country_flag'] == $value ? 'selected="selected"' : '', '>', $name, '</option>';
                     
                     echo '
                        </select>
                        <img id="flags" src="', $settings['images_url'], '/', isset($context['member']['country_flag']) && !empty($context['member']['country_flag']) ? 'flags/' . $context['member']['country_flag'] . '.png': 'blank.gif', '" width="25" height="15" align="top" />';   
            }
            else
            {
               echo '
                     <select name="', $key, '" id="', $key, '">';

            if (isset($field['options']))
            {
               // Is this some code to generate the options?
               if (!is_array($field['options']))
                  $field['options'] = eval($field['options']);
               // Assuming we now have some!
               if (is_array($field['options']))
                  foreach ($field['options'] as $value => $name)
                     echo '
                        <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
            }

            echo '
                     </select>';
         }
         }


Title: Re: CountryFlags Updated for SMF 2.0
Post by: Plutuss on August 06, 2011, 08:11:46 PM
That code is already in my profiletemplate....but I replaced it with yours anyway, and still nothing.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 07, 2011, 05:33:24 AM
After install this modification you must go in your profile and choose your country, but in the summary really is not visible only in Forum Profile Information.Both only in versions SMF1.1.x versions.Sorry, it's a job for vbgamer45

EDIT: Hmm, maybe is good solution for you... try in ACP»Features and Options »Profile Fields then in Custom Profile Fields down right you see box New field
Add Profile Field :
-Name:Country
-Description:Please insert your country name
-Profile Section:choose place for edit e.g. Account Settings
-Show on Registration:Yes, and require entry
-Show on Topic View:
-Choose Placement:

etc, etc

Sorry for the inconvenience
Title: Re: CountryFlags Updated for SMF 2.0
Post by: smitch6 on August 12, 2011, 03:57:20 AM
i've had this installed for ages and i've never been able to figure out why .........
when a newbie registers it asks them for their country but it never shows up on their profile?
it has to be done manually afterwards, any ideas please
i have both boxes ticked as well in the settings
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 12, 2011, 09:02:00 AM
Quote from: smitch6 on August 12, 2011, 03:57:20 AM
...it has to be done manually afterwards...

For all newly registered? I ask you because there (first position in the drop down menu) is a blank field (provided for no country)  for the selection of the flag...Its possible that they confirm that field?

I have already said, SMF 2.0 :
1.Profile Summary...not visible
2.Forum Profile...visible (see image)
3.Member Post Profile...visible (see image)

Make a print screen and put it here....forum link also.

Title: Re: CountryFlags Updated for SMF 2.0
Post by: cryptic3 on August 15, 2011, 08:03:03 AM
I am trying to uninstall my mods to upgrade and country flags is one of the 2 that shows errors

1.   Adapt Database   install.php   
   2.   Execute Modification   ./Sources/Load.php   Test successful
   3.   Execute Modification   ./Sources/ManageSettings.php   Test successful
   4.   Execute Modification   ./Sources/Profile-Modify.php   Test successful
   5.   Execute Modification   ./Sources/Subs.php   Test failed
   1.   Add Before   ./Sources/Subs.php   Test failed
   6.   Execute Modification   ./Themes/default/Display.template.php   Test successful
   7.   Execute Modification   ./Themes/default/Profile.template.php   Test successful
   8.   Execute Modification   ./Themes/default/Register.template.php   Test successful
   9.   Execute Modification   ./Sources/Register.php   Test successful
   10.   Execute Modification   ./Themes/default/languages/Modifications.english.php   Test successful
11.   Execute Modification   ./Themes/default/languages/Modifications.english-utf8.php   Skipping file

can anyone advise what to do please.

Thanks
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 08:22:28 AM
It's very simple.Just uninstall the mod and after manually remove that part in /Sources/Subs.php via FTP .Of course, previously copy this code (in add) to PC

EDIT: In some discussions I have read like "not necessary manually remove parts of modification" ...but in my case,after upgrade and reinstall mod) with this CountryFlags  I have problem with country double display (profile field,name and flag) in members profile and posts
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 08:47:20 AM
I have just installed country flag mods to SMF 2.0 - everything went smooth and without warning.

However, after setting the options and everything, the flags do not appear in the forum?

I have done everything as requested in the mod page.

Any idea what may be wrong? Thanks
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 09:13:19 AM
Quote from: aselmani on August 15, 2011, 08:47:20 AM..the flags do not appear in the forum?...
Where?In which part?Profile or post?
Settings
ACP>Modification Settings>Miscellaneous :
Ask for country flag on......both
Show flags on Display page (Where posts are shown). ...check


Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 09:17:26 AM
Quote from: Branko. on August 15, 2011, 09:13:19 AM
Quote from: aselmani on August 15, 2011, 08:47:20 AM..the flags do not appear in the forum?...
Where?In which part?Profile or post?
Settings
ACP>Modification Settings>Miscellaneous :
Ask for country flag on......both
Show flags on Display page (Where posts are shown). ...check


I did this before asking for help and still don`t see them.  I don`t see the flags anywhere.
I repeated the step after your advise and still don`t see the flag.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 09:28:22 AM
Please, give link to your forum
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 09:39:25 AM
Hm, I see that field in the registration form....please approve my account to your forum
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 09:46:28 AM
Quote from: Branko. on August 15, 2011, 09:39:25 AM
Hm, I see that field in the registration form....please approve my account to your forum

Approved!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 10:02:59 AM
You are right .. do not see in my post profile.You do not have the code in the Display template.


EDIT:Theme on your forum?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 10:06:23 AM
Quote from: Branko. on August 15, 2011, 10:02:59 AM
You are right .. do not see in my post profile.You do not have the code in the Display template.


EDIT:Theme on your forum?


What does this mean, can you elaborate please?
What do I have to do?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 10:11:47 AM
Change forum default theme to another and check, maybe that is not compatible
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 10:19:40 AM
Quote from: Branko. on August 15, 2011, 10:11:47 AM
Change forum default theme to another and check, maybe that is not compatible


I don`t think that`s the case! It worked with 2.0 RC3 with this same default theme without problems.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 10:24:52 AM
In this case you need perform changes in some php's via FTP
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 10:27:57 AM
Quote from: Branko. on August 15, 2011, 10:24:52 AM
In this case you need perform changes in some php's via FTP


Which php and can I do it through control panel?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 10:32:52 AM
Like:
sourcedir/ManageSettings.php
sourcedir/Load
sourcedir/Profile-Modify.php
in this case go to mod's page and try parse . You will see what should be changed
or attach here
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on August 15, 2011, 10:44:05 AM
Damn, this is too complicated for me - I am a newbie and only know elementary things.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 15, 2011, 10:55:05 AM
I understand, you have a lot of support on SMF ...Parse function make the table and everything is crystal clear
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on August 18, 2011, 08:08:58 AM
I been getting some errors when users register and I didn't know about it until now.

http://www.df-barracks.com/index.php?action=register
8: Undefined index: country_flag_ask
File: /home/dfbarrac/public_html/Themes/default/languages/TPShout.english.php (registration_form sub template - eval?)
Line: 203

I guess there's a database table that's missing, can any one tell me how to fix this.

Joe
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 18, 2011, 01:59:41 PM
First, You have an Country flag related error ...bad installation or uninstallation.Second, shows the shoutbox related error.If you have Portal,some mod's generate conflicts...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on August 18, 2011, 02:39:40 PM
Thank you, I went a head and uninstalled it. any ideas on a fix or a way to fix the errors. I didn't want to install it again if it was going to happen again.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on August 18, 2011, 03:46:04 PM
Not recommended,  better way is to contact author of this modification...and tell him that there is a portal installed.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on August 18, 2011, 04:12:47 PM
Quote from: Branko. on August 18, 2011, 03:46:04 PM
Not recommended,  better way is to contact author of this modification...and tell him that there is a portal installed.

Well that's what I thought I was doing when I posted in this topic. since it was linked from the mod download page.
Is there another one that I missed that I should post this topic on.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on September 25, 2011, 04:52:59 AM
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on September 25, 2011, 06:14:57 AM
Ventic, Your better off to uninstall it. there's a lot of bugs in that package and no one will or can support it.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on September 25, 2011, 06:23:19 AM
but i need country flags to be shown in my forum :S
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on September 25, 2011, 06:48:46 AM
Well your going to have to wait until some one can fix the bug or make a newer or better mod. See I wanted the same thing added to my board too. That mod or package just doesn't work, Sorry. I don't know what to tell you. You mite want to check the download section for other mods or packages that may work. I haven't tried any thing else. I was hoping that they or some one would have fix it by now. The problem is that, That mod is no longer supported. That's means that no one is working on it to make it better or fix bugs.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: T3CHN0 on September 26, 2011, 12:43:14 PM
Last update (http://custom.simplemachines.org/mods/index.php?mod=417) was 25 September 2011, 06:16:23
That's only 2 days ago. I wouldn't say not supported as it was only just updated.
and the mod works perfect for me, no error's at all
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on September 26, 2011, 01:02:47 PM
Sorry, That's the one I downloaded and had the same problems that Ventic had with his. Sorry. That's why I had to uninstall it. There was to many bugs in it.

Update:
Well I just setup that mod again, and lets see how it goes. It seems to be ok, so far.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on September 27, 2011, 06:11:21 AM
Quote from: Ventic on September 25, 2011, 04:52:59 AM
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
i got this prob

anyone knows how to fix it
Title: Re: CountryFlags Updated for SMF 2.0
Post by: T3CHN0 on September 28, 2011, 05:55:32 AM
Quote from: Ventic on September 27, 2011, 06:11:21 AM
Quote from: Ventic on September 25, 2011, 04:52:59 AM
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
i got this prob

anyone knows how to fix it
did it install without errors, have you checked the install the smf parser to make sure everything installed.
have you checked your admin logs to see if there are errors from the flag mod or maybe profile error's
after installing the mod and if so can you post them.

I try to help if I can but this info from you will help others help you

cheers
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on September 28, 2011, 06:08:55 AM
no errors while installing,no any log error from panel no nothing
Title: Re: CountryFlags Updated for SMF 2.0
Post by: T3CHN0 on September 28, 2011, 01:27:30 PM
Hi Ventic
MOD PARSER (http://www.tytyweb.net/projects/smf/package-parser/) Check over your install and make sure everything installed correctly.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: bigjoe11a on September 28, 2011, 02:46:22 PM
Quote from: Ventic on September 28, 2011, 06:08:55 AM
no errors while installing,no any log error from panel no nothing

for right now. They are better off just selecting it again. I tried to register under a new user name and went threw all the crap and I had the same problem. No errors when I installed it. every thing is fine. I didn't get any errors when I registered. SO if there was some thing wrong, It would have reported it.

I think it's just a small but. and more then likely some one will have a fix for it.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Apllicmz on October 02, 2011, 04:06:16 AM
Yes
thank you
good work
Nice Mod
translate Portuguese

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do pa&iacute;s Ligado';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localiza&ccedil;&atilde;o?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde postes s&atilde;o apresentados).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>
   
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do pa&iacute;s Ligado';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localiza&ccedil;&atilde;o?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde postes s&atilde;o apresentados).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>

<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do pa&iacute;s Ligado';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localiza&ccedil;&atilde;o?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde postes s&atilde;o apresentados).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>
   
    <file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do pa&iacute;s Ligado';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localiza&ccedil;&atilde;o?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde postes s&atilde;o apresentados).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>

Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on October 09, 2011, 12:36:35 PM
Thanks for the translation!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 09, 2011, 03:36:57 PM
Hi vbgamer45!
For the latest version updated  all install.xml files (flags array):
-after 'mn' => 'Mongolia',   added 'me' => 'Montenegro',
-'cs' => 'Serbia and Montenegro' changed to  'rs' => 'Serbia',
-updated languages.xml , added serbian latin, serbian_cyrillic and croatian  iso/utf8 , inserted error="skip"> to all and fix several character set errors
All tested, test successful  :)
Best regards,Branko
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on October 10, 2011, 06:44:52 AM
Quote from: vbgamer45 on October 09, 2011, 12:36:35 PM
Thanks for the translation!
did you fix the problem?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on October 10, 2011, 01:23:13 PM
Haven't made any updates so no.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on October 10, 2011, 01:34:35 PM
Quote from: vbgamer45 on October 10, 2011, 01:23:13 PM
Haven't made any updates so no.
you will fix it or not
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on October 10, 2011, 01:39:32 PM
Maybe i need to know what to fix though.....
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on October 11, 2011, 07:37:51 AM
Quote from: Ventic on September 25, 2011, 04:52:59 AM
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on October 11, 2011, 04:41:34 PM
If he selects it again does it appear? Or still not. Also what SMF version
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on October 12, 2011, 12:47:58 AM
Quote from: vbgamer45 on October 11, 2011, 04:41:34 PM
If he selects it again does it appear? Or still not. Also what SMF version
of he select it again it appears
smf 2.0.1
Title: Re: CountryFlags Updated for SMF 2.0
Post by: smitch6 on October 12, 2011, 03:08:13 AM
Quote from: Ventic on October 12, 2011, 12:47:58 AM
Quote from: vbgamer45 on October 11, 2011, 04:41:34 PM
If he selects it again does it appear? Or still not. Also what SMF version
of he select it again it appears
smf 2.0.1

this also happens on RC4 as well
been looking for a solution to this for ages :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Bazino on October 13, 2011, 03:36:23 PM
Hm for me this mod doesn't work with 2.0.1 it seems.

I tried the automatic install via packet manager => it SAYS it's installed successfully, but nothing happens. Can't automatically uninstall it either...

So I did the manual installation just now... now I can select a country on my profile, but still there is no country flag displayed whatsoever... ?  :'(
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 13, 2011, 04:53:41 PM
Check first default theme and if is all ok then chek via ftp if flags folder exists in your custom theme.If not there, You forgot to install the mod for other themes.In this case uninstall mod, choose preferred themes and install mod again.

EDIT: Via FTP path is /Themes/default/images and /Themes/yourtheme/images
Title: Re: CountryFlags Updated for SMF 2.0
Post by: shubha on October 19, 2011, 02:18:27 AM
I didn't get the any option on the registeration page. My forum version 2.0.1
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on October 19, 2011, 05:38:53 AM
Quote from: shubha on October 19, 2011, 02:18:27 AM
I didn't get the any option on the registeration page. My forum version 2.0.1
you should enable it

did you fix the bug
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ddabcd277 on October 19, 2011, 01:52:15 PM
Hello,

I am having many errors from this mod:
QuoteUndefined index: country_flag_ask

Anyone having simmilar errors? How to fix them? I am using SMF 2.0.1

Thanks,
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 20, 2011, 01:19:49 PM
Where it shows errors?Write here the full path...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ddabcd277 on October 20, 2011, 02:08:23 PM
@ Branko

Hi,

Always at line 212. Here an example:

QuoteToday 08:23:46 pm
91b6ee9fef15287ba4503e9303cd71ce
Type of error: Undefined
http://www.garminclub.bg/index.php?action=register2
8: Undefined index: country_flag_askФайл: /home/www/garminclub-bg.com/www/Themes/default/Register.template.php (eval?)
Line: 212

Cheers,
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 21, 2011, 04:33:59 AM
Attach your Register.template.php here
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ddabcd277 on October 21, 2011, 05:20:23 AM
Here you have.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 21, 2011, 06:41:58 AM
I will check it.You can now try to Disable evaluation of templates in Server Settings, then empty the error log.Make a test account, then check error log about this problem.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ddabcd277 on October 21, 2011, 09:29:05 AM
Ok, many thanks.  :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Sloth Sinner on October 21, 2011, 03:44:43 PM
How can i add custom flags?
I tried with this method but the flags cannot show, i added the flags files in themes/default/images/flags and then modified the file sources/subs.php.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 21, 2011, 04:00:16 PM
also added in flags array ?

EDIT: I see..array, try this gondor=go and rename images also, of course and others.I think it is too long...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Sloth Sinner on October 21, 2011, 06:30:28 PM
Quote from: Branko. on October 21, 2011, 04:00:16 PM
also added in flags array ?

EDIT: I see..array, try this gondor=go and rename images also, of course and others.I think it is too long...

Excuse me, in which file?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 21, 2011, 06:46:37 PM
In flags folder rename all added images,  for example gay=gy , gondor=go , isengard=ig etc ...only two words names, then in subs.php. (flags array) also.Be careful with existing names.

EDIT:Of course,respect the alphabetical arrangement in flags array...it looks better in drop-down menu
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Sloth Sinner on October 21, 2011, 07:07:24 PM
I'm affraid to tell you... It doesn't work  :(

ED: i'm gonna try if flags folder exists in another location, for example themes/other theme/images, i will tell you if it works

EDIT2: Yes... It works!!
If you want to add flags, you must add it in themes/your-current-theme/images/flags

Thank you very much anyways  ;)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 22, 2011, 06:20:55 AM
Quote from: ddabcd277 on October 21, 2011, 05:20:23 AM
Here you have.
No errors
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on October 22, 2011, 06:39:56 AM
Quote from: Sloth Sinner on October 21, 2011, 07:07:24 PM
If you want to add flags, you must add it in themes/your-current-theme/images/flags
Of course...this themes/default/images/flags is an example
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GlitchPC on November 03, 2011, 02:00:12 AM
Nice mod...

Don't really feel like searching through 50 pages to find out why the flag image doesn't display in a user's profile.  It displays in their posts but, not their profiles.

Any suggestions?  Running SMF 2.0.1.  This mod supports it, right?

Update...

Uninstalled....

Mod installs with no errors but, does not insert image into Profile Summary.  One should not have to manually edit files to get this to do what it claims it does...just saying.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on November 03, 2011, 08:45:09 AM
any fix?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on November 29, 2011, 06:14:59 PM
Hi vbgamer

On installation on SMF 1.1.15

I get this error:
8.    Execute Modification    ./Themes/babylon/Display.template.php    File not found

It's nothing critical, but in a future update, could you please set this to "Skipping file" mode instead of appearing in red, where it's currently quite alarming. I have deleted the babylon theme folder as i don't use it. I use only the default theme.

Also, could you please add a flag for Antarctica? I have a few members who selected it and it shows a missing image display where it should show the flag.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on November 29, 2011, 08:18:58 PM
I would need someone to find a flag .gif/png file for anatartica then i can include it.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Thac0 on November 29, 2011, 11:48:59 PM
Hi

This fixed my issue with the flag images not appearing anywhere at first.

I still am missing the flag image from the Summary. The image displays perfectly in the Main Profile and in the Post by the user. But, for some odd reason, it isn't appearing in the Summary.

Version = 2.0.1
Theme = Night_sky_2
Fresh install of CountryFlags

Suggestions?

Thanks in advance.

Quote from: Branko. on August 05, 2011, 05:28:50 AM
Of course, Summary and Forum Profile Information also. First check the default theme, if it's okay ( all visible) then look (via FTP)  in Themes/[your_theme]/Profile.template.php 

Find // Always fun - select boxes!
elseif ($field['type'] == 'select')
{
echo '
<select name="', $key, '" id="', $key, '">';


and Replace with         // Always fun - select boxes!
         elseif ($field['type'] == 'select')
         {
            if ($key == 'country_flag')
            {
               echo '
                        <script type="text/javascript" language="JavaScript">
                           function show_country_flags()
                           {
                              document.images.flags.src = document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value != \'\' ? \'' . $settings['images_url'] . '/flags/\' + document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value + \'.png\' : \'' . $settings['images_url'] . '/flags/blank.gif\';
                           }
                        </script>
                        <select name="', $key, '" id="', $key, '" onchange="show_country_flags()">';
                       
                     foreach ($field['options'] as $value => $name)
                        echo '
                           <option value="', $value, '" ', isset($context['member']['country_flag']) &&  $context['member']['country_flag'] == $value ? 'selected="selected"' : '', '>', $name, '</option>';
                     
                     echo '
                        </select>
                        <img id="flags" src="', $settings['images_url'], '/', isset($context['member']['country_flag']) && !empty($context['member']['country_flag']) ? 'flags/' . $context['member']['country_flag'] . '.png': 'blank.gif', '" width="25" height="15" align="top" />';   
            }
            else
            {
               echo '
                     <select name="', $key, '" id="', $key, '">';

            if (isset($field['options']))
            {
               // Is this some code to generate the options?
               if (!is_array($field['options']))
                  $field['options'] = eval($field['options']);
               // Assuming we now have some!
               if (is_array($field['options']))
                  foreach ($field['options'] as $value => $name)
                     echo '
                        <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
            }

            echo '
                     </select>';
         }
         }

Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on November 30, 2011, 03:08:24 AM
Quote from: vbgamer45 on November 29, 2011, 08:18:58 PM
I would need someone to find a flag .gif/png file for anatartica then i can include it.

Here it is :)
http://en.wikipedia.org/wiki/File:Flag_of_Antarctica.svg
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Branko. on November 30, 2011, 07:38:43 AM
Quote from: vbgamer45 on November 29, 2011, 08:18:58 PM
I would need someone to find a flag .gif/png file for anatartica then i can include it.

http://www.iconspedia.com/icon/antartica-flag.html
Title: Re: CountryFlags Updated for SMF 2.0
Post by: jimv8673 on December 04, 2011, 04:50:02 PM
This Mod and quite a few more supposedly for 2.0.1 creates a visible area just above my forum such as this"

// 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';

cant understand what is wrong.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 05, 2011, 10:16:26 AM
Quote from: jimv8673 on December 04, 2011, 04:50:02 PM
This Mod and quite a few more supposedly for 2.0.1 creates a visible area just above my forum such as this"

// 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';

cant understand what is wrong.
Open themes/default/languages/modifications.english.php

Find ?>
And move to the end of the file
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 05, 2011, 10:28:28 AM
12/5/2011 v1.1.3
!Fixed missing Antarctica image
!Fixed skipping on Babylon theme if does not  exist.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GlitchPC on December 05, 2011, 11:26:15 AM
Has this issue been addressed:  http://www.simplemachines.org/community/index.php?topic=106060.msg3199486#msg3199486  ???
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 05, 2011, 12:10:54 PM
Didn't look into that one.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on December 06, 2011, 05:15:18 AM
Quote from: vbgamer45 on December 05, 2011, 10:28:28 AM
12/5/2011 v1.1.3
!Fixed missing Antarctica image
!Fixed skipping on Babylon theme if does not  exist.

Thanks a lot for taking care of this nice mod, vbgamer45. It's always refreshing to see more bugs getting squashed. :)

On this mod's download page, there are 3 versions of CountryFlags_v1.1.3.zip. What's the difference?
http://custom.simplemachines.org/mods/index.php?mod=417
Or is that a bug in the download system on this SMF site?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 06, 2011, 10:00:56 AM
Was a bug fixed
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 20, 2011, 02:45:18 PM
I dont know If I am the only one experiencing this, but I just noticed that when a guest fill all required fields but the country they are from, it usually gives an error that they have to go back and chose a country. but when they hit back the county field is gone!


thanks for any help in advance


Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 20, 2011, 02:53:15 PM
Field is not shown at all? What SMF version?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 20, 2011, 02:56:00 PM
2.0.1 and yes it is not showing at all and forgot to mention that without it I was able to register a new user.


don't know if others also experiencing the same problem?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GlitchPC on December 20, 2011, 03:34:02 PM
Unfortunately...this mod STILL does NOT show the flag in a member's Summary Profile...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on December 20, 2011, 07:25:59 PM
thanks for this great mod

minor problem

its when you register on the forum and choose your country, the forum doesn't save the settings of the countryflag to the userprofile, people have to reselect the countryflag again in the forum profile later after register.(if they do it!!!)

its not cool because it is mandatory to Register on the forum. so if its not working, then it has no sense to use it, because people will not think they must set their countryflag in the forum profile, and some will never do it !!! ;)

so can anyone help me fix this bug thanks !!!!




Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on December 21, 2011, 02:44:55 AM
vinzbomb, this is strange, what SMF version are you using?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on December 21, 2011, 03:59:25 AM
Quote from: sharks on December 21, 2011, 02:44:55 AM
vinzbomb, this is strange, what SMF version are you using?

i use smf 2.01
Title: Re: CountryFlags Updated for SMF 2.0
Post by: smitch6 on December 21, 2011, 04:34:10 AM
mine has never remembered the country :(
i've been saying that from day 1 of using it

it's a great mod but could do with being sorted so it works 100%
i love it but it is a pain having a ? where it should be a country or nothing at all even though i have it set on moth registration and profile setting and it's a must when you join??

and i'm using the latest smf and mod available
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on December 21, 2011, 05:53:13 AM
Quote from: smitch6 on December 21, 2011, 04:34:10 AM
mine has never remembered the country :(
i've been saying that from day 1 of using it

it's a great mod but could do with being sorted so it works 100%
i love it but it is a pain having a ? where it should be a country or nothing at all even though i have it set on moth registration and profile setting and it's a must when you join??

and i'm using the latest smf and mod available

totally agree with you !!!

Guys we need some kinda talenteus php coder to find that bug and fix it
I'll give a free vip account for life if someone helps to resolve it
thanks anyways to you all bringing these great mods
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on December 21, 2011, 06:02:21 AM
Quote from: vinzbomb on December 20, 2011, 07:25:59 PM
thanks for this great mod

minor problem

its when you register on the forum and choose your country, the forum doesn't save the settings of the countryflag to the userprofile, people have to reselect the countryflag again in the forum profile later after register.(if they do it!!!)

its not cool because it is mandatory to Register on the forum. so if its not working, then it has no sense to use it, because people will not think they must set their countryflag in the forum profile, and some will never do it !!! ;)


ok i had said "MINOR BUG" actually NOT !!!

Its a big bugg !!!

the effect is that it has no sense to use it since its not working correctly like it should !!!! why putting the setting "require country select on registration page" IT DOESN'T WORK it appears and work on the registration page but do not save the setting to the user profile !!!
apparently i'am not only one with this bug, and was reported on the same day, the mod came out.
so can anyone help me fix this bug thanks !!!!

Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on December 22, 2011, 03:49:30 AM
I'm using SMF 1.1.15 and i haven't had this problem so you may be right, as you're using SMF 2.0. vbgamer should reply shortly. He maintains his mods fairly regularly.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on December 22, 2011, 06:22:09 AM
yes maybe its a problem with some mods installed !!!

i was thinking about that buggy, maybe its because their is a setting that ask "ask countryflag on both registration page and user profile" that makes a bugg
i tried all possibly settings but the still the same.
so i think people understand i am not php programmer or whatever, but how does it works ?

when you set your countryflag in your forum profile the setting is remembered, so it might not do the same action on the registration page
what is the code that tells the forum to save settings to the user profile ? maybe its a permission problem to write the settings from the registration page !!

i  really don't know !!!

hope vbgamer would take a closer look to that problem, or someone else, thanks everybody !!!
:P
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
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
Title: Re: CountryFlags Updated for SMF 2.0
Post by: sharks on December 22, 2011, 11:57:11 PM
Quote from: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
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


Dependable, as usual. :D Thanks for your continuous support, vbgamer45!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GlitchPC on December 23, 2011, 12:03:56 AM
Quote from: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
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


Has this been fixed, too?

http://www.simplemachines.org/community/index.php?topic=106060.msg3232398#msg3232398

Update...

Installed new mod...and the answer to my question is...NOPE.   ;)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 23, 2011, 12:11:38 AM
Currently not part of the mod. Maybe will include in the future.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GlitchPC on December 23, 2011, 12:19:09 AM
Quote from: vbgamer45 on December 23, 2011, 12:11:38 AM
Currently not part of the mod. Maybe will include in the future.

Then you need to modify your first post...

QuoteThis 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.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 23, 2011, 12:21:19 AM
Has been modified.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 23, 2011, 12:40:00 AM
Quote from: BaghdadGhost on December 20, 2011, 02:56:00 PM
2.0.1 and yes it is not showing at all and forgot to mention that without it I was able to register a new user.


don't know if others also experiencing the same problem?

great job,


I just installed the new version and it solved the above referred problem.


thanks again
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on December 23, 2011, 12:49:38 AM
Glad to help
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on December 23, 2011, 07:15:38 AM
Quote from: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
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

ok thanks works great now
vbgamer your are the best   ;)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: smitch6 on December 24, 2011, 07:10:07 PM
i just deleted the old version and tried to upload and install the new one
i'm using the latest V of smf and bang my whole site went down
i gather this new package doesn't like the latest version of smf?????

or do i have to manually edit files to get this to work?

thanks
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 24, 2011, 07:12:58 PM
Quote from: smitch6 on December 24, 2011, 07:10:07 PM
i just deleted the old version and tried to upload and install the new one
i'm using the latest V of smf and bang my whole site went down
i gather this new package doesn't like the latest version of smf?????

or do i have to manually edit files to get this to work?

thanks

was there any errors during installation?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: smitch6 on December 25, 2011, 03:17:43 AM
i managed to get it working with no errors now
but........

now everyone has 2 flags on their profile lol :) oops

how do i remove that pls?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 25, 2011, 03:35:34 AM
it means you have two of the same code.

if the duplication in profile then in ./Themes/default/Profile.template.php you should find and delete


         // Always fun - select boxes!
         elseif ($field['type'] == 'select')
         {
            if ($key == 'country_flag')
            {
               echo '
                        <script type="text/javascript" language="JavaScript">
                           function show_country_flags()
                           {
                              document.images.flags.src = document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value != \'\' ? \'' . $settings['images_url'] . '/flags/\' + document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value + \'.png\' : \'' . $settings['images_url'] . '/flags/blank.gif\';
                           }
                        </script>
                        <select name="', $key, '" id="', $key, '" onchange="show_country_flags()">';
                       
                     foreach ($field['options'] as $value => $name)
                        echo '
                           <option value="', $value, '" ', isset($context['member']['country_flag']) &&  $context['member']['country_flag'] == $value ? 'selected="selected"' : '', '>', $name, '</option>';
                     
                     echo '
                        </select>
                        <img id="flags" src="', $settings['images_url'], '/', isset($context['member']['country_flag']) && !empty($context['member']['country_flag']) ? 'flags/' . $context['member']['country_flag'] . '.png': 'blank.gif', '" width="25" height="15" alt="" align="top" />';   
            }
            else
            {
               echo '
                     <select name="', $key, '" id="', $key, '">';

            if (isset($field['options']))
            {
               // Is this some code to generate the options?
               if (!is_array($field['options']))
                  $field['options'] = eval($field['options']);
               // Assuming we now have some!
               if (is_array($field['options']))
                  foreach ($field['options'] as $value => $name)
                     echo '
                        <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
            }

            echo '
                     </select>';
         }
         }



if the duplication in mini profile near the avatar then in ./Themes/default/Display.template.php look for and delete



// Show the country they hail from!
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
{
$flags = country_flags();
echo '
<li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="', $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
}
Title: Re: CountryFlags Updated for SMF 2.0
Post by: smitch6 on December 25, 2011, 03:21:36 PM
kool thanks Bag :)
worked a treat i'm back to 1 flag again now

lets wait and see when a new member joins now wether they have a flag on their profile now

thanks again
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 25, 2011, 07:03:44 PM
I already watched some new members and it does show their flag.  :)


Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ventic on December 26, 2011, 05:46:21 AM
Quote from: BaghdadGhost on December 25, 2011, 07:03:44 PM
I already watched some new members and it does show their flag.  :)
yes it works :D
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ddabcd277 on December 26, 2011, 01:23:22 PM
Hello,

I have installed the latest version of country flags 2.0 but the problem with Undefined index: country_flag_ask still appears in forum errors log. Here what I have:

Quotehttp://www.myforum.bg/index.php?action=register
8: Undefined index: country_flag_ask
File: /home/www/myforum.com/www/Themes/default/GenericControls.template.php (eval?)
Line: 212

QuoteType of error: Undefined

I have attached the GenericControls.template.php
Title: Re: CountryFlags Updated for SMF 2.0
Post by: tank_fv101 on December 30, 2011, 02:20:08 PM
Hello all,

I hope you can help with an error I have on my forum with this mod.  I'm using 2.0.2.

When members have had a look at the selection of flags in their profile, but decided not to choose one, it would come up with "Country" under their avatar and a broken picture called 00.png   So, as a temporary measure to make it look nicer I created a 00.png which is transparent and uploaded (as the file didn't even exist).  I'm not sure why choosing a blank option should select a picture?

Can anyone help with the "Couuntry" not appearing, and also the picture not appearing as well.

Thanks for your time.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 30, 2011, 02:24:40 PM
I have had this problem before and uploaded an image of my own. it should make sense to other using this one cuz they did not want to declare their country of origin.


see attachment.

Title: Re: CountryFlags Updated for SMF 2.0
Post by: tank_fv101 on December 30, 2011, 03:02:05 PM
Thanks BaghdadGhost.  I've already sorted the image out for myself, but what I would like is for the 'Country' to disappear from the info area - under the users avatar - if a user doesn't select a country.  It seems silly to have to have it there if somebody doesn't select anything. :-\  I can understand it if a forum wants to force users to declare their country, but my forum doesn't want to do that.   :laugh:
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on December 30, 2011, 03:04:18 PM
btw, what version of the mod did you install? was it the most updated one
Title: Re: CountryFlags Updated for SMF 2.0
Post by: tank_fv101 on December 30, 2011, 03:07:05 PM
I have version 2.0.  Thanks!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ApplianceJunk on December 31, 2011, 11:54:47 PM
When I try to uninstall CountryFlags 1.1.2 so I can install 1.1.3 I see this...

Quote3.   Execute Modification   ./Sources/ManageSettings.php   Test failed

I'm running SMF 2.0.2
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on January 01, 2012, 12:46:38 AM
Quote from: ApplianceJunk on December 31, 2011, 11:54:47 PM
When I try to uninstall CountryFlags 1.1.2 so I can install 1.1.3 I see this...

Quote3.   Execute Modification   ./Sources/ManageSettings.php   Test failed

I'm running SMF 2.0.2

its because you installed another mod after this one.


in the same file try to find



'',
// 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'),


and remove it manually


Title: Re: CountryFlags Updated for SMF 2.0
Post by: mikedijital on January 01, 2012, 06:56:59 PM
I installed this on 2.0.2 and all the code is right were it should be. the admin features, and selection drop down in profiles works fine.... no flags show up on the mini profile in posts....  the code is there... just not translating from back end to front... can someone help
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on January 01, 2012, 08:44:34 PM
Please change "Serbia and Montenegro" to "Serbia" and change images
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on January 01, 2012, 09:38:18 PM
Quote from: mikedijital on January 01, 2012, 06:56:59 PM
I installed this on 2.0.2 and all the code is right were it should be. the admin features, and selection drop down in profiles works fine.... no flags show up on the mini profile in posts....  the code is there... just not translating from back end to front... can someone help

do you mean now there is a place created under the avatar for the flag but the flag is not showing, or there is no flag and no place for it or anything referring to it?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: mikedijital on January 01, 2012, 10:09:21 PM
the code is in the file as needed, but its not showing, or showing a space for it in the mini profile. I have it turned on in the admin panel.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on January 01, 2012, 10:56:42 PM
Quote from: mikedijital on January 01, 2012, 10:09:21 PM
the code is in the file as needed, but its not showing, or showing a space for it in the mini profile. I have it turned on in the admin panel.

I assume file=display.template correct?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: mikedijital on January 01, 2012, 11:03:48 PM
correct, display.template in the default theme folder
Title: Re: CountryFlags Updated for SMF 2.0
Post by: BaghdadGhost on January 01, 2012, 11:06:31 PM
do you yes the default theme for your forum or a custom theme?

if costume theme then you need to put the code in display. template of your current theme

Title: Re: CountryFlags Updated for SMF 2.0
Post by: mikedijital on January 01, 2012, 11:40:38 PM
there is no display template, just index.templete in the theme

its not working on the default theme either
Title: Re: CountryFlags Updated for SMF 2.0
Post by: admirable on January 08, 2012, 04:21:43 PM
Is there any way in Country Flag mod that assign country flag automatically which an users belongs to..

I mean members don't need to select their country... Mod automatically recognise every members country and show it....
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on January 08, 2012, 04:28:09 PM
Not at the moment.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on January 08, 2012, 07:52:24 PM
Quote from: vbgamer45 on January 08, 2012, 04:28:09 PM
Not at the moment.

please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!

Title: Re: CountryFlags Updated for SMF 2.0
Post by: rootuid on January 31, 2012, 11:42:01 AM
Apply Filter: Only show the error messages of this URL
http://xxxxxxxxxx/forum/index.php?action=register
Apply Filter: Only show the errors with the same message
8: Undefined index: country_flag_ask
Apply Filter: Only show the errors from this file
File: /xxxxx/xxxxxpublic_html/forum/Themes/default/Register.template.php
Line: 212

Any idea what is happening? It looks like it is being called and failing upon registration ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: rootuid on February 04, 2012, 03:26:30 AM
I have a problem:
When a user inputs their location in their profile and clicks save profiles it doesn't save . The user has to repeat this and it saves the second time. Any ideas? thanks.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 04, 2012, 11:05:27 AM
Quote from: rootuid on February 04, 2012, 03:26:30 AM
I have a problem:
When a user inputs their location in their profile and clicks save profiles it doesn't save . The user has to repeat this and it saves the second time. Any ideas? thanks.
Using latest version if so what SMF version?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on February 04, 2012, 06:59:28 PM
Quote from: Present. on January 08, 2012, 07:52:24 PM
please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!

whether this will happen once (quote)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 04, 2012, 07:04:40 PM
Quote from: Present. on February 04, 2012, 06:59:28 PM
Quote from: Present. on January 08, 2012, 07:52:24 PM
please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!
I would need flag images for both of the same size.

whether this will happen once (quote)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on February 04, 2012, 07:32:10 PM
Quote from: vbgamer45 on February 04, 2012, 07:04:40 PM
Quote from: Present. on February 04, 2012, 06:59:28 PM
Quote from: Present. on January 08, 2012, 07:52:24 PM
please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!
I would need flag images for both of the same size.

whether this will happen once (quote)

ok ,flags images in attachments
cs.png - Serbia
me.png - Montenegro
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 04, 2012, 09:09:49 PM
Update!
Separated Serbia and Montenegro
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on February 05, 2012, 07:41:02 AM
Quote from: vbgamer45 on February 04, 2012, 09:09:49 PM
Update!
Separated Serbia and Montenegro

No "Serbia and Montenegro" should only "Serbia"
and should only "Montenegro"  - me.png
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 05, 2012, 10:13:24 AM
Yeah that's what i di.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on February 05, 2012, 11:02:22 AM
Nope.
Source/Subs.php - edit
'cs' => 'Serbia and Montenegro',  replace with    'cs' => 'Serbia',
(http://www.dodaj.rs/f/U/FI/1XdhiALT/edit.png)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 05, 2012, 11:45:51 AM
Are you using new one on modsite?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Zuća on February 05, 2012, 11:56:52 AM
Quote from: vbgamer45 on February 05, 2012, 11:45:51 AM
Are you using new one on modsite?

yes - CountryFlags_v2.0.1.zip
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 05, 2012, 11:14:21 PM
Fixed now missed in SMF 2.0.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: 4Kstore on February 13, 2012, 02:09:18 PM
I have this error in the register page using CountryFlags_v2.0.1a

Fatal error: Call to undefined function country_flags() in /usr/home/todo-apuestas.es/web/foro/Sources/Load.php(2394) : eval()'d code on line 215

I fixed changin this:

In subs.php
function CountryFlag()

replace:
function country_flags()
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on February 16, 2012, 02:52:47 PM
In addition to the fix that 4Kstore posted, there's another THREE problems in the latest package, for SMF 2.0.2.

I'm going to go ahead and post the fixes here.

./Themes/default/Register.template.php
Code (Find) Select
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $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.registration.country.options[document.forms.registration.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.registration.country.options[document.forms.registration.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<dl class="register_form" id="country_flag">
<dt><strong>', $txt['country_flag_label'], ':</strong></dt>
<dd>
<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" alt="" width="25" height="15" align="top" />
</dd>
</dl>';
}

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

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.registration.country.options[document.forms.registration.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.registration.country.options[document.forms.registration.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<dl class="register_form" id="country_flag">
<dt><strong>', $txt['country_flag_label'], ':</strong></dt>
<dd>
<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" alt="" width="25" height="15" align="top" />
</dd>
</dl>';
}

echo '
</fieldset>
<span class="botslice"><span></span></span>
</div>';

So, what changed?

The if conditions statements were improperly grouped if the setting was empty, causing undefined errors.
Code (This) Select
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
Code (Should Be) Select
if (!empty($modSettings['country_flag_ask']) && ($modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3))Notice the grouping of the 2 || 3, without the grouping it is if the setting is NOT empty and the value is 2, OR if the value is 3, which is fine, but there's no isset();, so if the variable is not set, that's when it becomes undefined because it's not combined with the !empty();, and doesn't have an isset();.

The second is the function name...
$flags = CountryFlags();
The function name was apparently changed to "country_flags", and the corresponding function calls were not updated with the name change update. So simply changing it to$flags = country_flags();Resolved this error, which throws an undefined function error.

The final issue was that the closing of the windowbg was replaced, and not added in the flags code, so it screws up the registration layout without adding it back.

Code (Below the Flags Code) Select
echo '
</fieldset>
<span class="botslice"><span></span></span>
</div>';

Like so.

Hope this helps.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 16, 2012, 03:03:14 PM
I did an update last night that should have changed all calls to CountryFlags();
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on February 16, 2012, 03:23:47 PM
Well I downloaded the package today, and all four issues listed above were present. I'd suggest fixing them asap.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 16, 2012, 10:28:36 PM
Thanks Labradoodle-360 made all the changes except for $flags = country_flags(); since i do not have a country_flags() function in the code at all.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vinzbomb on February 17, 2012, 07:21:48 AM
hello,

i use country flags on two forums, one in english, and one in french, so i need coutry flags in french mod, i can translate it for you, but don't know how to do !

let me know i will translate it, or is there another quicker way to translate it ?!

tahnsk laters !!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 17, 2012, 11:04:19 AM
To translate find the text in themes/default/modifications.english.php
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on February 17, 2012, 11:23:55 AM
Quote from: vbgamer45 on February 16, 2012, 10:28:36 PM
Thanks Labradoodle-360 made all the changes except for $flags = country_flags(); since i do not have a country_flags() function in the code at all.
Not a problem :) Hope you're doing well!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 17, 2012, 11:39:45 AM
Doing well just busy as always.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: distante on February 20, 2012, 07:05:33 AM
Quote from: vbgamer45 on February 17, 2012, 11:39:45 AM
Doing well just busy as always.

Hello vbgamer45!

The actual file is bug free? (at least, reported bug free?)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 20, 2012, 11:02:30 AM
Should be.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: distante on February 20, 2012, 11:46:05 AM
I see everything ok, thanks ;)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 20, 2012, 12:05:22 PM
Glad it is working for you.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: distante on February 20, 2012, 08:01:31 PM
Hey vbgamer45, a little question, I saw in a part of the code this:

document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value + \'.png\' : \'' . $settings['images_url'] . '/flags/blank.gif\';


But in the mod package isn't any blank.gif file...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: mrselnombre on March 03, 2012, 03:19:48 PM
Quote from: tank_fv101 on December 30, 2011, 02:20:08 PM
Hello all,

I hope you can help with an error I have on my forum with this mod.  I'm using 2.0.2.

When members have had a look at the selection of flags in their profile, but decided not to choose one, it would come up with "Country" under their avatar and a broken picture called 00.png   So, as a temporary measure to make it look nicer I created a 00.png which is transparent and uploaded (as the file didn't even exist).  I'm not sure why choosing a blank option should select a picture?

Can anyone help with the "Couuntry" not appearing, and also the picture not appearing as well.

Thanks for your time.
yup, same here..
Title: Re: CountryFlags Updated for SMF 2.0
Post by: cachimbo.pt on March 16, 2012, 10:36:49 PM
I really don't understand the way the mods are supposed to work, I've been trying but no luck, so far... So, excuse me for another dumb question.

I managed to instal the Country Flags mod, the directory ./Themes/default/images/flags got created with all the pics, but I see no flags (after configuring the profile).
A search on httpd error log showed me that there were some requests for files inside ./Themes/core/images/flags, which of course does not exists.
So, I went into every theme and made a symlink to the correct place "ln -s ../../default/images/flags flags", ok, now when I select the country in the change profile page I can see the flag pic (including when using core theme) and no more errors in error_log.

My problem is that when seeing posts the text Country: [flagpic] does not show up ONLY WHEN I'm using the core theme.

I only have more 5 themes installed default Curve, Curve_Black_Gray_Light, DVP-Smoke-Machine, rusty-white and Skm_Night, but all my users are using the core theme (my fault, I set that as the default when I started the forum) and I don't want to force them to change, what do I do for the pic to show up with core theme ?

I'm using SMF 2.0.2, mod is CountryFlags_v2.1.zip (174925 bytes)
Thanks in advance
Title: Re: CountryFlags Updated for SMF 2.0
Post by: cachimbo.pt on March 16, 2012, 10:55:29 PM
Ok, solved it.
Had to edit Display.template.php in core by hand and pasted the line


// Show the country they hail from!
                        if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
                        {
                                $flags = CountryFlag();
                                echo '<li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="', $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
                        }


from the default theme... I wonder why it failed, permissions are the same rw-r--r--
Still have to find the right place to put it but it's ok now.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: RoCKeT-88 on April 03, 2012, 04:21:05 AM
I am trying to install this on a 2.02 but tells me the current version is not compatible with that 2.0.2
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on April 03, 2012, 02:32:59 PM
Try to emulate it in the package manager it should work for 2.0
Title: Re: CountryFlags Updated for SMF 2.0
Post by: RoCKeT-88 on April 03, 2012, 06:31:36 PM
OK So I just emulate 2.0.2 or another version?  Sorry I dont recall this feature before I been lax on updating stuff so just getting back into all. 

Thanks a lot~
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on April 04, 2012, 04:36:33 PM
I would emulate just 2.0 and see if that works.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: DaKrampus on May 06, 2012, 05:34:24 AM
Very nice mod.
Had to tweek a little to fit my needs.

I also added the country display in profile (which was missing in my version.)
If someone is interested, here is the code.

in Profile.template.php
Find:
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>




and after add:

// Flag Mod
if(!empty($modSettings['country_flag_show']) && $modSettings['country_flag_show'] == 1)
$flags = CountryFlag();
echo '

<dt>', $txt['country_flag'], ':</dt>

<dd>', (!empty($context['member']['country_flag']) && $context['member']['country_flag']!= '00') ? '<img src="' . $settings['images_url']. '/flags/' . $context['member']['country_flag'] . '.png" alt="' . $context['member']['country_flag'] . '" title="' . $flags[$context['member']['country_flag']] . '" />' :'N/A' . '</dd>';
// Flag Mod end


Thats it..

Da
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on May 06, 2012, 01:47:04 PM
Nice tip thanks!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: DaKrampus on May 09, 2012, 05:09:28 AM
ahh.. btw i forgot.
i fixed another little bug, because it was anoying, (although very few people could get pas registration without  putting in country flag....
in your version there are 2 empty fields when selecting country...
one is really empty (the one in the template) and the other one is the '00' flag in the flags array...
if the user selects the second empty field, he can register, but has no flag (i.e. the empty '00' flag.)

The fix is easy:
first added a 1 px transparent png and called it 00.png in the flags directory.

then:
- in the flags array i changed:

$flags = array(
'00' => '',

to
$flags = array(
'00' => 'Select country',


OK, I was to lazy to add the text to the language file...

then removed the empty select in 2 instances. (cant remember exactly where, but an empty <option.....></option> is easy to find in the installrc4

then:
where the posting is required... in register.php
find
if (!empty($modSettings['country_flag_required']) &&  empty($_POST['default_options']['country']))
replace with:
if (!empty($modSettings['country_flag_required']) && (empty($_POST['default_options']['country']) ||  $_POST['default_options']['country'] == '00'))

the addon for the profile page I posted above allready contains the fix for the 00.png...

Like this it works fine for me...
Da

there still remains 1 little todo...
if flag is required in registration, then he should NOT be able to select the empty 00 flag when he modifies his profile...
I will add that when i got a little more time.. its just a line identical to  the if statement above...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on May 09, 2012, 10:57:14 AM
There are a couple of bugs that I know of in this modification, I intend on rewriting it shortly to fix any of the bugs and clean it up a little bit.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: DaKrampus on May 09, 2012, 01:27:22 PM
Great news, If you want I can send you the install package I made that also includes incorporation in memberlist.
Da
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on May 09, 2012, 01:29:46 PM
I appreciate the offer, although I honestly prefer just writing any additions myself :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: DaKrampus on May 09, 2012, 06:31:26 PM
I fully understand, same here.
The memberlist sorting is anyway done the way I wanted it, which is not allways the way most want...

up and down.. sort by flag.. within the flags per username ASC ,
but no matter if you sort flags ASC or DESC, I allways wanted them first, and those that dont have a flag, only come afterwards.. (so i dont have to go to last page if the first 10 pages of users dont have flags  when I sort upwards..)

It works nicely, so here the sort "hint" if you want to do it my way...
'down' => 'mem.country_flag DESC, mem.real_name ASC',
'up' => 'LENGTH(mem.country_flag) > 0 DESC, mem.country_flag = "00" ASC, mem.country_flag ASC, mem.real_name ASC'

Da
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ShanRob_ClinnOTH23 on May 20, 2012, 11:09:09 AM
i have problems with it. i have installed the package but when i choose my country,the flag picture won't show,only the norway text.. why is that?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: TheListener on May 20, 2012, 11:38:52 AM
Quote from: ShanRob_ClinnOTH23 on May 20, 2012, 11:09:09 AM
i have problems with it. i have installed the package but when i choose my country,the flag picture won't show,only the norway text.. why is that?

Which theme do you use?

Check the default theme to see if the flag shows there.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on May 20, 2012, 01:35:10 PM
More details would be fantastic, it's most likely an issue of not having copied over the flag images to your theme images directory.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ShanRob_ClinnOTH23 on May 21, 2012, 08:53:31 PM
Quote from: Old Fossil on May 20, 2012, 11:38:52 AM
Quote from: ShanRob_ClinnOTH23 on May 20, 2012, 11:09:09 AM
i have problems with it. i have installed the package but when i choose my country,the flag picture won't show,only the norway text.. why is that?

Which theme do you use?

Check the default theme to see if the flag shows there.

it does,but since my forum is one tree hill forum i'm using a different theme. i'm using these theme called CLS-pro-finecolor and i downloaded the theme from this forum..
Title: Re: CountryFlags Updated for SMF 2.0
Post by: TheListener on May 21, 2012, 09:09:07 PM
Quote from: Labradoodle-360 on May 20, 2012, 01:35:10 PM
More details would be fantastic, it's most likely an issue of not having copied over the flag images to your theme images directory.

This may be your answer.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ShanRob_ClinnOTH23 on May 21, 2012, 09:48:30 PM
Quote from: Old Fossil on May 21, 2012, 09:09:07 PM
Quote from: Labradoodle-360 on May 20, 2012, 01:35:10 PM
More details would be fantastic, it's most likely an issue of not having copied over the flag images to your theme images directory.

This may be your answer.
i fixed it. i forgot to choose to install on some themes and when i changed that it worked completly. thank you guys so much :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: TheListener on May 21, 2012, 09:50:03 PM
Quote from: ShanRob_ClinnOTH23 on May 21, 2012, 09:48:30 PM
Quote from: Old Fossil on May 21, 2012, 09:09:07 PM
Quote from: Labradoodle-360 on May 20, 2012, 01:35:10 PM
More details would be fantastic, it's most likely an issue of not having copied over the flag images to your theme images directory.

This may be your answer.
i fixed it. i forgot to choose to install on some themes and when i changed that it worked completly. thank you guys so much :)

(http://i258.photobucket.com/albums/hh258/2plus1_bucket/fryingpan-1.jpg)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on May 21, 2012, 11:09:07 PM
Not a problem, I'm glad you got it working :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ShanRob_ClinnOTH23 on May 22, 2012, 03:40:08 AM
Quote from: Labradoodle-360 on May 21, 2012, 11:09:07 PM
Not a problem, I'm glad you got it working :)
yeah me too :) it was literally driving me insane.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: carloscuev on June 08, 2012, 12:35:54 AM
I had a problem with country flags and want to share the solution:

Problem: Install went well and everything, but there was always php code on the top of the forum

Solution: Dig to Modifications.english.php and change that badly terminated PHP file

From this:
(http://img600.imageshack.us/img600/489/countryflags0.png)

To this:
(http://img528.imageshack.us/img528/7820/countryflags1.png)

I guess Anti Bot: Are You Human/Bot? mod left the php close mark: ?> in that place and CountryFlags couldn't handle it.

BTW, if your forum is in another language, add to Modifications.<your laguage>.php those new variables

It's the least I could do for such an awesome forum ;)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 08, 2012, 12:37:16 AM
Hello carloscuev! Thank you for stopping by and posting your solution, we definitely appreciate it.

I actually believe it's a bug in this modification, as I've seen it before. I'll put it on my list of things to fix. Thanks for reminding me :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Arantor on June 08, 2012, 09:21:23 AM
It's not a bug in this modification. As stated and as demonstrated, it's a bug in the Are You Human modification.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on June 09, 2012, 08:32:44 PM
How to show the country in text and no with images ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 20, 2012, 08:07:13 PM
I'm hoping you can help me out with this every time you try to log into the site I get this error

Database Error: Field 'country' doesn't have a default value
File: C:/inetpub/root/Sources/Subs.php
Line: 2760
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 21, 2012, 01:28:48 AM
@Dracopaion - Try running the Country Flags install file again. You can extract the .zip archive on your computer and then upload the install.php file to your server and then run it in your browser.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 21, 2012, 04:16:12 AM
no Joy it still errors out ive attached some more information that may help i hope and attached is the subs.php file itself.

I also noticed that when you log out there is another error that says Database Error Please try again. If you come back to this error screen, report the error to an administrator.

The Mods installed

1.   Add Social Media Icons To Profiles
2.   Add Stars To Profile
3.   Adk Custom Block
4.   Adk Gallery
5.   Adk Highlight Php
6.   Admin Toolbox
7.   Aeva Media
8.   Auto Refresh Who Index
9.   Autor In Display
10.   AvatarSelect
11.   Avatar Verification
12.   BBCode with style
13.   Country Flags
14.   Curve mobile mod
15.   Custom Action Mod
16.   Custom Form Mod
17.   Custom Permissions
18.   ENotify
19.   Event Registration Mod
20.   Hide Info Center From Guests
21.   Login Logger
22.   Membergroup ID with Group Name
23.   Menu Editor Lite
24.   NChat
25.   newstaffblock
26.   Notify of posts and replys by default
27.   Order Custom Profile Fields
28.   nneonneo's AJAX ShoutBox
29.   Separate the sticky topics
30.   SimplePortal
31.   Staff Permissions For Simple Portal
32.   Topic Rating Bar

the top and bottem 5 of the error location

$smcFunc['db_insert']($do_delete ? 'ignore' : 'replace',
'{db_prefix}log_online',
array('session' => 'string', 'id_member' => 'int', 'id_spider' => 'int', 'log_time' => 'int', 'ip' => 'raw', 'url' => 'string'),
array($session_id, $user_info['id'], empty($_SESSION['id_robot']) ? 0 : $_SESSION['id_robot'], time(), 'IFNULL(INET_ATON(\'' . $user_info['ip'] . '\'), 0)', $serialized),
array('session')
);
}

// Mark your session as being logged.
$_SESSION['log_time'] = time();
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on June 21, 2012, 11:17:30 AM
Quote from: Diego Andrés on June 09, 2012, 08:32:44 PM
How to show the country in text and no with images ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 21, 2012, 01:01:47 PM
I am currently working on a new version of Country Flags that will contain quite a few enhancements.

Quote from: Diego Andrés on June 09, 2012, 08:32:44 PM
How to show the country in text and no with images ?
I'll throw this option in for you.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on June 21, 2012, 06:10:01 PM
Thank you !! ;D
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 21, 2012, 06:20:00 PM
There's a sneak peak on our Facebook page if you want to see it. (SMFHacks)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 21, 2012, 06:24:54 PM
Link to FB account for the preview http://www.facebook.com/smfhacks
Link us if you enjoy the work we do!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 22, 2012, 12:45:13 AM
Hi guys

Any more possible fixes for this found yet?

QuoteDatabase Error: Field 'country' doesn't have a default value
File: C:/inetpub/root/Sources/Subs.php
Line: 2760

Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 22, 2012, 01:12:55 AM
Quote from: Labradoodle-360 on June 21, 2012, 01:01:47 PM
I am currently working on a new version of Country Flags that will contain quite a few enhancements.

Quote from: Diego Andrés on June 09, 2012, 08:32:44 PM
How to show the country in text and no with images ?
I'll throw this option in for you.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 22, 2012, 03:28:51 AM
Unfortunately I can't wait until you release your next version of this mod to see if it may fix the problem so I tried to uninstall the mod instead. The pre check for uninstall was all good to go and it seemed to uninstall without a problem however I'm still getting the same error. Is this a problem of the mod or of SMF? Do I need to elevate this to a different forum? I ask this because this almost looks more like a database error then an error in the coding for subs.php
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 22, 2012, 11:20:20 AM
It's not going to be long for the update to be released...furthermore, it's an issue with the modification not installing properly. Any bugs in this modification (not seen many fatal bugs) will be fixed in the next patch.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 22, 2012, 12:29:02 PM
Quote from: Dracopaion on June 22, 2012, 03:28:51 AM
Unfortunately I can't wait until you release your next version of this mod to see if it may fix the problem so I tried to uninstall the mod instead. The pre check for uninstall was all good to go and it seemed to uninstall without a problem however I'm still getting the same error. Is this a problem of the mod or of SMF? Do I need to elevate this to a different forum? I ask this because this almost looks more like a database error then an error in the coding for subs.php
alter table smf_members change country country varchar(255) default '';
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on June 22, 2012, 03:41:39 PM
Quote from: vbgamer45 on June 21, 2012, 06:24:54 PM
Link to FB account for the preview http://www.facebook.com/smfhacks
Link us if you enjoy the work we do!

Liked!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 22, 2012, 03:43:04 PM
Thanks!! Appreciate the support
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 22, 2012, 03:45:20 PM
QuoteUnfortunately I can't wait until you release your next version of this mod to see if it may fix the problem so I tried to uninstall the mod instead. The pre check for uninstall was all good to go and it seemed to uninstall without a problem however I'm still getting the same error. Is this a problem of the mod or of SMF? Do I need to elevate this to a different forum? I ask this because this almost looks more like a database error then an error in the coding for subs.php



alter table smf_members change country country varchar(255) default '';

Ran this and it returned an error #1054 - Unknown column 'country' in 'smf_members' (my site hates me) not sure what to do next

QuoteIt's not going to be long for the update to be released...furthermore, it's an issue with the modification not installing properly. Any bugs in this modification (not seen many fatal bugs) will be fixed in the next patch.

First let me mention after going over my post I haven't mentioned how much I appreciate the work that you guys have put into your mods, and SMF for making the base to do all this. What should have taken months to create for me I've been able to do in days. I'm also still questioning if it is indeed an actual bug in your mod because of what I just attempted above. I have also just found out that the server had crashed just as this all started and it may have indeed caused a corruption in the database. And if that is the case then the database needs to be repaired not your mod.

This site is a guild site for an mmo and having the country flags for all the different people around the world that are playing is a very nice touch. Unfortunately that also comes with a bunch of crabby people when the site isn't working during an in game server move (they have a tendency to get a bit cranky with the person operating the site). With that said that is the reason for my "urgency" to get this resolved. I have read your posts on the upcoming changes to your mod and am looking forward to them. However if I can't get the current problem resolved I'm worried that even upgrading your mod won't solve the problem if it is indeed actually your mod that is causing this.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 22, 2012, 03:48:38 PM
Try this
alter table smf_members add column country varchar(255) default '';


We renamed the field to country_flag might be some code that still uses the old name.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 22, 2012, 04:00:04 PM
That worked for adding the country column unfortunately it didn't repair the problem im still seeing when you log in  :

Database Error
Field 'country' doesn't have a default value
File: C:\inetpub\wwwroot3\Sources\Subs.php
Line: 2760

and when you log out:

Database Error
Database Error Please try again. If you come back to this error screen, report the error to an administrator.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 22, 2012, 05:37:00 PM
That means the queries are still looking for country. Go ahead and attach your Subs.php and Load.php (both in ./Sources) and I'll try to help you out.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 22, 2012, 06:03:32 PM
As your request subs.php and load.php have been attached. hope this helps if not just let me know what you need.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 25, 2012, 05:18:24 PM
Gentlemen

Any luck on finding a solution to my problem or would it be best if I just backed up my data deleted everything and started from scratch again?

Not my first choice of actions of course but better that then flogging a dead horse if there isn't a clear solution and tying you up with it.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dracopaion on June 26, 2012, 12:13:57 AM
I managed to figure out the problem. It was as I suspected a database problem not a problem with your mod. If you recall I mentioned that the sever had crashed, what looks like happened when it restarted MySQL it started it in strict mode even though the ini it's set not to. So to quick test this I ran [SET @@global.sql_mode= '';] in myphpadmin started up the web page and it works perfectly. No more errors logging in or out.

So I thank you for the time you spent looking into this for me but it looks like its fixed and also how do I mark this as solved In this forum or is that needed?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: repxl on June 26, 2012, 11:03:12 AM
when comes out the 2.0.2 ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: TheListener on June 26, 2012, 11:14:26 AM
Quote from: repxl on June 26, 2012, 11:03:12 AM
when comes out the 2.0.2 ?

The mod works on 2.0.2 already.

Look at the mod emulate link in my signature.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on June 26, 2012, 12:31:45 PM
Quote from: Dracopaion on June 26, 2012, 12:13:57 AM
how do I mark this as solved In this forum or is that needed?

That's only when you are requesting support in your own topic.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 30, 2012, 11:45:23 PM
This modification is most definitely compatible with SMF 2.0.2. I just got home from working at a camp, and I was almost finished with the update. Once I catch up on some of my freelancing projects that fell behind and just pick up the pace a little bit, I'll shoot out the update quickly.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Apllicmz on July 20, 2012, 04:39:05 AM
Please Update linguage files Portuguese


    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s a qual nos visita';
$txt['country_flag_ask'] = 'Pe&ccedil;a bandeira do pa&iacute;s em';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s a qual nos visita';
$txt['country_flag_ask'] = 'Pe&ccedil;a bandeira do pa&iacute;s em';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s a qual nos visita';
$txt['country_flag_ask'] = 'Pe&ccedil;a bandeira do pa&iacute;s em';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
        <operation>
            <search position="end" />
            <add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s a qual nos visita';
$txt['country_flag_ask'] = 'Pe&ccedil;a bandeira do pa&iacute;s em';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
        </operation>
    </file>

Title: Re: CountryFlags Updated for SMF 2.0
Post by: danialasghar on July 22, 2012, 06:26:26 PM
Hi

Please help needed!

I have download this mod and Installed through packages.. however it was installed successfully but I can't find the settings of it. I'm using SMF v2.0.2.

The package was installed successfully. You should now be able to use whatever functionality it adds or changes; or not be able to use functionality it removes.

this is message i got when i install it..

Where is the setting I can't find in Features and options..!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on July 22, 2012, 11:24:20 PM
Try looking through Manual Installation of Mods (http://wiki.simplemachines.org/smf/Manual_installation_of_mods) and make sure all of the edits are in place.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Elizabeth II on July 28, 2012, 12:17:51 PM
Hello,

I'm wondering.. If I edit anything in my forum profile but don't select a country it will appear as 'Country: broken image logo' If people don't select a country how can I avoid this as I hate seeing that broken/missing image thing.

thanks!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on July 28, 2012, 12:30:22 PM
Quote from: danialasghar on July 22, 2012, 06:26:26 PM
I have download this mod and Installed through packages..

Where is the setting I can't find in Features and options..!

Should be in Admin > Configuration > Modification Settings > Miscellaneous


Ask for country flag on

Require a member to select a location?

Show flags on Display page (Where posts are shown).
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on July 28, 2012, 12:32:51 PM
Quote from: Mod Mark on July 28, 2012, 12:17:51 PM
...If I edit anything in my forum profile but don't select a country it will appear as 'Country: broken image logo'...

I think I saw this when I first installed it a while back. I seem to remember creating a blank image file called 00.png and put it in the flags folder. I think.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Elizabeth II on July 28, 2012, 10:31:10 PM
Quote from: Shambles™ on July 28, 2012, 12:32:51 PM
Quote from: Mod Mark on July 28, 2012, 12:17:51 PM
...If I edit anything in my forum profile but don't select a country it will appear as 'Country: broken image logo'...

I think I saw this when I first installed it a while back. I seem to remember creating a blank image file called 00.png and put it in the flags folder. I think.

Yeah I tried doing that without success  :(
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on August 01, 2012, 03:20:31 AM
Are you using a custom theme? If so, make sure the SMF hacks image directory exists in the themes image directory.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Mandizzy on August 21, 2012, 02:20:54 PM
Quote from: Dracopaion on June 22, 2012, 04:00:04 PM
That worked for adding the country column unfortunately it didn't repair the problem im still seeing when you log in  :

Database Error
Field 'country' doesn't have a default value
File: C:\inetpub\wwwroot3\Sources\Subs.php
Line: 2760

and when you log out:

Database Error
Database Error Please try again. If you come back to this error screen, report the error to an administrator.

I encountered the same problem and MySQL db was running in strict mode, have already removed that and can logon to forum. However, the mod is still having issues, specifically, the status says "The Database is not installed". I tried to install it again a few times (country & city), it kept throwing the same error:

Database Error
Field 'country' doesn't have a default value
File: C:\inetpub\wwwroot3\Sources\Subs.php
Line: 2760

After a few more tries, it started to fail with this error:

Last Update Status: The MaxMind download site did not respond

I'm guessing I reached some sort of download limit perhaps? Anyway, I can see the downloaded files in C:\inetpub\wwwroot\forum\Sources\geoIP.  Next, I tried manual database choice and it fails with database error and logs this error:

Last Update Status: Database Import Error

There's no other errors being logged in mysql log or forum log events. Any help would be appreciated and keep in mind, I'm a noob when it comes to php and mysql.

Thanks


Title: Re: CountryFlags Updated for SMF 2.0
Post by: preet0925 on October 29, 2012, 12:14:26 PM
dear sir thats both country flags mods are not working on our 2.2 version in guest register page.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on October 29, 2012, 01:39:57 PM
what happens?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on October 29, 2012, 03:50:57 PM
There is some code that causes problems...it needs to be fixed. My version was 98% complete.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on October 30, 2012, 11:55:33 PM
Nothing new about the "new version"?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: DarkT3rror on December 21, 2012, 05:12:19 AM
to me all the countries aren't in the list and shows me blank images.....
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on December 21, 2012, 11:37:43 PM
vbgamer - you should PM me about my releasing the update for this modification, I almost had it completely rewritten using your SMF Hacks modification framework which fixes all bugs and makes improvements.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Gryzor on December 22, 2012, 02:40:06 AM
Quote from: Santa Paws on December 21, 2012, 11:37:43 PM
vbgamer - you should PM me about my releasing the update for this modification, I almost had it completely rewritten using your SMF Hacks modification framework which fixes all bugs and makes improvements.

Ohhh so there's a new version coming up? :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on December 29, 2012, 11:43:20 AM
Finally, when is coming up?
Or can you publish the manual changes?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ashdaw on January 14, 2013, 10:37:30 PM
I tried to install this to my 2.03 version and it said there was an error. I went to the manual install details and the only thing I could see that is different to the code listed by VBGamer is this.
mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,


and this is what I can find:
mem.yim_user,mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.yim_user, mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,


Would it be ok to add the mem.country_flag, to both of the lines I found?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on January 14, 2013, 11:48:07 PM
Yes it would be
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ashdaw on January 15, 2013, 08:39:36 AM
Quote from: vbgamer45 on January 14, 2013, 11:48:07 PM
Yes it would be
Thanks very much. :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Mr. Pedram on January 17, 2013, 09:14:59 AM
Hi, thanks for this awesome MOD
is there anyway to show multi flags? that user can select multi flag, that will show multi flag icons in profile?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on January 17, 2013, 09:23:37 AM
Not at the moment.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Mr. Pedram on January 17, 2013, 09:55:04 AM
Quote from: vbgamer45 on January 17, 2013, 09:23:37 AM
Not at the moment.

even with change a part of codes?
like change select option to select multiple in html codes..
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on January 17, 2013, 09:58:06 AM
Not easily doable. Requires many edits and then changes in the database structure.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Gryzor on January 17, 2013, 09:59:37 AM
...and, I'd say, super useless for the vast majority of people...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Mr. Pedram on January 17, 2013, 04:47:01 PM
Ok guys, but i need it (necessary) :/
wish you explain how to do it. a little teach enough, i do it my self, no need to make a new MOD, just tell what,which code should change or replace and...
just select in profile and show in post

maybe in future someone need this tutorial.
i know it's hard to do it for one person, but i can't do it myself...
please
Title: Re: CountryFlags Updated for SMF 2.0
Post by: MoreBloodWine on January 20, 2013, 09:26:47 PM
I cant find the setting in features n options to set this to show on registration, where is this located ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Diego Andrés on January 21, 2013, 05:34:55 PM
Quote from: vbgamer45 on January 17, 2013, 09:58:06 AM
Not easily doable. Requires many edits and then changes in the database structure.

Check

Quote from: Labradoodle-360 on December 21, 2012, 11:37:43 PM
vbgamer - you should PM me about my releasing the update for this modification, I almost had it completely rewritten using your SMF Hacks modification framework which fixes all bugs and makes improvements.

I'm interested on that
Title: Re: CountryFlags Updated for SMF 2.0
Post by: FragaCampos on January 25, 2013, 12:18:14 PM
Quote from: DaKrampus on May 09, 2012, 01:27:22 PM
Great news, If you want I can send you the install package I made that also includes incorporation in memberlist.
Da

Hi, DaKrampus, can you please share this incorporation in memberlist?
I had it working in my Smf 1.1.x but now the edits are different for Smf 2.0.3. I was using these (http://www.simplemachines.org/community/index.php?topic=269806.0) tips from [SiNaN].


Also, I upgraded my SMF 1.1x to SMF 2.0.3 on localhost and my members' country fields are obsviously empty.
Is there a way to copy those old entries to the new empty ones via phpMyAdmin?
Thanks in advance.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: FragaCampos on January 31, 2013, 02:13:16 PM
Help, anyone?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: FragaCampos on February 24, 2013, 11:19:08 AM
Ok, I just want to share the solution to this problem given to me by Kindred.

It can be found here (http://www.simplemachines.org/community/index.php?topic=496388.0).
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GL700Wing on June 04, 2013, 10:01:24 AM
I'm using SMF 2.0.4 and I really like this mod but it wasn't working quite the way I expected (ie, even though you can make it mandatory to select a country on Registration the member can subsequently deselect it in their Forum Profile) so I decided to have a go at fixing this issue.  I also decided to update the mod to display the country and flag on the member's Profile Summary and in the Memberlist. And I changed some other things as well ... :)

I now have a Country Flags mod that works on SMF 2.0.4 as follows:

Admin --> Modification Settings --> Miscellaneous
Allow member to select country:
Option 1. Never (Disabled)
Option 2. On Profile only
Option 3. On both Profile and Registration

If disabled (option 1):
A. Do not allow country name or flag to be selected on Registration or changed in Forum Profile;
B. Do not show country name or flag on Posts, Profile Summary or in Forum Profile; and
C. Do not show country name or flag (or Country column) on Memberlist.

If enabled (option 2 or 3):
A. Allow country name and flag to be changed in Forum Profile.

If ALSO enabled for Registration (option 3):
A. Display country name and flag selection drop-down in 'Additional Information' section on Registration form.

If 'Require member to select a country' checked:
A. For option 2 and 3: Force country name and flag to be selected in Forum Profile; and
B. For option 3: Force country name and flag to be selected on Registration.

If enabled (option 2 or 3) AND member has selected a country name/flag:
A. Show country name and flag on Profile Summary and in Forum Profile.

If enabled (option 2 or 3) AND 'Show country name and flag on posts as well as profile?' checked AND member has selected a country:
A. Show on posts with 'Country' label in bold text with name of country and flag; and
B. Show country name and flag on Memberlist.



Many thanks to DaKrampus for the tips in these messages: CountryFlags Updated for SMF 2.0 - Reply #1083 (http://www.simplemachines.org/community/index.php?topic=106060.msg3328627#msg3328627)  and CountryFlags Updated for SMF 2.0 - Reply #1085 (http://www.simplemachines.org/community/index.php?topic=106060.msg3330892#msg3330892)

And many thanks also to [SiNaN] for the tips in these messages:  Help on flags mod - Reply #2 (http://www.simplemachines.org/community/index.php?topic=269806.msg1767398#msg1767398), Help on flags mod - Reply #4 (http://www.simplemachines.org/community/index.php?topic=269806.msg1770356#msg1770356) and Help on flags mod - Reply #8 (http://www.simplemachines.org/community/index.php?topic=269806.msg1772280#msg1772280)

I've attached some screenshots and a package file that will install this version on SMF 2.0.4.

Enjoy!!


[Edit 1:  Discovered that I'd forgotten to declare a '$modSettings' variable - fixed package uploaded]
[Edit 2:  Discovered a minor issue with the '$modSettings' fix made in previous edit - fixed package uploaded]
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on June 04, 2013, 11:24:55 AM
Is the mod author Ok with you redistributing his code?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 04, 2013, 11:29:28 AM
I am ok with it will comment in a bit after I check it out more later tonight but looks awesome.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on June 04, 2013, 12:29:13 PM
vbgamer - I'll have to shoot you my local copy of the update eventually.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GL700Wing on June 04, 2013, 05:51:55 PM
Quote from: Shambles on June 04, 2013, 11:24:55 AM
Is the mod author Ok with you redistributing his code?
I haven't changed any of the original package credits/ownership info but if the owner wants me to delete the attached package file I will.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on June 04, 2013, 06:15:08 PM
Don't you worry - vbgamer45 has already given the ok above (I was just checking, to save you getting into bother) :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: SMFHacks.com Team on June 18, 2013, 10:23:29 AM
Mod updates!

2.2 For SMF 2.0.x Thanks to GL700Wing Settings changes: Allow member to select country: Option 1. Never (Disabled) Option 2. On Profile only Option 3. On both Profile and Registration.  Display the country and flag on the member's Profile Summary and in the Memberlist
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Kevinex on June 19, 2013, 06:26:13 PM
Install the mod but not on posts or members list. :(

What did I do wrong?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 19, 2013, 07:20:32 PM
What SMF version?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Kevinex on June 19, 2013, 07:41:18 PM
Quote from: vbgamer45 on June 19, 2013, 07:20:32 PM
What SMF version?

Use version 2.0.4

Download this version and does not work:
http://custom.simplemachines.org/mods/index.php?mod=417

Then download this version:
http://www.simplemachines.org/community/index.php?topic=106060.msg3555791#msg3555791

And if I work, the problem is that when you do not want to uninstall delete the files, I say this because first install it and did not work but I realized I ought to add some options just so I went back to install and gave me error and review was because when you uninstall not erase the modifications, so I had to do everything manually reinstalling again it worked: D

In manual installation, just follow the steps to the only two files that could not find the codes to modify. Now I want to uninstall it if I have to manually clear the codes, is the only mistake I see in the user who made the modification above.

Thank you.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Adrek on June 23, 2013, 07:24:33 AM
There is parse error in package at mod site: http://img825.imageshack.us/img825/6605/3y8p.png
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ~Luke on June 23, 2013, 10:42:22 AM
I am also getting this parse error.

Any idea on how to fix the parse error? I really want this mod.

Thanks and great job on building it - I hope I can get it to work.

When getting the above screenshotted error (parse modification error) it puts my forums into internal server error (changing permission to 777 from 755 on root folder fixes this.)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 23, 2013, 11:19:07 AM
Do you get an error with this package
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ~Luke on June 23, 2013, 12:11:30 PM
It didn't have a parse error and all passed but upon applying I get the usual (for me) internal server error and then my root folder has 777 permission instead of 755 - changing the 755 fixes and when checking back the package isn't installed.

It only does this for CountryFlags add ons (both versions) by the look of it.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: gd4now on June 23, 2013, 01:11:54 PM
I also get the same parse error
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on June 23, 2013, 02:00:07 PM
Generally when I see that error when it fails for all is a server/hosting issue post in the SMF forums for advice.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: gd4now on June 23, 2013, 07:13:51 PM
OK so it may well be related to the site/server. But could it also be related to other mods I have installed.

Currently running 2.0.4 forum software
I do have join date and location mod installed - could it be part of the problem?

Have also noted that when I attempt to pull down the instructions for manual install on 2.0.4 via the parse button I get an error message that it can be parsed. Am I doing somthing wrong?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ~Luke on June 30, 2013, 09:08:42 AM
Im still yet to find a resolution to this :( I really want this mod.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: TheListener on June 30, 2013, 08:45:49 PM
Quote from: ~Luke on June 30, 2013, 09:08:42 AM
Im still yet to find a resolution to this :( I really want this mod.

Who is your host?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ~Luke on July 01, 2013, 04:41:04 PM
Im with Kualo.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ~Luke on July 07, 2013, 12:45:23 PM
Does the mod owner check this thread?

Hopefully we will be able to use it soon.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: minos on July 11, 2013, 12:23:17 AM
i get the same parse errors :/
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Rain Forest on July 11, 2013, 06:50:52 AM
Works for me on 2.0.4 :)

http://summerwish.org
Title: Re: CountryFlags Updated for SMF 2.0
Post by: SD-X on July 13, 2013, 04:46:13 PM
This mod can't even be parsed on the mod site, let alone in SMF itself. Anyone figure out what's going on with it?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on July 13, 2013, 04:47:08 PM
There are some bugs in the modification. Although it should still function.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: SD-X on July 13, 2013, 05:01:49 PM
Quote from: Labradoodle-360 on July 13, 2013, 04:47:08 PM
There are some bugs in the modification. Although it should still function.
My problem is that it won't even parse the modification to install it in the first place.

I have the same, exact issue as this user, in SMF 2.0.4:
http://www.simplemachines.org/community/index.php?topic=106060.msg3565995#msg3565995
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Matthew K. on July 13, 2013, 05:03:55 PM
It doesn't have to parse to install it...you use Package Manager and upload the .zip.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: SD-X on July 13, 2013, 05:04:50 PM
Quote from: Labradoodle-360 on July 13, 2013, 05:03:55 PM
It doesn't have to parse to install it...you use Package Manager and upload the .zip.
I did that. The Package Manager cannot parse the mod.

I edited my previous post right as you replied, but I'm having the same issue as this user:
http://www.simplemachines.org/community/index.php?topic=106060.msg3565995#msg3565995

Edit: Interesting. Seems non-existent files are being referenced for SMF 2.0.4 in the Package's information file. This is the cause of the parsing errors, however upon fixing them, the existing installation files are causing bugs. I'm still experimenting with it, but it's clear that this package is broken and needs updating.

Edit #2: I've made progress and have gotten it to correctly install in SMF 2.0.4, however nothing is showing up in my theme. Looking into it now.

Edit #3: I have attached the modified package so that it will correctly parse and install. Still have no idea why it's not showing up anywhere though. Feel free to play around and see if you can get it working. I'll post back if I'm able to.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GL700Wing on July 15, 2013, 07:26:25 AM
I've successfully installed this package using the zip file attached to CountryFlags Updated for SMF 2.0 - Reply # 1160 (http://www.simplemachines.org/community/index.php?topic=106060.msg3555791#msg3555791) on a brand new SMF 2.0.4 forum and on an SMF 2.0.4 forum that has more than 100 other mods installed.

QuoteStill have no idea why it's not showing up anywhere though.
If you read the message I've just referred to you'll find out how this version of the mod works.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: EnglishRose on July 18, 2013, 03:08:28 AM
Hello everyone, I tried to read the last few pages of posts but couldn't see anyone having the same issue that I'm having.

I have installed the mod successfully with version 2.04 - the text appears in profiles e.g. "country:au" but there is no image or graphic with a flag corresponding to the country they've selected.

I'm not sure if I've missed out something simple or what has happened?

Has anyone had the same problem or can anyone help please?

Thank you.

X
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GL700Wing on July 18, 2013, 05:32:56 AM
Quotethe text appears in profiles e.g. "country:au" but there is no image or graphic with a flag corresponding to the country they've selected.
What you're seeing is the text that is displayed as an alternative when the image can't be displayed for some reason (eg, either the referenced image doesn't exist or it can't be accessed)

Make sure that the './Themes/default/images/flags' folder exists (it should have been created when the package was installed) and that it contains 251 '.png' files (one for each country flag).

If you're using Unix hosting the './Themes/default/images/flags' folder will need permissions of at least 755 (you can check/change the folder permissions via Admin -> Package Manager -> File Permissions).
Title: Re: CountryFlags Updated for SMF 2.0
Post by: EnglishRose on July 18, 2013, 03:13:44 PM
Thank you so much for the response.

The Flags folder permission is 755 and all the flags are there in the Themes/Default/Images section.

This may sound like a silly question but do I need to copy and paste the flags file into the image folder of the Theme that I'm using? I.e. with my current settings will the flag images only appear when I'm using the default theme?

Thanks again for your help.

X
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on July 18, 2013, 06:29:59 PM
Give it a try and see if it helps copying to your themes folder
Title: Re: CountryFlags Updated for SMF 2.0
Post by: EnglishRose on July 18, 2013, 10:39:20 PM
Quote from: vbgamer45 on July 18, 2013, 06:29:59 PM
Give it a try and see if it helps copying to your themes folder

It worked, we have flag waving :)

Big hug for all the help.

X
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on July 18, 2013, 11:46:50 PM
Glad to help!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: SD-X on August 02, 2013, 06:40:30 AM
QuoteIf you read the message I've just referred to you'll find out how this version of the mod works.
Not sure why my reply never posted, but I know how the mod works. The problem is that the section just doesn't show up at all on the fixed version. I can't seem to figure out why.

Edit: Seems to be an issue with installing on crappy hosts. The fixed version I posted is finally working on my self-hosting.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on August 02, 2013, 06:50:58 AM
Good to know.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: valek0972 on September 04, 2013, 09:19:25 AM
Greetings. There is a problem, the choice of the flag, all OK:
(http://i.imgur.com/5PyZY99.png)      (http://i.imgur.com/TBZi2eB.png)                                                                                                                                     

And then clean it, then so:

(http://i.imgur.com/YII6I5k.png)     (http://i.imgur.com/ZZDOCeW.png)

How to fix it, thank you.

Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on September 04, 2013, 10:43:34 AM
Make sure the flags folder was copied over.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: valek0972 on September 04, 2013, 11:09:29 AM
QuoteMake sure the flags folder was copied over.
The mod works fine, it appears when the user changed his mind to show the flag in the profile.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on September 04, 2013, 11:37:28 AM
Ok good to know
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on September 04, 2013, 12:01:51 PM
Is it looking for a file called 00.png?

I simply created one for my forum...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: valek0972 on September 04, 2013, 12:12:22 PM
QuoteIs it looking for a file called 00.png?
It turns out that yes, please feel free to fix.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on September 04, 2013, 12:21:15 PM
Quote from: Shambles
I simply created one for my forum...
Title: Re: CountryFlags Updated for SMF 2.0
Post by: valek0972 on September 04, 2013, 12:38:07 PM
Downloaded from the office. site, there was a mistake.
I downloaded here (http://www.simplemachines.org/community/index.php?topic=106060.msg3575520#msg3575520), all is well.

Thank you all.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Apllicmz on September 07, 2013, 08:12:30 PM
Update Portuguese File



<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s a qual nos visita';
$txt['country_flag_ask'] = 'Pe&ccedil;a bandeira do pa&iacute;s em';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu pa&iacute;s';
$txt['country_flag_error_required'] = 'Voc&ecirc; deve selecionar o pa&iacute;s a qual nos visita';
$txt['country_flag_ask'] = 'Pe&ccedil;a bandeira do pa&iacute;s em';
$txt['country_flag_disabled'] = 'N&atilde;o mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na p&aacute;gina de exibi&ccedil;&atilde;o (Onde as mensagens s&atilde;o mostradas).';
$txt['country_flag'] = 'Pa&iacute;s';
]]></add>
</operation>
</file>
Title: Re: CountryFlags Updated for SMF 2.0
Post by: MikelAL93 on October 05, 2013, 11:40:54 AM
I can't seem to install this for SMF 2.0.5...  gives me errors since it only detects the installation files for SMF 2.0.4's version of this mod...

If anyone can explain why, that'd be appreciated. :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on October 05, 2013, 11:42:06 AM
What errors are given?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: MikelAL93 on October 05, 2013, 12:31:39 PM
Quote from: vbgamer45 on October 05, 2013, 11:42:06 AM
What errors are given?

The same error as in this post:

http://www.simplemachines.org/community/index.php?topic=106060.msg3565995#msg3565995 (http://www.simplemachines.org/community/index.php?topic=106060.msg3565995#msg3565995)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: dannb on October 06, 2013, 09:33:29 PM
Quote from: vbgamer45 on October 05, 2013, 11:42:06 AM
What errors are given?

Click the advanced option under browse packages.

And type 2.04 for the emulate version.

Title: Re: CountryFlags Updated for SMF 2.0
Post by: Arantor on October 26, 2013, 01:48:21 PM
Why doesn't this work on the mod site's parser?

This should be fixed.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ^HeRaCLeS^ on November 01, 2013, 08:24:47 PM
What does not work is the mod.

I made ​​the report to the author but not update
This bad file "package-info.xml"
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on November 03, 2013, 08:59:09 PM
Quote from: ^HeRaCLeS^ on November 01, 2013, 08:24:47 PM
What does not work is the mod.

I made ​​the report to the author but not update
This bad file "package-info.xml"
Should work now.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: ^HeRaCLeS^ on November 03, 2013, 09:40:38 PM
Excellent  ;)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: cgid on December 05, 2013, 03:41:05 AM
Hi,

After installing the Mod all country names are in English. Is there an option to add the country names into the $txt[countryname]-section per language?
So by selecting another language people see the names in their own language?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: djr33 on January 19, 2014, 11:07:32 PM
Quote from: Shambles on September 04, 2013, 12:01:51 PM
Is it looking for a file called 00.png?

I simply created one for my forum...
I'm having exactly this problem.
I can certainly create a file called 00.png, but this isn't optimal: if no country is selected, then it should not display at all, just like when a user has not implemented it in the first place.

Configuration:
--SMF 2.0.6
--I do NOT have the country required on registration, so users should be able to use it if they want or avoid it completely if not.

Otherwise I like this and it's working fine.


I can probably fix this (in the code) myself, but if there's an existing fix let me know and really this should be updated in the version available for download. If it has not yet been fixed, I'd be happy to supply my edits once I have a chance to debug it.


Edit:
Quote from: rica.carv on July 10, 2011, 12:51:18 PM
Well, the 00.png couldn't exist really, since it's no flag at all for the mod.
I've got to dig on the code, to see if i can came up with anything that overrides the 00.png display....

00.png issue solved...
I've changed the code, so that if the user selected no country, it won't display any flag line at all....

Now, more dig, to see if i can set options for the formating of the country line....
Any status on this?
Sounds to me like it has been fixed but hasn't been updated on the website. Is that right?
I still don't mind helping to find a fix, but no point in doing it if it's already done.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GamePersia on February 13, 2014, 08:15:37 AM
if choosing a contry flag,...it's working well,..
but when removing it from profile,...it's showing broken image in post.
(http://i.imgur.com/5IGYPyB.jpg)
A PROPER SOLUTION IS REQUIRED,....SMF 2.0.7....... :(
Title: Re: CountryFlags Updated for SMF 2.0
Post by: LirikAskO on February 13, 2014, 12:22:07 PM
Thanks.  ;D
Title: Re: CountryFlags Updated for SMF 2.0
Post by: [OG]Anirudh on February 16, 2014, 02:26:40 AM
How to show the country flags at post box eg
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=518373.0;attach=228886;image)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GamePersia on February 17, 2014, 07:29:43 AM
Quote from: GamePersia on February 13, 2014, 08:15:37 AM
if choosing a contry flag,...it's working well,..
but when removing it from profile,...it's showing broken image in post.
(http://i.imgur.com/5IGYPyB.jpg)
A PROPER SOLUTION IS REQUIRED,....SMF 2.0.7....... :(
May i get a solution for this error ???
Title: Re: CountryFlags Updated for SMF 2.0
Post by: [OG]Anirudh on February 17, 2014, 08:46:14 AM
[quote author=[OG]Anirudh link=topic=106060.msg3670067#msg3670067 date=1392535600]
How to show the country flags at post box eg
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=518373.0;attach=228886;image)
[/quote]
Bump
Title: Re: CountryFlags Updated for SMF 2.0
Post by: vbgamer45 on February 18, 2014, 03:01:24 PM
You would need to edit the display.template.php
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GamePersia on February 26, 2014, 09:25:43 PM
i uninstalled this mod,..
but in Miscellaneous section,..traces has been left out !!...
i am sure that this traces are of this mod !!....because when i installed it again,...traces were not there !!
http://i.imgur.com/P3xj1iB.jpg
A solution is needed,...if you want managesettings.php file for fixing this error,..i have attached it..
Title: Re: CountryFlags Updated for SMF 2.0
Post by: TheListener on February 26, 2014, 09:33:19 PM
Have you considered using the mods parser?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GamePersia on February 26, 2014, 09:35:01 PM
Quote from: Old Fossil on February 26, 2014, 09:33:19 PM
Have you considered using the mods parser?
oop's...
you are correct..
ok,..i am checking by that !!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: GamePersia on February 26, 2014, 09:38:36 PM
Quote from: Old Fossil on February 26, 2014, 09:33:19 PM
Have you considered using the mods parser?
problem solved,..thanks for giving idea !! :P
Title: Re: CountryFlags Updated for SMF 2.0
Post by: FemR on March 26, 2014, 10:45:05 AM
Thanks for such a neat mod!

I noticed how many here have posted about a bug / situation when a forum user later decides to deselect/remove his flag from his profile, the line 'Country: ' along with the missing flag image icon still shows.

Yes, you can upload empty transparent 00.png to at least get rid of the broken file/image thing. But the line 'Country: ' still shows even when country is no longer selected in profile.

To get rid of it, edit your display.template.php like this:

Code (Find) Select
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))

Code (Replace it with) Select
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']) && $message['member']['country_flag']!='00')

Title: Re: CountryFlags Updated for SMF 2.0
Post by: Starz0r on June 04, 2014, 07:33:33 PM
Is there a edit available where the flag is automatically chosen by GeoIP other than the users choosing it themselves?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ninja ZX-10RR on June 28, 2014, 12:28:07 PM
Hi everyone.

Is there a way to show the country on the summary of the profile view? Which file do I need to edit and how?

Thanks in advance.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Chris B. on August 15, 2014, 01:53:22 AM
I'm working on figuring out were three countries are appearing under a user's name right now. I cleared out all the files that are associated with the mod but that didn't do much of any good. Going to try the mod parser next.

Looks like I was able to fix it. Took a few hours to figure it out.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ninja ZX-10RR on August 16, 2014, 03:05:41 PM
Quote from: Chris B. on August 15, 2014, 01:53:22 AM
I'm working on figuring out were three countries are appearing under a user's name right now. I cleared out all the files that are associated with the mod but that didn't do much of any good. Going to try the mod parser next.

Looks like I was able to fix it. Took a few hours to figure it out.
If you experience troubles with something it would be useful to tell everyone else your solution so that if they are experiencing the same issues you are having troubles with they can try to solve it the same way :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Rain Forest on November 04, 2014, 11:50:21 AM
Quote from: ♦ Ninja ZX-10RR ♦ on June 28, 2014, 12:28:07 PM
Hi everyone.

Is there a way to show the country on the summary of the profile view? Which file do I need to edit and how?

Thanks in advance.

Like this?

(http://i.imgur.com/K5mUjox.png) (http://lovetroops.com)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ninja ZX-10RR on November 04, 2014, 12:55:20 PM
Yes, damn exactly. May I ask you how you did that sir?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Rain Forest on November 04, 2014, 01:04:28 PM
Quote from: ♦ Ninja ZX-10RR ♦ on November 04, 2014, 12:55:20 PM
Yes, damn exactly. May I ask you how you did that sir?

Sure, sir :P

I did this:

in Profile.template.php find:

if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>




after add:

// Space for countryflags
if(!empty($modSettings['country_flag_show']) && $modSettings['country_flag_show'] == 1)
$flags = CountryFlag();
echo '

<dt>', $txt['country_flag'], ':</dt>

<dd>', (!empty($context['member']['country_flag']) && $context['member']['country_flag']!= '00') ? '<img src="' . $settings['images_url']. '/flags/' . $context['member']['country_flag'] . '.png" alt="' . $context['member']['country_flag'] . '" title="' . $flags[$context['member']['country_flag']] . '" />' :'N/A' . '</dd>';
// Space for countryflags end
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Ninja ZX-10RR on November 04, 2014, 02:45:33 PM
Awwwwwwwwwwww (http://www.katzy.dsl.pipex.com/Smileys/thanks3.gif) that works!!!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Rain Forest on November 04, 2014, 03:07:50 PM
Quote from: ♦ Ninja ZX-10RR ♦ on November 04, 2014, 02:45:33 PM
Awwwwwwwwwwww (http://www.katzy.dsl.pipex.com/Smileys/thanks3.gif) that works!!!

(http://lovetroops.com/forums/Smileys/facebooksmileys/smilepack.png)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: coltp45 on December 28, 2014, 08:49:54 PM
Great mods.
How to display  only the flag, no "country:"  ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Dwarp on April 19, 2015, 04:43:59 AM
i didnt see da flag ??? in someone post
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on April 19, 2015, 07:55:12 AM
Quote from: Dwarp on April 19, 2015, 04:43:59 AM
i didnt see da flag ??? in someone post

They have to select a country in their profile.


Has this been answered somewhere? I'd like to remove it too.

Quote from: coltp45 on December 28, 2014, 08:49:54 PMHow to display  only the flag, no "country:"  ?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: aselmani on April 28, 2015, 07:19:21 AM
Hi,
is there a way to add the flag of Kosovo to this mod.

Thanks in advance,
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on April 28, 2015, 08:56:09 AM
This is what it would look like: (http://i1262.photobucket.com/albums/ii614/OPStuph/all2/kosovo.jpg)

Just wanted to let the mod author know if you are okay with that or not. :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Empire KickAss on May 04, 2015, 03:48:55 AM
I have it working good, But it's not showing up on members profile. It's on posts and it's under forum profile. But not showing in profile
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on May 04, 2015, 08:43:30 AM
It wasn't designed to show in the profile. Just in the mini-profile in posts. :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Rain Forest on May 04, 2015, 09:04:59 AM
Quote from: Empire KickAss on May 04, 2015, 03:48:55 AM
I have it working good, But it's not showing up on members profile. It's on posts and it's under forum profile. But not showing in profile

Read page 62..

http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on May 04, 2015, 09:07:38 AM
Nice! ;D
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Empire KickAss on May 04, 2015, 09:04:42 PM
Quote from: Rain Forest on May 04, 2015, 09:04:59 AM
Quote from: Empire KickAss on May 04, 2015, 03:48:55 AM
I have it working good, But it's not showing up on members profile. It's on posts and it's under forum profile. But not showing in profile

Read page 62..

http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246

(http://www.katzy.dsl.pipex.com/Smileys/thanks3.gif)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,

I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Empire KickAss on May 13, 2015, 03:29:20 AM
Quote from: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,

I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help

Read page 62... LOL.... ::)

http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246
Title: Re: CountryFlags Updated for SMF 2.0
Post by: dannyv1708 on May 13, 2015, 05:28:17 AM
Quote from: Empire KickAss on May 13, 2015, 03:29:20 AM
Quote from: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,

I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help

Read page 62... LOL.... ::)

http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246

Thank you so much. I have edited and now profile summary shows the country flag. I tried editing display.template.php with the same coding but it show as County: NA

Please help.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: dannyv1708 on May 28, 2015, 03:25:33 AM
Quote from: dannyv1708 on May 13, 2015, 05:28:17 AM
Quote from: Empire KickAss on May 13, 2015, 03:29:20 AM
Quote from: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,

I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help

Read page 62... LOL.... ::)

http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246

Thank you so much. I have edited and now profile summary shows the country flag. I tried editing display.template.php with the same coding but it show as County: NA

Please help.

Would appreciate if someone can help me. The country is shown as N/A in the posts.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on May 28, 2015, 08:04:19 AM
Each member has to select a country in their profile. Have you done that for yourself and does it show for you after clearing your browser cache?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 09:01:38 AM
SMF 2.0.9
Made a couple of edits in Load.php and Country Flags working to the extent that in my own forum profile as an example, i select UK under Country and select Save and forum software confirms the edit is saved however, the country I added reverts to Select Country again. When i do select UK the union jack is displayed.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on June 29, 2015, 10:43:48 AM
The mod author is more than likely going to want to know what edits you made as this mod makes edits to that same file.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 10:49:13 AM
Quote from: Steve on June 29, 2015, 10:43:48 AM
The mod author is more than likely going to want to know what edits you made as this mod makes edits to that same file.

Thanks Steve


Load.php

Just the two manual entries of mem.country_flag,





mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, [b]mem.country_flag,[/b]





mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good, [b]mem.country_flag,[/b]

Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on June 29, 2015, 11:15:30 AM
And if you take  [b]mem.country_flag,[/b] off the end of both those lines does it work properly?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 11:19:28 AM
Quote from: Steve on June 29, 2015, 11:15:30 AM
And if you take  [b]mem.country_flag,[/b] off the end of both those lines does it work properly?
That was added to highlight on here 
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on June 29, 2015, 11:25:02 AM
All I can say is try it without the edits. If it still doesn't work, then the mod author will have to help you further. :)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 11:28:19 AM
Quote from: Steve on June 29, 2015, 11:25:02 AM
All I can say is try it without the edits. If it still doesn't work, then the mod author will have to help you further. :)

But they're essential to the Mod ???
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on June 29, 2015, 11:57:13 AM
When I parse the mod at the mod site I don't see that part.

I checked my Load.php and it's not there either and the mod works just fine for me.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 12:01:17 PM
(http://s15.postimg.org/kb4aqpe8n/sources.jpg) (http://postimg.org/image/kb4aqpe8n/)
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on June 29, 2015, 01:37:05 PM
Oh! Your bold threw me off. I should have looked closer.

But what I said earlier still remains:

Quote from: Steve on June 29, 2015, 11:25:02 AM
All I can say is try it without the edits. If it still doesn't work, then the mod author will have to help you further. :)

Try removing the bold tags. Don't know why that would affect it though, if it even does.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 02:10:36 PM
There isn't any bold tags in the script on the live forum

i merely forgot bold doesnt show up in coded text

Title: Re: CountryFlags Updated for SMF 2.0
Post by: Steve on June 29, 2015, 05:57:57 PM
Finally! Now I understand. This must be thick as a brick day for me.

Did you install this manually or through the package manager?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on June 29, 2015, 06:06:26 PM
Quote from: Steve on June 29, 2015, 05:57:57 PM

Did you install this manually or through the package manager?

Package Manager aside from the 2 additional edits
Title: Re: CountryFlags Updated for SMF 2.0
Post by: yakyakyak on July 20, 2015, 01:49:49 PM
Quote from: yakyakyak on June 29, 2015, 09:01:38 AM
SMF 2.0.9
Made a couple of edits in Load.php and Country Flags working to the extent that in my own forum profile as an example, i select UK under Country and select Save and forum software confirms the edit is saved however, the country I added reverts to Select Country again. When i do select UK the union jack is displayed.

Checked all file edits and they seem ok.
File permissions for the images again are correct.

Any ideas please?
Title: Re: CountryFlags Updated for SMF 2.0
Post by: danster on July 24, 2015, 08:44:42 AM
Hi..!
I try to use this mod cos it's locks like very good but unfortunately
something wrong with my installation cos there is NO displaying the country flag in the users profile
I'm using SMF version SMF 2.0.10 and using them is silentwave so please some one
help me to resolve this issue...

I attached a screen shot for your reference...

Thank you...!
Title: Re: CountryFlags Updated for SMF 2.0
Post by: Shambles on July 24, 2015, 09:01:49 AM
Those picture placeholders you see, find out the URL that they are pointing to by right-clicking them and checking the image properties/location. That will tell you where they should be. Those placeholders are telling you that the images aren't in the place you think they are.
Title: Re: CountryFlags Updated for SMF 2.0
Post by: danster on July 24, 2015, 09:41:07 AM
Thank you very much Shambles..,
I found that issue and now its works perfectly (http://s20.postimg.org/b70nco9ih/good.png)
Title: Re: CountryFlags
Post by: SMFHacks.com Team on March 06, 2016, 10:31:19 PM
Must update!

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


Title: Re: CountryFlags
Post by: Ninja ZX-10RR on March 06, 2016, 10:58:14 PM
Quote from: SMFHacks.com Team on March 06, 2016, 10:31:19 PM
Must update!

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
Can you please tell me if it's a complete overhaul or just a few things? It's gonna be a nightmare to update, because I've done several modifications to this :/
Title: Re: CountryFlags
Post by: vbgamer45 on March 06, 2016, 10:59:44 PM
minor changes register.php mainly.
Title: Re: CountryFlags
Post by: Ninja ZX-10RR on March 06, 2016, 11:07:50 PM
Thanks! So basically the template edits are the same? They all fail on uninstall (my fault, I recoded it entirely in some sections) so if they are the same I can just uninstall with them failing and then update I'll be good, otherwise it's gonna be a very long thingy.
Title: Re: CountryFlags
Post by: vbgamer45 on March 06, 2016, 11:18:28 PM
Yes template edits are the same.
Title: Re: CountryFlags
Post by: Ninja ZX-10RR on March 06, 2016, 11:31:26 PM
Thanks a lot, I forced the new version to fail on Display.template and everything went smooth ;D
Title: Re: CountryFlags
Post by: vbgamer45 on March 07, 2016, 07:50:36 AM
Glad the update went well.
Title: Re: CountryFlags
Post by: lntit on March 07, 2016, 11:23:11 AM
Thanks for the update! :D

Just a very little thing, in the registration, profile editor and thread, there appear a "missing image" sign if a member selected no specific flag. There is just missing a "00.png" and sometimes a "blank.gif" in the flags folder.
Title: Re: CountryFlags
Post by: Jade Elizabeth on March 08, 2016, 09:05:59 PM
Is there a way to get this to work with social logins?

http://custom.simplemachines.org/mods/index.php?mod=3580
Title: Re: CountryFlags
Post by: Ninja ZX-10RR on March 08, 2016, 11:53:40 PM
Where does it fail? It's likely template-wise, I might have a look later if I can install it, not sure when (can be within 5 minutes or a couple of days ;D).
Title: Re: CountryFlags
Post by: Jade Elizabeth on March 09, 2016, 01:16:09 AM
No fail, when they register with oneall it bypasses the regular rego page is all. I want this but something close to 70% of my regos come from social media and there's no point if it wont work lol.
Title: Re: CountryFlags
Post by: vbgamer45 on March 09, 2016, 09:11:30 AM
Unknown it would depend if you can pass country flag option to the social option Or after they are registered redirect to a page to select the flag
Title: Re: CountryFlags
Post by: Talon Senatu on April 02, 2016, 02:18:15 PM
I'm having a 'test failed' on ./Sources/Load.php. Anyone know how that comes?
Title: Re: CountryFlags
Post by: vbgamer45 on April 02, 2016, 02:35:13 PM
Another mod modified the same area you would have to eye ball and make the change manually if it is possible.
Title: Re: CountryFlags
Post by: Steve on April 02, 2016, 06:15:33 PM
To expand on what vbgamer said:

Quote from: Talon Senatu on April 02, 2016, 02:18:15 PM
I'm having a 'test failed' on ./Sources/Load.php. Anyone know how that comes?

http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: CountryFlags
Post by: ninik on August 25, 2016, 01:31:51 AM
Hi guys a question:

I installed the mod as the instructions told us to do (Simply install the package to install on the SMF Default Core Theme ONLY (<-- I did that although I do use another theme).) etc.

But the next instruction suggests: To enable this mod you must go to Admin > Features and Options > Last set of options.

What is "Last set of options" supposed to be? I mean I searched every option but could not find anything?

Any help please...?
Title: Re: CountryFlags
Post by: skb on August 25, 2016, 05:46:29 AM
I don't use the mod but I think what was meant is that the country flags settings will be the last in the Features & Options scroll down list.
Title: Re: CountryFlags
Post by: Shambles on August 25, 2016, 06:57:39 AM
The setting(s) are in

Admin > Configuration > Modification Settings > Miscellaneous
Title: Re: CountryFlags
Post by: cnashx on March 03, 2017, 02:01:53 PM
So... I accidently installed the 3.0 version when I had an older version installed and when I uninstalled it broke my forum.
I have fixed the forum itself but I cannot get any country flags to work now. I install 3.0 and nothing happens.

Anyone have any reason why this may be? or a fix?
Title: Re: CountryFlags
Post by: vbgamer45 on March 03, 2017, 02:03:35 PM
Try uploading package to and make sure all the edits are done to your site.
http://smfhacks.com/smf-package-parser.html
Title: Re: CountryFlags
Post by: cnashx on March 03, 2017, 02:15:57 PM
Quote from: vbgamer45 on March 03, 2017, 02:03:35 PM
Try uploading package to and make sure all the edits are done to your site.
http://smfhacks.com/smf-package-parser.html

I just noticed that I got it to work if I got to my profile and add a country, originally this was done automagically based on location. Not sure how that got deleted.
Guess I will have to get all my users to update that.
Title: Re: CountryFlags
Post by: MULITRI on March 18, 2017, 02:10:56 PM
Just wanted to say i have installed this Mod into a new v2.0.13 forum and it works perfect, just what i needed.

Thanks a lot for this great Mod, Good Job, Thanks.
Title: Re: CountryFlags
Post by: MULITRI on April 29, 2017, 07:40:17 PM
Sorry to bump but i had to rebuilt my forum, and now, after install the mod, the mod works fine as before, but i get an error in the logs:


https://xxxxxx.com/index.php?topic=65.0
8: Undefined index: country_flag
/home/volxx_x/xxxxxx.com/xxxxxxxxxx/htdocs/Sources/Load.php
Línea: 1212


That line it refers to this code:

'country_flag' => $profile['country_flag'],


I had an error installing the package in Load.php, so i had to install that part of code into Load.php manually. I have checked several times the parse of that part of code and everything is in it correct place.

I have readed the whole topic and i saw others with that error, but i did not found a solution.

I would appreciate some help, Thank you.
Title: Re: CountryFlags
Post by: richardwbb on April 30, 2017, 09:16:06 AM
I'm not the author of 'CountryFlags'. Now I have written that, I'd say your re-install didn't include the database changes for this modification. Maybe you know from here, where to start. Let me say this again; This is my experience with such 'message', 'it is saying it can not find something that must have been there before', [so it isn't really an error message], and it would make me re-install Country Flags. I'm not saying you should take my word for this. I advise to have a backup from the database and the forum, before doing anything. Preferably on a local server of your own, another domain with the ISP, or probably if you have access to a VPS, to start working on a copy, instead of working on the 'original', and so, if someone is saying something different, then I just did, I would like to hear about this, too.
Title: Re: CountryFlags
Post by: Kindred on April 30, 2017, 05:42:33 PM
Richard....  no
That is not what the error message is indicating.

The error message isn't indicating that the variable within the array is not properly defined and thus, is not properly filled.  This suggests that some part of the mod code did not get properly added, despite the claims that all code is correct.
Title: Re: CountryFlags
Post by: landyvlad on March 14, 2018, 11:31:17 PM
Is a version for SMF 2.1 likely?
Title: Re: CountryFlags
Post by: vbgamer45 on March 14, 2018, 11:34:30 PM
Probably once 2.1 final hits
Title: Re: CountryFlags
Post by: landyvlad on March 14, 2018, 11:59:24 PM
Cool ! Thanks
Title: Re: CountryFlags
Post by: landyvlad on February 06, 2019, 06:12:32 AM
Re my question for a SMF 2.1 version

Quote from: vbgamer45 on March 14, 2018, 11:34:30 PM
Probably once 2.1 final hits

Well we finally have RC1. Any chance of this mod being updated to be compatible please?
Title: Re: CountryFlags
Post by: Arantor on February 06, 2019, 06:58:40 AM
RC1 != final.
Title: Re: CountryFlags
Post by: shadav on August 17, 2019, 12:45:37 PM
thank you for this mod :) and all the helpful posts in this thread

I was able to get this running on 2.0.15

but I have a question

how to move the flag from below the location to inline with the location?

I have tried to move it around but keep getting template errors on my site

here's the code I have from my profile.template.php
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>';
// Space for countryflags
if(!empty($modSettings['country_flag_show']) && $modSettings['country_flag_show'] == 1)
$flags = CountryFlag();
echo '

<dt>', $txt['country_flag'], ':</dt>

<dd>', (!empty($context['member']['country_flag']) && $context['member']['country_flag']!= '00') ? '<img src="' . $settings['images_url']. '/flags/' . $context['member']['country_flag'] . '.png" alt="' . $context['member']['country_flag'] . '" title="' . $flags[$context['member']['country_flag']] . '" />' :'N/A' . '</dd>';
// Space for countryflags end

echo '
</dl>';


Thank you for any help :)
Title: Re: CountryFlags
Post by: shadav on August 17, 2019, 01:06:20 PM
oh well... I don't know
I swear I tried that earlier...
seems I managed to get it to work :D
now the flag is next to the location

if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], ' ', (!empty($context['member']['country_flag']) && $context['member']['country_flag']!= '00') ? '<img src="' . $settings['images_url']. '/flags/' . $context['member']['country_flag'] . '.png" alt="' . $context['member']['country_flag'] . '" title="' . $flags[$context['member']['country_flag']] . '" />' :'N/A' . '</dd>';

echo '
</dl>';
Title: Re: CountryFlags
Post by: shadav on September 19, 2019, 09:41:19 PM
question, or maybe feature request?

Would there be, or how can I, show in the who's online the image of the flag and how many users are using it
does that make sense?
Title: Re: CountryFlags
Post by: daveb47 on October 08, 2019, 02:26:55 PM
Can anyone tell me how to get this working on Vakit theme please
Title: Re: CountryFlags
Post by: Kindred on October 08, 2019, 02:45:32 PM
you will have to manually apply the template changes to whatever templates that theme uses...

https://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: CountryFlags
Post by: shadav on July 06, 2020, 09:45:42 PM
for some reason i'm now getting

8: Undefined variable: flags
File: /forum/Themes/SN/Profile.template.php
Line: 93

line 93
', $context['member']['location'], ' ', (!empty($context['member']['country_flag']) && $context['member']['country_flag']!= '00') ? '<img src="' . $settings['default_images_url']. '/flags/' . $context['member']['country_flag'] . '.png" alt="' . $context['member']['country_flag'] . '" title="' . $flags[$context['member']['country_flag']] . '" width="20px" />' :'N/A' . ' ';
Title: Re: CountryFlags
Post by: Kindred on July 07, 2020, 01:59:40 PM
your code is screwed up
that code does not appear anywhere in the code for this mod...


that line is supposed to be

<img id="flags" src="', $settings['images_url'], '/', isset($context['member']['country_flag']) && !empty($context['member']['country_flag']) ? 'flags/' . $context['member']['country_flag'] . '.png': 'blank.gif', '" width="25" height="15" alt="" align="top" />'
Title: Re: CountryFlags
Post by: shadav on July 07, 2020, 02:22:51 PM
Quote from: Kindred on July 07, 2020, 01:59:40 PM
your code is screwed up
that code does not appear anywhere in the code for this mod...


that line is supposed to be

<img id="flags" src="', $settings['images_url'], '/', isset($context['member']['country_flag']) && !empty($context['member']['country_flag']) ? 'flags/' . $context['member']['country_flag'] . '.png': 'blank.gif', '" width="25" height="15" alt="" align="top" />'


eh it was probably me playing around trying to get it to display next to the location....
I tried the code you posted and still getting
8: Undefined variable: flags
File: /forum/Themes/SN/Profile.template.php
Line: 93
Title: Re: CountryFlags
Post by: Kindred on July 07, 2020, 04:22:15 PM
then you really broke something, because there is no variable or even subvariable called flags in the code that the mod uses.... nor in the code that I copied...

So, this would appear to be a problem with whatever edits you made, not with the mod code -- and we have no idea what edits you have made.
Title: Re: CountryFlags
Post by: KittyGalore on March 11, 2022, 03:33:31 PM
Any chance this mod can be updated for 2.1
Title: Re: CountryFlags
Post by: Shades. on March 11, 2022, 03:41:58 PM
Quote from: KittyGalore on March 11, 2022, 03:33:31 PMAny chance this mod can be updated for 2.1
I second that with a P-l-e-a-s-e! O:)
Title: Re: CountryFlags
Post by: landyvlad on March 23, 2022, 09:46:53 PM
I third it !
Title: Re: CountryFlags
Post by: Steve on April 15, 2022, 06:58:29 AM
I'll fourth it!
Title: Re: CountryFlags
Post by: -Rock Lee- on April 15, 2022, 10:23:55 AM
I understand that yes that it would only take time to achieve it, although I still believe that vbgamer45 time is 32 hours a day ::). While they wait I can share mates and alfajores, time passes faster O:).
Title: Re: CountryFlags
Post by: landyvlad on July 19, 2022, 05:54:21 AM
I love this mod and am really looking forward to a 2.1 version - its something I'll miss when I upgrade the forum this weekend.
Title: Re: CountryFlags
Post by: Steve on July 24, 2022, 08:20:24 AM
Any response @SMFHacks.com Team?
Title: Re: CountryFlags
Post by: landyvlad on December 06, 2022, 01:42:32 AM
@SMFHacks.com Team

Any progress on making this 2.1.x compatible? (or is that not planned)


My members love this mod and will miss it in our upgrade.
Title: Re: CountryFlags
Post by: Shades. on December 06, 2022, 01:53:46 AM
Quote from: landyvlad on December 06, 2022, 01:42:32 AM@SMFHacks.com Team

Any progress on making this 2.1.x compatible? (or is that not planned)


My members love this mod and will miss it in our upgrade.
While I've been waiting for this mod to be updated also, @landyvlad I did this https://www.simplemachines.org/community/index.php?topic=578961.msg4098007#msg4098007

It's a lot of work but it did the job for now! ;)
Title: Re: CountryFlags
Post by: landyvlad on December 07, 2022, 07:04:33 PM
Ta.
I really would love to see the mod officially updated.

Is what you've done  reversible easily if the mod does get updated to work in 2.1?
Title: Re: CountryFlags
Post by: Speed King on December 08, 2022, 12:15:07 AM
Quote from: landyvlad on December 07, 2022, 07:04:33 PMIs what you've done  reversible easily if the mod does get updated to work in 2.1?

Yes, disable related profile field :)

But with profile field enabled, you will have image flags always active, with all templates, regardless minor/large forum upgrades.
Title: Re: CountryFlags
Post by: Shades. on December 08, 2022, 03:11:04 AM
Quote from: landyvlad on December 07, 2022, 07:04:33 PMTa.
I really would love to see the mod officially updated.

Is what you've done  reversible easily if the mod does get updated to work in 2.1?
Yes and what @Speed King said you can just disable it and/or remove it in custom profiles. But also note that it won't work with the mod once/if the mod is updated and enabled. In other words, you can only use one or the other. If you decide later to use the mod, everyone will have to update their country.
Title: Re: CountryFlags
Post by: vbgamer45 on July 04, 2023, 12:49:09 PM
Updated for SMF 2.1.x!
Title: Re: CountryFlags
Post by: Steve on July 04, 2023, 06:18:29 PM
Thanks vb!
Title: Re: CountryFlags
Post by: Shades. on July 05, 2023, 02:41:40 PM
SMF 2.1.4
Country Flags 3.0

I got no errors installing on SMF 2.1.4 but when I go to admin ?action=admin;area=modsettings;sa=general I get the WSOD 500 error page.

Edit: It works on a clean 2.1.4 but not on my test copy of my site. Must be another mod interfering but I'm not getting any error message.

Thanks,
Shades 8)
Title: Re: CountryFlags
Post by: Shades. on July 05, 2023, 05:45:50 PM
Quote from: Shades. on July 05, 2023, 02:41:40 PMSMF 2.1.4
Country Flags 3.0

I got no errors installing on SMF 2.1.4 but when I go to admin ?action=admin;area=modsettings;sa=general I get the WSOD 500 error page.

Edit: It works on a clean 2.1.4 but not on my test copy of my site. Must be another mod interfering but I'm not getting any error message.

Thanks,
Shades 8)

Hmm...weird! :o  I uninstalled all mods on my test site then reinstalled them one by one but installed this Country Mod first and it works fine with no errors! ;)

But still don't know what caused the WSOD! ???
Title: Re: CountryFlags
Post by: vbgamer45 on July 05, 2023, 05:50:02 PM
Probably some strange file edit issue.
Title: Re: CountryFlags
Post by: Shades. on July 05, 2023, 06:39:47 PM
Any way for this to show flags on the members list too?

Thanks,
Shades 8)
Title: Re: CountryFlags
Post by: durangod on December 13, 2023, 05:03:25 AM
Hi, I installed your mod and i have a question..  How do i set US and Canada at the top (after 00) of the array when the drop down shows.  I changed the xml files and reinstalled but it still does not change their placement.  How do i do that ? 

Also your core files does not include a blank.gif image, so i made one.  What happens is that since there is no image it just shows a empty image border until you select a flag.  I could write some js to change from display none to display block but its easier just to make an image.  So i made a blank white blank.gif file and included it in the images.

I added it to my package zip and also copied it to the Themes/default/images/flags/  dir. 

Here is that image (it has a white background so it may not show up on this page)

blank.gif
Title: Re: CountryFlags
Post by: Steve on December 13, 2023, 09:10:22 AM
Quote from: durangod on December 13, 2023, 05:03:25 AMHere is that image
You do realize that:

QuoteThe white flag was the official flag of the Taliban-ruled Islamic Emirate of Afghanistan between September 1996 and October 1997. It is sometimes used as an unofficial variant of the current flag which includes the Shahada written in black on a white field.
Title: Re: CountryFlags
Post by: durangod on December 13, 2023, 11:10:00 AM
Quote from: Steve on December 13, 2023, 09:10:22 AM
Quote from: durangod on December 13, 2023, 05:03:25 AMHere is that image
You do realize that:

QuoteThe white flag was the official flag of the Taliban-ruled Islamic Emirate of Afghanistan between September 1996 and October 1997. It is sometimes used as an unofficial variant of the current flag which includes the Shahada written in black on a white field.

No i did not know that... OMG no way i am using that.... thank you so much for letting me know.  I will change it to a transparent image and repost it if anyone needs it.  I never thought a blank white flag would mean anything but maybe surrender or as they used to say parlay.  Thanks again ill change it.
Title: Re: CountryFlags
Post by: Steve on December 13, 2023, 12:16:41 PM
No worries. I figured you'd want to know.  :)
Title: Re: CountryFlags
Post by: durangod on December 13, 2023, 01:31:35 PM
Ok this one will work, its transparent so nothing shows up next to the dropdown box until you select your flag.

There is only one caveat - be sure you check the console or view source to see where the image needs to be. When i installed the plugin it all installed correctly however in the source for some reason its looking for the blank.gif file in the  Themes/Repulse/images  rather than Themes/Repulse/images/flags dir.    I am sure its the same if you just use the default theme out of the box.  So just check it and you might need to do (as i did) and just copy the blank.gif file to the correct dir.  Just remember that some themes also have a blank.png file so dont get them confused, leave the .png file alone.

Here is the before and after

beforeafterflag.jpg

and the new blank.gif image remember its transparent

>>>>>> here >>>> blank.gif <<<< here <<<<

Hope that helps  :)

PS  i was also able to get the US and Canada flags to show up first on the drop down list.  I guess i needed to remove all files and delete the files when i uninstalled then when i reinstalled with my edited xml files it shows correctly.  So all is well now, thanks :)



Title: Re: CountryFlags
Post by: durangod on December 13, 2023, 03:22:04 PM
If you have customers (or if this has happened to you as admin testing) that seem to skip over the flag entry (if its required) then you may need to highlight it on the page somehow... here are two ideas just add a big border around it and give it some padding...  or give it the same background as the other imputs.  Change the colors for your theme...

dl#country_flag.register_form {
    border: 0.438em ridge #781818;
    padding: 1em;
}


or you could just add the same background on it that the above inputs have like this.. I did not do the rounded corners but i dont think anyone will notice but me lol


dl#country_flag.register_form {
    background-color: #121212;
    padding: 1em;
}



here is what it looks like before and after for all three (original, big border or same background)

flags_beforreafter.jpg