Changeset 5

Show
Ignore:
Timestamp:
2007-11-21 11:43:50 (5 years ago)
Author:
hannes
Message:

introduced suggestions for the path variables ([3]) based on PHP environment variables

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/classes/pages/Settings.php

    r3 r5  
    141141                $form->addTableRow($LANG['SQL_Database'], 'text', 'newdbname', $SETTINGS['dbname']); 
    142142                $form->addTableRow($LANG['SQL_Database_Table_Prefix'], 'text', 'newdbtableprefix', $SETTINGS['dbtableprefix']); 
    143                 $form->addTableRow($LANG['Filesystem_Path'], 'text', 'newfspath', $SETTINGS['fspath']); 
    144                 $form->addTableRow($LANG['Webserver_Path'], 'text', 'newwebpath', $SETTINGS['webpath']); 
     143                $_fspath = substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/') - 5); 
     144                if ($_fspath != $SETTINGS['fspath']) { 
     145                    // highlight this if it differs from the current setting 
     146                    $_class = 'suggestion-highlight'; 
     147                } else { 
     148                    $_class = 'suggestion'; 
     149                } 
     150                $form->addRawTableRow(Array('<td>' . $LANG['Filesystem_Path'] . '<br /><span class="' . $_class . '">' . $LANG['Suggestion'] . ': ' . $_fspath . '</span></td>', '<td><input type="text" name="newfspath" value="' . $SETTINGS['fspath'] . '" /></td>')); 
     151                $_webpath = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') - 5); 
     152                if ($_webpath != $SETTINGS['webpath']) { 
     153                    // highlight this if it differs from the current setting 
     154                    $_class = 'suggestion-highlight'; 
     155                } else { 
     156                    $_class = 'suggestion'; 
     157                } 
     158                $form->addRawTableRow(Array('<td>' . $LANG['Webserver_Path'] . '<br /><span class="' . $_class . '">' . $LANG['Suggestion'] . ': ' . $_webpath . '</span></td>', '<td><input type="text" name="newwebpath" value="' . $SETTINGS['webpath'] . '" /></td>')); 
    145159                $form->addTableRow($LANG['Board_Name'], 'text', 'newforumname', $SETTINGS['forumname']); 
    146160                $form->addTableRow($LANG['Board_Slogan'], 'text', 'newslogan', $SETTINGS['slogan']); 
  • trunk/includes/lang/en.php

    r3 r5  
    182182$LANG['Banning'] = 'Banning'; 
    183183$LANG['Registration'] = 'Registration'; 
     184$LANG['Suggestion'] = 'Suggestion'; 
    184185 
    185186/* multi-word statements */ 
  • trunk/includes/session.php

    r3 r5  
    2828    ini_set('session.save_path', $SETTINGS['fspath'] . 'sessions'); 
    2929    // session valid for whole board 
    30     ini_set('session.cookie_path', $SETTINGS['fspath']); 
     30    ini_set('session.cookie_path', $SETTINGS['webpath']); 
    3131    // name of the session variable 
    3232    ini_set('session.name', 's'); 
  • trunk/includes/styles/default.css

    r1 r5  
    545545} 
    546546 
     547.suggestion { 
     548    font-size:8px; 
     549    color:#0a0; 
     550} 
     551 
     552.suggestion-highlight { 
     553    font-size:8px; 
     554    color:#a00; 
     555} 
     556 
    547557a:link { 
    548558    text-decoration:none;