I would like to default the timezone to a specific standard time for all the users on registration and remove the timezone mandatory field from the "Registration Page". Please help. Thanks.
Thank you very much, this is perfect, exactly what I meant: no timezone-field in registration screen but only adjustable in user-profile!
Great piece of software by the way, I use it for less than 2 weeks now, still solving some issues on the host-side and adjusting the software here and there.
I am planning to rewrite the whole Dutch translation file and I have some ideas for developing components and themes in the future, but I have to study the code and the architecture a bit first and get everything in order on the host-side.
I'll definitely will be back to try and help you out!
Sorry my code had issue you need to replace the original function in your timezone ossn_com;php
file
function time_zone_init(){
if(ossn_isLoggedin()){
$user = ossn_loggedin_user();
if(isset($user->timezone)){
date_default_timezone_set($user->timezone);
}
ossn_add_hook('user', 'default:fields', 'time_zone_only_loggedin');
}
}
Thank you
-I have first flushed and switched off cache, left the website and cleaned browser-cache (Edge)
-Then I added your code and switched off the original code with /* ... */ but the timezonefield was still there
-Then I switched off the last else in your code and the field is gone, the page is working fine
Will that switching off the last else have any consequences for the functionality of the timezone-component? I mean, will I still be able to use it's values in another script later? Or does it break the plugin completely? (I have looked at my user-profiles' settings-page but with or without the else there's no timezone-field there)
The site is here
There are two ways one way to remove is to not to add for non-loggedin users
function time_zone_init(){
if(ossn_isLoggedin()){
$user = ossn_loggedin_user();
if(isset($user->timezone)){
date_default_timezone_set($user->timezone);
}
} else {
ossn_add_hook('user', 'default:fields', 'time_zone_only_loggedin');
}
}
.
I have implemented the code Arsalan gave, but it doesn't remove the timezone-field from the registration page.
I have had several requests to make this easier for people on mobile phones, it's a huge list with large font-size and finding your right timezone is difficult for a lot of people because it is not sorted on timezone but on time.
Is there a way to A: either remove the whole field from the registration-page or B: sort the list on:
1. Continent
2. City
?
Thanks in advance!
Awesome. It worked well. Thank You Arsalan.
Edit components/TimeZone/ossn.com.php
Around 79 to 86 edit
$extrafield = array(
'class' => 'timezone-dropdown',
'name' => 'timezone',
'label' => $label,
'placeholder' => $placeholder,
'display_on_about_page' => false,
'options' => $zones,
'value' => 'Your Value from https://www.php.net/manual/en/timezones.php'
);
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)