Force Flag on Register
Forum rules
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Force Flag on Register
Rich,
Is it a big hassle for the Flags Mod, to add a force to choose flag on registration? If it can be done easily and you know how, I will switch from the one I am using as I know the support is bar-none.
Is it a big hassle for the Flags Mod, to add a force to choose flag on registration? If it can be done easily and you know how, I will switch from the one I am using as I know the support is bar-none.
Re: Force Flag on Register
OPEN
language/en/ucp.php
OPEN
includes/ucp/ucp_register.php
OPEN
styles/xxx/template/ucp_register.html
Refresh the style in the ACP and that should do it.
language/en/ucp.php
Find This may be a partial find and not the whole line
Code: Select all
'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.',
Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
// BEGIN National Flags
'CHOOSE_FLAG' => 'Please choose a National Flag',
// END National Flags
OPEN
includes/ucp/ucp_register.php
Find This may be a partial find and not the whole line
Code: Select all
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
//Begin: National_Flag
include($phpbb_root_path . 'includes/functions_flag.' . $phpEx);
//End: National_Flag
Find This may be a partial find and not the whole line
Code: Select all
// Check and initialize some variables if needed
if ($submit)
Add before Add these lines on a new blank line before the preceding line(s) to find
Code: Select all
//Begin: National_Flag
if (!empty($config['allow_flags']))
{
$data['flag'] = request_var('flag', 0);
}
//End: National_Flag
Find This may be a partial find and not the whole line
Code: Select all
if (!check_form_key('ucp_register'))
Add before Add these lines on a new blank line before the preceding line(s) to find
Code: Select all
//Begin: National_Flag
if (!empty($config['allow_flags']))
{
$flag_error = validate_data($data, array('flag' => array('num', false, 1, 300)));
if ($flag_error)
{
$error[] = $user->lang['CHOOSE_FLAG'];
}
}
//End: National_Flag
Find This may be a partial find and not the whole line
Code: Select all
'user_inactive_time' => $user_inactive_time,
);
Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
//Begin: National_Flag
if (!empty($config['allow_flags']))
{
$user_row['user_flag'] = $data['flag'];
}
//End: National_Flag
Find This may be a partial find and not the whole line
Code: Select all
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
Add before Add these lines on a new blank line before the preceding line(s) to find
Code: Select all
//Begin: National_Flag
if (!empty($config['allow_flags']))
{
global $cache;
get_user_flag();
$flags = $cache->get('_user_flags');
$flag_name = '';
if ($data['flag'] && $config['flag_type'] != USER_FLAG_TEXT)
{
$flag_name = $flags[$data['flag']]['flag_image'];
}
unset($flags);
$s_flag_options = list_all_flags($data['flag']);
$template->assign_vars(array(
'S_FLAG_OPTIONS' => $s_flag_options,
'S_FLAGS_ENABLED' => true,
'FLAG_IMAGE' => ($flag_name) ? "{$phpbb_root_path}images/flags/$flag_name" : '',
'FLAG_NAME' => $flag_name,
'AJAX_FLAG_INFO' => append_sid("{$phpbb_root_path}ajax_user_flag.$phpEx", 'flag_id=FLAG_ID'),
));
}
//End: National_Flag
OPEN
styles/xxx/template/ucp_register.html
Find This may be a partial find and not the whole line
Code: Select all
<dl>
<dt><label for="tz">{L_TIMEZONE}:</label></dt>
<dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd>
</dl>
Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
<!-- INCLUDE ucp_user_flag.html -->
Refresh the style in the ACP and that should do it.
Re: Force Flag on Register
Thanks Rich. I will be changing....I'll uninstall the other flag mod and use yours.
Gras....
Gras....
Re: Force Flag on Register
Worked great. Uninstalled the "other" flags program, installed via (AUTOMOD which I don't normally use), and made the above changes also. Worked first time through.
Had to do a FORCE install for the Flags as my edits in viewtop_body.html were a little out of the ordinary. Did a manual edit and it was done.
Many thanks Rich. All is well in Ooopsieville.
Had to do a FORCE install for the Flags as my edits in viewtop_body.html were a little out of the ordinary. Did a manual edit and it was done.
Many thanks Rich. All is well in Ooopsieville.
Re: Force Flag on Register
thanks, installed the flags module earlier, went smooth as silk, just as all the mods I have done from you, and was very happy to see this for registering, worked great, just as I expected
Re: National Flag
Hello Rich,
I have tried installing this Force flag on register mod. http://www.rmcgirr83.org/viewtopic.php?f=5&t=1286&hilit=flag
Now I got a problem. The Choose your country flag on registration page is now double. Please take a look. How do I fix this? TIA!
[img]http://lulzimg.com/i24/e7e2be.png[/img]
I have tried installing this Force flag on register mod. http://www.rmcgirr83.org/viewtopic.php?f=5&t=1286&hilit=flag
Now I got a problem. The Choose your country flag on registration page is now double. Please take a look. How do I fix this? TIA!
[img]http://lulzimg.com/i24/e7e2be.png[/img]
Re: National Flag
You have two of these in the ucp_register.html.
remove one of them and refresh the template in the ACP.
Code: Select all
<!-- INCLUDE ucp_user_flag.html -->
remove one of them and refresh the template in the ACP.
-
- Old member
- Posts: 677
- Joined: 30 Mar 2011, 00:32
- Contact:
Re: Force Flag on Register
Works like a charm ty
Re: Force Flag on Register
when i edited the language/en/ucp.php file i get a load of errors all over the site and don't let me log it
Re: Force Flag on Register
You probably edited the file with a non strict text editor, use Notepad++ to edit the file with and save it with encoding of UTF-8 without BOM.
Re: Force Flag on Register
thanks rich that worked
Re: Force Flag on Register
Problem with Breizh Ajax Checks
[img]http://content.screencast.com/users/DamirMitrovic/folders/Jing/media/9f1e0b2f-dade-4f81-87b5-ddd9b6c04477/2011-11-16_0222.png[/img]
how to get rid this problem?
Thanks
[img]http://content.screencast.com/users/DamirMitrovic/folders/Jing/media/9f1e0b2f-dade-4f81-87b5-ddd9b6c04477/2011-11-16_0222.png[/img]
how to get rid this problem?
Thanks
Re: Force Flag on Register
There is no conflict as I have that mod installed on here as well as forcing to choose a national flag. Double check your edits to the files involved.
-
- Member
- Posts: 98
- Joined: 08 Nov 2011, 22:22
- Contact:
Re: Force Flag on Register
Any hint on how to force this for current users when they edit their profile?
Support requests via PM go straight to /dev/null!
Re: Force Flag on Register
Open includes/ucp/ucp_profile.php
Delete Remove the preceding lines
Code: Select all
//Begin: National_Flag
//Currently set to validate up to 300, if you want more
//flags than 300 change to the amount you want
if (!empty($config['allow_flags']))
{
$validate_array = array_merge($validate_array, array(
'flag' => array('num', true, 0, 300),
));
}
//End: National_Flag
Find This may be a partial find and not the whole line
Code: Select all
$error = validate_data($data, $validate_array);
Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
//Begin: National_Flag
//Currently set to validate up to 300, if you want more
//flags than 300 change to the amount you want
if (!empty($config['allow_flags']))
{
$flag_error = validate_data($data, array('flag' => array('num', false, 1, 300)));
if ($flag_error)
{
$error[] = $user->lang['CHOOSE_FLAG'];
}
}
//End: National_Flag