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

whoey

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

Lolafish

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!

AquaPuppies - A Goldfish Community
www.aquapuppies.com

Running SMF 2.0.2 & SimplePortal 2.3.5

FragaCampos

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!

smitch6

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
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

smitch6

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
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

smitch6

Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

Februs

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?


vbgamer45

Community Suite for SMF - Take your forum to the next level built for 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

Februs

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?


vbgamer45

Community Suite for SMF - Take your forum to the next level built for 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

Februs

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.


Februs

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.


smitch6

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
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

sharks

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.

Paul_Pauline

Sharks, the answer is two posts above yours !!!
"In every life, no matter how full or empty one's purse, there is tragedy. It is the one promise life always fulfills.
Happiness is a gift and the trick is not to expect it, but to delight in it when it comes and to add to other people's store of it."
Pauline was one of those rare people who increased the store of happiness in the world.

sharks

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?

vbgamer45

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.
Community Suite for SMF - Take your forum to the next level built for 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

sharks

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.

vbgamer45

Is there even a flag for Antarctica? If so attach the small image here.
Community Suite for SMF - Take your forum to the next level built for 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

sharks

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:

Advertisement: