Loading...
 
Skip to main content

Architecture / Installation


How I changed the Users Preferences Defaults

Some of my new users were asking the same questions over and over. Why can't people send me PMs?, Why can't people click my name and request friendship? The answers were simple - they just needed to change some of the default values in their user preferences. After I had to tell the fourth person how to change their profile from private to public I decided to change the defaults for new users.

If this is in the documentation somewhere - I missed it. Here is how I did it:

  1. I used my FTP application to get to the root directory of my TW install.
  2. I moved a copy of the file tiki-register.php over to my desktop
  3. I've set .php and .tpl files to open with notepad by default so I double-clicked the file to edit it
  4. I scrolled down to the section marked "// save default user preferences"
User Defaults
// save default user preferences

$tikilib->set_user_preference($_REQUEST%22name%22, 'theme', $style);
$tikilib->set_user_preference($_REQUEST%22name%22, 'userbreadCrumb', 4);
$tikilib->set_user_preference($_REQUEST%22name%22, 'language', $language);
$tikilib->set_user_preference($_REQUEST%22name%22, 'display_timezone', 'Local');
$tikilib->set_user_preference($_REQUEST%22name%22, 'user_information', 'public');
$tikilib->set_user_preference($_REQUEST%22name%22, 'user_dbl', 'n');
$tikilib->set_user_preference($_REQUEST%22name%22, 'diff_versions', 'n');
$tikilib->set_user_preference($_REQUEST%22name%22, 'show_mouseover_user_info', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'email is public', 'n');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mailCharset', 'utf-8');
$tikilib->set_user_preference($_REQUEST%22name%22, 'realName', '');
$tikilib->set_user_preference($_REQUEST%22name%22, 'homePage', '');
$tikilib->set_user_preference($_REQUEST%22name%22, 'lat', floatval(0));
$tikilib->set_user_preference($_REQUEST%22name%22, 'lon', floatval(0));
$tikilib->set_user_preference($_REQUEST%22name%22, 'country', '');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mess_maxRecords', 10);
$tikilib->set_user_preference($_REQUEST%22name%22, 'mess_archiveAfter', 0);
$tikilib->set_user_preference($_REQUEST%22name%22, 'mess_sendReadStatus', 'n');
$tikilib->set_user_preference($_REQUEST%22name%22, 'minPrio', 6);
$tikilib->set_user_preference($_REQUEST%22name%22, 'allowMsgs', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_pages', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_blogs', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_gals', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_msgs', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_tasks', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_items', 'y');
$tikilib->set_user_preference($_REQUEST%22name%22, 'mytiki_workflow', 'y');

$tikilib->set_user_preference($_REQUEST%22name%22, 'tasks_maxRecords', 10);


4. This is where I changed User Information to "Public", Show Mouseover to "y", allow messages to "Y", and set all the mytiki defaults to "Y".
5. Once I saved the file to my desktop I used my FTP program to rename the original tiki-register.php to tiki-register-old.php - never write over an existing file with your changed file without making a backup of the original
6. Then I uploaded the file and registered as a new user to test the defaults.

> Another solution is to simply edit the values in your tiki-preferences database table.
>
> HTH,
>
> -RickQuestion

True - that works if you are comfortable mucking around with MySql. That's actually where I started, but was too nervous about breaking something to use trial and error to change default values.

The other issue with changing the .php file is that if that file is replaced in future upgrades of TW, then you'll have to make the changes again in the new file. Whereas a change to the tiki-preferences database table would be permanant.


For your information, in tikwiki1.10 (the next release), you can do it from the panel admin->login