Author: vbgamer45 Original Author: JayBachatero (http://custom.simplemachines.org/mods/index.php?action=profile;u=4365) Current Version: 2.0 Compatibility: SMF 2.0.x, 1.1.x Donate (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W43RKPPZ2KGYE) | Homepage: SMFHacks (http://www.smfhacks.com) Type: Profile (http://custom.simplemachines.org/mods/index.php?action=search;type=10) Languages: (http://www.simplemachines.org/site_images/lang/english.gif) |
Version 3.0
!Fixed an XSS issue on registration for flags update for SMF 2.0.x and SMF 1.1.x Reported by Jaume Llopis
2.0.1
Separated Serbia and Montenegro
12/23/2011 v2.0
!Fixed for SMF 2.0 selecting flag on registration was not saving.
!Added some alt tags for SMF 2.0 version
12/5/2011 v1.1.3
!Fixed missing Antarctica image
!Fixed skipping on Babylon theme if does not exist.
9/24/2009 - v1.0.3
o Taken over by JBlaze
o Added new flag images
! Fixed version error
8/29/2006 - v1.0.2
! Fixed the bug that I thought I had fixed.
8/28/2006 - v1.0.1
! Fixed error when no flag is selected
8/26/2006 - v1.0
^ Initial release.
Quote {
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '<br /><br />';
}
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /><br /><br />';
}
8: Undefined index: country_flag
File: me\smf\Themes\default\Register.template.php (before sub template - eval?)
Line: 90
// If flags is set for registration show it.
if (!empty($modSettings['country_flag']) && $modSettings['country_flag'] == 2 || $modSettings['country_flag'] == 3)
// 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';
// If flags is set for registration show it.
if (!empty($modSettings['country_flag']) && $modSettings['country_flag'] == 2 || $modSettings['country_flag'] == 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, '">', $name, '</option>';
echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>';
QuoteIn the mean time try this file.
'so' => 'Scotland',
in the install and add a Scotland flag to the images directory?
Quotewould it just be as simple as adding
'so' => 'Scotland',
in the install and add a Scotland flag to the images directory?
Quote from: Jay The Code Monkey on August 16, 2006, 10:17:02 PM
Yea it should work w/o a problem. All of the mods that I've written lately have been built on RC3.
Quote from: Jay The Code Monkey on August 17, 2006, 10:33:32 PM
Polymath did you enable it on Admin > Features and Options > Last settings.
Quote
Installing this package will perform the following actions: Type Action Description
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test failed
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test failed
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags
Quote
Parijs add this to the /Themes/wow/languages/Modifications.engligh.phpCode Select
// 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';
Quote from: VegasBoxers on August 20, 2006, 02:59:13 AM
What do I edit on the Modsettings.php file?
Sincerest Thanks!
VB
(http://www.boxer-france.com/Galerie_Vos_photos/4chiots.jpg)
Quote from: AwwLilMaggie on August 20, 2006, 06:41:18 AM
Your theme probably has its own Display.template.php
-AwwLilMaggie
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
// Did they select a flag?
if(isset($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" />';
}
Quote from: K_4_kelly on August 19, 2006, 04:00:12 AM
to be honest, I almost installed all the mods been created and shared by you... hehe I like your mods very much, cos it always have a very good and systematic setting/contro panel
Quote from: Assistance on August 20, 2006, 07:34:29 AM
yoursCode Select
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
from the install fileCode Select// Did they select a flag?
if(isset($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" />';
}
try the above see if that works
Quote from: Jay The Code Monkey on August 20, 2006, 09:39:18 AM
mforum use the code that you had to beguin with. The last code will give an error if users select blank as their flag. Did you check the settings in Admin > Features and Options > Last one.
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
<td class="windowbg" align="left">', $member['link'], '</td>
<td class="windowbg" align="left">', $member['link'], ' ',(empty($member['options']['country']) ? '' : '<img src="' . $settings['default_theme_url'] . '/images/flags2/' . $member['options']['country'] . '.png" style=float: right;" />'),'</td>
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
</div>';
}
if(isset($member['options']['country']) && !empty($member['options']['country']))
{
$flags = CountryFlag();
echo '<img src="', $settings['default_theme_url'], '/images/flags2/', $member['options']['country'], '.png" alt="Country" />';
}
echo '
Quote from: Assistance on August 20, 2006, 04:29:55 AM
<file name="$sourcedir/ModSettings.php">
<operation>
<search position="before"><![CDATA[ // Reporting of personal messages?
array('check', 'enableReportPM'),
]]></search>
<add><![CDATA[
'',
// Show flags
array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
array('check', 'country_flag_required'),
array('check', 'country_flag_show'),
]]></add>
</operation>
'',
// Show flags
array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
array('check', 'country_flag_required'),
array('check', 'country_flag_show'),
array('check', 'enableReportPM'),
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
// Did they select a flag?
if(isset($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" />';
}
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';
Quote from: Jay The Code Monkey on August 22, 2006, 01:55:34 AM
That is the code for Profile page. Need to look at the one that has the $message var.
Quote from: Jay The Code Monkey on August 22, 2006, 01:37:01 PM
Vegas make sure that you have the latests package.
QuoteInstalling this package will perform the following actions: Type Action Description
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test failed
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags
Quote
<?php
// Version: 1.1 RC2; Display
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
// Show the anchor for the top and for the first message. If the first message is new, say so.
echo '
<a name="top"></a>
<a name="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : '';
// Is this topic also a poll?
if ($context['is_poll'])
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="bottom" /> ', $txt['smf43'], '
</td>
</tr>
<tr>
<td width="5%" valign="top" class="windowbg"><b>', $txt['smf21'], ':</b></td>
<td class="windowbg">
', $context['poll']['question'];
if (!empty($context['poll']['expire_time']))
echo '
(', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], ')';
// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote'])
{
echo '
<table>
<tr>
<td style="padding-top: 2ex;">
<table border="0" cellpadding="0" cellspacing="0">';
// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
echo '
<tr>
<td style="padding-right: 2ex;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>', $context['allow_poll_view'] ? '
<td nowrap="nowrap">' . $option['bar'] . ' ' . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
</tr>';
echo '
</table>
</td>
<td valign="bottom" style="padding-left: 15px;">';
// If they are allowed to revote - show them a link!
if ($context['allow_change_vote'])
echo '
<a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />';
// If we're viewing the results... maybe we want to go back and vote?
if ($context['poll']['show_results'] && $context['allow_vote'])
echo '
<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />';
// If they're allowed to lock the poll, show a link!
if ($context['poll']['lock'])
echo '
<a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';
// If they're allowed to edit the poll... guess what... show a link!
if ($context['poll']['edit'])
echo '
<a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';
echo '
</td>
</tr>', $context['allow_poll_view'] ? '
<tr>
<td colspan="2"><b>' . $txt['smf24'] . ': ' . $context['poll']['total_votes'] . '</b></td>
</tr>' : '', '
</table><br />';
}
// They are allowed to vote! Go to it!
else
{
echo '
<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" style="margin: 0px;">
<table>
<tr>
<td colspan="2">';
// Show a warning if they are allowed more than one option.
if ($context['poll']['allowed_warning'])
echo '
', $context['poll']['allowed_warning'], '
</td>
</tr><tr>
<td>';
// Show each option with its button - a radio likely.
foreach ($context['poll']['options'] as $option)
echo '
', $option['vote_button'], ' ', $option['option'], '<br />';
echo '
</td>
<td valign="bottom" style="padding-left: 15px;">';
// Allowed to view the results? (without voting!)
if ($context['allow_poll_view'])
echo '
<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';viewResults">', $txt['smf29'], '</a><br />';
// Show a link for locking the poll as well...
if ($context['poll']['lock'])
echo '
<a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '</a><br />';
// Want to edit it? Click right here......
if ($context['poll']['edit'])
echo '
<a href="', $scripturl, '?action=editpoll;topic=', $context['current_topic'], '.', $context['start'], '">', $txt['smf39'], '</a>';
echo '
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="', $txt['smf23'], '" /></td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
echo '
</td>
</tr>
</table>';
}
// Does this topic have some events linked to it?
if (!empty($context['calendar_events']))
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 3ex;">
<tr>
<td class="titlebg" valign="middle" align="left" style="padding-left: 6px;">
', $txt['calendar_linked_events'], '
</td>
</tr>
<tr>
<td width="5%" valign="top" class="windowbg">
<ul>';
foreach ($context['calendar_events'] as $event)
echo '
<li>
<b>', $event['title'] , '</b> ' , ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" >[' . $txt['calendar_shortedit'] . ']</a> ' : '') , ': ', $event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' . $event['end_date'] : ''), '
</li>';
echo '
</ul>
</td>
</tr>
</table>';
}
// Build the normal button array.
$normal_buttons = array(
'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'custom' => array(),
'send' => array('test' => 'can_send_topic', 'text' => 707, 'image' => 'sendtopic.gif', 'lang' => true, 'url' => $scripturl . '?action=sendtopic;topic=' . $context['current_topic'] . '.0'),
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
);
// Special case for the custom one.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
else
unset($normal_buttons['custom']);
// Show the page index... "Pages: [1]".
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext" valign="bottom" style="padding-bottom: 4px;"> ', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#lastPost"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], ' </div>
<table cellpadding="0" cellspacing="0">
<tr>
', template_button_strip($normal_buttons, 'bottom'), '
</tr>
</table>
</td>
</tr>
</table>';
// Show the topic information - icon, subject, etc.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
<tr class="catbg3">
<td valign="middle" width="2%" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
</td>
<td width="13%"> ', $txt[29], '</td>
<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
', $txt[118], ': ', $context['subject'], ' (', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
</td>
</tr>';
if (!empty($settings['display_who_viewing']))
{
echo '
<tr>
<td colspan="3" class="smalltext">';
// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
// Or show the actual people viewing the topic?
else
echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
</td>
</tr>';
}
echo '
</table>';
echo '
<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save(\'' . $context['session_id'] . '\') : confirm(\'' . $txt['quickmod_confirm'] . '\');">';
// These are some cache image buttons we may want.
$reply_button = create_button('quote.gif', 145, 'smf240', 'align="middle"');
$modify_button = create_button('modify.gif', 66, 17, 'align="middle"');
$remove_button = create_button('delete.gif', 121, 31, 'align="middle"');
$split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"');
// Time to display all the posts
echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">';
// Get all the messages...
while ($message = $context['get_message']())
{
echo '
<tr><td style="padding: 1px 1px 0 1px;">';
// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="', $message['alternate'] == 0 ? 'windowbg' : 'windowbg2', '">';
// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $message['member']['link'], '</b>
<div class="smalltext">';
// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['title'], '<br />';
// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';
// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
', $message['member']['post_group'], '<br />';
echo '
', $message['member']['group_stars'], '<br />';
// Is karma display enabled? Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
<br />
', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '
<br />
', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '<br />';
// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '
<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';
// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $message['member']['online']['text'] . '</span>' : '', '<br /><br />';
// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
', $txt[231], ': ', $message['member']['gender']['image'], '<br />';
// Did they select a flag?
if(isset($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" />';
}
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';
// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">', $message['member']['avatar']['image'], '</div><br />';
// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
', $message['member']['blurb'], '<br />
<br />';
// This shows the popular messaging icons.
echo '
', $message['member']['icq']['link'], '
', $message['member']['msn']['link'], '
', $message['member']['aim']['link'], '
', $message['member']['yim']['link'], '<br />';
// Show the profile, website, email address, and personal message buttons.
if ($settings['show_profile_buttons'])
{
// Don't show the profile button if you're not allowed to view the profile.
if ($message['member']['can_view_profile'])
echo '
<a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.gif" alt="' . $txt[27] . '" title="' . $txt[27] . '" border="0" />' : $txt[27]), '</a>';
// Don't show an icon if they haven't specified a website.
if ($message['member']['website']['url'] != '')
echo '
<a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $txt[515] . '" border="0" />' : $txt[515]), '</a>';
// Don't show the email address if they want it hidden.
if (empty($message['member']['hide_email']))
echo '
<a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';
// Since we know this person isn't a guest, you *can* message them.
if ($context['can_send_pm'])
echo '
<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
}
}
// Otherwise, show the guest's email.
elseif (empty($message['member']['hide_email']))
echo '
<br />
<br />
<a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';
// Done with the information about the poster... on to the post itself.
echo '
</div>
</td>
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a></td>
<td valign="middle">
<div style="font-weight: bold;" id="subject_', $message['id'], '">
<a href="', $message['href'], '">', $message['subject'], '</a>
</div>';
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<div class="smalltext">« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</div></td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" onclick="doQuote(', $message['id'], ', \'', $context['session_id'], '\'); return false;">', $reply_button, '</a>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '">', $reply_button, '</a>';
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';
// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', $remove_button, '</a>';
// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a>';
// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
echo '
<input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';" />';
// Show the post itself, finally!
echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '
<img src="' . $settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' . $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' . $message['id'] . '\', \'' . $context['session_id'] . '\')" />' : '' , '
</td>
</tr>';
// Now for the attachments, signature, ip logged, etc...
echo '
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">';
// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">';
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" /> ' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}
echo '
</div>';
}
echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';
echo '
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">';
// Maybe they want to report this post to the moderator(s)?
if ($context['can_report_moderator'])
echo '
<a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['rtm1'], '</a> ';
echo '
<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />';
// Show the IP to this user for this post - because you can moderate?
if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
echo '
<a href="', $scripturl, '?action=trackip;searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
// Or, should we show it because this is you?
elseif ($message['can_see_ip'])
echo '
<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $message['member']['ip'], '</a>';
// Okay, are you at least logged in? Then we can show something about why IPs are logged...
elseif (!$context['user']['is_guest'])
echo '
<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">', $txt[511], '</a>';
// Otherwise, you see NOTHING!
else
echo '
', $txt[511];
echo '
</td>
</tr></table>';
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">', $message['member']['signature'], '</div>';
echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
}
echo '
<tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
<a name="lastPost"></a>';
// As before, build the custom button right.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread', 'image' => 'markunread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll', 'image' => 'add_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext"> ', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#top"><b>' . $txt['topbottom4'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
', template_button_strip($normal_buttons, 'top', true), '
</tr>
</table>
</td>
</tr>
</table>';
if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';
echo '
<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
quickReplyCollapsed = ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ';
smf_topic = ', $context['current_topic'], ';
smf_start = ', $context['start'], ';
smf_show_modify = ', $settings['show_modify'] ? '1' : '0', ';
// On quick modify, this is what the body will look like.
var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="', $context['session_id'], '" /><input type="hidden" name="topic" value="', $context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="', $txt[10], '" onclick="return modify_save(\\\'' . $context['session_id'] . '\\\');" accesskey="s" /> ', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" /> ' : '', '<input type="submit" name="cancel" value="', $txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\';
// And this is the replacement for the subject.
var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\';
// Restore the message to this after editing.
var smf_template_body_normal = \'%body%\';
var smf_template_subject_normal = \'<a href="', $scripturl, '?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\';
var smf_template_top_subject = "', $txt[118], ': %subject% (', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')"
if (window.XMLHttpRequest)
showModifyButtons();
// ]]></script>
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 1ex;">
<tr>';
if ($settings['linktree_inline'])
echo '
<td valign="top">', theme_linktree(), '</td> ';
echo '
<td valign="top" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="nav"> ', $context['previous_next'], ' </td>
</tr>
</table>';
$mod_buttons = array(
'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),
'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_locked']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),
'remove_poll' => array('test' => 'can_remove_poll', 'text' => 'poll_remove', 'image' => 'admin_remove_poll.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');"', 'url' => $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start']),
'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),
);
if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">
<tr>
', template_button_strip($mod_buttons, 'bottom') , '
</tr>
</table>';
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
echo '
<input type="hidden" name="sc" value="', $context['session_id'], '" />
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.getElementById("quickmodSubmit").style.display = "none";
// ]]></script>';
echo '
</form>';
echo '
<div class="tborder"><div class="titlebg2" style="padding: 4px;" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<form action="', $scripturl, '" method="get" style="padding:0; margin: 0;">
<span class="smalltext">' . $txt[160] . ':</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 && this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt[251] . ':</option>';
foreach ($context['jump_to'] as $category)
{
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="#', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';
foreach ($category['boards'] as $board)
echo '
<option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ' . str_repeat('==', $board['child_level']) . '=> ' . $board['name'] . '</option>';
}
echo '
</select>
<input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
</form>
</div></div>';
echo '<br />';
if ($context['can_reply'] && !empty($options['display_quick_reply']))
{
echo '
<a name="quickreply"></a>
<table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
<tr>
<td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td>
</tr>
<tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
<td class="windowbg" width="25%" valign="top">', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</td>
<td class="windowbg" width="75%" align="center">
<form action="', $scripturl, '?action=post2" method="post" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
<input type="hidden" name="subject" value="' . $txt['response_prefix'] . $context['subject'] . '" />
<input type="hidden" name="icon" value="xx" />
<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
<input type="hidden" name="num_replies" value="', $context['num_replies'], '" />
<textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
<input type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
<input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
if ($context['show_spellchecking'])
echo '
<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" />';
echo '
<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
</form>
</td>
</tr>
</table>';
if ($context['show_spellchecking'])
echo '
<form name="spell_form" id="spell_form" method="post" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value="" /></form>';
}
}
?>
if(isset($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" />';
}
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
Quote from: L.G.S on August 26, 2006, 07:11:50 AM
Hey Jay, I installed your mod and turned it on for Both reg and profiles
Quote from: L.G.S on August 29, 2006, 06:56:21 AM
I had TP installed before upgrading and didn't want people to change their theme, it's back now. I see you have your flag selected in your profile on my forum, how did you do it ?
Quote from: L.G.S on August 29, 2006, 06:56:21 AMSo you telling me that you didn't select a flag in the profile first?
I had TP installed before upgrading and didn't want people to change their theme, it's back now. I see you have your flag selected in your profile on my forum, how did you do it ?
Quote7. Execute Modification ./Themes/default/Display.template.php Test failed
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
if (!empty($member['ip']))
echo '
(<a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank">' . $member['ip'] . '</a>)';
// 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']], '" /> ', $flags[$member['options']['country']], '<br /><br />';
}
<?php
// The only template in the file.
function template_main()
{
global $context, $settings, $options, $scripturl, $txt;
// Display the table header and linktree.
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>';
$brokendown = array (
'Members' => array(),
'Guests' => array(),
'Spiders' => array(),
);
foreach($context['members'] AS $key => $member)
{
$spider = getAgent($member['query']['USER_AGENT'], $context['members'][$key]['name'], $agent, $member['id'] == 0);
$context['members'][$key]['agent'] = $agent;
$member['query']['USER_AGENT'] = isset($member['query']['USER_AGENT']) ? $member['query']['USER_AGENT'] : '';
if ( $member['id'] != 0 )
$brokendown['Members'][] = &$context['members'][$key];
else if ( $spider )
$brokendown['Spiders'][] = &$context['members'][$key];
else
$brokendown['Guests'][] = &$context['members'][$key];
}
// echo '<pre>'; print_r($brokendown['Spiders']); echo '</pre>'; return;
foreach($brokendown AS $group => $members)
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
<tr>
<td class="catbg">', $group, '</td>
</tr>
</table>
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg">
<td width="30%"><a href="' . $scripturl . '?action=who;sort=user', $context['sort_direction'] == 'down' && $context['sort_by'] == 'user' ? ';asc' : '', '">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td style="width: 14ex;"><a href="' . $scripturl . '?action=who;sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
<td>', $txt['who_action'], '</td>
</tr>';
// This is used to alternate the color of the background.
$alternate = true;
// For every member display their name, time and action (and more for admin).
foreach ($members as $member)
{
// $alternate will either be true or false. If it's true, use "windowbg2" and otherwise use "windowbg".
echo '
<tr class="windowbg', $alternate ? '2' : '', '">
<td>';
// Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
if (!$member['is_guest'])
{
echo '
<div style="float: right; width: 14ex;">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" border="0" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
', $member['icq']['link'], ' ', $member['msn']['link'], ' ', $member['yim']['link'], ' ', $member['aim']['link'], '
</div>';
}
echo '
<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt[92] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '</span>';
if ( !empty($member['ip']) )
echo ' <br /> <span class="smalltext">(<b><a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank" title="' . $member['ip'] . '" class="smalltext2">' . $member['ip'] . '</a></b>, <acronym title="' . $member['query']['USER_AGENT'] . '">' . $member['agent'] . '</acronym>)</span>';
echo '
</td>
<td nowrap="nowrap">', $member['time'], '</td>
<td>', $member['action'], '</td>
</tr>
';
// Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
$alternate = !$alternate;
}
echo '</table><br/>';
}
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder"><tr><td class="titlebg">
<b>', $txt[139], ':</b> ', $context['page_index'], '
</td></tr></table>';
}
function getAgent( &$user_agent, &$user_name, &$result, $guest )
{
$known_agents = array (
//Search Spiders
array (
'agent' => 'WISENutbot',
'spidername' => 'Looksmart spider',
'spider' => true,
),
array (
'agent' => 'MSNBot',
'spidername' => 'MSN spider',
'spider' => true,
),
array (
'agent' => 'W3C_Validator',
'spidername' => 'W3C Validaator',
'spider' => true,
),
array (
'agent' => 'Googlebot-Image',
'spidername' => 'Google-Image Spider',
'spider' => true,
),
array (
'agent' => 'Googlebot',
'spidername' => 'Google spider',
'spider' => true,
),
array (
'agent' => 'Mediapartners-Google',
'spidername' => 'Google AdSense spider',
'spider' => true,
),
array (
'agent' => 'Openbot',
'spidername' => 'Openfind spider',
'spider' => true,
),
array (
'agent' => 'Yahoo! Slurp',
'spidername' => 'Yahoo spider',
'spider' => true,
),
array (
'agent' => 'FAST-WebCrawler',
'spider' => true,
),
array (
'agent' => 'Wget',
'spider' => true,
),
array (
'agent' => 'Ask Jeeves',
'spider' => true,
),
array (
'agent' => 'Speedy Spider',
'spider' => true,
),
array (
'agent' => 'SurveyBot',
'spider' => true,
),
array (
'agent' => 'IBM_Planetwide',
'spider' => true,
),
array (
'agent' => 'GigaBot',
'spider' => true,
),
array (
'agent' => 'ia_archiver',
'spider' => true,
),
array (
'agent' => 'FAST-WebCrawler',
'spider' => true,
),
array (
'agent' => 'Inktomi Slurp',
'spider' => true,
),
array (
'agent' => 'appie',
'spidername' => 'Walhello spider',
'spider' => true,
),
//mobiles
array (
'agent' => 'Nokia',
),
array (
'agent' => 'Samsung',
),
array (
'agent' => 'Ericsson',
),
array (
'agent' => 'Siemens',
),
array (
'agent' => 'Motorola',
),
//Browsers
array (
'agent' => 'Opera',
),
array (
'agent' => 'Firefox',
),
array (
'agent' => 'Firebird',
),
array (
'agent' => 'Safari',
),
array (
'agent' => 'Netscape',
),
array (
'agent' => 'MyIE2',
),
array (
'agent' => 'Konqueror',
),
array (
'agent' => 'Galeon',
),
array (
'agent' => 'KMeleon',
),
array (
'agent' => 'NG/2.0',
),
array (
'agent' => 'Gecko',
'name' => 'Mozilla',
),
array (
'agent' => 'MSIE',
),
);
foreach( $known_agents AS $poss )
if (strpos(strtolower($user_agent), strtolower($poss['agent'])) !== false)
{
if ( $guest && isset($poss['spider']) && $poss['spider'] )
$user_name = isset($poss['spidername']) ? $poss['spidername'] : (isset($poss['name']) ? $poss['name'] : $poss['agent']);
$result = isset($poss['name']) ? $poss['name'] : $poss['agent'];
return isset($poss['spider']) && $poss['spider'];
}
$result = $user_agent;
return false;
}
?>
echo ' <br /> <span class="smalltext">(<b><a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank" title="' . $member['ip'] . '" class="smalltext2">' . $member['ip'] . '</a></b>, <acronym title="' . $member['query']['USER_AGENT'] . '">' . $member['agent'] . '</acronym>)</span>';
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Type Action Description
1. Execute Modification install.xml Modification parse error
2. Execute Modification - Modification parse error
3. Extract Tree ./Themes/default/images/flags
function CountryFlag()
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'nire' => 'Northern Ireland', 'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'scot' => 'Scotland', 'sn' => 'Senegal', 'cs' => 'Serbia and Montenegro',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wales' => 'Wales', 'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}
Quote from: JayBachatero on October 02, 2006, 04:03:09 PM
Add the $txt from the default theme's Modification.english.php to Dilberts Modification.english.php.
// 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';
Quote from: JayBachatero on October 22, 2006, 08:57:26 PMI'm 100 % positive I copied everything right... which is whats so frustrating...
Make sure that you copied and pasted in the right location. Might be slightly different for your theme.
Quote from: JayBachatero on October 22, 2006, 10:32:05 PMkoo...
I'll look at it later on when I get a chance.
Quote from: JayBachatero on October 22, 2006, 11:06:28 PMThats cool least it is workin but since this is a test site i may have to call upon u again come production time if i cant figure out what u did by lookin at the file hehe... is the display.template the only file u had to touch to get this to work...
Ok done. Not sure what exactly was wrong since it took me a few chances to get it done. I had to move it around a bit.
Quote from: JayBachatero on October 23, 2006, 01:09:16 AMWell 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"
Yea that was the only file that was edited.
Quote from: JayBachatero on October 23, 2006, 10:10:56 PMI 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...
Sure no problem just let me know.
Quote from: JayBachatero on October 23, 2006, 11:17:27 PMNo 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...
Ok I'll look into it later on.
Quote from: JayBachatero on October 25, 2006, 08:24:44 PMKool... like I said no rush hehe... whats Ubuntu just curious bec it has a weird name lol
Just been busy trying to install Ubuntu on my PC.
Quote from: JayBachatero on October 25, 2006, 08:46:56 PMKool.. 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**
Ubuntu is a Linux Distro. Ubuntu.com
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.
Quote from: JayBachatero on October 31, 2006, 08:48:46 PM
Change to the default theme. Check if the option is there.
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.
Quote from: JayBachatero on October 31, 2006, 11:32:32 PM
Yes is inside the archive.
<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>
Quote from: JayBachatero on November 01, 2006, 08:22:47 AM
http://docs.simplemachines.org/index.php?topic=402
Quote from: VegasBoxers on November 01, 2006, 11:59:04 AMQuote from: JayBachatero on November 01, 2006, 08:22:47 AM
http://docs.simplemachines.org/index.php?topic=402
Thanks Jay! That should be simple enough! I'll have to give it a shot tonight when I get home. I'll have to owe you a Snickers bar from my daughter's stash she picked up last night! ;D
VB
Quote from: JayBachatero on November 01, 2006, 11:11:39 PM
There are several places that you need to edit in profile.template.php.
Quote from: JayBachatero on November 02, 2006, 08:06:59 AM
I suggest that you don't use dreamweaver for editing. It messes up php files.
Quote from: VegasBoxers on November 02, 2006, 01:28:34 PMQuote from: JayBachatero on November 02, 2006, 08:06:59 AM
I suggest that you don't use dreamweaver for editing. It messes up php files.
Alright, I'll go back and do it again by hand tonight. That's interesting about Dreamweaver messing up the php files. I've never heard that before.
Thanks Jay!
VB
QuoteIt should be called temp not Temp. Also try chmoding it to 755.
Quote from: JayBachatero on November 21, 2006, 10:09:12 PMNo. Should I?
Did you ever remove the file from the server?
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.
Quote from: JayBachatero on December 12, 2006, 12:34:31 PM
I just tested this mod and it works fine with 1.1.
Quote from: KGIII on December 12, 2006, 03:41:32 PMWhen you have too many mods it's prone to fail in ModSettings.php.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.
Quote from: Amon777 on December 13, 2006, 02:11:50 AMWhat mods do you have installed?
Test Failed at Themes/default/Display.template.php
i use 1.1 , any idea?
Quote from: JayBachatero on August 20, 2006, 01:34:15 PM
Fixed.
For those of you that have this problem just changeCode Select
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($context['member']['options']['country']))
toCode Select
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
// Old style tabs?
$colnums=count($context['columns'])+1;
<td colspan="12">
<td colspan="',$colnums,'">
<td class="windowbg" align="left">', $member['link'], '</td>
<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>
'realName' => array(
'label' => $txt[35]
),
'location' => array(
'label' => $txt['country_flag'],
'width' => '10'
),
'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),
'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),
// Select the members from the database.
if ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . "
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)" : '') . "
// Search for messengers...
// Search for location.
if (in_array('location', $_POST['fields']))
$fields += array(7 => 'locationTitle', 'location');
Quote from: trackman on January 06, 2007, 07:01:56 AM
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 :(
Quote from: trackman on January 15, 2007, 02:28:51 PM
Help please I have the following text at the top of my Forum page when I installed the mod:
// 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'; >:(
Quote from: txleo on January 18, 2007, 01:46:52 AM
I installed the mod and it worked fine on my board. I'm using latest version of SMF.
Quote from: Dhekelian on January 21, 2007, 06:02:24 PMQuote from: txleo on January 18, 2007, 01:46:52 AM
I installed the mod and it worked fine on my board. I'm using latest version of SMF.
What version you using? Can you get this working on 1.1.1?
Quote from: MrPrise on December 29, 2006, 01:03:21 PMfollowed that but it didnt work =\
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 lineCode Select// Old style tabs?
add this:Code Select$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 fourCode Select<td colspan="12">
You should change all the 12 in them to ',$colnums,' so the td will look like this:Code Select<td colspan="',$colnums,'">
And now the real thing. We are going to add a new column for the table. Find this:Code Select<td class="windowbg" align="left">', $member['link'], '</td>
and after that insert these lines:Code Select<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 findCode Select'realName' => array(
'label' => $txt[35]
),
and after it add that:Code Select'location' => array(
'label' => $txt['country_flag'],
'width' => '10'
),
find that:Code Select'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),
and after it add that:Code Select'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),
Find the lineCode Select// Select the members from the database.
and before it add these:Code Selectif ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';
Replace that lineCode SelectLEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . "
with thatCode SelectLEFT 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 lineCode Select// Search for messengers...
insert that:Code Select
// 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!
<?php
// Version: 1.1; Memberlist
// Displays a sortable listing of all members registered on the forum.
function template_main() $modSettings
{
global $context, $settings, $options, $scripturl, $txt;
// Show the link tree.
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>';
// shall we use the tabs?
if (!empty($settings['use_tabs']))
{
// Display links to view all/search.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first"> </td>';
foreach ($context['sort_links'] as $link)
{
if ($link['selected'])
echo '
<td class="mirrortab_active_first"> </td>
<td valign="top" class="mirrortab_active_back">
<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
</td>
<td class="mirrortab_active_last"> </td>';
else
echo '
<td valign="top" class="mirrortab_back">
<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
</td>';
}
echo '
<td class="mirrortab_last"> </td>
</tr>
</table>';
}
echo '
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="bordercolor">';
// Old style tabs?
$colnums=count($context['columns'])+1;
if (empty($settings['use_tabs']))
{
echo '
<tr class="titlebg">
<td colspan=",$colnums">';
$links = array();
foreach ($context['sort_links'] as $link)
$links[] = ($link['selected'] ? '<img src="' . $settings['images_url'] . '/selected.gif" alt=">" /> ' : '') . '<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">' . $link['label'] . '</a>';
echo '
', implode(' | ', $links), '
</td>
</tr>';
}
echo '
<tr>
<td colspan=",$colnums" class="', empty($settings['use_tabs']) ? 'catbg' : 'titlebg', '">';
// Display page numbers and the a-z links for sorting by name if not a result of a search.
if (!isset($context['old_search']))
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>', $txt[139], ': ', $context['page_index'], '</td>
<td align="right">', $context['letter_links'] . '</td>
</tr>
</table>';
// If this is a result of a search then just show the page numbers.
else
echo '
', $txt[139], ': ', $context['page_index'];
echo '
</td>
</tr>
<tr class="', empty($settings['use_tabs']) ? 'titlebg' : 'catbg3', '">';
// Display each of the column headers of the table.
foreach ($context['columns'] as $column)
{
// We're not able (through the template) to sort the search results right now...
if (isset($context['old_search']))
echo '
<td', isset($column['width']) ? ' width="' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
', $column['label'], '</td>';
// This is a selected solumn, so underline it or some such.
elseif ($column['selected'])
echo '
<td style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . ' nowrap="nowrap">
<a href="' . $column['href'] . '">' . $column['label'] . ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" /></a></td>';
// This is just some column... show the link and be done with it.
else
echo '
<td', isset($column['width']) ? ' width="' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '>
', $column['link'], '</td>';
}
echo '
</tr>';
// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
echo '
<tr style="text-align: center;"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>
<td class="windowbg2">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
</td>
<td class="windowbg" align="left">', $member['link'], '</td>
<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>
<td class="windowbg2">', $member['hide_email'] ? '' : '<a href="mailto:' . $member['email'] . '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . ' ' . $member['name'] . '" /></a>', '</td>
<td class="windowbg">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><img src="' . $settings['images_url'] . '/www.gif" alt="' . $member['website']['title'] . '" title="' . $member['website']['title'] . '" /></a>' : '', '</td>
<td class="windowbg2">', $member['icq']['link'], '</td>
<td class="windowbg2">', $member['aim']['link'], '</td>
<td class="windowbg2">', $member['yim']['link'], '</td>
<td class="windowbg2">', $member['msn']['link'], '</td>
<td class="windowbg" align="left">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
<td class="windowbg" align="left">', $member['registered_date'], '</td>
<td class="windowbg2" width="15">', $member['posts'], '</td>
<td class="windowbg" width="100" align="left">
', $member['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $member['post_percent'] . '" height="15" alt="" />' : '', '
</td>
</tr>';
}
// No members?
else
echo '
<tr>
<td colspan=",$colnums" class="windowbg">', $txt[170], '</td>
</tr>';
// Show the page numbers again. (makes 'em easier to find!)
echo '
<tr>
<td class="titlebg" colspan=",$colnums">', $txt[139], ': ', $context['page_index'], '</td>
</tr>
</table>';
// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<br />
<a href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search2'], '</a>';
}
// A page allowing people to search the member list.
function template_search()
{
global $context, $settings, $options, $scripturl, $txt;
// Start the submission form for the search!
echo '
<form action="', $scripturl, '?action=mlist;sa=search" method="post" accept-charset="', $context['character_set'], '">';
// Display that link tree...
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>';
// Display links to view all/search.
if (!empty($settings['use_tabs']))
{
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first"> </td>';
foreach ($context['sort_links'] as $link)
{
if ($link['selected'])
echo '
<td class="mirrortab_active_first"> </td>
<td valign="top" class="mirrortab_active_back">
<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
</td>
<td class="mirrortab_active_last"> </td>';
else
echo '
<td valign="top" class="mirrortab_back">
<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
</td>';
}
echo '
<td class="mirrortab_last"> </td>
</tr>
</table>
<div class="tborder">';
}
else
{
echo '
<div class="bordercolor" style="padding: 1px;">
<div class="titlebg" style="padding: 4px 4px 4px 10px;">';
$links = array();
foreach ($context['sort_links'] as $link)
$links[] = ($link['selected'] ? '<img src="' . $settings['images_url'] . '/selected.gif" alt=">" /> ' : '') . '<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">' . $link['label'] . '</a>';
echo '
', implode(' | ', $links), '
</div>
</div>
<div class="bordercolor" style="padding: 1px">';
}
// Display the input boxes for the form.
echo '
<div class="windowbg" align="center" style="padding-bottom: 1ex;">
<table width="440" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left">
<br />
<b>', $txt[582], ':</b> <input type="text" name="search" value="', $context['old_search'], '" size="35" /> <input type="submit" name="submit" value="' . $txt[182] . '" style="margin-left: 20px;" /><br />
<br />
</td>
</tr>
<tr>
<td align="left">
<label for="fields-email"><input type="checkbox" name="fields[]" id="fields-email" value="email" checked="checked" class="check" /> ', $txt['mlist_search_email'], '</label><br />
<label for="fields-messenger"><input type="checkbox" name="fields[]" id="fields-messenger" value="messenger" class="check" /> ', $txt['mlist_search_messenger'], '</label><br />
<label for="fields-group"><input type="checkbox" name="fields[]" id="fields-group" value="group" class="check" /> ', $txt['mlist_search_group'], '</label>
</td>
<td align="left" valign="top">
<label for="fields-name"><input type="checkbox" name="fields[]" id="fields-name" value="name" checked="checked" class="check" /> ', $txt['mlist_search_name'], '</label><br />
<label for="fields-website"><input type="checkbox" name="fields[]" id="fields-website" value="website" class="check" /> ', $txt['mlist_search_website'], '</label>
</td>
</tr>
</table>
</div>
</div>
</form>';
}
?>
<?php
/**********************************************************************************
* Memberlist.php *
***********************************************************************************
* SMF: Simple Machines Forum *
* Open-Source Project Inspired by Zef Hemel ([email protected]) *
* =============================================================================== *
* Software Version: SMF 1.1 *
* Software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2006 by: Simple Machines LLC (http://www.simplemachines.org) *
* 2001-2006 by: Lewis Media (http://www.lewismedia.com) *
* Support, News, Updates at: http://www.simplemachines.org *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under *
* the terms of the provided license as published by Simple Machines LLC. *
* *
* This program is distributed in the hope that it is and will be useful, but *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version can always be found at http://www.simplemachines.org. *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');
/* This file contains the functions for displaying and searching in the
members list. It does so with these functions:
void MemberList()
- shows a list of registered members.
- if a subaction is not specified, lists all registered members.
- allows searching for members with the 'search' sub action.
- calls MLAll or MLSearch depending on the sub action.
- uses the Memberlist template with the main sub template.
- requires the view_mlist permission.
- is accessed via ?action=mlist.
void MLAll()
- used to display all members on a page by page basis with sorting.
- called from MemberList().
- can be passed a sort parameter, to order the display of members.
- calls printMemberListRows to retrieve the results of the query.
void MLSearch()
- used to search for members or display search results.
- called by MemberList().
- if variable 'search' is empty displays search dialog box, using the
search sub template.
- calls printMemberListRows to retrieve the results of the query.
void printMemberListRows(resource request)
- retrieves results of the request passed to it
- puts results of request into the context for the sub template.
*/
// Show a listing of the registered members.
function Memberlist()
{
global $scripturl, $txt, $modSettings, $context, $settings;
// Make sure they can view the memberlist.
isAllowedTo('view_mlist');
loadTemplate('Memberlist');
$context['listing_by'] = !empty($_GET['sa']) ? $_GET['sa'] : 'all';
// $subActions array format:
// 'subaction' => array('label', 'function', 'is_selected')
$subActions = array(
'all' => array(&$txt[303], 'MLAll', $context['listing_by'] == 'all'),
'search' => array(&$txt['mlist_search'], 'MLSearch', $context['listing_by'] == 'search'),
);
// Set up the sort links.
$context['sort_links'] = array();
foreach ($subActions as $act => $text)
$context['sort_links'][] = array(
'label' => $text[0],
'action' => $act,
'selected' => $text[2],
);
$context['num_members'] = $modSettings['totalMembers'];
// Set up the columns...
$context['columns'] = array(
'isOnline' => array(
'label' => $txt['online8'],
'width' => '20'
),
'realName' => array(
'label' => $txt[35]
),
'location' => array(
'label' => $txt['country_flag'],
'width' => '10'
),
'emailAddress' => array(
'label' => $txt[307],
'width' => '25'
),
'websiteUrl' => array(
'label' => $txt[96],
'width' => '25'
),
'ICQ' => array(
'label' => $txt[513],
'width' => '25'
),
'AIM' => array(
'label' => $txt[603],
'width' => '25'
),
'YIM' => array(
'label' => $txt[604],
'width' => '25'
),
'MSN' => array(
'label' => $txt['MSN'],
'width' => '25'
),
'ID_GROUP' => array(
'label' => $txt[87]
),
'registered' => array(
'label' => $txt[233]
),
'posts' => array(
'label' => $txt[21],
'width' => '115',
'colspan' => '2'
)
);
$context['linktree'][] = array(
'url' => $scripturl . '?action=mlist',
'name' => &$txt[332]
);
$context['can_send_pm'] = allowedTo('pm_send');
// Jump to the sub action.
if (isset($subActions[$context['listing_by']]))
$subActions[$context['listing_by']][1]();
else
$subActions['all'][1]();
}
// List all members, page by page.
function MLAll()
{
global $txt, $scripturl, $db_prefix, $user_info;
global $modSettings, $context, $func;
// The chunk size for the cached index.
$cache_step_size = 500;
// Only use caching if:
// 1. there are at least 2k members,
// 2. the default sorting method (realName) is being used,
// 3. the page shown is high enough to make a DB filesort unprofitable.
$use_cache = $modSettings['totalMembers'] > 2000 && (!isset($_REQUEST['sort']) || $_REQUEST['sort'] === 'realName') && isset($_REQUEST['start']) && $_REQUEST['start'] > $cache_step_size;
if ($use_cache)
{
// Maybe there's something cached already.
if (!empty($modSettings['memberlist_cache']))
$memberlist_cache = @unserialize($modSettings['memberlist_cache']);
// Only update the cache if something changed or no cache existed yet.
if (empty($memberlist_cache) || empty($modSettings['memberlist_updated']) || $memberlist_cache['last_update'] < $modSettings['memberlist_updated'])
{
$request = db_query("
SELECT realName
FROM {$db_prefix}members
WHERE is_activated = 1
ORDER BY realName", __FILE__, __LINE__);
$memberlist_cache = array(
'last_update' => time(),
'num_members' => mysql_num_rows($request),
'index' => array(),
);
for ($i = 0, $n = mysql_num_rows($request); $i < $n; $i += $cache_step_size)
{
mysql_data_seek($request, $i);
list($memberlist_cache['index'][$i]) = mysql_fetch_row($request);
}
mysql_data_seek($request, $memberlist_cache['num_members'] - 1);
list($memberlist_cache['index'][$i]) = mysql_fetch_row($request);
mysql_free_result($request);
// Now we've got the cache...store it.
updateSettings(array('memberlist_cache' => addslashes(serialize($memberlist_cache))));
}
$context['num_members'] = $memberlist_cache['num_members'];
}
// Without cache we need an extra query to get the amount of members.
else
{
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}members
WHERE is_activated = 1", __FILE__, __LINE__);
list ($context['num_members']) = mysql_fetch_row($request);
mysql_free_result($request);
}
// Set defaults for sort (realName) and start. (0)
if (!isset($_REQUEST['sort']) || !isset($context['columns'][$_REQUEST['sort']]))
$_REQUEST['sort'] = 'realName';
if (!is_numeric($_REQUEST['start']))
{
if (preg_match('~^[^\'\\\\/]~' . ($context['utf8'] ? 'u' : ''), $func['strtolower']($_REQUEST['start']), $match) === 0)
fatal_error('Hacker?', false);
$_REQUEST['start'] = $match[0];
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}members
WHERE LOWER(SUBSTRING(realName, 1, 1)) < '$_REQUEST[start]'
AND is_activated = 1", __FILE__, __LINE__);
list ($_REQUEST['start']) = mysql_fetch_row($request);
mysql_free_result($request);
}
$context['letter_links'] = '';
for ($i = 97; $i < 123; $i++)
$context['letter_links'] .= '<a href="' . $scripturl . '?action=mlist;sa=all;start=' . chr($i) . '#letter' . chr($i) . '">' . strtoupper(chr($i)) . '</a> ';
// Sort out the column information.
foreach ($context['columns'] as $col => $dummy)
{
$context['columns'][$col]['href'] = $scripturl . '?action=mlist;sort=' . $col . ';start=0';
if (!isset($_REQUEST['desc']) && $col == $_REQUEST['sort'])
$context['columns'][$col]['href'] .= ';desc';
$context['columns'][$col]['link'] = '<a href="' . $context['columns'][$col]['href'] . '">' . $context['columns'][$col]['label'] . '</a>';
$context['columns'][$col]['selected'] = $_REQUEST['sort'] == $col;
}
$context['sort_by'] = $_REQUEST['sort'];
$context['sort_direction'] = !isset($_REQUEST['desc']) ? 'down' : 'up';
// Construct the page index.
$context['page_index'] = constructPageIndex($scripturl . '?action=mlist;sort=' . $_REQUEST['sort'] . (isset($_REQUEST['desc']) ? ';desc' : ''), $_REQUEST['start'], $context['num_members'], $modSettings['defaultMaxMembers']);
// Send the data to the template.
$context['start'] = $_REQUEST['start'] + 1;
$context['end'] = min($_REQUEST['start'] + $modSettings['defaultMaxMembers'], $context['num_members']);
$context['page_title'] = $txt[308] . ' ' . $context['start'] . ' ' . $txt[311] . ' ' . $context['end'];
$context['linktree'][] = array(
'url' => $scripturl . '?action=mlist;sort=' . $_REQUEST['sort'] . ';start=' . $_REQUEST['start'],
'name' => &$context['page_title'],
'extra_after' => ' (' . $txt[309] . ' ' . $context['num_members'] . ' ' . $txt[310] . ')'
);
// List out the different sorting methods...
$sort_methods = array(
'isOnline' => array(
'down' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') ASC, realName ASC',
'up' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') DESC, realName DESC'
),
'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),
'location' => array(
'down' => 'opt.value ASC',
'up' => 'opt.value DESC'
),
'emailAddress' => array(
'down' => (allowedTo('moderate_forum') || empty($modSettings['allow_hideEmail'])) ? 'mem.emailAddress ASC' : 'mem.hideEmail ASC, mem.emailAddress ASC',
'up' => (allowedTo('moderate_forum') || empty($modSettings['allow_hideEmail'])) ? 'mem.emailAddress DESC' : 'mem.hideEmail DESC, mem.emailAddress DESC'
),
'websiteUrl' => array(
'down' => 'LENGTH(mem.websiteURL) > 0 DESC, ISNULL(mem.websiteURL) ASC, mem.websiteURL ASC',
'up' => 'LENGTH(mem.websiteURL) > 0 ASC, ISNULL(mem.websiteURL) DESC, mem.websiteURL DESC'
),
'ICQ' => array(
'down' => 'LENGTH(mem.ICQ) > 0 DESC, ISNULL(mem.ICQ) OR mem.ICQ = 0 ASC, mem.ICQ ASC',
'up' => 'LENGTH(mem.ICQ) > 0 ASC, ISNULL(mem.ICQ) OR mem.ICQ = 0 DESC, mem.ICQ DESC'
),
'AIM' => array(
'down' => 'LENGTH(mem.AIM) > 0 DESC, ISNULL(mem.AIM) ASC, mem.AIM ASC',
'up' => 'LENGTH(mem.AIM) > 0 ASC, ISNULL(mem.AIM) DESC, mem.AIM DESC'
),
'YIM' => array(
'down' => 'LENGTH(mem.YIM) > 0 DESC, ISNULL(mem.YIM) ASC, mem.YIM ASC',
'up' => 'LENGTH(mem.YIM) > 0 ASC, ISNULL(mem.YIM) DESC, mem.YIM DESC'
),
'MSN' => array(
'down' => 'LENGTH(mem.MSN) > 0 DESC, ISNULL(mem.MSN) ASC, mem.MSN ASC',
'up' => 'LENGTH(mem.MSN) > 0 ASC, ISNULL(mem.MSN) DESC, mem.MSN DESC'
),
'registered' => array(
'down' => 'mem.dateRegistered ASC',
'up' => 'mem.dateRegistered DESC'
),
'ID_GROUP' => array(
'down' => 'ISNULL(mg.groupName) ASC, mg.groupName ASC',
'up' => 'ISNULL(mg.groupName) DESC, mg.groupName DESC'
),
'posts' => array(
'down' => 'mem.posts DESC',
'up' => 'mem.posts ASC'
)
);
$limit = $_REQUEST['start'];
// Using cache allows to narrow down the list to be retrieved.
if ($use_cache && $_REQUEST['sort'] === 'realName' && !isset($_REQUEST['desc']))
{
$first_offset = $_REQUEST['start'] - ($_REQUEST['start'] % $cache_step_size);
$second_offset = ceil(($_REQUEST['start'] + $modSettings['defaultMaxMembers']) / $cache_step_size) * $cache_step_size;
$where = "mem.realName BETWEEN '" . addslashes($memberlist_cache['index'][$first_offset]) . "' AND '" . addslashes($memberlist_cache['index'][$second_offset]) . "'";
$limit -= $first_offset;
}
// Reverse sorting is a bit more complicated...
elseif ($use_cache && $_REQUEST['sort'] === 'realName')
{
$first_offset = floor(($memberlist_cache['num_members'] - $modSettings['defaultMaxMembers'] - $_REQUEST['start']) / $cache_step_size) * $cache_step_size;
if ($first_offset < 0)
$first_offset = 0;
$second_offset = ceil(($memberlist_cache['num_members'] - $_REQUEST['start']) / $cache_step_size) * $cache_step_size;
$where = "mem.realName BETWEEN '" . addslashes($memberlist_cache['index'][$first_offset]) . "' AND '" . addslashes($memberlist_cache['index'][$second_offset]) . "'";
$limit = $second_offset - ($memberlist_cache['num_members'] - $_REQUEST['start']) - ($second_offset > $memberlist_cache['num_members'] ? $cache_step_size - ($memberlist_cache['num_members'] % $cache_step_size) : 0);
}
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)" : '') . "// Select the members from the database.
$request = db_query("
SELECT mem.ID_MEMBER
FROM {$db_prefix}members AS mem" . ($_REQUEST['sort'] === 'isOnline' ? "
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)" : '') . ($_REQUEST['sort'] === 'ID_GROUP' ? "
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . "
WHERE mem.is_activated = 1" . (empty($where) ? '' : "
AND $where") . "
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT $limit, $modSettings[defaultMaxMembers]", __FILE__, __LINE__);
printMemberListRows($request);
mysql_free_result($request);
// Add anchors at the start of each letter.
if ($_REQUEST['sort'] == 'realName')
{
$last_letter = '';
foreach ($context['members'] as $i => $dummy)
{
$this_letter = $func['strtolower']($func['substr']($context['members'][$i]['name'], 0, 1));
if ($this_letter != $last_letter && preg_match('~[a-z]~', $this_letter) === 1)
{
$context['members'][$i]['sort_letter'] = htmlspecialchars($this_letter);
$last_letter = $this_letter;
}
}
}
}
// Search for members...
function MLSearch()
{
global $txt, $scripturl, $db_prefix, $context, $user_info, $modSettings;
$context['page_title'] = $txt['mlist_search'];
// They're searching..
if (isset($_REQUEST['search']) && isset($_REQUEST['fields']))
{
$_POST['search'] = trim(isset($_GET['search']) ? $_GET['search'] : $_POST['search']);
$_POST['fields'] = isset($_GET['fields']) ? explode(',', $_GET['fields']) : $_POST['fields'];
$context['old_search'] = $_REQUEST['search'];
$context['old_search_value'] = urlencode($_REQUEST['search']);
// No fields? Use default...
if (empty($_POST['fields']))
$_POST['fields'] = array('name');
// Search for a name?
if (in_array('name', $_POST['fields']))
$fields = array('memberName', 'realName');
else
$fields = array();
// Search for location.
if (in_array('location', $_POST['fields']))
$fields += array(7 => 'locationTitle', 'location');
// Search for messengers...
if (in_array('messenger', $_POST['fields']) && (!$user_info['is_guest'] || empty($modSettings['guest_hideContacts'])))
$fields += array(3 => 'MSN', 'AIM', 'ICQ', 'YIM')
;
// Search for websites.
if (in_array('website', $_POST['fields']))
$fields += array(7 => 'websiteTitle', 'websiteUrl');
// Search for groups.
if (in_array('group', $_POST['fields']))
$fields += array(9 => 'IFNULL(groupName, \'\')');
// Search for an email address?
if (in_array('email', $_POST['fields']))
{
$fields += array(2 => allowedTo('moderate_forum') ? 'emailAddress' : '(hideEmail = 0 AND emailAddress');
$condition = allowedTo('moderate_forum') ? '' : ')';
}
else
$condition = '';
$query = $_POST['search'] == '' ? "= ''" : "LIKE '%" . strtr($_POST['search'], array('_' => '\\_', '%' => '\\%', '*' => '%')) . "%'";
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE " . implode(" $query OR ", $fields) . " $query$condition
AND is_activated = 1", __FILE__, __LINE__);
list ($numResults) = mysql_fetch_row($request);
mysql_free_result($request);
$context['page_index'] = constructPageIndex($scripturl . '?action=mlist;sa=search;search=' . $_POST['search'] . ';fields=' . implode(',', $_POST['fields']), $_REQUEST['start'], $numResults, $modSettings['defaultMaxMembers']);
// Find the members from the database.
// !!!SLOW This query is slow.
$request = db_query("
SELECT mem.ID_MEMBER
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE " . implode(" $query OR ", $fields) . " $query$condition
AND is_activated = 1
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);
printMemberListRows($request);
mysql_free_result($request);
}
else
{
$context['sub_template'] = 'search';
$context['old_search'] = isset($_REQUEST['search']) ? htmlspecialchars($_REQUEST['search']) : '';
}
$context['linktree'][] = array(
'url' => $scripturl . '?action=mlist;sa=search',
'name' => &$context['page_title']
);
}
function printMemberListRows($request)
{
global $scripturl, $txt, $db_prefix, $user_info, $modSettings;
global $context, $settings, $memberContext;
// Get the most posts.
$result = db_query("
SELECT MAX(posts)
FROM {$db_prefix}members", __FILE__, __LINE__);
list ($MOST_POSTS) = mysql_fetch_row($result);
mysql_free_result($result);
// Avoid division by zero...
if ($MOST_POSTS == 0)
$MOST_POSTS = 1;
$members = array();
while ($row = mysql_fetch_assoc($request))
$members[] = $row['ID_MEMBER'];
// Load all the members for display.
loadMemberData($members);
$context['members'] = array();
foreach ($members as $member)
{
if (!loadMemberContext($member))
continue;
$context['members'][$member] = $memberContext[$member];
$context['members'][$member]['post_percent'] = round(($context['members'][$member]['real_posts'] * 100) / $MOST_POSTS);
$context['members'][$member]['registered_date'] = strftime('%Y-%m-%d', $context['members'][$member]['registered_timestamp']);
}
}
?>[/code[
Quote from: JayBachatero on February 18, 2007, 01:14:46 AM
You need to add the language string to your Modifications.spanish.php file.
Quote from: Iggiecat on February 18, 2007, 03:31:24 PM
I"m worried about installing this mod as i see this error:
(http://runepixels.com/uimages3/countryflagerror.png)
what would cause this?
Quote from: linders on February 19, 2007, 11:25:21 AMYou need these strings. Just need to translate them.Quote from: JayBachatero on February 18, 2007, 01:14:46 AM
You need to add the language string to your Modifications.spanish.php file.
Hello/Hola Jay:
Can you post the string exactly so I can copy/paste it into that file?
Thanks, Hubert
// 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';
Quote from: warhonowicz on February 20, 2007, 05:03:27 AMSeems like a conflict with your other mods. Need to install this mod manually.
I just downloaded the latest version and tried to install it on SMF 1.1.2 with the following mods installed:
1. SMF Links 1.6.3
2. SMF 1.1.2 Update Package 1.1.2
3. Merge Double Posts 1.0.6
4. TinyPortal 0.971
5. Spam Me Not Mod 1.02
6. Enhanced Calendar 1.1
7. Award Mod 1.11
and when I try to install the country flags I get the following error
3. Execute Modification ./Sources/ModSettings.php Test failed
Anyone got this before and found a way around it?
Quote from: Marianita on February 25, 2007, 02:56:35 AMPost your Profile.php and Profile.template.php files.
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification. :(
Quote from: trecool999 on February 27, 2007, 01:09:12 PMUninstall the mod. Then upgrade to SMF 1.1.2 and reinstall the mod.
All I get is this at the top of every page:
// 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';
I think you messed up somewhere...
Also, when I install V.1.0.2, it tells me it's still 1.0.1... but all tests are succesful...
Quote from: JayBachatero on February 26, 2007, 10:31:14 AMQuote from: Marianita on February 25, 2007, 02:56:35 AMPost your Profile.php and Profile.template.php files.
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification. :(
Quote from: Crimson on March 07, 2007, 12:12:43 AM
i downloaded this mod and then deleted it becuase i have this on the top of my forum
// 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';
Even after i deleted it its still there? can u PLEASE tell me how to remoce it its really annoying? *and ugly
Quote from: Marianita on March 06, 2007, 02:19:18 PMI looked at the files and everything looks ok to me. Can you pm me a test account?Quote from: JayBachatero on February 26, 2007, 10:31:14 AMQuote from: Marianita on February 25, 2007, 02:56:35 AMPost your Profile.php and Profile.template.php files.
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification. :(
The files:
Thanks in advance. :)
Quote from: fritpa on March 05, 2007, 12:12:04 AM
I have the Spanish language package, what I have to do to see the option in this language package?
One thing is translate the .xml, another thing is see the option in the other language package.
Thanks.
Quote8: Undefined index: country_flag_ask
File: /home/texgnome/public_html/DD/Themes/default/Register.template.php (before sub template - eval?)
Line: 152
Quote// If flags is set for registration show it.
line 152- if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
{
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
if (!empty($modSettings['country_flag_ask']) && ($modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3))
Quote from: littleone on April 13, 2007, 10:52:28 PM
Its your CHMOD settings on the folder. For some reason alot of the mod folder's CHMOD cannot be changed and nothing inside of them can be deleted.
Quote from: folkandfaith on April 14, 2007, 10:49:51 PMYes I want to know this too. I have a memeber that is from scottland he wants a scottish flag not the universal UK flag. I would like to add the scottish flag not replace any.Quote from: littleone on April 13, 2007, 10:52:28 PM
Its your CHMOD settings on the folder. For some reason alot of the mod folder's CHMOD cannot be changed and nothing inside of them can be deleted.
Can other flags /countries then be added or switched out? If so - HOW?
QuoteLine 7 is what I need help with. I am using SMF 1.1.2.
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test successful
7. Execute Modification ./Themes/default/Display.template.php Test failed
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags
Quote from: brianjw on May 13, 2007, 08:27:12 PM
I need help. When attempting to install, there was an error.QuoteLine 7 is what I need help with. I am using SMF 1.1.2.
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test successful
7. Execute Modification ./Themes/default/Display.template.php Test failed
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags
Brianjw
Quote from: Chucky on May 14, 2007, 08:56:37 AMI am using a recent fresh install and haven't modified any files. I do however have some modules installed that could be causing this:Quote from: brianjw on May 13, 2007, 08:27:12 PM
I need help. When attempting to install, there was an error.QuoteLine 7 is what I need help with. I am using SMF 1.1.2.
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test successful
7. Execute Modification ./Themes/default/Display.template.php Test failed
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
10. Extract Tree ./Themes/default/images/flags
Brianjw
You'd have to look at your Display.template.php file and check the code it's trying to add/replace. Do this by looking in the xml file in the zipped mod. You've most likely have the code altered that it's trying to locate.
QuoteThanks for your help so far but for me modifying it myself isn't the case. It could be a module. Who knows :)
1. TinyPortal 0.983 [ Uninstall ]
2. Invite 1.13 [ Uninstall ]
3. Custom Action Mod 2.04 [ Uninstall ]
4. Custom Profile Field Mod 3.16 [ Uninstall ]
5. SMF Gallery Lite 1.7.1 [ Uninstall ]
6. Ad Managment 2.3 [ Uninstall ]
7. Bear Tabs 1.0 [ Uninstall ]
8. BBCode Bar For Signature 1.3 [ Uninstall ]
9. SMF Links 1.6.3 [ Uninstall ]
10. YouTube BBC Tag (XHTML Compliant) 1.0 [ Uninstall ]
11. Paid Subscriptions 0.18 [ Uninstall ]
12. AvatarSelect 1.1.2 [ Uninstall ]
13. FontandSizeDropdown1.1 1.1 [ Uninstall ]
14. Streaming 3 4.2.2b [ Uninstall ]
15. K-Detection 2.2 [ Uninstall ]
Quote from: TrueSatan on May 16, 2007, 10:25:45 PMOk, I have uploaded and attached the Display.template.php file. I have done what you suggested but will wait to continue the renaming file part until I have the updated display.template.php :)
Brian...if you'll post your Display.template.php file I'll have a look at it for you and see if I can put this mod into it...BTW I think Chunky was trying to say that you have modified the file by installing other mods...he/she's quite right.
If I'm able to fix that file then you'll need to follow this procedure:
Backup your database and files
Install the mod ignoring the error in Display.template.php
Rename the existing Display.template.php and leave it on the server (call it Display.template.php-flag so you know what the file is if you need it at a later date)
Via ftp upload the fixed Display.template.php I'll give you
Not difficult and it should get your problem over and done...all I need is that file...
// Show the member's gender icon?
// Show the member's gender icon?
Quote from: bilalghouri on May 18, 2007, 06:47:29 AM
its giving me error when i am installing it.
its giving me error of profile.php
Quote from: KGIII on May 17, 2007, 02:32:04 AM
This one too I will look at and if there are enough folks wanting it then I will consider taking over the support for it. That's and the other is about all I can handle at the moment.
Quote from: brianjw on May 18, 2007, 11:25:28 AM
Thanks truesatan your a good person :)
Edit: I will test this in a minute as I was away from home when I originally posted this.
Edit2: It didn't work and I don't think its worth it.
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
QuoteLine 344 in display.template.php was
Parse error: parse error, unexpected '<' in .../Themes/default/Display.template.php on line 344
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
Quote8: Undefined index: country_flag
File: /home/simju2/public_html/Forum/Themes/default/languages/Who.english.php (eval?)
Line: 269
Quote
1. Execute Modification ./Sources/Register.php Test successful
2. Execute Modification ./Sources/Subs.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Profile.template.php Test successful
7. Execute Modification ./Themes/default/Display.template.php Test successful
8. Execute Modification ./Themes/babylon/Display.template.php Test successful
9. Execute Modification ./Themes/default/languages/Modifications.english.php Test failed
// 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';
Quote from: KGIII on June 10, 2007, 06:10:48 PM
TrueSatan:
http://www.simplemachines.org/community/index.php?topic=106060.msg1094961#msg1094961
You might want to see that topic. Then you could take 'ownership' of it and, yeah, I peek in on the various mod threads from time to time. Some of them exceed my knowledge though. ;)
<b>', $message['member']['link'], '</b>';
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" height="12px" width="20px" title="', $flags[$message['member']['options']['country']], '" /> <br />';
}
Quote from: hadesflames on June 29, 2007, 01:37:16 PM
update for 1.1.3 coming soon?
Quote from: hadesflames on June 29, 2007, 04:19:57 PM
i did try using the mod with 1.1.3 and it didnt work for me.
QuoteIt is meant to show up next to the "Karma" link in "features" right?
Quote from: TrueSatan on July 03, 2007, 03:59:20 AM
If you wish to make custom edits to the code you have always been able to do so....your "decentralised countries" would appear to come under this heading...likewise you can make custom changes to the flags for your own use.
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'sn' => 'Senegal', 'cs' => 'Serbia and Montenegro',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}
{
$flags = array(
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'CĂ´te d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'gq' => 'Equatorial Guinea', 'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'me' => 'Montenegro', 'ms' => 'Montserrat',
'ma' => 'Morocco', 'mz' => 'Mozambique', 'mm' => 'Myanmar',
'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'sn' => 'Senegal', 'cs' => 'Serbia',
'sc' => 'Seychelles', 'sl' => 'Sierra Leone', 'sg' => 'Singapore',
'sk' => 'Slovakia', 'si' => 'Slovenia', 'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.',
'wf' => 'Wallis and Futuna', 'eh' => 'Western Sahara', 'ye' => 'Yemen',
'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}
Quote
echo '</td><td><table cellspacing="0" cellpadding="2" width="100%"><tr><td>';
echo '<div class="largetext"><b>', $context['member']['name'], '</b> <i>', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</i></div>';
echo '<div class="smalltext"><b>', $txt[231], ': </b>'. $context['member']['gender']['name'] .'</div>';
echo '<div class="smalltext"><b>', $txt[420], ': </b>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' <img src="' . $settings['images_url'] . '/bdaycake.gif" width="40" alt="" />' : '') .'</div>';
echo '<div class="smalltext"><b>', $txt[227], ': </b>', $context['member']['location'] .'</div>';
echo '<div class="smalltext"><b>', $txt['local_time'], ': </b>', $context['member']['local_time'] .'</div>';
if (!empty($modSettings['userLanguage']))
echo '<div class="smalltext"><b>', $txt['smf225'], ': </b>', $context['member']['language'] .'</div>';
Quote</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>
QuoteMod Name Version
1. Avatars at Index Mod 1.5 [ Uninstall ] [ List Files ] [ Delete ]
3. Who Voted What? 1.1.3 [ Uninstall ] [ List Files ] [ Delete ]
4. Ultimate Profile 0.7 [ Apply Mod ] [ List Files ] [ Delete ] ****manually installed*****
5. SMFShop 3.0 [ Uninstall ] [ List Files ] [ Delete ]
6. SMF Shoutbox 1.16 [ Uninstall ] [ List Files ] [ Delete ]
8. Topic Ratings 1.03 [ Uninstall ] [ List Files ] [ Delete ]
9. Titled Links 1.1c [ Uninstall ] [ List Files ] [ Delete ]
Quote
echo '<div class="smalltext"><b>', $txt['country_flag'], '</b></div>';
// 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" />';
}
?>
...once only and at the end of the file on a line of its own.Quote from: samames on October 06, 2007, 08:21:33 PMPlease help :).
please see attached image for a screen shot of the issue I am facing.
For some reason, when I use the the 'Apollo BB' theme, the "Country" title (on the profile summary page) before the ":" is not visible. Please can somebody tell me what I need to change to fix this issue? And Which file it's in?
Thank you in advance :)
$txt['country_flag'] = 'Country';
Quote from: Alundra on October 21, 2007, 02:34:55 AMwell I think the mod is about location and not country. probably will be easy to change that code to show the country flag and not the location. And the search would be nice too :D
there is such a thing
check the mod list
</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>
</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']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country" />';
}
echo '
</td>
</tr><tr>
<td><b>', $txt['local_time'], ':</b></td>
<td>', $context['member']['local_time'], '</td>
</tr><tr>';
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']], '<br /><br />';
}
Quote from: alving on November 02, 2007, 07:47:05 AM
thanks truesatan!
Quote from: TrueSatan on October 31, 2007, 09:06:15 PMthanks mate
You would need to edit the array this mod adds to Subs.php and to add the new flag to the flags directory.
Quote
The package you tried to upload either is not a valid package or has become corrupted.
Quote from: TrueSatan on November 21, 2007, 09:20:33 AMThank you, I will try that and let you know how it goes.
The upgrade to SMF 1.1.4 is strongly advised and shouldn't cause major problems...if some mods don't work you may need to do a little file editing to sort them out but that's the worst that can happen.
Please try getting the mod again (a fresh copy) using a different browser and with that browser again try to add it to your site...more often than not this will resolve your problem.
Brianjw's advice is incorrect as this mod does not contain version limiting/checking!
Quote from: TrueSatan on November 23, 2007, 09:17:01 AMWell, this other thread might help: http://www.simplemachines.org/community/index.php?topic=207274.0
I've taken this mod over with kind permission from Jay Bachatero and will provide a new version shortly once I find out why the Package Parser is playing silly games. All being well the new version will work with the Package Parser.
Quote from: TrueSatan on December 23, 2007, 01:23:01 PMok, thanks. I tried one time but no luck :(
These are not features of the mod, and unless you wish to code them yourself and offer the results, aren't something I plan to add to it.
<file name="$languagedir/Modifications.thai-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'กรุณาเลือกประเทศของคุณ';
$txt['country_flag_error_required'] = 'กรุณาเลือกประเทศที่คุณอยู่';
$txt['country_flag_ask'] = 'ถามประเทศ';
$txt['country_flag_disabled'] = 'ไม่แสดง';
$txt['country_flag_profile'] = 'ข้อมูลส่วนตัว';
$txt['country_flag_registration'] = 'การลงทะเบียนสมัครสมาชิก';
$txt['country_flag_both'] = 'ทั้งคู่';
$txt['country_flag_required'] = 'ต้องการให้สมาชิกเลือกประเทศ?';
$txt['country_flag_show'] = 'แสดงธงประเทศนั้น ๆ ในหน้ากระทู้.';
$txt['country_flag'] = 'ประเทศ';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.lao-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'ກະລຸນາເລືອກປະເທດຂອງທ່ານ';
$txt['country_flag_error_required'] = 'ກະລຸນາເລືອກປະເທດທີ່ທ່ານຢູ່';
$txt['country_flag_ask'] = 'ຖາມປະເທດ';
$txt['country_flag_disabled'] = 'ບໍ່ສະແດງ';
$txt['country_flag_profile'] = 'ຂໍ້ມູນສ່ວນຕົວ';
$txt['country_flag_registration'] = 'ການລົງທະບຽນສະມາຊິກ';
$txt['country_flag_both'] = 'ທັງສອງ';
$txt['country_flag_required'] = 'ຕ້ອງການໃຫ້ສະມາຊິກເລືອກປະເທດ?';
$txt['country_flag_show'] = 'ສະແດງທຸງຊາດປະເທດນັ້ນ ໆ ໃນຫນ້າກະທູ້.';
$txt['country_flag'] = 'ປະເທດ';
]]></add>
</operation>
</file>
Quote from: Sabre™ on February 24, 2008, 02:36:57 PMHi mate.
If I wanted to make one flag a gif, what would I need to add/change?
Or would it be easier just to make them all gif images?
Thank You
Quote from: TrueSatan on March 05, 2008, 11:03:28 AM
@sabre...it's better to leave all the images as .png files.
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.gif" alt="', $flags[$message['member']['options']['country']], '" /><br />
', $flags[$message['member']['options']['country']], '<br />';
}
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" title="', $flags[$message['member']['options']['country']], '" /><br /><br />';
}
Quote from: FragaCampos on April 20, 2008, 08:48:14 AM
Hello there, and thank you a lot for this mod :)
I translated it to portuguese, and there are some countries that stayed out of order, ie, the list is not sorted due to the differences between the two languages, of course.
Question: is there a way to sort them out editing the files?
QuoteParse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/docspt/public_html/Sources/Subs.php on line 3912
Quote from: Sabre™ on May 21, 2008, 08:31:08 PM
Maybe check your language file.(modifications.english.php)
Make sure the code has been inserted there.
Are your files utf-8? This could be another reason why you see no text.
Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Quote
3. Execute Modification ./Sources/ModSettings.php Test failed
Quote from: Rawpaleoforum on May 21, 2008, 11:49:02 PM
I've been thinking. Would requiring registrants to choose a flag help to thwart spam bots?
Quote from: FragaCampos on May 01, 2008, 08:05:58 PM
Just a sugestion for this mod:
Would it be difficult to put a column in the "members" panel with the flag of each member? That would be nice :)
Quote from: neil h on May 26, 2008, 03:46:28 AM
When I tried to install the package, I got this in a warning box:Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Below in the files list, this comes up:Quote
3. Execute Modification ./Sources/ModSettings.php Test failed
The only other mod I have running is Ad Management 2.3
My version is SMF 1.1.5
Anyone know why this is happening?
Quote from: Rawpaleoforum on May 21, 2008, 07:05:53 PM
I really like this mod but the text doesn't show up durring registration, or in the profiles - only a colon.
The text doesn't show up in the admin panel either - just two checkboxes and a blank drop down menu.
I've uninstalled and deleted the original and reinstalled using the zip file. I still have the same problem. Does anyone have any idea what could be the problem?
8: Undefined index: country_flag
File: /home/*****/public_html/forums/Themes/default/languages/Who.english.php (summary sub template - eval?)
Line: 272
8: Undefined index: country_flag_label
File: /home/*****/public_html/forums/Themes/default/Profile.template.php (forumProfile sub template - eval?)
Line: 1442
Quote from: Anub1s on July 11, 2008, 10:19:22 AM
I was thinkning about making 2 mods that run along the same line as this.
one is a forum pets (just a png image of a monster or somthing.)
another for consoles. im just wondering if i could use the structure to make these two mods please
Quote from: neil h on May 26, 2008, 03:46:28 AM
When I tried to install the package, I got this in a warning box:Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Below in the files list, this comes up:Quote
3. Execute Modification ./Sources/ModSettings.php Test failed
The only other mod I have running is Ad Management 2.3
My version is SMF 1.1.5
Anyone know why this is happening?
</file>
<file name="$languagedir/Modifications.portuguese.php" error="skip">
<operation>
<search position="after" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país que você visitar-nos ';
$txt['country_flag_ask'] = 'Pergunte qual e o país para poder escolher a bandeira';
$txt['country_flag_disabled'] = 'Não mostrar (com Deficiência)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'requerem um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras e Mostrar na página (Quando as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.brazilian.php" error="skip">
<operation>
<search position="after" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país que você visitar-nos ';
$txt['country_flag_ask'] = 'Pergunte ao país para a bandeira';
$txt['country_flag_disabled'] = 'Não mostrar (com Deficiência)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Inscrição';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'requerem um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras e Mostrar na página (Quando as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
Quote from: shelzmike on August 05, 2008, 01:50:15 PMQuote from: neil h on May 26, 2008, 03:46:28 AM
When I tried to install the package, I got this in a warning box:Quote
!!Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.
Below in the files list, this comes up:Quote
3. Execute Modification ./Sources/ModSettings.php Test failed
The only other mod I have running is Ad Management 2.3
My version is SMF 1.1.5
Anyone know why this is happening?
Did this ever get resolved? I am getting the same error. Would it possibly be due to file permission issues? Thanks.
Mike
Parse error: syntax error, unexpected '<' in .../Themes/default/Profile.template.php on line 1718
1709: // Show age only
1710: echo implode('-', $context['member']['birth_date']);
1711: }
1712: echo '
1713: </td>
1714: </tr><tr>
1715: <td width="40%"><b>', $txt[227], ': </b></td>
1716: <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>
1717:
1718: <td>';1719: if($context['user']['is_admin'] || !isset($context['member']['gender']['name']))
1720: {
1721:
<td><input type="text" name="location" size="50" value="', $context['member']['location'], '" /></td>
</tr>
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
<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 + \'.gif\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" align="top">
<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>
Quote from: Powerbob on October 20, 2008, 07:16:29 AM
It has been asked before, but I will ask here again.
Will this mod be updated for smf 2.0 any time soon? Thanks.
// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_required', false);
}
// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}
// 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"/>';
}
$flags[$context['member']['options']['country']] . ' <img src="', $settings['default_theme_url'], '/images/flags/', $context['member']['options']['country'], '.png" alt="Country"/>';
Quote from: Papa on July 31, 2008, 09:48:08 PM
Anyone have this mod packaged up and working for 1.1.5?
Thanks for replys.
Quote from: AlenNS on November 08, 2008, 09:24:49 AM
1.1.7?
WTF?
Can someone make this mod for SMF 2.x?
Quote from: TheListener on April 13, 2009, 06:41:23 AM
Is the mod available for 1.1.8?
Quote from: J Dub on May 08, 2009, 11:42:18 AM
.... is there anyone that can help me with ....... the issue I suddenly have.
Cheers
Quote from: Sabre™ on May 08, 2009, 05:28:45 PMQuote from: J Dub on May 08, 2009, 11:42:18 AM
.... is there anyone that can help me with ....... the issue I suddenly have.
Cheers
You would have to mention what the issue is, in order for someone to see if they can be of any assistance lol ;)
Quote from: Sabre™ on May 08, 2009, 05:36:44 PM
No probs buddy, glad you've got it all sorted :)
./Sources/Profile.php
Find: [Select]
$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
Add Before: [Select]
// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];
// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}
Quote from: bluesinjid on June 13, 2009, 09:49:01 PM
hi anyone know where to edit this??/Code Select./Sources/Profile.php
Find: [Select]
$erase_options = array();
if (isset($_POST['default_options']) && is_array($_POST['default_options']))
Add Before: [Select]
// Convert the $_POST['country'] to $_POST['default_options']['country']
if (isset($_POST['country']))
{
$_POST['default_options']['country'] = $_POST['country'];
// Check if it's required to select location
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
fatal_lang_error('country_flag_error_required', false);
}
I can do all the other edits. I use 2.0 rc1-1
Quote from: Sabre™ on July 19, 2009, 05:36:42 PM
@ milicik
Could you attach your display.template.php?
@ trashgeek
Do you see your options in the admin panel?
Check if the code was added to your language file (Modifications.english.php), if you are using (Modifications.english-utf8.php), then add it to that template also.
@ TheListener
The three pieces of code you speak of could only have been deleted, altered by another mod, or simply missed.
Download a fresh copy of those templates and find them there to learn the location.
Easy as pie ;)
Quote from: Sabre™ on July 21, 2009, 05:16:01 AM
Okay, here's the package.
The code may need a little clean, but I'll wait for smf2 to go final until I do that and add my extras.
Could somebody confirm that it installs into SMF 2.0 RC1.2?
I haven't updated my test site from RC1-1 yet.
Thanks and enjoy :)
Quote from: Sabre™ on July 21, 2009, 05:16:01 AM
Okay, here's the package.
The code may need a little clean, but I'll wait for smf2 to go final until I do that and add my extras.
Could somebody confirm that it installs into SMF 2.0 RC1.2?
I haven't updated my test site from RC1-1 yet.
Thanks and enjoy :)
Quote from: mark3 on August 16, 2009, 07:09:21 PM
Hi
I would like to put 2 flags in profile. Is this possible?
thanks.
Quote from: neverhurry on August 22, 2009, 04:10:48 AM
Hi, anybody know where can i find a Flag mod for smf 2.0? Thank you!
Quote from: bbmtalk on September 03, 2009, 01:44:56 PM
I have this flag mod installed and am just wondering if it is possible to display a list of countries with members who have selected their flags on a pag. It is similar to the location mod that displays the map. Unfortunately, the location mod is not compatible with later version of SMF.
Any idea?
Quote from: Sabre™ on September 03, 2009, 04:31:29 PM
It should be possible buddy.
Good luck :)
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" align="absmiddle" /><br />';
}
Quote from: bbmtalk on July 23, 2009, 09:38:22 PM
Does this package work with 1.1.10?
Quote from: qayyom on September 25, 2009, 03:36:31 AM
But it is not visible in Posts
Quote from: JBlaze on September 25, 2009, 12:41:47 AM
Update:
I have taken over this mod from JayBachatero. I will be updating it to work for 2.0 as well as fix some things for the 1.1.x series.
Quote from: JBlaze on September 25, 2009, 12:41:47 AM
Update:
I have taken over this mod from JayBachatero. I will be updating it to work for 2.0 as well as fix some things for the 1.1.x series.
Quote from: Lolafish on September 25, 2009, 07:59:48 AMQuote from: qayyom on September 25, 2009, 03:36:31 AM
But it is not visible in Posts
Works for me in posts. Just not on registration. (In v. 1.1.10)
What version are you running it in, and do you have the default or a custom theme?
<?php
// Version: 1.1.10; Register
// Before registering - get their information.
function template_before()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Make sure they've agreed to the terms and conditions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function verifyAgree()
{
if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
{
alert("', $txt['register_passwords_differ_js'], '");
return false;
}';
// If they haven't checked the "I agree" box, tell them and don't submit.
if ($context['require_agreement'])
echo '
if (!document.forms.creator.regagree.checked)
{
alert("', $txt['register_agree'], '");
return false;
}';
// Otherwise, let it through.
echo '
return true;
}';
if ($context['require_agreement'])
echo '
function checkAgree()
{
document.forms.creator.regSubmit.disabled = isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.email) || isEmptyText(document.forms.creator.passwrd1) || !document.forms.creator.regagree.checked;
setTimeout("checkAgree();", 1000);
}
setTimeout("checkAgree();", 1000);';
if ($context['visual_verification'])
{
echo '
function refreshImages()
{
// Make sure we are using a new rand code.
var new_url = new String("', $context['verificiation_image_href'], '");
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);
// Quick and dirty way of converting decimal to hex
var hexstr = "0123456789abcdef";
for(var i=0; i < 32; i++)
new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);';
if ($context['use_graphic_library'])
echo '
document.getElementById("verificiation_image").src = new_url;';
else
echo '
document.getElementById("verificiation_image_1").src = new_url + ";letter=1";
document.getElementById("verificiation_image_2").src = new_url + ";letter=2";
document.getElementById("verificiation_image_3").src = new_url + ";letter=3";
document.getElementById("verificiation_image_4").src = new_url + ";letter=4";
document.getElementById("verificiation_image_5").src = new_url + ";letter=5";';
echo '
}';
}
echo '
// ]]></script>
<form action="', $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return verifyAgree();">
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
<tr class="titlebg">
<td>', $txt[97], ' - ', $txt[517], '</td>
</tr><tr class="windowbg">
<td width="100%">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td width="40%">
<b>', $txt[98], ':</b>
<div class="smalltext">', $txt[520], '</div>
</td>
<td>
<input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />
</td>
</tr><tr>
<td width="40%">
<b>', $txt[69], ':</b>
<div class="smalltext">', $txt[679], '</div>
</td>
<td>
<input type="text" name="email" size="30" tabindex="', $context['tabindex']++, '" />';
// Are they allowed to hide their email?
if ($context['allow_hide_email'])
echo '
<label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label>';
echo '
</td>
</tr><tr>
<td width="40%">
<b>', $txt[81], ':</b>
</td>
<td>
<input type="password" name="passwrd1" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr><tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if ($context['visual_verification'])
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>', $txt['visual_verification_label'], ':</b>
<div class="smalltext">', $txt['visual_verification_description'], '</div>
</td>
<td>';
if ($context['use_graphic_library'])
echo '
<img src="', $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />';
else
echo '
<img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" />
<img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" />
<img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" />
<img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" />
<img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />';
echo '
<input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" />
<div class="smalltext">
<a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '?action=register" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a>
</div>
</td>
</tr>';
}
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $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, '">', $name, '</option>';
echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>';
}
// Are there any verification questions to answer?
if (!empty($modSettings['anti_spam_ver_enable']))
{
if (!empty($modSettings['anti_spam_ver_ques_1']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_1'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_1" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_2']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_2'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_2" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_3']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_3'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_3" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_4']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_4'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_4" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
if (!empty($modSettings['anti_spam_ver_ques_5']))
echo '
<tr valign="top">
<td width="40%">
<b>', $modSettings['anti_spam_ver_ques_5'], ':</b>
</td>
<td valign="top">
<input type="text" name="anti_spam_ver_resp_5" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
}
// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
echo '
<tr>
<td colspan="2" align="center" style="padding-top: 1ex;">
<label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="', $context['tabindex']++, '" class="check" /> <b>', $context['coppa_desc'], '.</b></label>
</td>
</tr>';
echo '
</table>
</td>
</tr>
</table>';
// Require them to agree here?
if ($context['require_agreement'])
echo '
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="5" class="tborder" style="border-top: 0;">
<tr>
<td class="windowbg2" style="padding-top: 8px; padding-bottom: 8px;">
', $context['agreement'], '
</td>
</tr><tr>
<td align="center" class="windowbg2">
<label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /> <b>', $txt[585], '</b></label>
</td>
</tr>
</table>';
echo '
<br />
<div align="center">
<input type="submit" name="regSubmit" value="', $txt[97], '" />
</div>
</form>';
// Uncheck the agreement thing....
if ($context['require_agreement'])
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.creator.regagree.checked = false;
document.forms.creator.regSubmit.disabled = !document.forms.creator.regagree.checked;
// ]]></script>';
}
// After registration... all done ;).
function template_after()
{
global $context, $settings, $options, $txt, $scripturl;
// Not much to see here, just a quick... "you're now registered!" or what have you.
echo '
<br />
<table border="0" width="80%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr class="titlebg">
<td>', $context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">', $context['description'], '<br /><br /></td>
</tr>
</table>
<br />';
}
// Template for giving instructions about COPPA activation.
function template_coppa()
{
global $context, $settings, $options, $txt, $scripturl;
// Formulate a nice complicated message!
echo '
<br />
<table width="60%" cellpadding="4" cellspacing="0" border="0" class="tborder" align="center">
<tr class="titlebg">
<td>', $context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">', $context['coppa']['body'], '<br /></td>
</tr><tr class="windowbg">
<td align="center">
<a href="', $scripturl, '?action=coppa;form;member=', $context['coppa']['id'], '" target="_blank">', $txt['coppa_form_link_popup'], '</a> | <a href="', $scripturl, '?action=coppa;form;dl;member=', $context['coppa']['id'], '">', $txt['coppa_form_link_download'], '</a><br /><br />
</td>
</tr><tr class="windowbg">
<td align="left">', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</td>
</tr>';
// Can they send by post?
if (!empty($context['coppa']['post']))
{
echo '
<tr class="windowbg">
<td align="left"><b>1) ', $txt['coppa_send_by_post'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
', $context['coppa']['post'], '
</div>
</td>
</tr>';
}
// Can they send by fax??
if (!empty($context['coppa']['fax']))
{
echo '
<tr class="windowbg">
<td align="left"><b>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
', $context['coppa']['fax'], '
</div>
</td>
</tr>';
}
// Offer an alternative Phone Number?
if ($context['coppa']['phone'])
{
echo '
<tr class="windowbg" style="padding-bottom: 1ex;">
<td align="left">', $context['coppa']['phone'], '</td>
</tr>';
}
echo '
</table>
<br />';
}
// An easily printable form for giving permission to access the forum for a minor.
function template_coppa_form()
{
global $context, $settings, $options, $txt, $scripturl;
// Show the form (As best we can)
echo '
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr>
<td align="left">', $context['forum_contacts'], '</td>
</tr><tr>
<td align="right">
<i>', $txt['coppa_form_address'], '</i>: ', $context['ul'], '<br />
', $context['ul'], '<br />
', $context['ul'], '<br />
', $context['ul'], '
</td>
</tr><tr>
<td align="right">
<i>', $txt['coppa_form_date'], '</i>: ', $context['ul'], '
<br /><br />
</td>
</tr><tr>
<td align="left">
', $context['coppa_body'], '
</td>
</tr>
</table>
<br />';
}
// Show a window containing the spoken verification code.
function template_verification_sound()
{
global $context, $settings, $options, $txt, $scripturl;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css" />
<style type="text/css">';
// Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are bigger...)
if ($context['browser']['needs_size_fix'])
echo '
@import(', $settings['default_theme_url'], '/fonts-compat.css);';
// Just show the help text and a "close window" link.
echo '
</style>
</head>
<body style="margin: 1ex;">
<div class="popuptext">';
if ($context['browser']['is_ie'])
echo '
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
<param name="AutoStart" value="1" />
<param name="FileName" value="', $context['verificiation_sound_href'], ';format=.wav" />
</object>';
else
echo '
<object type="audio/x-wav" data="', $context['verificiation_sound_href'], ';format=.wav">
<a href="', $context['verificiation_sound_href'], ';format=.wav">', $context['verificiation_sound_href'], ';format=.wav</a>
</object>';
echo '
<br />
<a href="', $context['verificiation_sound_href'], ';sound">', $txt['visual_verification_sound_again'], '</a><br />
<a href="javascript:self.close();">', $txt['visual_verification_sound_close'], '</a><br />
<a href="', $context['verificiation_sound_href'], ';format=.wav">', $txt['visual_verification_sound_direct'], '</a>
</div>
</body>
</html>';
}
function template_admin_register()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm" id="postForm">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function onCheckChange()
{
if (document.forms.postForm.emailActivate.checked || document.forms.postForm.password.value == \'\')
{
document.forms.postForm.emailPassword.disabled = true;
document.forms.postForm.emailPassword.checked = true;
}
else
document.forms.postForm.emailPassword.disabled = false;
}
// ]]></script>
<table border="0" cellspacing="0" cellpadding="4" align="center" width="70%" class="tborder">
<tr class="titlebg">
<td colspan="2" align="center">', $txt['admin_browse_register_new'], '</td>
</tr>';
if (!empty($context['registration_done']))
echo '
<tr class="windowbg2">
<td colspan="2" align="center"><br />
', $context['registration_done'], '
</td>
</tr><tr class="windowbg2">
<td colspan="2" align="center"><hr /></td>
</tr>';
echo '
<tr class="windowbg2">
<th width="50%" align="right">
<label for="user_input">', $txt['admin_register_username'], ':</label>
<div class="smalltext" style="font-weight: normal;">', $txt['admin_register_username_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="user" id="user_input" size="30" maxlength="25" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="email_input">', $txt['admin_register_email'], ':</label>
<div class="smalltext" style="font-weight: normal;">', $txt['admin_register_email_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="email" id="email_input" size="30" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_input">', $txt['admin_register_password'], ':</label>
<div class="smalltext" style="font-weight: normal;">', $txt['admin_register_password_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="password" name="password" id="password_input" size="30" onchange="onCheckChange();" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="group_select">', $txt['admin_register_group'], ':</label>
<div class="smalltext" style="font-weight: normal;">', $txt['admin_register_group_desc'], '</div>
</th>
<td width="50%" align="left">
<select name="group" id="group_select">';
foreach ($context['member_groups'] as $id => $name)
echo '
<option value="', $id, '">', $name, '</option>';
echo '
</select><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailPassword_check">', $txt['admin_register_email_detail'], ':</label>
<div class="smalltext" style="font-weight: normal;">', $txt['admin_register_email_detail_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailPassword" id="emailPassword_check" checked="checked" disabled="disabled" class="check" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailActivate_check">', $txt['admin_register_email_activate'], ':</label>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailActivate" id="emailActivate_check"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' checked="checked"' : '', ' onclick="onCheckChange();" class="check" /><br />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="right">
<input type="submit" name="regSubmit" value="', $txt[97], '" />
<input type="hidden" name="sa" value="register" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
// Form for editing the agreement shown for people registering to the forum.
function template_edit_agreement()
{
global $context, $settings, $options, $scripturl, $txt;
// Just a big box to edit the text file ;).
echo '
<form action="', $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="80%" class="tborder">
<tr class="titlebg">
<td align="center">', $txt['smf11'], '</td>
</tr>';
// Warning for if the file isn't writable.
if (!empty($context['warning']))
echo '
<tr class="windowbg2">
<td style="color: red; font-weight: bold;" align="center">
', $context['warning'], '
</td>
</tr>';
echo '
<tr class="windowbg2">
<td align="center" style="padding-bottom: 1ex; padding-top: 2ex;">';
// Show the actual agreement in an oversized text box.
echo '
<textarea cols="70" rows="20" name="agreement" style="width: 94%; margin-bottom: 1ex;">', $context['agreement'], '</textarea><br />
<label for="requireAgreement"><input type="checkbox" name="requireAgreement" id="requireAgreement"', $context['require_agreement'] ? ' checked="checked"' : '', ' value="1" /> ', $txt[584], '.</label><br />
<br />
<input type="submit" value="', $txt[10], '" />
<input type="hidden" name="sa" value="agreement" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
function template_edit_reserved_words()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<form action="', $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" class="bordercolor" align="center" cellpadding="4" width="80%">
<tr class="titlebg">
<td align="center">
', $txt[341], '
</td>
</tr><tr>
<td class="windowbg2" align="center">
<div style="width: 80%;">
<div style="margin-bottom: 2ex;">', $txt[342], '</div>
<textarea cols="30" rows="6" name="reserved" style="width: 98%;">', implode("\n", $context['reserved_words']), '</textarea><br />
<div align="left" style="margin-top: 2ex;">
<label for="matchword"><input type="checkbox" name="matchword" id="matchword" ', $context['reserved_word_options']['match_word'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[726], '</label><br />
<label for="matchcase"><input type="checkbox" name="matchcase" id="matchcase" ', $context['reserved_word_options']['match_case'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[727], '</label><br />
<label for="matchuser"><input type="checkbox" name="matchuser" id="matchuser" ', $context['reserved_word_options']['match_user'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[728], '</label><br />
<label for="matchname"><input type="checkbox" name="matchname" id="matchname" ', $context['reserved_word_options']['match_name'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[729], '</label><br />
</div>
<input type="submit" value="', $txt[10], '" name="save_reserved_names" style="margin: 1ex;" />
</div>
</td>
</tr>
</table>
<input type="hidden" name="sa" value="reservednames" />
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
function template_admin_settings()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
// Javascript for the verification image.
if ($context['use_graphic_library'])
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refreshImages()
{
var imageType = document.getElementById(\'visual_verification_type_select\').value;
document.getElementById(\'verificiation_image\').src = \'', $context['verificiation_image_href'], ';type=\' + imageType;
}
// ]]></script>';
}
echo '
<form action="', $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="tborder">
<tr class="titlebg">
<td align="center">', $txt['settings'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">';
// Functions to do some nice box disabling dependant on age restrictions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function checkCoppa()
{
var coppaDisabled = document.getElementById(\'coppaAge_input\').value == 0;
document.getElementById(\'coppaType_select\').disabled = coppaDisabled;
var disableContacts = coppaDisabled || document.getElementById(\'coppaType_select\').options[document.getElementById(\'coppaType_select\').selectedIndex].value != 1;
document.getElementById(\'coppaPost_input\').disabled = disableContacts;
document.getElementById(\'coppaFax_input\').disabled = disableContacts;
document.getElementById(\'coppaPhone_input\').disabled = disableContacts;
}
// ]]></script>';
echo '
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2">
<th width="50%" align="right">
<label for="registration_method_select">', $txt['admin_setting_registration_method'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=registration_method" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="registration_method" id="registration_method_select">
<option value="0"', empty($modSettings['registration_method']) ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_standard'], '</option>
<option value="1"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_activate'], '</option>
<option value="2"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_approval'], '</option>
<option value="3"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_disabled'], '</option>
</select>
</td>
</tr>
<tr class="windowbg2">
<th width="50%" align="right">
<label for="notify_new_registration_check">', $txt['admin_setting_notify_new_registration'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="notify_new_registration" id="notify_new_registration_check" ', !empty($modSettings['notify_new_registration']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="send_welcomeEmail_check">', $txt['admin_setting_send_welcomeEmail'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=send_welcomeEmail" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="send_welcomeEmail" id="send_welcomeEmail_check"', !empty($modSettings['send_welcomeEmail']) ? ' checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_strength_select">', $txt['admin_setting_password_strength'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=password_strength" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="password_strength" id="password_strength_select">
<option value="0"', empty($modSettings['password_strength']) ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_low'], '</option>
<option value="1"', !empty($modSettings['password_strength']) && $modSettings['password_strength'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_medium'], '</option>
<option value="2"', !empty($modSettings['password_strength']) && $modSettings['password_strength'] == 2 ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_high'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="visual_verification_type_select">
', $txt['admin_setting_image_verification_type'], ':<br />
<span class="smalltext" style="font-weight: normal;">
', $txt['admin_setting_image_verification_type_desc'], '
</span>
</label>
</th>
<td width="50%" align="left">
<select name="visual_verification_type" id="visual_verification_type_select" ', $context['use_graphic_library'] ? 'onchange="refreshImages();"' : '', '>
<option value="1" ', !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 1 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_off'], '</option>
<option value="2" ', !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 2 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_vsimple'], '</option>
<option value="3" ', !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 3 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_simple'], '</option>
<option value="0" ', empty($modSettings['disable_visual_verification']) ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_medium'], '</option>
<option value="4" ', !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 4 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_high'], '</option>
</select><br />';
if ($context['use_graphic_library'])
echo '
<img src="', $context['verificiation_image_href'], ';type=', empty($modSettings['disable_visual_verification']) ? 0 : $modSettings['disable_visual_verification'], '" alt="', $txt['admin_setting_image_verification_sample'], '" id="verificiation_image" /><br />';
else
{
echo '
<span class="smalltext">', $txt['admin_setting_image_verification_nogd'], '</span>';
}
echo '
</td>
</tr>
</table>
</td>
</tr>
<tr class="titlebg">
<td align="center">', $txt['anti_spam_ver_title'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2">
<th width="50%" align="right">
<label for="anti_spam_ver_enable_check">', $txt['anti_spam_ver_enable'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="anti_spam_ver_enable" id="anti_spam_ver_enable_check"', !empty($modSettings['anti_spam_ver_enable']) ? ' checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<td colspan="2">', $txt['anti_spam_ver_descr'], '</td>
</tr><tr class="windowbg2">
<td width="50%" align="center">
<b>', $txt['anti_spam_ver_ques_col'], '</b>
</td>
<td width="50%" align="center">
<b>', $txt['anti_spam_ver_ans_col'], '</b>
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_1" id="anti_spam_ver_ques_1_input" value="', !empty($modSettings['anti_spam_ver_ques_1']) ? $modSettings['anti_spam_ver_ques_1'] : '', '" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_1" id="anti_spam_ver_ans_1_input" value="', !empty($modSettings['anti_spam_ver_ans_1']) ? $modSettings['anti_spam_ver_ans_1'] : '', '" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_2" id="anti_spam_ver_ques_2_input" value="', !empty($modSettings['anti_spam_ver_ques_2']) ? $modSettings['anti_spam_ver_ques_2'] : '', '" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_2" id="anti_spam_ver_ans_2_input" value="', !empty($modSettings['anti_spam_ver_ans_2']) ? $modSettings['anti_spam_ver_ans_2'] : '', '" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_3" id="anti_spam_ver_ques_3_input" value="', !empty($modSettings['anti_spam_ver_ques_3']) ? $modSettings['anti_spam_ver_ques_3'] : '', '" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_3" id="anti_spam_ver_ans_3_input" value="', !empty($modSettings['anti_spam_ver_ans_3']) ? $modSettings['anti_spam_ver_ans_3'] : '', '" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_4" id="anti_spam_ver_ques_4_input" value="', !empty($modSettings['anti_spam_ver_ques_4']) ? $modSettings['anti_spam_ver_ques_4'] : '', '" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_4" id="anti_spam_ver_ans_4_input" value="', !empty($modSettings['anti_spam_ver_ans_4']) ? $modSettings['anti_spam_ver_ans_4'] : '', '" size="60%" maxlength="60" />
</td>
</tr><tr class="windowbg2">
<td width="50%" align="right">
<input type="text" name="anti_spam_ver_ques_5" id="anti_spam_ver_ques_5_input" value="', !empty($modSettings['anti_spam_ver_ques_5']) ? $modSettings['anti_spam_ver_ques_5'] : '', '" size="60%" maxlength="60" />
</td>
<td width="50%" align="left">
<input type="text" name="anti_spam_ver_ans_5" id="anti_spam_ver_ans_5_input" value="', !empty($modSettings['anti_spam_ver_ans_5']) ? $modSettings['anti_spam_ver_ans_5'] : '', '" size="60%" maxlength="60" />
</td>
</tr>
</table>
</td>
</tr>
<tr class="titlebg">
<td align="center">', $txt['anti_spam_ver_coppa'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaAge_input">', $txt['admin_setting_coppaAge'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaAge" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">', $txt['admin_setting_coppaAge_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaAge" id="coppaAge_input" value="', !empty($modSettings['coppaAge']) ? $modSettings['coppaAge'] : '', '" size="3" maxlength="3" onkeyup="checkCoppa();" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaType_select">', $txt['admin_setting_coppaType'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaType" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="coppaType" id="coppaType_select" onchange="checkCoppa();">
<option value="0"', empty($modSettings['coppaType']) ? ' selected="selected"' : '', '>', $txt['admin_setting_coppaType_reject'], '</option>
<option value="1"', !empty($modSettings['coppaType']) && $modSettings['coppaType'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_coppaType_approval'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPost_input">', $txt['admin_setting_coppaPost'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">', $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<textarea name="coppaPost" id="coppaPost_input" rows="4" cols="35">', $context['coppaPost'], '</textarea>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaFax_input">', $txt['admin_setting_coppaFax'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">', $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaFax" id="coppaFax_input" value="', !empty($modSettings['coppaFax']) ? $modSettings['coppaFax'] : '', '" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPhone_input">', $txt['admin_setting_coppaPhone'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">', $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaPhone" id="coppaPhone_input" value="', !empty($modSettings['coppaPhone']) ? $modSettings['coppaPhone'] : '', '" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="3" align="right">
<input type="submit" name="save" value="', $txt[10], '" />
<input type="hidden" name="sa" value="settings" />
</td>
</tr>
</table>';
// Handle disabling of some of the input boxes.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
if (empty($modSettings['coppaAge']) || empty($modSettings['coppaType']))
echo '
document.getElementById(\'coppaPost_input\').disabled = true;
document.getElementById(\'coppaFax_input\').disabled = true;
document.getElementById(\'coppaPhone_input\').disabled = true;';
if (empty($modSettings['coppaAge']))
echo '
document.getElementById(\'coppaType_select\').disabled = true;';
echo '
// ]]></script>
</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';
}
?>
Quote from: Paul_Pauline on October 08, 2009, 05:06:40 PM
Hiya !
Many thanks for all you help, I like this mod & the only reason I was uninstalling it was so I could install the updated version when you have had the time to do it, (ie, England, Scotland, Wales in the options to choose from).
I seem to have managed to follow your instructions, and my board hasn't crashed & burned :)
It's a good job someone knows what they are doing, lol !
Thanks again, Paul.
Quote from: Powerbob on October 16, 2009, 07:29:38 AMI haven't had a chance to work on it lately, but I should get around to it sometime this week :)
Yes Blaze, your mod in RC2 will be fantastic 8)
Quote from: W7 riso on October 26, 2009, 09:19:17 AM
Great Mod... only I have a problem!
I'm using 2 simulair Forums and I exported in phpMyAdmin the Memberlist from my first Forum and imported it into my second Forum all went fine but all Country Flags are missing at the second Forum Memberlist.
(At both Forums the Mod was already installed so I only switched the Memberlist)
How do I get the Flags back? the Flags who were already there at the original Memberlist/ Forum
Do I need to copy more besides the Memberlist? perhaps a Template?
Quote''The data is stored in smf_themes against the user's id, where the 'variable' is called country''Tnx Arantor
Quote from: Sabre™ on October 29, 2009, 03:19:02 AM
Jblaze is in the process of updating it for smf2 buddy :)
Quote from: Sabre™ on October 29, 2009, 03:19:02 AM
Jblaze is in the process of updating it for smf2 buddy :)
Quote from: mcgovery on October 29, 2009, 04:21:36 PM
Awsome I look forward to getting this one!
Thanks Sabre.
Quote from: JBlaze on November 17, 2009, 05:47:54 AM
RC2 is coming soon :D
Quote from: Paul_Pauline on September 25, 2009, 09:52:53 AM
I see that you have flags for England, Scotland & Wales in the images folder, but they are not listed in the dropdown menu when members sign up, would it be possible for you to add them ?
Quote from: Kamali on November 17, 2009, 01:39:31 PMQuote from: Paul_Pauline on September 25, 2009, 09:52:53 AM
I see that you have flags for England, Scotland & Wales in the images folder, but they are not listed in the dropdown menu when members sign up, would it be possible for you to add them ?
Hi, I have a new member from Scotland, can anyone tell me how I can make the Scotland appear in the picklist? (I am using 1.1.10).
Quote from: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2
Quote from: hariS. on November 22, 2009, 04:50:21 PM
(http://img689.imageshack.us/img689/3064/71459268.jpg)
How to fix this ? It's not i this square , like nubmer of post's and rank is
Quote from: Sabre™ on November 19, 2009, 07:35:42 AMQuote from: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2
I've also updated this for RC2 with all the flags(waving/moving flags) and more, but I haven't managed to figure out how to display the image in the reg.
At this early stage of learning RC2, I cannot see what I'm missing.
I just may wait for your update to look at that.
Quote from: Sabre™ on November 23, 2009, 08:15:54 PM
Off topic: a couple months ago I decided to start installing locally to test, instead of on host sites.
Im using Vertrigo, is there another you'd suggest? I found a few things Im not liking with this one.
Cheers mate :)
Quote from: Sabre™ on November 23, 2009, 08:15:54 PM
Off topic: a couple months ago I decided to start installing locally to test, instead of on host sites.
Im using Vertrigo, is there another you'd suggest? I found a few things Im not liking with this one.
Cheers mate :)
<div class="windowbg4"><img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /><br /> ', $flags[$message['member']['options']['country']], '</div>';
Quote from: JBlaze on November 18, 2009, 06:13:19 AM
Exactly. When the mod is updated to work with 2.0 RC2, the new countries will be added for both 1.1.10 and 2.0 RC2
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
Quote from: JBlaze on December 05, 2009, 10:52:42 AM
Sorry folks, I've been extremely busy lately and haven't been able to crank this one out. There are a few showstopping bugs in it right now including the fact that the registration won't work.
I'll keep you all updated or if you want constant updates on all my projects, then go to http://forum.thelulz.com
Quote from: JBlaze on January 09, 2010, 02:10:12 AM
OK, I got it working awesome now. Only problem is that for some reason it's not showing the flag chosen on the register page. Maybe a couple more days before I release it.
Quote from: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2
Quote from: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2
Quote from: Paul_Pauline on January 10, 2010, 09:05:45 AM
It'll be great to see this mod back up again ;D
Hope it will support v 1.1.11 as i'm keeping well away from v 2 until it's completely stable ::)
Thanks for finding the time to do this ;)
Quote from: Mr. Pirate on January 09, 2010, 07:10:30 PM
make this compatible with SMF RC1.2
Quote from: SN on January 18, 2010, 02:02:01 AM
will this be updated for RC2?
Quote from: JBlaze on January 18, 2010, 02:41:40 AMQuote from: SN on January 18, 2010, 02:02:01 AM
will this be updated for RC2?
Try reading the last 3 pages of topics and you'll find out.
Quote from: Paul_Pauline on January 24, 2010, 08:39:47 AM
Hi.
I was wondering if England, Scotland, Wales had been added to the list for members to choose from when registering, the flags were always in the images folder, but the names were not on the list !
Also would it be a big job to have the flags larger & animated ? A forum I am a member of (powered by IPB) has a similar mod which shows the flags like this, which I personally prefer, be interesting to know what others think ?
Not that I don't appreciate the work you have already done !
Quote from: HorTs on January 25, 2010, 10:35:26 AMIt does work on the curve theme as well
Hi,
It says on the spec that it will only work with the core theme, is there any play to make this available for Curve users?
Thanks.
Quote from: Sabre™ on January 28, 2010, 11:35:21 AM
SMF 1 = Features and options
SMF 2 = Configuration - Modification Settings - Miscellaneous
With regards to the gif images, in one of my packages, the flag folder ended up being around 30mb I think lol But well worth it.
Quote from: Sabre™ on February 04, 2010, 02:44:36 PM
Remove $txt['country_flag'] from your display.template.php
Quote from: Sabre™ on February 06, 2010, 05:17:22 AM
LOL
Congrats on getting it to work champ!!
Those early hour code sessions get to the best of us ;)
Quote from: Sabre™ on February 04, 2010, 02:44:36 PM
Remove $txt['country_flag'] from your display.template.php
// Country Flag mod
$txt['country_flag_label'] = 'Пожалуйста, выберите свою страну';
$txt['country_flag_error_required'] = 'Вы должны выбрать страну, в которой живёте';
$txt['country_flag_ask'] = 'Показывать список выбора стран';
$txt['country_flag_disabled'] = 'Не показывать (Выключено)';
$txt['country_flag_profile'] = 'В профиле';
$txt['country_flag_registration'] = 'При регистрации';
$txt['country_flag_both'] = 'В профиле и при регистрации';
$txt['country_flag_required'] = 'Требовать, чтобы пользователи указывали свое расположение?';
$txt['country_flag_show'] = 'Показывать флаги стран в сообщениях (под аватарами).';
$txt['country_flag'] = 'Страна';
Quote from: vbgamer45 on February 09, 2010, 10:55:52 AM
What's the error path and line number?
Quote from: Sabre™ on February 16, 2010, 03:55:52 PM
Any time champ :)
Are you still receiving errors in your logs regarding the above line?
<td>';
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
echo '</td>
Quote from: Penelope on March 04, 2010, 05:49:37 PM
Hi all,
I installed this mod on SMF 1.1.11 and it works great! 8) Thanks! :D It'shows perfect on the profile, post and registration page! :D
I have a question, i want to show the country flag of a member also on the arcade, but i cannot figure it out i tried almost everything i can think of so that's why this request for help. :)
I use SMF 1.1.11 and E-Arcade.
My question is how to show the country flag on the arcade game highscores page? :)
I have already the layout that is no problem. I only need to make the country flag work. So far it shows nothing :( Anyone can help? :)
For example i tried this underneath code in Themes/default/Arcade.template.php but it shows nothing.Code Select<td>';
// Did they select a flag?
if(isset($message['member']['options']['country']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['options']['country']))
{
$flags = CountryFlag();
echo '
<img src="', $settings['default_theme_url'], '/images/flags/', $message['member']['options']['country'], '.png" alt="', $flags[$message['member']['options']['country']], '" /> ', $flags[$message['member']['options']['country']], '<br /><br />';
}
echo '</td>
I hope someone can help me! So it will also show on the arcade highscores, which would be very nice :)
http://www.xxxxxxxxx.net/index.php?action=register2
8: Undefined index: country_flag_ask
File: /home/ xxxxxxxxx/public_html/Themes/default/Register.template.php (registration_form sub template - eval?)
Line: 203
http://www.xxxxxxxxx.net/index.php?action=register
8: Undefined index: country_flag_ask
File: /home/xxxxxxxxx/public_html/Themes/default/GenericControls.template.php (registration_form sub template - eval?)
Line: 203
Quote from: xnathansxdadx on April 02, 2010, 07:56:13 PM
remove this
as it says if you click on the box to the left of the error
'', // Show flags array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])), array('check', 'country_flag_required'), array('check', 'country_flag_show'),
Quote from: xnathansxdadx on April 02, 2010, 08:13:56 PM
bit of advice
if you are installing any of the following do them first.
this mod
Sitemap
Ajax chat
membermap
avatar on board index
Thumbnail Topic Mod
Good Post/Bad Post Mod
Quote from: xnathansxdadx on April 02, 2010, 08:25:04 PM
yeah it is
except there is a karma button mod which gives green and red arrows for the karma mod
yet with the karma mod you can change it to whatever you want,,,
i use it as a banning system for the members,,,,,,
Quote from: Sabre™ on July 22, 2009, 08:08:10 PM
Does it work ok in the default theme?
Copy the "flags" folder to your custom themes "images" folder
// 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';
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
{
$flags = country_flags();
echo '
<li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="',
$message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
}
Quote from: Brack1 on July 24, 2010, 07:09:21 PM
Someone didn't read the packaging lol
To enable this mod you must go to Admin > Features and Options > Last set of options.
Quote from: Sabre™ on August 06, 2010, 07:45:40 AM
png, but you can change that in your display, profile and register template edits.
Quote from: vbgamer45 on August 06, 2010, 02:23:31 PM
You should edit the display.template.php file
QuoteUnknown column 'mem.country_flag' in 'field list'
File: /home/content/k/y/s/kystormz/html/thepromisedland/Sources/Load.php
Line: 995
Quote
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,
replace with:
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good, mem.country_flag,
Quote
Fatal error: Cannot redeclare country_flags() (previously declared in /home/content/k/y/s/kystormz/html/thepromisedland/Sources/Subs.php:4249) in /home/content/k/y/s/kystormz/html/thepromisedland/Sources/Subs.php on line 4425
Quote from: Kurakama on November 03, 2010, 01:24:28 AMseconded!
upgrade to rc4?
for="2.0 RC1 - 2.0 RC3"
for="2.0 RC1 - 2.0 RC4"
<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>
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!
Quote from: vbgamer45 on December 03, 2010, 02:29:53 PM
Yes it works with SMF 1.1.2
Quote from: vbgamer45 on December 03, 2010, 02:52:08 PM
Check your forum's error log.
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
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.
Quote from: smitch6 on December 22, 2010, 01:44:26 PM
sorry should of said i'm running RC4
Call to undefined function CountryFlag() in /home/public_html/forums/Sources/Load.php(2189) : eval()'d code on line 296
Quote from: mortymoose on January 05, 2011, 09:10:53 AMtry this package
Thanks for the assistance, Went to the Modifications setting tabs, get the following message: "There are no modifications installed that have added any settings to this area yet."
Went to the installed packages and see that the package is indeed installed. , see the attached images....
This is getting very confusing for me...
Thanks
Quote from: smitch6 on January 20, 2011, 05:31:30 PM
yes mine is set to registration and profile and it doesn't show it
even if they choose on registration
really annoying because i want to know where my members are based
there must be a bug with this new version
Quote from: `Z0mB|e` on February 08, 2011, 09:28:20 PM
Alright I have this installed but now I seem to be stupid to find Admin > Features and Options > Last set of options. Where is this in the admin section exactly? TY!~
Quote from: `Z0mB|e` on February 09, 2011, 09:13:44 PM
OK I Have 2. RC4 I will look some more I must be stupid ~ LOL
Quote from: techno489 on January 31, 2011, 10:54:36 AMQuote from: smitch6 on January 20, 2011, 05:31:30 PM
yes mine is set to registration and profile and it doesn't show it
even if they choose on registration
really annoying because i want to know where my members are based
there must be a bug with this new version
I just installed this on my 2.0 RC3 forum theme black rain
and it works perfect. you might have a coding in your
php file thats stopping it from working.
I can't help you with this but vbgamer45 might be able to.
he could have a look at your php files for you if he has the time
to see where the problem is!!!
just a thought
Quote from: vbgamer45 on June 06, 2011, 08:01:17 PM
What's the error?
Quote from: vbgamer45 on June 07, 2011, 06:55:17 AM
It sounds like you are missing a file edit if there was a failure on it install you will have to modify a file add that function
// Nice big array of countries!
function country_flags()
{
$flags = array(
'00' => '',
'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria',
'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola',
'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua and Barbuda',
'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba',
'au' => 'Australia', 'at' => 'Austria', 'az' => 'Azerbaijan',
'bs' => 'Bahamas', 'bh' => 'Bahrain', 'bd' => 'Bangladesh',
'bb' => 'Barbados', 'by' => 'Belarus', 'be' => 'Belgium',
'bz' => 'Belize', 'bj' => 'Benin', 'bm' => 'Bermuda',
'bt' => 'Bhutan', 'bo' => 'Bolivia', 'ba' => 'Bosnia and Herzegovina',
'bw' => 'Botswana', 'bv' => 'Bouvet Island', 'br' => 'Brazil',
'io' => 'British Indian Ocean Territory', 'bn' => 'Brunei Darussalam', 'bg' => 'Bulgaria',
'bf' => 'Burkina Faso', 'bi' => 'Burundi', 'kh' => 'Cambodia',
'cm' => 'Cameroon', 'ca' => 'Canada', 'cv' => 'Cape Verde',
'ky' => 'Cayman Islands', 'cf' => 'Central African Republic', 'td' => 'Chad',
'cl' => 'Chile', 'cn' => 'China', 'cx' => 'Christmas Island',
'cc' => 'Cocos (Keeling) Islands', 'co' => 'Colombia', 'km' => 'Comoros',
'cg' => 'Congo, Republic of the', 'cd' => 'Congo, The Democratic Republic of the', 'ck' => 'Cook Islands',
'cr' => 'Costa Rica', 'ci' => 'Côte d\'Ivoire', 'hr' => 'Croatia',
'cu' => 'Cuba', 'cy' => 'Cyprus', 'cz' => 'Czech Republic',
'dk' => 'Denmark', 'dj' => 'Djibouti', 'dm' => 'Dominica',
'do' => 'Dominican Republic', 'ec' => 'Ecuador', 'eg' => 'Egypt',
'sv' => 'El Salvador', 'england' => 'England', 'gq' => 'Equatorial Guinea',
'er' => 'Eritrea',
'ee' => 'Estonia', 'et' => 'Ethiopia', 'fk' => 'Falkland Islands (Islas Malvinas)',
'fo' => 'Faroe Islands', 'fj' => 'Fiji', 'fi' => 'Finland',
'fr' => 'France', 'gf' => 'French Guiana', 'pf' => 'French Polynesia',
'tf' => 'French Southern Territories', 'ga' => 'Gabon', 'gm' => 'Gambia',
'ge' => 'Georgia', 'de' => 'Germany', 'gh' => 'Ghana',
'gi' => 'Gibraltar', 'gr' => 'Greece', 'gl' => 'Greenland',
'gd' => 'Grenada', 'gp' => 'Guadeloupe', 'gu' => 'Guam',
'gt' => 'Guatemala', 'gn' => 'Guinea', 'gw' => 'Guinea-Bissau',
'gy' => 'Guyana', 'ht' => 'Haiti', 'hm' => 'Heard Island and McDonald Islands',
'va' => 'Vatican City State', 'hn' => 'Honduras', 'hk' => 'Hong Kong',
'hu' => 'Hungary', 'is' => 'Iceland', 'in' => 'India',
'id' => 'Indonesia', 'ir' => 'Iran, Islamic Republic of', 'iq' => 'Iraq',
'ie' => 'Ireland, Republic of', 'il' => 'Israel', 'it' => 'Italy',
'jm' => 'Jamaica', 'jp' => 'Japan', 'jo' => 'Jordan',
'kz' => 'Kazakhstan', 'ke' => 'Kenya', 'ki' => 'Kiribati',
'kp' => 'Korea, Democratic People\'s Republic of', 'kr' => 'Korea, Republic of', 'kw' => 'Kuwait',
'kg' => 'Kyrgyzstan', 'la' => 'Lao People\'s Democratic Republic', 'lv' => 'Latvia',
'lb' => 'Lebanon', 'ls' => 'Lesotho', 'lr' => 'Liberia',
'ly' => 'Libyan Arab Jamahiriya', 'li' => 'Liechtenstein', 'lt' => 'Lithuania',
'lu' => 'Luxembourg', 'mo' => 'Macao', 'mk' => 'Macedonia, The Former Yugoslav Republic of',
'mg' => 'Madagascar', 'mw' => 'Malawi', 'my' => 'Malaysia',
'mv' => 'Maldives', 'ml' => 'Mali', 'mt' => 'Malta',
'mh' => 'Marshall Islands', 'mq' => 'Martinique', 'mr' => 'Mauritania',
'mu' => 'Mauritius', 'yt' => 'Mayotte', 'mx' => 'Mexico',
'fm' => 'Micronesia, Federated States of', 'md' => 'Moldova, Republic of', 'mc' => 'Monaco',
'mn' => 'Mongolia', 'ms' => 'Montserrat', 'ma' => 'Morocco',
'mz' => 'Mozambique', 'mm' => 'Myanmar', 'na' => 'Namibia',
'nr' => 'Nauru', 'np' => 'Nepal', 'nl' => 'Netherlands',
'an' => 'Netherlands Antilles', 'nc' => 'New Caledonia', 'nz' => 'New Zealand',
'ni' => 'Nicaragua', 'ne' => 'Niger', 'ng' => 'Nigeria',
'nu' => 'Niue', 'nf' => 'Norfolk Island', 'mp' => 'Northern Mariana Islands',
'no' => 'Norway', 'om' => 'Oman', 'pk' => 'Pakistan',
'pw' => 'Palau', 'ps' => 'Palestinian Territory, Occupied', 'pa' => 'Panama',
'pg' => 'Papua New Guinea', 'py' => 'Paraguay', 'pe' => 'Peru',
'ph' => 'Philippines', 'pn' => 'Pitcairn', 'pl' => 'Poland',
'pt' => 'Portugal', 'pr' => 'Puerto Rico', 'qa' => 'Qatar',
're' => 'Reunion', 'ro' => 'Romania', 'ru' => 'Russian Federation',
'rw' => 'Rwanda', 'sh' => 'Saint Helena', 'kn' => 'Saint Kitts and Nevis',
'lc' => 'Saint Lucia', 'pm' => 'Saint Pierre and Miquelon', 'vc' => 'Saint Vincent and the Grenadines',
'ws' => 'Samoa', 'sm' => 'San Marino', 'st' => 'Sao Tome and Principe',
'sa' => 'Saudi Arabia', 'scotland' => 'Scotland', 'sn' => 'Senegal',
'cs' => 'Serbia and Montenegro', 'sc' => 'Seychelles', 'sl' => 'Sierra Leone',
'sg' => 'Singapore', 'sk' => 'Slovakia', 'si' => 'Slovenia',
'sb' => 'Solomon Islands',
'so' => 'Somalia', 'za' => 'South Africa', 'gs' => 'South Georgia and the South Sandwich Islan',
'es' => 'Spain', 'lk' => 'Sri Lanka', 'sd' => 'Sudan',
'sr' => 'Suriname', 'sj' => 'Svalbard and Jan Mayen', 'sz' => 'Swaziland',
'se' => 'Sweden', 'ch' => 'Switzerland', 'sy' => 'Syrian Arab Republic',
'tw' => 'Taiwan', 'tj' => 'Tajikistan', 'tz' => 'Tanzania, United Republic of',
'th' => 'Thailand', 'tl' => 'Timor-Leste', 'tg' => 'Togo',
'tk' => 'Tokelau', 'to' => 'Tonga', 'tt' => 'Trinidad and Tobago',
'tn' => 'Tunisia', 'tr' => 'Turkey', 'tm' => 'Turkmenistan',
'tc' => 'Turks and Caicos Islands', 'tv' => 'Tuvalu', 'ug' => 'Uganda',
'ua' => 'Ukraine', 'ae' => 'United Arab Emirates', 'gb' => 'United Kingdom',
'us' => 'United States', 'um' => 'United States Minor Outlying Islands', 'uy' => 'Uruguay',
'uz' => 'Uzbekistan', 'vu' => 'Vanuatu', 've' => 'Venezuela',
'vn' => 'Viet Nam', 'vg' => 'Virgin Islands, British', 'vi' => 'Virgin Islands, U.S.', 'wales' => 'Wales',
'wf' => 'Wallis and Futuna', 'wales' => 'Wales', 'eh' => 'Western Sahara',
'ye' => 'Yemen', 'zm' => 'Zambia', 'zw' => 'Zimbabwe',
);
return $flags;
}
<file name="$languagedir/Modifications.portuguese_pt.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Por favor, seleccione o seu pais';
$txt['country_flag_error_required'] = 'Tem de seleccionar o pais onde se encontra actualmente';
$txt['country_flag_ask'] = 'Permitir selecção da bandeira do pais';
$txt['country_flag_disabled'] = 'Não exibir (Desligado)';
$txt['country_flag_profile'] = 'No Perfil';
$txt['country_flag_registration'] = 'No Registo';
$txt['country_flag_both'] = 'Em ambos';
$txt['country_flag_required'] = 'Obrigar o utilizador a escolher uma localização?';
$txt['country_flag_show'] = 'Exibir bandeira do pais no quadro do utilizador (Onde os tópicos são exibidos).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Por favor, seleccione o seu pais';
$txt['country_flag_error_required'] = 'Tem de seleccionar o pais onde se encontra actualmente';
$txt['country_flag_ask'] = 'Permitir selecção da bandeira do pais';
$txt['country_flag_disabled'] = 'Não exibir (Desligado)';
$txt['country_flag_profile'] = 'No Perfil';
$txt['country_flag_registration'] = 'No Registo';
$txt['country_flag_both'] = 'Em ambos';
$txt['country_flag_required'] = 'Obrigar o utilizador a escolher uma localização?';
$txt['country_flag_show'] = 'Exibir bandeira do pais no quadro do utilizador (Onde os tópicos são exibidos).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
Quote from: sharks on February 02, 2011, 05:53:17 PM
My cpanel error log is full of these errors:
File does not exist: /home/sharks/forum/Themes/default/images/flags/00.png
...
Where to find and how to fix those missing 00.png ... flags??
...
Quote from: rica.carv on July 08, 2011, 05:46:42 AM
...
There's also a small bug, that when someone selects no country AFTER had selected a country, it keeps displaying in the threads page, but it displays "Pais: 00"
Anyone got this issue also???
...
Quote from: phill104 on July 19, 2011, 09:42:00 AM
After updating a forum from 1.x to 2.x we lost all the flag data for exisiting users. I cannot seem to find it in the DB, I think I must be going blind. Where is it so I can restore?
<file name="$languagedir/Modifications.croatian.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahtijeva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gdje je poruka prikazana).';
$txt['country_flag'] = 'Drzava';
<file name="$languagedir/Modifications.croatian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod
$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahtijeva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gdje je poruka prikazana).';
$txt['country_flag'] = 'Drzava';
<file name="$languagedir/Modifications.serbian.php">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahteva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gde je poruka prikazana).';
$txt['country_flag'] = 'Drzava';
<file name="$languagedir/Modifications.serbian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod$txt['country_flag_label'] = 'Molimo izaberite vasu drzavu';
$txt['country_flag_error_required'] = 'Morate izabrati drzavu iz koje dolazite';
$txt['country_flag_ask'] = 'Izaberite zastavu';
$txt['country_flag_disabled'] = 'Ne prikazuj (Zabranjeno)';
$txt['country_flag_profile'] = 'Profil';
$txt['country_flag_registration'] = 'Registracija';
$txt['country_flag_both'] = 'Oboje';
$txt['country_flag_required'] = 'Zahtijeva da clan izabere lokaciju?';
$txt['country_flag_show'] = 'Prikazi zastavu na stranici (Gdje je poruka prikazana).';
$txt['country_flag'] = 'Drzava';
Quote from: vbgamer45 on July 29, 2011, 12:33:49 PMYou're welcome, vbgamer45 whenever you need it.
Thanks for the translation
// Always fun - select boxes!
elseif ($field['type'] == 'select')
{
echo '
<select name="', $key, '" id="', $key, '">';
// 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>';
}
}
Quote from: smitch6 on August 12, 2011, 03:57:20 AM
...it has to be done manually afterwards...
Quote from: aselmani on August 15, 2011, 08:47:20 AM..the flags do not appear in the forum?...Where?In which part?Profile or post?
Quote from: Branko. on August 15, 2011, 09:13:19 AMQuote from: aselmani on August 15, 2011, 08:47:20 AM..the flags do not appear in the forum?...Where?In which part?Profile or post?
Settings
ACP>Modification Settings>Miscellaneous :
Ask for country flag on......both
Show flags on Display page (Where posts are shown). ...check
Quote from: Branko. on August 15, 2011, 09:39:25 AM
Hm, I see that field in the registration form....please approve my account to your forum
Quote from: Branko. on August 15, 2011, 10:02:59 AM
You are right .. do not see in my post profile.You do not have the code in the Display template.
EDIT:Theme on your forum?
Quote from: Branko. on August 15, 2011, 10:11:47 AM
Change forum default theme to another and check, maybe that is not compatible
Quote from: Branko. on August 15, 2011, 10:24:52 AM
In this case you need perform changes in some php's via FTP
Quote from: Branko. on August 18, 2011, 03:46:04 PM
Not recommended, better way is to contact author of this modification...and tell him that there is a portal installed.
Quote from: Ventic on September 25, 2011, 04:52:59 AMi got this prob
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
Quote from: Ventic on September 27, 2011, 06:11:21 AMdid it install without errors, have you checked the install the smf parser to make sure everything installed.Quote from: Ventic on September 25, 2011, 04:52:59 AMi got this prob
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
anyone knows how to fix it
Quote from: Ventic on September 28, 2011, 06:08:55 AM
no errors while installing,no any log error from panel no nothing
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do país Ligado';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localização?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde postes são apresentados).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do país Ligado';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localização?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde postes são apresentados).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do país Ligado';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localização?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde postes são apresentados).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod Translate by Candidosa2 SMFPT
$txt['country_flag_label'] = 'Selecione o seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país que nos visita';
$txt['country_flag_ask'] = 'Solicitar a bandeira do país Ligado';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registar';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Requer um membro para seleccionar a localização?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde postes são apresentados).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
Quote from: vbgamer45 on October 09, 2011, 12:36:35 PMdid you fix the problem?
Thanks for the translation!
Quote from: vbgamer45 on October 10, 2011, 01:23:13 PMyou will fix it or not
Haven't made any updates so no.
Quote from: Ventic on September 25, 2011, 04:52:59 AM
serius bug
when someone register and select his country flag,then when he posts something his flag doesnt appear and he must select it again
Quote from: vbgamer45 on October 11, 2011, 04:41:34 PMof he select it again it appears
If he selects it again does it appear? Or still not. Also what SMF version
Quote from: Ventic on October 12, 2011, 12:47:58 AMQuote from: vbgamer45 on October 11, 2011, 04:41:34 PMof he select it again it appears
If he selects it again does it appear? Or still not. Also what SMF version
smf 2.0.1
Quote from: shubha on October 19, 2011, 02:18:27 AMyou should enable it
I didn't get the any option on the registeration page. My forum version 2.0.1
QuoteUndefined index: country_flag_ask
QuoteToday 08:23:46 pm
91b6ee9fef15287ba4503e9303cd71ce
Type of error: Undefined
http://www.garminclub.bg/index.php?action=register2
8: Undefined index: country_flag_askФайл: /home/www/garminclub-bg.com/www/Themes/default/Register.template.php (eval?)
Line: 212
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...
Quote from: ddabcd277 on October 21, 2011, 05:20:23 AMNo errors
Here you have.
Quote from: Sloth Sinner on October 21, 2011, 07:07:24 PMOf course...this themes/default/images/flags is an example
If you want to add flags, you must add it in themes/your-current-theme/images/flags
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
FindCode Select// Always fun - select boxes!
elseif ($field['type'] == 'select')
{
echo '
<select name="', $key, '" id="', $key, '">';
and Replace withCode Select// 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>';
}
}
Quote from: vbgamer45 on November 29, 2011, 08:18:58 PM
I would need someone to find a flag .gif/png file for anatartica then i can include it.
Quote from: vbgamer45 on November 29, 2011, 08:18:58 PM
I would need someone to find a flag .gif/png file for anatartica then i can include it.
Quote from: jimv8673 on December 04, 2011, 04:50:02 PMOpen themes/default/languages/modifications.english.php
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.
Quote from: vbgamer45 on December 05, 2011, 10:28:28 AM
12/5/2011 v1.1.3
!Fixed missing Antarctica image
!Fixed skipping on Babylon theme if does not exist.
Quote from: sharks on December 21, 2011, 02:44:55 AM
vinzbomb, this is strange, what SMF version are you using?
Quote from: smitch6 on December 21, 2011, 04:34:10 AM
mine has never remembered the country :(
i've been saying that from day 1 of using it
it's a great mod but could do with being sorted so it works 100%
i love it but it is a pain having a ? where it should be a country or nothing at all even though i have it set on moth registration and profile setting and it's a must when you join??
and i'm using the latest smf and mod available
Quote from: vinzbomb on December 20, 2011, 07:25:59 PM
thanks for this great mod
minor problem
its when you register on the forum and choose your country, the forum doesn't save the settings of the countryflag to the userprofile, people have to reselect the countryflag again in the forum profile later after register.(if they do it!!!)
its not cool because it is mandatory to Register on the forum. so if its not working, then it has no sense to use it, because people will not think they must set their countryflag in the forum profile, and some will never do it !!! ;)
ok i had said "MINOR BUG" actually NOT !!!
Its a big bugg !!!
the effect is that it has no sense to use it since its not working correctly like it should !!!! why putting the setting "require country select on registration page" IT DOESN'T WORK it appears and work on the registration page but do not save the setting to the user profile !!!
apparently i'am not only one with this bug, and was reported on the same day, the mod came out.
so can anyone help me fix this bug thanks !!!!
Quote from: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
12/23/2011 v2.0
!Fixed for SMF 2.0 selecting flag on registration was not saving.
!Added some alt tags for SMF 2.0 version
Quote from: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
12/23/2011 v2.0
!Fixed for SMF 2.0 selecting flag on registration was not saving.
!Added some alt tags for SMF 2.0 version
Quote from: vbgamer45 on December 23, 2011, 12:11:38 AM
Currently not part of the mod. Maybe will include in the future.
QuoteThis mod allows your members to select from a list the countries to denote where they live. This will include a country flag in their posts and profile.
Quote from: BaghdadGhost on December 20, 2011, 02:56:00 PM
2.0.1 and yes it is not showing at all and forgot to mention that without it I was able to register a new user.
don't know if others also experiencing the same problem?
Quote from: vbgamer45 on December 22, 2011, 11:29:13 PM
Updates:
12/23/2011 v2.0
!Fixed for SMF 2.0 selecting flag on registration was not saving.
!Added some alt tags for SMF 2.0 version
Quote from: smitch6 on December 24, 2011, 07:10:07 PM
i just deleted the old version and tried to upload and install the new one
i'm using the latest V of smf and bang my whole site went down
i gather this new package doesn't like the latest version of smf?????
or do i have to manually edit files to get this to work?
thanks
// 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" alt="" 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>';
}
}
// Show the country they hail from!
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
{
$flags = country_flags();
echo '
<li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="', $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
}
Quote from: BaghdadGhost on December 25, 2011, 07:03:44 PMyes it works :D
I already watched some new members and it does show their flag. :)
Quotehttp://www.myforum.bg/index.php?action=register
8: Undefined index: country_flag_ask
File: /home/www/myforum.com/www/Themes/default/GenericControls.template.php (eval?)
Line: 212
QuoteType of error: Undefined
Quote3. Execute Modification ./Sources/ManageSettings.php Test failed
Quote from: ApplianceJunk on December 31, 2011, 11:54:47 PM
When I try to uninstall CountryFlags 1.1.2 so I can install 1.1.3 I see this...Quote3. Execute Modification ./Sources/ManageSettings.php Test failed
I'm running SMF 2.0.2
'',
// Show flags
array('select', 'country_flag_ask', array($txt['country_flag_disabled'], $txt['country_flag_profile'], $txt['country_flag_registration'], $txt['country_flag_both'])),
array('check', 'country_flag_required'),
array('check', 'country_flag_show'),
Quote from: mikedijital on January 01, 2012, 06:56:59 PM
I installed this on 2.0.2 and all the code is right were it should be. the admin features, and selection drop down in profiles works fine.... no flags show up on the mini profile in posts.... the code is there... just not translating from back end to front... can someone help
Quote from: mikedijital on January 01, 2012, 10:09:21 PM
the code is in the file as needed, but its not showing, or showing a space for it in the mini profile. I have it turned on in the admin panel.
Quote from: vbgamer45 on January 08, 2012, 04:28:09 PM
Not at the moment.
Quote from: rootuid on February 04, 2012, 03:26:30 AMUsing latest version if so what SMF version?
I have a problem:
When a user inputs their location in their profile and clicks save profiles it doesn't save . The user has to repeat this and it saves the second time. Any ideas? thanks.
Quote from: Present. on January 08, 2012, 07:52:24 PM
please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!
Quote from: Present. on February 04, 2012, 06:59:28 PMQuote from: Present. on January 08, 2012, 07:52:24 PMI would need flag images for both of the same size.
please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!
whether this will happen once (quote)
Quote from: vbgamer45 on February 04, 2012, 07:04:40 PMQuote from: Present. on February 04, 2012, 06:59:28 PMQuote from: Present. on January 08, 2012, 07:52:24 PMI would need flag images for both of the same size.
please edit with Serbia and Montenegro to Serbia
these two states are separated by more than 2007 years!
whether this will happen once (quote)
Quote from: vbgamer45 on February 04, 2012, 09:09:49 PM
Update!
Separated Serbia and Montenegro
Quote from: vbgamer45 on February 05, 2012, 11:45:51 AM
Are you using new one on modsite?
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $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.registration.country.options[document.forms.registration.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.registration.country.options[document.forms.registration.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<dl class="register_form" id="country_flag">
<dt><strong>', $txt['country_flag_label'], ':</strong></dt>
<dd>
<select name="country" onchange="showflags()">
<option value=""></option>';
// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '">', $name, '</option>';
echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" alt="" width="25" height="15" align="top" />
</dd>
</dl>';
}
// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && ($modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3))
{
// Call the function that has all the flag info
$flags = country_flags();
echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.registration.country.options[document.forms.registration.country.selectedIndex].value != \'\' ? \'' . $settings['default_theme_url'] . '/images/flags/\' + document.forms.registration.country.options[document.forms.registration.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<dl class="register_form" id="country_flag">
<dt><strong>', $txt['country_flag_label'], ':</strong></dt>
<dd>
<select name="country" onchange="showflags()">
<option value=""></option>';
// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="', $key, '">', $name, '</option>';
echo '
</select>
<img id="flags" src="', $settings['default_theme_url'], '/images/blank.gif" alt="" width="25" height="15" align="top" />
</dd>
</dl>';
}
echo '
</fieldset>
<span class="botslice"><span></span></span>
</div>';
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
if (!empty($modSettings['country_flag_ask']) && ($modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3))
Notice the grouping of the 2 || 3, without the grouping it is if the setting is NOT empty and the value is 2, OR if the value is 3, which is fine, but there's no isset();, so if the variable is not set, that's when it becomes undefined because it's not combined with the !empty();, and doesn't have an isset();.$flags = CountryFlags();
$flags = country_flags();
Resolved this error, which throws an undefined function error. echo '
</fieldset>
<span class="botslice"><span></span></span>
</div>';
Quote from: vbgamer45 on February 16, 2012, 10:28:36 PMNot a problem :) Hope you're doing well!
Thanks Labradoodle-360 made all the changes except for $flags = country_flags(); since i do not have a country_flags() function in the code at all.
Quote from: vbgamer45 on February 17, 2012, 11:39:45 AM
Doing well just busy as always.
document.forms.creator.country_flag.options[document.forms.creator.country_flag.selectedIndex].value + \'.png\' : \'' . $settings['images_url'] . '/flags/blank.gif\';
Quote from: tank_fv101 on December 30, 2011, 02:20:08 PMyup, same here..
Hello all,
I hope you can help with an error I have on my forum with this mod. I'm using 2.0.2.
When members have had a look at the selection of flags in their profile, but decided not to choose one, it would come up with "Country" under their avatar and a broken picture called 00.png So, as a temporary measure to make it look nicer I created a 00.png which is transparent and uploaded (as the file didn't even exist). I'm not sure why choosing a blank option should select a picture?
Can anyone help with the "Couuntry" not appearing, and also the picture not appearing as well.
Thanks for your time.
// Show the country they hail from!
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
{
$flags = CountryFlag();
echo '<li class="gender">', $txt['country_flag'], ': <img src="', $settings['images_url'], '/flags/', $message['member']['country_flag'], '.png" alt="', $message['member']['country_flag'], '" title="', $flags[$message['member']['country_flag']], '" /></li>';
}
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>
// 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
$flags = array(
'00' => '',
$flags = array(
'00' => 'Select country',
if (!empty($modSettings['country_flag_required']) && empty($_POST['default_options']['country']))
if (!empty($modSettings['country_flag_required']) && (empty($_POST['default_options']['country']) || $_POST['default_options']['country'] == '00'))
'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'
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?
Quote from: Old Fossil on May 20, 2012, 11:38:52 AMQuote 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.
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.
Quote from: Old Fossil on May 21, 2012, 09:09:07 PMi fixed it. i forgot to choose to install on some themes and when i changed that it worked completly. thank you guys so much :)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.
Quote from: ShanRob_ClinnOTH23 on May 21, 2012, 09:48:30 PMQuote from: Old Fossil on May 21, 2012, 09:09:07 PMi fixed it. i forgot to choose to install on some themes and when i changed that it worked completly. thank you guys so much :)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.
Quote from: Labradoodle-360 on May 21, 2012, 11:09:07 PMyeah me too :) it was literally driving me insane.
Not a problem, I'm glad you got it working :)
$smcFunc['db_insert']($do_delete ? 'ignore' : 'replace',
'{db_prefix}log_online',
array('session' => 'string', 'id_member' => 'int', 'id_spider' => 'int', 'log_time' => 'int', 'ip' => 'raw', 'url' => 'string'),
array($session_id, $user_info['id'], empty($_SESSION['id_robot']) ? 0 : $_SESSION['id_robot'], time(), 'IFNULL(INET_ATON(\'' . $user_info['ip'] . '\'), 0)', $serialized),
array('session')
);
}
// Mark your session as being logged.
$_SESSION['log_time'] = time();
Quote from: Diego Andrés on June 09, 2012, 08:32:44 PM
How to show the country in text and no with images ?
Quote from: Diego Andrés on June 09, 2012, 08:32:44 PMI'll throw this option in for you.
How to show the country in text and no with images ?
QuoteDatabase Error: Field 'country' doesn't have a default value
File: C:/inetpub/root/Sources/Subs.php
Line: 2760
Quote from: Labradoodle-360 on June 21, 2012, 01:01:47 PM
I am currently working on a new version of Country Flags that will contain quite a few enhancements.Quote from: Diego Andrés on June 09, 2012, 08:32:44 PMI'll throw this option in for you.
How to show the country in text and no with images ?
Quote from: Dracopaion on June 22, 2012, 03:28:51 AMalter table smf_members change country country varchar(255) default '';
Unfortunately I can't wait until you release your next version of this mod to see if it may fix the problem so I tried to uninstall the mod instead. The pre check for uninstall was all good to go and it seemed to uninstall without a problem however I'm still getting the same error. Is this a problem of the mod or of SMF? Do I need to elevate this to a different forum? I ask this because this almost looks more like a database error then an error in the coding for subs.php
Quote from: vbgamer45 on June 21, 2012, 06:24:54 PM
Link to FB account for the preview http://www.facebook.com/smfhacks
Link us if you enjoy the work we do!
QuoteUnfortunately I can't wait until you release your next version of this mod to see if it may fix the problem so I tried to uninstall the mod instead. The pre check for uninstall was all good to go and it seemed to uninstall without a problem however I'm still getting the same error. Is this a problem of the mod or of SMF? Do I need to elevate this to a different forum? I ask this because this almost looks more like a database error then an error in the coding for subs.php
alter table smf_members change country country varchar(255) default '';
QuoteIt's not going to be long for the update to be released...furthermore, it's an issue with the modification not installing properly. Any bugs in this modification (not seen many fatal bugs) will be fixed in the next patch.
Quote from: repxl on June 26, 2012, 11:03:12 AM
when comes out the 2.0.2 ?
Quote from: Dracopaion on June 26, 2012, 12:13:57 AM
how do I mark this as solved In this forum or is that needed?
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país a qual nos visita';
$txt['country_flag_ask'] = 'Peça bandeira do país em';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país a qual nos visita';
$txt['country_flag_ask'] = 'Peça bandeira do país em';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país a qual nos visita';
$txt['country_flag_ask'] = 'Peça bandeira do país em';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país a qual nos visita';
$txt['country_flag_ask'] = 'Peça bandeira do país em';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
The package was installed successfully. You should now be able to use whatever functionality it adds or changes; or not be able to use functionality it removes.
Quote from: danialasghar on July 22, 2012, 06:26:26 PM
I have download this mod and Installed through packages..
Where is the setting I can't find in Features and options..!
Ask for country flag on
Require a member to select a location?
Show flags on Display page (Where posts are shown).
Quote from: Mod Mark on July 28, 2012, 12:17:51 PM
...If I edit anything in my forum profile but don't select a country it will appear as 'Country: broken image logo'...
Quote from: Shambles™ on July 28, 2012, 12:32:51 PMQuote from: Mod Mark on July 28, 2012, 12:17:51 PM
...If I edit anything in my forum profile but don't select a country it will appear as 'Country: broken image logo'...
I think I saw this when I first installed it a while back. I seem to remember creating a blank image file called 00.png and put it in the flags folder. I think.
Quote from: Dracopaion on June 22, 2012, 04:00:04 PM
That worked for adding the country column unfortunately it didn't repair the problem im still seeing when you log in :
Database Error
Field 'country' doesn't have a default value
File: C:\inetpub\wwwroot3\Sources\Subs.php
Line: 2760
and when you log out:
Database Error
Database Error Please try again. If you come back to this error screen, report the error to an administrator.
Quote from: Santa Paws on December 21, 2012, 11:37:43 PM
vbgamer - you should PM me about my releasing the update for this modification, I almost had it completely rewritten using your SMF Hacks modification framework which fixes all bugs and makes improvements.
mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,
mem.yim_user,mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.yim_user, mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,
mem.country_flag,
to both of the lines I found?
Quote from: vbgamer45 on January 14, 2013, 11:48:07 PMThanks very much. :)
Yes it would be
Quote from: vbgamer45 on January 17, 2013, 09:23:37 AM
Not at the moment.
Quote from: vbgamer45 on January 17, 2013, 09:58:06 AM
Not easily doable. Requires many edits and then changes in the database structure.
Quote from: Labradoodle-360 on December 21, 2012, 11:37:43 PM
vbgamer - you should PM me about my releasing the update for this modification, I almost had it completely rewritten using your SMF Hacks modification framework which fixes all bugs and makes improvements.
Quote from: DaKrampus on May 09, 2012, 01:27:22 PM
Great news, If you want I can send you the install package I made that also includes incorporation in memberlist.
Da
Quote from: Shambles on June 04, 2013, 11:24:55 AMI haven't changed any of the original package credits/ownership info but if the owner wants me to delete the attached package file I will.
Is the mod author Ok with you redistributing his code?
Quote from: vbgamer45 on June 19, 2013, 07:20:32 PM
What SMF version?
Quote from: ~Luke on June 30, 2013, 09:08:42 AM
Im still yet to find a resolution to this :( I really want this mod.
Quote from: Labradoodle-360 on July 13, 2013, 04:47:08 PMMy problem is that it won't even parse the modification to install it in the first place.
There are some bugs in the modification. Although it should still function.
Quote from: Labradoodle-360 on July 13, 2013, 05:03:55 PMI did that. The Package Manager cannot parse the mod.
It doesn't have to parse to install it...you use Package Manager and upload the .zip.
QuoteStill have no idea why it's not showing up anywhere though.If you read the message I've just referred to you'll find out how this version of the mod works.
Quotethe text appears in profiles e.g. "country:au" but there is no image or graphic with a flag corresponding to the country they've selected.What you're seeing is the text that is displayed as an alternative when the image can't be displayed for some reason (eg, either the referenced image doesn't exist or it can't be accessed)
Quote from: vbgamer45 on July 18, 2013, 06:29:59 PM
Give it a try and see if it helps copying to your themes folder
QuoteIf you read the message I've just referred to you'll find out how this version of the mod works.Not sure why my reply never posted, but I know how the mod works. The problem is that the section just doesn't show up at all on the fixed version. I can't seem to figure out why.
QuoteMake sure the flags folder was copied over.The mod works fine, it appears when the user changed his mind to show the flag in the profile.
QuoteIs it looking for a file called 00.png?It turns out that yes, please feel free to fix.
Quote from: Shambles
I simply created one for my forum...
<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país a qual nos visita';
$txt['country_flag_ask'] = 'Peça bandeira do país em';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// Country Flag mod translate by Candidosa2
$txt['country_flag_label'] = 'Selecione seu país';
$txt['country_flag_error_required'] = 'Você deve selecionar o país a qual nos visita';
$txt['country_flag_ask'] = 'Peça bandeira do país em';
$txt['country_flag_disabled'] = 'Não mostrar (Desactivado)';
$txt['country_flag_profile'] = 'Perfil';
$txt['country_flag_registration'] = 'Registo';
$txt['country_flag_both'] = 'Ambos';
$txt['country_flag_required'] = 'Exigir um membro para selecionar um local?';
$txt['country_flag_show'] = 'Mostrar bandeiras na página de exibição (Onde as mensagens são mostradas).';
$txt['country_flag'] = 'País';
]]></add>
</operation>
</file>
Quote from: vbgamer45 on October 05, 2013, 11:42:06 AM
What errors are given?
Quote from: vbgamer45 on October 05, 2013, 11:42:06 AM
What errors are given?
Quote from: ^HeRaCLeS^ on November 01, 2013, 08:24:47 PMShould work now.
What does not work is the mod.
I made the report to the author but not update
This bad file "package-info.xml"
Quote from: Shambles on September 04, 2013, 12:01:51 PMI'm having exactly this problem.
Is it looking for a file called 00.png?
I simply created one for my forum...
Quote from: rica.carv on July 10, 2011, 12:51:18 PMAny status on this?
Well, the 00.png couldn't exist really, since it's no flag at all for the mod.I've got to dig on the code, to see if i can came up with anything that overrides the 00.png display....
00.png issue solved...
I've changed the code, so that if the user selected no country, it won't display any flag line at all....
Now, more dig, to see if i can set options for the formating of the country line....
Quote from: GamePersia on February 13, 2014, 08:15:37 AMMay i get a solution for this error ???
if choosing a contry flag,...it's working well,..
but when removing it from profile,...it's showing broken image in post.
(http://i.imgur.com/5IGYPyB.jpg)
A PROPER SOLUTION IS REQUIRED,....SMF 2.0.7....... :(
Quote from: Old Fossil on February 26, 2014, 09:33:19 PMoop's...
Have you considered using the mods parser?
Quote from: Old Fossil on February 26, 2014, 09:33:19 PMproblem solved,..thanks for giving idea !! :P
Have you considered using the mods parser?
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']))
if (isset($message['member']['country_flag']) && !empty($modSettings['country_flag_show']) && !empty($message['member']['country_flag']) && $message['member']['country_flag']!='00')
Quote from: Chris B. on August 15, 2014, 01:53:22 AMIf you experience troubles with something it would be useful to tell everyone else your solution so that if they are experiencing the same issues you are having troubles with they can try to solve it the same way :)
I'm working on figuring out were three countries are appearing under a user's name right now. I cleared out all the files that are associated with the mod but that didn't do much of any good. Going to try the mod parser next.
Looks like I was able to fix it. Took a few hours to figure it out.
Quote from: ♦ Ninja ZX-10RR ♦ on June 28, 2014, 12:28:07 PM
Hi everyone.
Is there a way to show the country on the summary of the profile view? Which file do I need to edit and how?
Thanks in advance.
Quote from: ♦ Ninja ZX-10RR ♦ on November 04, 2014, 12:55:20 PM
Yes, damn exactly. May I ask you how you did that sir?
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>
// Space for countryflags
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>';
// Space for countryflags end
Quote from: ♦ Ninja ZX-10RR ♦ on November 04, 2014, 02:45:33 PM
Awwwwwwwwwwww (http://www.katzy.dsl.pipex.com/Smileys/thanks3.gif) that works!!!
Quote from: Dwarp on April 19, 2015, 04:43:59 AM
i didnt see da flag ??? in someone post
Quote from: coltp45 on December 28, 2014, 08:49:54 PMHow to display only the flag, no "country:" ?
Quote from: Empire KickAss on May 04, 2015, 03:48:55 AM
I have it working good, But it's not showing up on members profile. It's on posts and it's under forum profile. But not showing in profile
Quote from: Rain Forest on May 04, 2015, 09:04:59 AMQuote from: Empire KickAss on May 04, 2015, 03:48:55 AM
I have it working good, But it's not showing up on members profile. It's on posts and it's under forum profile. But not showing in profile
Read page 62..
http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246
Quote from: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,
I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help
Quote from: Empire KickAss on May 13, 2015, 03:29:20 AMQuote from: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,
I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help
Read page 62... LOL.... ::)
http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246
Quote from: dannyv1708 on May 13, 2015, 05:28:17 AMQuote from: Empire KickAss on May 13, 2015, 03:29:20 AMQuote from: dannyv1708 on May 13, 2015, 02:02:23 AM
Hi,
I'm able to see the correct flag when I select location in the profile settings. However, I'm not able to see the flag in the profile summary as well as in any posts. What could be wrong? Please help
Read page 62... LOL.... ::)
http://www.simplemachines.org/community/index.php?topic=106060.msg3760246#msg3760246
Thank you so much. I have edited and now profile summary shows the country flag. I tried editing display.template.php with the same coding but it show as County: NA
Please help.
Quote from: Steve on June 29, 2015, 10:43:48 AM
The mod author is more than likely going to want to know what edits you made as this mod makes edits to that same file.
mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, [b]mem.country_flag,[/b]
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good, [b]mem.country_flag,[/b]
Quote from: Steve on June 29, 2015, 11:15:30 AMThat was added to highlight on here
And if you take [b]mem.country_flag,[/b] off the end of both those lines does it work properly?
Quote from: Steve on June 29, 2015, 11:25:02 AM
All I can say is try it without the edits. If it still doesn't work, then the mod author will have to help you further. :)
Quote from: Steve on June 29, 2015, 11:25:02 AM
All I can say is try it without the edits. If it still doesn't work, then the mod author will have to help you further. :)
Quote from: Steve on June 29, 2015, 05:57:57 PM
Did you install this manually or through the package manager?
Quote from: yakyakyak on June 29, 2015, 09:01:38 AM
SMF 2.0.9
Made a couple of edits in Load.php and Country Flags working to the extent that in my own forum profile as an example, i select UK under Country and select Save and forum software confirms the edit is saved however, the country I added reverts to Select Country again. When i do select UK the union jack is displayed.
Quote from: SMFHacks.com Team on March 06, 2016, 10:31:19 PMCan you please tell me if it's a complete overhaul or just a few things? It's gonna be a nightmare to update, because I've done several modifications to this :/
Must update!
Version 3.0
!Fixed an XSS issue on registration for flags update for SMF 2.0.x and SMF 1.1.x Reported by Jaume Llopis
Quote from: Talon Senatu on April 02, 2016, 02:18:15 PM
I'm having a 'test failed' on ./Sources/Load.php. Anyone know how that comes?
Quote from: vbgamer45 on March 03, 2017, 02:03:35 PM
Try uploading package to and make sure all the edits are done to your site.
http://smfhacks.com/smf-package-parser.html
https://xxxxxx.com/index.php?topic=65.0
8: Undefined index: country_flag
/home/volxx_x/xxxxxx.com/xxxxxxxxxx/htdocs/Sources/Load.php
Línea: 1212
'country_flag' => $profile['country_flag'],
Quote from: vbgamer45 on March 14, 2018, 11:34:30 PM
Probably once 2.1 final hits
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], '</dd>';
// Space for countryflags
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>';
// Space for countryflags end
echo '
</dl>';
if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
echo '
<dt>', $txt['location'], ':</dt>
<dd>', $context['member']['location'], ' ', (!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>';
echo '
</dl>';
', $context['member']['location'], ' ', (!empty($context['member']['country_flag']) && $context['member']['country_flag']!= '00') ? '<img src="' . $settings['default_images_url']. '/flags/' . $context['member']['country_flag'] . '.png" alt="' . $context['member']['country_flag'] . '" title="' . $flags[$context['member']['country_flag']] . '" width="20px" />' :'N/A' . ' ';
<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" alt="" align="top" />'
Quote from: Kindred on July 07, 2020, 01:59:40 PM
your code is screwed up
that code does not appear anywhere in the code for this mod...
that line is supposed to beCode 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" alt="" align="top" />'
Quote from: KittyGalore on March 11, 2022, 03:33:31 PMAny chance this mod can be updated for 2.1I second that with a P-l-e-a-s-e! O:)
Quote from: landyvlad on December 06, 2022, 01:42:32 AM@SMFHacks.com TeamWhile I've been waiting for this mod to be updated also, @landyvlad I did this https://www.simplemachines.org/community/index.php?topic=578961.msg4098007#msg4098007
Any progress on making this 2.1.x compatible? (or is that not planned)
My members love this mod and will miss it in our upgrade.
Quote from: landyvlad on December 07, 2022, 07:04:33 PMIs what you've done reversible easily if the mod does get updated to work in 2.1?
Quote from: landyvlad on December 07, 2022, 07:04:33 PMTa.Yes and what @Speed King said you can just disable it and/or remove it in custom profiles. But also note that it won't work with the mod once/if the mod is updated and enabled. In other words, you can only use one or the other. If you decide later to use the mod, everyone will have to update their country.
I really would love to see the mod officially updated.
Is what you've done reversible easily if the mod does get updated to work in 2.1?
Quote from: Shades. on July 05, 2023, 02:41:40 PMSMF 2.1.4
Country Flags 3.0
I got no errors installing on SMF 2.1.4 but when I go to admin ?action=admin;area=modsettings;sa=general I get the WSOD 500 error page.
Edit: It works on a clean 2.1.4 but not on my test copy of my site. Must be another mod interfering but I'm not getting any error message.
Thanks,
Shades 8)
Quote from: durangod on December 13, 2023, 05:03:25 AMHere is that imageYou do realize that:
QuoteThe white flag was the official flag of the Taliban-ruled Islamic Emirate of Afghanistan between September 1996 and October 1997. It is sometimes used as an unofficial variant of the current flag which includes the Shahada written in black on a white field.
Quote from: Steve on December 13, 2023, 09:10:22 AMQuote from: durangod on December 13, 2023, 05:03:25 AMHere is that imageYou do realize that:QuoteThe white flag was the official flag of the Taliban-ruled Islamic Emirate of Afghanistan between September 1996 and October 1997. It is sometimes used as an unofficial variant of the current flag which includes the Shahada written in black on a white field.
dl#country_flag.register_form {
border: 0.438em ridge #781818;
padding: 1em;
}
dl#country_flag.register_form {
background-color: #121212;
padding: 1em;
}