plugins/SpecialUserPrefs.php
changeset 175 1465f48faba0
parent 140 40f7fa5fd061
child 192 9237767a23ae
equal deleted inserted replaced
174:4c5c2b66a34d 175:1465f48faba0
    98 function userprefs_menu_init()
    98 function userprefs_menu_init()
    99 {
    99 {
   100   global $db, $session, $paths, $template, $plugins; // Common objects
   100   global $db, $session, $paths, $template, $plugins; // Common objects
   101   global $userprefs_menu_links;
   101   global $userprefs_menu_links;
   102   
   102   
   103   userprefs_menu_add('Profile/membership', 'Edit e-mail address and password', makeUrlNS('Special', 'Preferences/EmailPassword'));
   103   userprefs_menu_add('Profile/membership', 'Edit e-mail address and password', makeUrlNS('Special', 'Preferences/EmailPassword') . '" onclick="ajaxLoginNavTo(\'Special\', \'Preferences/EmailPassword\', '.USER_LEVEL_CHPREF.'); return false;');
   104   userprefs_menu_add('Profile/membership', 'Edit signature', makeUrlNS('Special', 'Preferences/Signature'));
   104   userprefs_menu_add('Profile/membership', 'Edit signature', makeUrlNS('Special', 'Preferences/Signature'));
   105   userprefs_menu_add('Profile/membership', 'Edit public profile', makeUrlNS('Special', 'Preferences/Profile'));
   105   userprefs_menu_add('Profile/membership', 'Edit public profile', makeUrlNS('Special', 'Preferences/Profile'));
   106   userprefs_menu_add('Private messages', 'Inbox', makeUrlNS('Special', 'PrivateMessages/Folder/Inbox'));
   106   userprefs_menu_add('Private messages', 'Inbox', makeUrlNS('Special', 'PrivateMessages/Folder/Inbox'));
   107   userprefs_menu_add('Private messages', 'Outbox', makeUrlNS('Special', 'PrivateMessages/Folder/Outbox'));
   107   userprefs_menu_add('Private messages', 'Outbox', makeUrlNS('Special', 'PrivateMessages/Folder/Outbox'));
   108   userprefs_menu_add('Private messages', 'Sent items', makeUrlNS('Special', 'PrivateMessages/Folder/Sent'));
   108   userprefs_menu_add('Private messages', 'Sent items', makeUrlNS('Special', 'PrivateMessages/Folder/Sent'));
   300         
   300         
   301   switch ( $section )
   301   switch ( $section )
   302   {
   302   {
   303     case 'Home':
   303     case 'Home':
   304       global $email;
   304       global $email;
   305       $user_page = '<a href="' . makeUrlNS('User', str_replace(' ', '_', $session->username)) . '">user page</a> <sup>(<a href="' . makeUrlNS('User', str_replace(' ', '_', $session->username)) . '#do:comments">comments</a>)</sup>';
   305       $userpage_id = $paths->nslist['User'] . sanitize_page_id($session->username);
       
   306       $userpage_exists = ( isPage($userpage_id) ) ? '' : ' class="wikilink-nonexistent"';
       
   307       $user_page = '<a href="' . makeUrlNS('User', sanitize_page_id($session->username)) . '"' . $userpage_exists . '>user page</a> <sup>(<a href="' . makeUrlNS('User', str_replace(' ', '_', $session->username)) . '#do:comments">comments</a>)</sup>';
   306       $site_admin = $email->encryptEmail(getConfig('contact_email'), '', '', 'administrator');
   308       $site_admin = $email->encryptEmail(getConfig('contact_email'), '', '', 'administrator');
       
   309       $make_one_now = '<a href="' . makeUrlNS('User', sanitize_page_id($session->username)) . '">make one now</a>';
   307       echo "<h3 style='margin-top: 0;'>$session->username, welcome to your control panel</h3>";
   310       echo "<h3 style='margin-top: 0;'>$session->username, welcome to your control panel</h3>";
   308       echo "<p>Here you can make changes to your profile, view statistics on yourself on this site, and set your preferences.</p>
   311       echo "<p>Here you can make changes to your profile, view statistics on yourself on this site, and set your preferences.</p>
   309             <p>If you have not already done so, you are encouraged to make a $user_page and tell the other members of this site a little about yourself.</p>
   312             <p>Your $user_page is your free writing space. You can use it to tell the other members of this site a little bit about yourself. If you haven't already made a user page, why not $make_one_now?</p>
   310             <p>Use the menu at the top to navigate around. If you have any questions, you may contact the $site_admin.";
   313             <p>Use the menu at the top to navigate around. If you have any questions, you may contact the $site_admin.";
   311       break;
   314       break;
   312     case 'EmailPassword':
   315     case 'EmailPassword':
   313       
   316       
   314       $errors = trim($errors);
   317       $errors = trim($errors);