📄 changelog.php
字号:
<?phpdefined('WikyBlog') or die("Not an entry point...");global $pageOwner,$dbObject,$lang;$page->displayTitle = $lang['change_log'];$dbObject->links['?'] = 'Change Log';includeFile('search/all.php'); class queryChangeLog extends query{ var $classes; var $day,$month,$year = false; var $unsafeFile = false; var $uncheckedFile = false; function queryChangeLog(){ global $page,$dbInfo,$pageOwner,$lang,$wbTables; $page->css2 =true; $this->rowLimit = 25; $this->classes[] = ' class="tableRowOdd" '; $this->classes[] = ' class="tableRowEven" '; $unix = 'UNIX_TIMESTAMP( '.$wbTables['all_files'].'.`modified` )'; $this->allSelect = array('modified','created','username','ip','flags',$unix=>'unixtime'); $this->infoSelect[] = 'summary'; $this->queryAllFiles(); $this->query .= ' AND '.$wbTables['all_files'].'.owner_id = "'.$pageOwner['user_id'].'" '; $this->query .= ' AND !FIND_IN_SET("hidden", '.$wbTables['all_files'].'.`flags`) '; $this->query .= ' AND !FIND_IN_SET("deleted", '.$wbTables['all_files'].'.`flags`) '; if( isset($_GET['flagged']) ){ $this->query .= ' AND FIND_IN_SET("flag1", '.$wbTables['all_files'].'.`flags`) '; } $this->query .= ' ORDER BY '.$wbTables['all_files'].'.`modified` DESC '; //won't need to specify all_files once completely developed $this->searchUrl = '/Special/'.$pageOwner['username'].'/ChangeLog'; browseSearch3($this,$lang['change_log']); } function mysqlFetch(&$result){ return mysql_fetch_row($result); } function displayPre(){ global $lang; echo '<table cellpadding="2" cellspacing="0" border="0">'; echo '<tr class="tableRows"><th>'.$lang['timeline'].'</th>'; echo '<th colspan="2">'.$lang['file'].'</th>'; echo '<th>'.$lang['user'].'</th>'; echo '<th>'.$lang['edit_summary'].'</th></tr>'; } function displayPost(&$prev,&$pages,&$next){ global $lang; echo '</table>'; $list = ''; $more = ''; if( $this->isOwner ){ $list .= '<li>'; if( isset($_GET['flagged']) ){ $list .= wbLinks::local($this->searchUrl,$lang['all']); $list .= ' <strong>'.$lang['flagged'].'</strong>'; }else{ $list .= '<strong>'.$lang['all'].'</strong> '; $list .= wbLinks::local($this->searchUrl.'?flagged=true',$lang['flagged']); } $list .= '</li>'; } if( $this->unsafeFile || $this->uncheckedFile){ $more .= '<p>'; if( $this->unsafeFile ){ $more .= '<img src="'.wbLinks::getDir('/imgs/icons/bullet_error.gif').'" border="0" width="16" height="16" style="vertical-align:middle" alt="Error" title="Syntax Error" /> '.$lang['indicates_syntax_error']; if( $this->uncheckedFile ){ $more.= '<br/>'; } } if( $this->uncheckedFile ){ $more .= '<img src="'.wbLinks::getDir('/imgs/icons/bullet_flag_yellow.gif').'" border="0" width="16" height="16" style="vertical-align:middle" alt="Unchecked" title="Unchecked"/> '.$lang['indicates_unchecked']; } $more .= '</p>'; } parent::displayPost($prev,$pages,$next,$list,$more); } function abbrevOutput(&$row,$i){ global $lang; $this->queryAllResult($row); $this->isOwner = isOwner(); //Format For Display $unixTime =& $row['unixtime']; $month = date('ym',$unixTime); $day = date('ymj',$unixTime); //////// 1) format the timeline dates $dateTime = dbFromDate($row['modified'],array('H',':','i')); if( $this->day !== $day){ $dateTime = dbFromDate($row['modified'],array('D',' ','j')).', '.$dateTime; if( $this->month !== $month ){ $dateTime = '<div style="text-align:left"><b>'.dbFromDate($row['modified'],array('Y',' ','M')).'</b></div> '.$dateTime; } } $this->month = $month; $this->day = $day; //////// 2) For Odd rows $class3 = $this->classes[($i%2)]; //////// 3) Echo a row echo '<tr><td class="historyTimeline"><span class="historyTime">'; echo $dateTime; echo '</span></td>'; echo '<td '.$class3.' style="white-space:nowrap;padding:0 !important;">'; if( $this->isOwner ){ if( strpos($row['flags'],'flag1') !== false){ $this->uncheckedFile = true; echo '<img src="'.wbLinks::getDir('/imgs/icons/bullet_flag_yellow.gif').'" border="0" width="16" height="16" style="vertical-align:middle" alt="Unchecked" title="Unchecked"/>'; }else{ echo '<img src="'.wbLinks::getDir('/imgs/blank.gif').'" border="0" width="16" height="16" style="vertical-align:middle" alt="" />'; } } if( strpos($row['flags'],'safe') === false){ $this->unsafeFile = true; echo '<img src="'.wbLinks::getDir('/imgs/icons/bullet_error.gif').'" border="0" width="16" height="16" style="vertical-align:middle" alt="Error" title="Syntax Error" />'; }else{ //echo '<img src="'.wbLinks::getDir('/imgs/blank.gif').'" border="0" width="16" height="16" style="vertical-align:middle" alt="" /> '; } echo '</td>'; echo '<td '.$class3.' style="white-space:nowrap">'; ////// DB method of creating links if( $row['modified'] != $row['created']){ echo '('.wbLinks::local('/Edit'.$row['uniqLink'].'?cmd=difference',$lang['diff'],'title="'.$lang['DIFF_TITLE'].'"').') '; }else{ echo '('.$lang['new'].') '; } echo ' .. '; if( strpos($row['flags'],'redirect') === false){ echo wbLinks::local($row['uniqLink'],toDisplay($row['dTitle'],30),' title="'.toDisplay($row['dTitle']).'"'); }else{ echo wbLinks::local($row['uniqLink'].'?cmd=showOriginal',toDisplay($row['dTitle'],30),' title="'.toDisplay($row['dTitle']).'"'); } echo '</td><td '.$class3.'>'; if( !empty($row['username']) ){ echo wbLinks::local('/'.$row['username'].'/Home',$row['username']); }else{ echo $row['ip']; } if( isset($_SESSION['username']) ){ if($_SESSION['username'] != $row['username']){ $guest = $row['username']; if( empty($row['username']) ){ $guest = $row['ip']; } if( !empty($row['username']) ){ echo ' <span class="sm">'; echo wbLinks::special('Permissions?guest='.$guest,'+/-','title="'.$lang['SET_USER_PERMISSIONS'].$guest.'"',$_SESSION['username']); echo '</span>'; } } } echo '</td><td '.$class3.'><span class="sm">'; echo $row['summary']; echo ' </span></td></tr>'; }}new queryChangeLog();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -