News:

Wondering if this will always be free?  See why free is better.

Main Menu

CountryFlags

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

Previous topic - Next topic

vbgamer45

Try to emulate it in the package manager it should work for 2.0
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

RoCKeT-88

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~
Insert Witty Signature Here.

vbgamer45

I would emulate just 2.0 and see if that works.
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

DaKrampus

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

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

DaKrampus

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

Matthew K.

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.

DaKrampus

Great news, If you want I can send you the install package I made that also includes incorporation in memberlist.
Da

Matthew K.

I appreciate the offer, although I honestly prefer just writing any additions myself :)

DaKrampus

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

ShanRob_ClinnOTH23

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?

TheListener

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.

Matthew K.

More details would be fantastic, it's most likely an issue of not having copied over the flag images to your theme images directory.

ShanRob_ClinnOTH23

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

TheListener

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.

ShanRob_ClinnOTH23

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

TheListener

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


Matthew K.

Not a problem, I'm glad you got it working :)

ShanRob_ClinnOTH23

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.

carloscuev

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:


To this:


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

Advertisement: