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.
{
$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
This is 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>';
In the mean time try this file.
'so' => 'Scotland',
in the install and add a Scotland flag to the images directory?
would it just be as simple as adding
'so' => 'Scotland',
in the install and add a Scotland flag to the images directory?
Yea it should work w/o a problem. All of the mods that I've written lately have been built on RC3.
Polymath did you enable it on Admin > Features and Options > Last settings.
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
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';
What do I edit on the Modsettings.php file?
Sincerest Thanks!
VB
(http://www.boxer-france.com/Galerie_Vos_photos/4chiots.jpg)
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" />';
}
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
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
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']))
toif(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 '
<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'),
after this 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 />';
That is the code for Profile page. Need to look at the one that has the $message var.
Vegas make sure that you have the latests package.
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 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
<?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 />';
}
Hey Jay, I installed your mod and turned it on for Both reg and profiles
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 ?
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 ?So you telling me that you didn't select a flag in the profile first?
7. 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
did someone know what the problem is?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;
}
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';
Make sure that you copied and pasted in the right location. Might be slightly different for your theme.I'm 100 % positive I copied everything right... which is whats so frustrating...
I'll look at it later on when I get a chance.koo...
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.Thats 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...
Yea that was the only file that was edited.Well it shouldnt be to hard to figure out then assumin all u touched was the code for the flag hhe. shouldbe interesting to see if I can "get" this ;-P if not hope u wont mind helpin me one more time assumin i can get this on my own when im redy to go "production"
Sure no problem just let me know.I actually sent you a PM on this just saying when you can.. I decided to put this on my production forum ahead of schedule bec I wana try to "open" the doors within the next week or two and i still have alot of work to do...
Ok I'll look into it later on.No rush just wanted to make sure you still have the info I pm'd you for my forum... and wanted to make sure you havent forgotten about me hehe...
Just been busy trying to install Ubuntu on my PC.Kool... like I said no rush hehe... whats Ubuntu just curious bec it has a weird name lol
Ubuntu is a Linux Distro. Ubuntu.comKool.. 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**
You can edit the flag for any member just like you can edit their profile.
Change to the default theme. Check if the option is there.
You need to edit the Profile.template.php for your theme. Look at the install.xml file for the changes required for that file.
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>
http://docs.simplemachines.org/index.php?topic=402
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
There are several places that you need to edit in profile.template.php.
I suggest that you don't use dreamweaver for editing. It messes up php files.
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
It should be called temp not Temp. Also try chmoding it to 755.
Did you ever remove the file from the server?No. Should I?
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.
I just tested this mod and it works fine with 1.1.
When you have too many mods it's prone to fail in ModSettings.php.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.
Test Failed at Themes/default/Display.template.phpWhat mods do you have installed?
i use 1.1 , any idea?
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?
add this:$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');
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 :(
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'; >:(
I installed the mod and it worked fine on my board. I'm using latest version of SMF.
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?
Well, I did it myself ;-) These are the necessary changes to display the country flags on the memberlist page:followed that but it didnt work =\
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: [Select]if ($_REQUEST['sort'] === 'location') $where ='opt.variable="country"';
Replace that lineCode: [Select]LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . "
with thatCode: [Select]LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') .
($_REQUEST['sort'] === 'location' ? " LEFT JOIN {$db_prefix}themes AS opt ON (opt.ID_MEMBER = mem.ID_MEMBER)" : '') . "
Before the 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 (zef@zefhemel.com) *
* =============================================================================== *
* 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[
You need to add the language string to your Modifications.spanish.php file.
I"m worried about installing this mod as i see this error:
(http://runepixels.com/uimages3/countryflagerror.png)
what would cause this?
You need these strings. Just need to translate them.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';
I just downloaded the latest version and tried to install it on SMF 1.1.2 with the following mods installed:Seems like a conflict with your other mods. Need to install this mod manually.
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?
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification. :(Post your Profile.php and Profile.template.php files.
All I get is this at the top of every page:Uninstall the mod. Then upgrade to SMF 1.1.2 and reinstall 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';
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...
Welll, my problem is fixed but now only admins can change the flag, users cant make the modification. :(Post your Profile.php and Profile.template.php files.
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
I looked at the files and everything looks ok to me. Can you pm me a test account?Welll, my problem is fixed but now only admins can change the flag, users cant make the modification. :(Post your Profile.php and Profile.template.php files.
The files:
Thanks in advance. :)
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.
8: Undefined index: country_flag_ask
File: /home/texgnome/public_html/DD/Themes/default/Register.template.php (before sub template - eval?)
Line: 152
// 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)
toif (!empty($modSettings['country_flag_ask']) && ($modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3))
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.
Yes 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.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?
1. Execute Modification ./Sources/Register.php Test successfulLine 7 is what I need help with. I am using SMF 1.1.2.
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
I need help. When attempting to install, there was an error.Quote1. Execute Modification ./Sources/Register.php Test successfulLine 7 is what I need help with. I am using SMF 1.1.2.
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
I am using a recent fresh install and haven't modified any files. I do however have some modules installed that could be causing this:I need help. When attempting to install, there was an error.Quote1. Execute Modification ./Sources/Register.php Test successfulLine 7 is what I need help with. I am using SMF 1.1.2.
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.
1. TinyPortal 0.983 [ Uninstall ]Thanks for your help so far but for me modifying it myself isn't the case. It could be a module. Who knows :)
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 ]
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.Ok, 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 :)
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?
its giving me error when i am installing it.
its giving me error of profile.php
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.
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 />';
}
Parse error: parse error, unexpected '<' in .../Themes/default/Display.template.php on line 344Line 344 in display.template.php was
<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 />';
8: Undefined index: country_flag
File: /home/simju2/public_html/Forum/Themes/default/languages/Who.english.php (eval?)
Line: 269
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';
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>';
Add After // 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 />';
}
update for 1.1.3 coming soon?
i did try using the mod with 1.1.3 and it didnt work for me.
It is meant to show up next to the "Karma" link in "features" right?
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;
}
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>';
</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>
Mod 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 ]
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.please see attached image for a screen shot of the issue I am facing.Please help :).
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';
there is such a thingwell 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
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 />';
}
thanks truesatan!
You would need to edit the array this mod adds to Subs.php and to add the new flag to the flags directory.thanks mate
The package you tried to upload either is not a valid package or has become corrupted.
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.Thank you, I will try that and let you know how it goes.
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!
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.Well, this other thread might help: http://www.simplemachines.org/community/index.php?topic=207274.0
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.ok, thanks. I tried one time but no luck :(
<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>
Hi 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
@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 />';
}
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?
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/docspt/public_html/Sources/Subs.php on line 3912
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.
!!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.
3. Execute Modification ./Sources/ModSettings.php Test failed
I've been thinking. Would requiring registrants to choose a flag help to thwart spam bots?
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 :)
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:Quote3. 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?
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
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
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:Quote3. 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>
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:Quote3. 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>
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"/>';
Anyone have this mod packaged up and working for 1.1.5?
Thanks for replys.
1.1.7?
WTF?
Can someone make this mod for SMF 2.x?
Is the mod available for 1.1.8?
.... is there anyone that can help me with ....... the issue I suddenly have.
Cheers
.... 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 ;)
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);
}
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
@ 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 ;)
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 :)
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 :)
Hi
I would like to put 2 flags in profile. Is this possible?
thanks.
Hi, anybody know where can i find a Flag mod for smf 2.0? Thank you!
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?
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 />';
}
Does this package work with 1.1.10?
But it is not visible in Posts
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.
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.
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">
<