News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

CountryFlags

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

Previous topic - Next topic

JayBachatero

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.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

KGIII

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.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

JayBachatero

I just tested this mod and it works fine with 1.1.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

KGIII

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.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Amon777

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

i use 1.1 , any idea?

JayBachatero

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?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Amon777

Gallery lite and Users online today

KGIII

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.

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Amon777

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?

JayBachatero

Yea that might be the cause of the problem.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Amon777


emaildrop

which package should I install for my 1.1 smf ?

emaildrop

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 ?

JayBachatero

Yea there is a chance that the uninstall might fail there.  You can just remove it manually if you uninstall.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

emaildrop

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? :'(

Amon777

Finally i installed the mod (display.template.php test failed) and then i copied the display code manually there and it worked...

bbmtalk

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


MrPrise

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.

MrPrise

#198
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!

trackman

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

Advertisement: