⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 history.php

📁 一款基于PHP的网络日记程序。WikyBlog支持:多用户的 BLOG
💻 PHP
字号:
<?php//$lang checkeddefined('WikyBlog') or die("Not an entry point...");//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////					HISTORY LISTS//		includeFile('search/all.php');		class queryHistory extends query{		var $classes;				var $month,$day = false;				function queryHistory(){			global $page,$dbInfo,$dbObject,$pageOwner,$maxHistory,$defaultUser,$lang,$wbTables;						if( !$dbObject->exists ){				message('NON_EXISTANT');				return;			}									$page->css2 = true;			$page->formMethod = 'get';			$page->formAction = $this->searchUrl = '/Edit'.$dbObject->uniqLink;								if( !empty($pageOwner['maxHistory']) ){				$this->maxRows = $pageOwner['maxHistory'];							}elseif( !empty($defaultUser['maxHistory']) && !empty($maxHistory) ){				$this->maxRows = $defaultUser['maxHistory'];			}else{				$this->maxRows = $maxHistory;			}						$this->classes[] = ' class="tableRowEven" ';			$this->classes[] = ' class="tableRowOdd" ';			$this->rowLimit = 25;						$this->query = ' SELECT SQL_CALC_FOUND_ROWS *, UNIX_TIMESTAMP(`modified`) as `unixtime` FROM '.$wbTables['all_history'].' WHERE ';			$this->query .= ' `file_id` = '.$dbObject->file_id;			$this->query .= ' ORDER BY revision DESC';			browseSearch3($this,$lang['history']);		}		function mysqlFetch(&$result){			return mysql_fetch_object($result);		}		function displayEmpty(){			return true;		}				function displayPre(){			global $page,$dbObject,$lang,$jsNum;			//$page->scripts[] = '/include/'.$jsNum.'/history.js';						echo '<table cellpadding="2" cellspacing="0" border="0" width="100%">';			echo  '<tr class="tableRows"><th>'.$lang['timeline'].'</th><th colspan="2">'.$lang['revision'].'</th><th>'.$lang['user'].'</th><th>'.$lang['summary'].'</th></tr>';			$dbObject->unixtime = dbFromDate($dbObject->modified,4);			$this->abbrevOutput($dbObject,'current');		}				function abbrevOutput(&$row,$i){			global $page,$pageOwner,$dbObject;			global $lang;									$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;				//	3)	Echo a row			if( $i == $lang['current'] && isset($_GET['offset']) ){				$class3 = $this->classes[($_GET['offset']%2)];			}else{				$class3 = $this->classes[($i%2)];			}			echo '<tr><td class="historyTimeline" style="vertical-align:bottom"><span class="historyTime">';			echo $dateTime;			echo '</span></td>';				echo '<td '.$class3.' style="white-space:nowrap">';			$checked = '';			if( $i == 'current' ){				$checked = ' checked="checked" ';				echo $lang['current'];			}else{				echo $row->revision;			}			echo '</td><td '.$class3.' style="white-space:nowrap"> ';			//echo '<input type="radio" name="revNum1" value="'.$row->revision.'" '.$checked.' onFocus="radioFocus(this)" />';			//echo '<input type="submit" name="cmd['.$row->revision.']" value="'.$lang['compare'].'" title="'.$lang['COMPARE_REVISONS'].'" onMouseOver="histList(this)" />';			echo '<input type="radio" name="revNum1" value="'.$row->revision.'" '.$checked.' /> ';			echo '<input type="submit" name="cmd['.$row->revision.']" value="'.$lang['compare'].'" title="'.$lang['COMPARE_REVISONS'].'" />';						if( $i == 'current' ){				//echo wbLinks::local($dbObject->uniqLink,$lang['show']); .. won't be right for templates							}elseif( is_numeric($row->revision) ){				if( isset($dbObject->dbInfo['xmlHTTP']) && $dbObject->dbInfo['xmlHTTP'] == 0){					echo wbLinks::local('/Edit'.$dbObject->uniqLink.'?cmd=editRevision&revNum='.$row->revision,$lang['edit_revision'],'name="noxml"');				}else{					echo wbLinks::local('/Edit'.$dbObject->uniqLink.'?cmd=show&revNum='.$row->revision,$lang['show']);				}			}						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'].$row->username.'"',$_SESSION['username']);						echo '</span>';					}				}			}									echo '</td><td '.$class3.'><span class="sm">';			echo $row->summary;			echo '&nbsp;</span></td></tr>';		}		function displayPost(&$prev,&$pages,&$next){			echo '</table>';			parent::displayPost($prev,$pages,$next);		}	}//end class			new queryHistory();////					HISTORY LISTS//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -