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

JayBachatero

Yea that was the only file that was edited.
Follow me on Twitter

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

MoreBloodWine

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"
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


JayBachatero

Sure no problem just let me know.
Follow me on Twitter

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

MoreBloodWine

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...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


JayBachatero

Ok I'll look into it later on.
Follow me on Twitter

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

MoreBloodWine

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...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


JayBachatero

Just been busy trying to install Ubuntu on my PC.
Follow me on Twitter

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

MoreBloodWine

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
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


JayBachatero

Ubuntu is a Linux Distro.  Ubuntu.com
Follow me on Twitter

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

MoreBloodWine

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**
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


VegasBoxers

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

JayBachatero

You can edit the flag for any member just like you can edit their profile.
Follow me on Twitter

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

VegasBoxers

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

JayBachatero

Change to the default theme.  Check if the option is there.
Follow me on Twitter

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

VegasBoxers

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

JayBachatero

You need to edit the Profile.template.php for your theme.  Look at the install.xml file for the changes required for that file.
Follow me on Twitter

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

VegasBoxers

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

JayBachatero

Yes is inside the archive.
Follow me on Twitter

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

VegasBoxers

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

JayBachatero

Follow me on Twitter

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

Advertisement: