News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

CountryFlags

Started by SMFHacks.com Team, August 14, 2006, 01:07:43 PM

Previous topic - Next topic

Sloth Sinner

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.

Branko.

#982
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...
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Sloth Sinner

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?

Branko.

#984
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
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Sloth Sinner

#985
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  ;)

Branko.

Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Branko.

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
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

GlitchPC

#988
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.


sharks

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.

vbgamer45

I would need someone to find a flag .gif/png file for anatartica then i can include it.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Thac0

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


sharks


Branko.

Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

jimv8673

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.

vbgamer45

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
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

vbgamer45

12/5/2011 v1.1.3
!Fixed missing Antarctica image
!Fixed skipping on Babylon theme if does not  exist.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: