📄 preferences.php
字号:
//Max History Rows global $maxHistory; $personalMax = ''; if( empty($maxHistory) ){ $max = $lang['unlimited']; }else{ $max = $maxHistory; } if( empty($defaultUser['maxHistory']) ){ if( is_numeric($max) ){ $defaultMax = $max; }else{ $defaultMax = 'Unlimited'; } }else{ $defaultMax = $defaultUser['maxHistory']; } if( empty($_SESSION['maxHistory']) ){ if( is_numeric($defaultMax) ){ $personalMax = $defaultMax; } }else{ $personalMax = $_SESSION['maxHistory']; } ?> <br> <table class="tableRows" width="100%" border="0"> <tr><th colspan="3"><?php echo $lang['user'] ?></th></tr> <tr><td><?php echo $lang['email'] ?>:</td><td> <input size="30" name="email" value="<?php echo $_SESSION['email'] ?>" type="text" /> </td><td class="row2"><?php echo $lang['EMAIL_PREFS'] ?></td></tr> <tr><td><?php echo $lang['language'] ?>:</td><td> <?php echo formSelect('lang',$this->getPossible('lang'),$_SESSION['lang']); ?> </td><td class="row2"><?php echo $lang['LANG_PREFS'] ?></td></tr> <tr><td><?php echo $lang['time_zone'] ?>:</td><td> <input size="6" name="timezone" value="<?php echo $_SESSION['timezone'] ?>" type="text" /> </td><td class="row2"><?php echo $lang['TIME_ZONE_PREFS'] ?> <div style="width:18em;margin-left:auto;margin-right:auto;white-space:nowrap"> <?php echo wbLang::text('TIME_ZONE_PREFS2', $serverTime,$adjustedTime) ?> </div> </td></tr> <tr><td><?php echo $lang['sig'] ?>:</td><td> <textarea rows="3" style="width:98%" name="sig"><?php echo $_SESSION['sig']; ?></textarea> </td><td class="row2"><?php echo $lang['SIGNATURE'] ?> </td></tr> <tr><th colspan="3"><?php echo $lang['javascript'] ?></th></tr> <tr><td><?php echo $lang['javascript'] ?>:</td><td> <?php echo formSelect('ajax',$this->values['bool2'],$_SESSION['ajax']) ?> </td><td class="row2"> <?php echo $lang['JAVASCRIPT_PREFS'] ?> </td></tr> <tr><td><?php echo $lang['tab_limit'] ?>:</td><td> <input size="6" name="nTabs" value="<?php echo $_SESSION['nTabs'] ?>" type="text" /> </td><td class="row2"> <?php echo $lang['TAB_LIMIT'] ?> </td></tr> <tr><td><?php echo $lang['nWin'] ?>:</td><td> <?php echo formSelect('nWin',$this->values['bool'],$_SESSION['nWin']) ?> </td><td class="row2"> <?php echo $lang['EXTERNAL_LINKS']; ?> </td></tr> <tr><th colspan="3"><?php echo $lang['template'] ?></th></tr> <tr><td><?php echo $lang['pTemplate'] ?>:</td><td> <?php $this->pTemplates(); ?> </td><td class="row2"><?php /*echo $lang['LANG_PREFS']*/ ?></td></tr> <?php if( !isset($wbWritable) || $wbWritable === true){ echo '<tr><td>'. $lang['custom_template'] .':</td><td>'; $script = ' onchange="this.form.pTemplate.value=\'\'" '; if( is_array($template) ){ echo '<input '.$script.' size="30" name="template" value="'. $template['templateName'].'" type="text" /><br>'; echo '</td><td class="row2">'; $link1 = wbLinks::local('/Template/'.$template['templateName'],false); echo wbLang::text('VIEW_TEMPLATE',$link1,'</a>'); }else{ echo '<input '.$script.' size="30" name="template" value="" type="text" /><br>'; echo '</td><td class="row2">'; } echo '</td></tr>'; } ?> <tr><th colspan="3"><?php echo $lang['account_display'] ?></th></tr> <tr><td><?php echo $lang['home_title'] ?>:</td><td> <input size="30" name="homeTitle" value="<?php echo $_SESSION['homeTitle'] ?>" type="text" /> </td><td class="row2"><?php echo $lang['HOME_TITLE_PREFS'] ?></td></tr> <tr><td style="white-space:nowrap"><?php echo $lang['quick_comment']; ?>:</td><td> <?php echo formSelect('quickComment',$this->values['bool'],$_SESSION['quickComment']) ?> </td><td class="row2"><?php echo $lang['QUICK_COMMENT']; ?></td></tr> <tr><td style="white-space:nowrap"><?php echo $lang['share'] ?>:</td><td> <?php // sharing echo formSelect('share',$this->values['bool'],$_SESSION['share']); ?> </td><td class="row2"><?php echo $lang['SHARE'] ?></td></tr> <tr><th colspan="3"><?php echo $lang['blog'] ?></th></tr> <tr><td style="white-space:nowrap"><?php echo $lang['blog_styled_frontpage'] ?>:</td><td> <?php // isBlog echo formSelect('isBlog',$this->values['bool'],$_SESSION['isBlog']) ?> </td><td class="row2"><?php echo $lang['BLOG_PREFS'] ?></td></tr> <tr><td style="white-space:nowrap"><?php echo $lang['blogT'] ?>:</td><td> <?php // isBlog echo formSelect('blogT',$this->values['blogT'],$_SESSION['blogT']) ?> </td><td class="row2"><?php echo $lang['BLOG_TYPE'] ?></td></tr> <tr><td style="white-space:nowrap"><?php echo $lang['selective_blogging'] ?>:</td><td> <?php // sBlog echo formSelect('sBlog',$this->values['bool'],$_SESSION['sBlog'],'showSBOptions'); ?> </td><td class="row2"><?php echo $lang['SELECTIVE_BLOGGING'] ?></td></tr> <?php if( isset($_SESSION['sBlog']) && ($_SESSION['sBlog'] == 'On') ){ echo '<tr id="WBPrefUpdateServices">'; }else{ echo '<tr id="WBPrefUpdateServices" style="display:none">'; } echo '<td>'; echo $lang['uServices']; ?> :</td> <td colspan="2"> <?php echo $lang['UPDATE_SERVICES']; ?> <p> <textarea rows="5" style="width:98%" name="uServices"><?php echo $_SESSION['uServices']; ?></textarea> </p> </td></tr> <tr><th colspan="3"><?php echo $lang['editing'] ?></th></tr> <tr><td><?php echo $lang['textarea rows'] ?>:</td><td> <input size="4" name="textareaY" value="<?php echo $_SESSION['textareaY'] ?>" type="text" /> </td><td class="row2"><?php echo $lang['TEXTAREA_ROWS_PREFS'] ?></td></tr> <tr><td style="white-space:nowrap"><?php echo $lang['history_rows'] ?>:</td><td> <input size="4" name="maxHistory" value="<?php echo $personalMax; ?>" type="text" /> </td><td class="row2"> <?php echo $lang['HISTORY_ROWS_PREFS'] ?> <div style="width:18em;margin-left:auto;margin-right:auto;white-space:nowrap"> <?php echo wbLang::text('HISTORY_ROWS_PREFS2',$defaultMax,$max) ?> </div> </td></tr> <tr><td style="white-space:nowrap"><?php echo $lang['fEdits'] ?>:</td><td> <?php echo formSelect('fEdits',$this->values['fEdits'],$_SESSION['fEdits']); ?> </td><td class="row2"><?php echo $lang['FLAG_EDITS'] ?></td></tr> <tr><td></td><td> <input type="hidden" name="cmd" value="Save Preferences" /> <input type="submit" value="<?php echo $lang['save_preferences'] ?>" accessKey="s" /> <input type="reset" value="<?php echo $lang['reset'] ?>" /> </td></tr> </table> <?php } /////////////////////////////////// // // Select for pTemplates // function pTemplates(){ global $lang; includeFile('themes/data.php'); $this->themes = returnThemeData(); $currTheme = false; echo '<select name="pTemplate">'; foreach($this->themes as $theme => $colors){ if( $currTheme ){ echo '</optgroup>'; } echo '<option value="" ></option>'; if( isset($lang['themes'][$theme]) ){ echo '<optgroup label="'.$lang['themes'][$theme].'" title="'.$lang['themes'][$theme].'">'; }else{ echo '<optgroup label="'.$theme.'" title="'.$theme.'">'; } foreach($colors as $color => $array){ if( $color == 'html'){ continue; } $full = $theme.'/'.$color; if( $full == $_SESSION['pTemplate'] ){ echo '<option value="'.$full.'" selected="selected" >'.$lang['colors'][$color].'</option>'; }else{ echo '<option value="'.$full.'" >'.$lang['colors'][$color].'</option>'; } } } echo '</optgroup>'; echo '</select>'; } function setPref($array){ global $page,$pageOwner,$lang,$dbObject; $page->formAction = '/Special/'.$pageOwner['username'].'/Preferences'; echo $lang['CONFIRM_CHANGE']; echo '<table class="tableRows" cellspacing="0">'; echo '<tr><th>'.$lang['preference'].'</th><th>'.$lang['old_value'].'</th><th>'.$lang['new_value'].'</th></tr>'; $i = 0; $classes[] = ' class="tableRowOdd" '; $classes[] = ' class="tableRowEven" '; foreach($array as $key => $value){ if( !array_key_exists($key,$this->emptyPrefs) ){ continue; } $i++; echo '<tr'.$classes[($i%2)].'><td>'.toDisplay($key); echo '</td><td>'; if( isset($_SESSION[$key]) ){ echo $_SESSION[$key]; }else{ echo ' '; } echo '</td><td>'.$value; echo '<input type="hidden" name="'.$key.'" value="'.$value.'" />'; echo '</td></tr>'; } echo '</table>'; echo '<input type="hidden" name="cmd" value="Save Preferences" />'; echo '<input type="submit" value="'. $lang['save_preferences'] .'" accessKey="s" />'; echo '<input type="submit" name="cmd" value="'.$lang['cancel'].'" />'; } /////////////////////////////////// // // get possible value // //Get an array of available languages function getPossible($dir){ global $includeDir,$lang; $array = array(); $langDir = $includeDir.'/'.$dir; if($dh = @opendir($langDir)){ while (($file = readdir($dh)) !== false){ if( strpos($file,'.') === 0){ continue; } if( strpos($file,'x_') === 0){ continue; } $fullPath = $langDir.'/'.$file; if( !is_dir($fullPath) ){ continue; } $array[$file] = $lang[$dir][$file]; } } asort($array); return $array; } }new specPreferences();// similar to functions in searchSearch.php, specPreferences.phpfunction formSelect($name,$values,$selected=null,$onchange=false){ if( !$onchange ){ $select = '<select name="'.$name.'">'; }else{ $select = '<select name="'.$name.'" onchange="'.$onchange.'(this)">'; } foreach($values as $key => $value){ if($key == $selected){ $focus = ' selected '; }else{ $focus = ''; } // if( is_numeric($key) ){ // $key = ''; // } $select .= '<option value="'.$key.'" '.$focus.'>'.$value.'</option>'; } $select .= '</select>'; return $select;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -