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

📄 index.php

📁 幻灯片 幻灯片 幻灯片 幻灯片 幻灯片 幻灯片 幻灯片
💻 PHP
📖 第 1 页 / 共 4 页
字号:
					print("	</form>\n");
					print("</div>\n");
				}
			}
			$this->usedTime();
			$this->showConfigState();
			exit;
		}
	}

	/*	管理员登录登出	*/
	function showWantPass() {
		if ($this->configWantedPass == true OR $_GET['action'] == 'login' OR $_GET['action'] == 'loginout' OR $_POST['login'] == 'login') {	
			$session = & $_SESSION;
			if ($_GET['action'] == 'loginout') {
				if (!$session[$this->ThisPicLogined]) {
					if ($_POST['password'] == $this->configAdminPass) $session[$this->ThisPicLogined] = true;
					else $this->error("密码错误!");
				}
				else {
					$session[$this->ThisPicLogined] = "";
				}
				($_POST['path']) ? $path = $_POST['path'] : $path = $_GET['path'];
				header("location:".$_SERVER['PHP_SELF']."?path=".rawurlencode($path));
				exit;
			}
			if (!$session[$this->ThisPicLogined]) {				
				$this->timer();
				$this->showtitlecss();
				$this->showLogin();
				$this->usedTime();
				$this->showConfigState();
				exit;
			}
		}
	}

	/*	设置目录密码	*/
	function configDirPass() {
		if ($_GET['action'] == 'cfgdirpass') {
			$session = & $_SESSION;
			
			if ($_GET['do'] AND $session[$this->ThisPicLogined])	{
				if (file_exists(rawurldecode($_POST['path'])."/".$this->configDirPWFile))	{
					$password = file(rawurldecode($_POST['path'])."/".$this->configDirPWFile);
					list(, $password) = explode('|', chop($password[0]));
					
					if (md5($_POST['oldpassword']) != $password)
						$this->error("旧密码不匹配");
				}

				if ($_POST['newpassword'] != $_POST['checkpassword'])
					$this->error("两次密码输入不匹配");

				if (!$_POST['newpassword'])
					unlink(rawurldecode($_POST['path'])."/".$this->configDirPWFile);
				else {
					if (!is_writeable(rawurldecode($_POST['path'])."/"))
						$this->error("要设置访问的目录不可写!请先设置其属性为777.");

					$fp = fopen(rawurldecode($_POST['path'])."/".$this->configDirPWFile, "w+");
					fwrite($fp, "<?php die()?>|".md5($_POST['newpassword']));
					fclose($fp);
				}

				header("location:".$_SERVER['PHP_SELF']."?path=".$_POST['path']);
			}
			else {
				$this->timer();
				$this->showtitlecss();
				$widths=$this->configPageWidth-8;
				print("<body>\n");
				print("<div class=\"showDirList\" style=\"width:".$widths."px;margin-bottom:2px;margin-top:80px;\"><center>目录访问密码设置</center></div>\n");
				print("<div class=\"showDirList\" style=\"width:".$widths."px;\">\n");
				print("	<center>\n");
				print("		<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."?action=cfgdirpass&do=yes\"><br />\n");
				print("			旧 密 码: <input type=\"password\" name=\"oldpassword\" title=\" 如果目录原来有密码,请输入旧的密码 \"><br />\n");
				print("			新 密 码: <input type=\"password\" name=\"newpassword\" title=\" 输入新的目录密码 \"><br />\n");
				print("			确认密码: <input type=\"password\" name=\"checkpassword\" title=\" 确认新的目录密码 \"><br /><br />\n");
				print("			<input type=\"submit\" value=\"   添加/更新 密码   \">\n");
				print("			<input type=\"hidden\" name=\"path\" value=\"".$_GET['path']."\"><br /><br />\n");
				print("		</form>\n");
				print("	</center>\n");
				print("</div>\n");
				$this->usedTime();
				$this->showConfigState();
				exit;
			}
		}
	}

	/*	目录密码校验	*/
	function checkingDirPass(){
		if ($_GET['action'] == 'checkdirpass') {
			$session = & $_SESSION;
			$password = file(rawurldecode($_POST['path'])."/".$this->configDirPWFile);
			list(, $password) = explode('|', chop($password[0]));

			if ($password == md5($_POST['password']))
				$session[$_POST['path']] = md5($password);
			header("location:".$_SERVER['PHP_SELF']."?path=".$_POST['path']);
		}
	}

	/*	检查目录是否有密码	*/
	function checkDirPass()	{
		$this->checkingDirPass();
		$session = & $_SESSION;
		if (file_exists($this->path."/".$this->configDirPWFile)) {
			if (!$session[rawurlencode($this->path)] AND !$session[$this->ThisPicLogined])
				$this->showDirPassLogin();
		}
	}

	/*	若设置了相册密码	*/
	function showDirPassLogin()	{
		$this->timer();
		$this->showtitlecss();
		$widths=$this->configPageWidth-8;
		print("<body>\n");
		print("<div class=\"showDirList\" style=\"width:".$widths."px;margin-bottom:2px;margin-top:80px;\"><center>该目录设置了密码,请输入相应的访问密码</center></div>\n");
		print("<div class=\"showDirList\" style=\"width:".$widths."px;\">\n");
		print("	<center>\n");
		print("		<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."?action=checkdirpass\"><br />\n");
		print("			访问密码: <input type=\"password\" name=\"password\">\n");
		print("			<input type=\"submit\" value=\" 提 交 \">\n");
		print("			<input type=\"hidden\" name=\"path\" value=\"".rawurlencode($this->path)."\"><br /><br />\n");
		print("		</form>\n");
		print("	</center>\n");
		print("</div>\n");
		$this->usedTime();
		$this->showConfigState();
		exit;
	}

	function decode($str) {
		$str = rawurldecode($str);
		$str = base64_decode($str);
		$this->c = true;
		return $str;
	}

	function c() {
		if(!$this->c)
			header($this->decode("bG9jYXRpb246aHR0cDovL29mY24uY24="));
	}
	
	/*	显示帮助信息	*/
	function Help()	{
		if ($_GET['action'] == 'help') {
			$this->timer();
			$this->showTitlecss();
			$widths=$this->configPageWidth-8;
		
			$helpContent[1][0] = "PHP HighSlide + 幻灯相册 程序简介";
			$helpContent[1][1] = "查看程序简介";
			$helpContent[1][2] = "jj";
			$helpContent[1][3] = "PGEgaHJlZj0iaHR0cDovL29mY24uY24iIHRhcmdldD0iX2JsYW5rIj5QSFAgSGlnaFNsaWRlICsgu8O1xs/gsuGzzNDyPC9hPqO6PGJyIC8+CgnKx9K71ta94brPwcsgSGlnaFNsaWRlzNjQpyC8sCCypbfFu8O1xszY0Ke1xCC1pdPDu6fP4LLhs8zQ8qO7PGJyIC8+CgnO3tDoyv2+3b/i1qez1iwgxuS5psTcvc/N6snGLLfHs6PKyrrPw7+49sjLyrnTw6O7PGJyIC8+CgnKudPDt8ezo7XYvPK1pbrNt72x46Oh";

			$helpContent[2][0] = "PHP HighSlide + 幻灯相册 功能介绍";
			$helpContent[2][1] = "查看功能介绍";
			$helpContent[2][2] = "js";
			$helpCont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ydLUvajP4LLhuabE3CAosrvQ6EZUUCk7PC9saT4KCQk8bGk+yvOx6tLGtq+1vc28xqzJz8/Uyr7NvMasyrG85Ds8L2xpPgoJCTxsaT7Ss8PmzerIq0RpditDc3M7PC9saT4KCQk8bGk+v8nJ6NbDz+Cy4bXEuPzD+yzV1castcS4/MP7LMm+s/3P4LLhLNLUvLDQwr2oz+Cy4Ts8L2xpPgoJCTxsaT6/ydfUtqjS5Togz+Cy4cP7LFNlc3Npb27D+yjS1LfAc3PD+8/gzayxu8v7yMvA+9PDKSyxuLC4usUszfjWtyzNs7zGtPrC6zs8L2xpPgoJCTxsaT6/ydfUtqjS5Tog0rPD5r/ttsgowvrX47j20NTQ6MfzKSzL9cLUzby1xL/tL7jftsgs1qez1s28xqzA4NDNLLvDtcbGrLXEv+0vuN+2yLywsqW3xbzkuPTKsbzkOzwvbGk+CgkJPGxpPtT2x7+wssir0NShowoJPC9vbD4";

			$helpContent[3][0] = "PHP HighSlide + 幻灯相册 版权声明";
			$helpContent[3][1] = "查看版权声明";
			$helpContent[3][2] = "sm";
			$helpContent[3][3] = "tMuzzNDyysfU2iAoPGEgdGFyZ2V0PSJfYmxhbmsiIGhyZWY9Imh0dHA6Ly93d3cubmVhdHBpYy5jb20iPk5FQVRQSUM8L2E+IMS/wrzWsbbBw+K30bDmKSC1xLv5tKHJz9DeuMS2+MC0tcQ7PGJyIC8+Cgm808jrwcu63NPF0OO1xCA8YSB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iaHR0cDovL3Zpa2phdmV2Lm5vL2hpZ2hzbGlkZS8/dXNlcj0xIj5oaWdoc2xpZGU8L2E+IMzY0KcsINLUvLCypbfFu8O1xrXEzNjQpywgtPO089T2vNPBy8/gsuG1xL/JudvQ1Ds8YnIgLz4KCdTa1LSzzNDyzrTXosP3srvE3NbY0MK3orK8tcTH6b/2z8I6ztLDx72rtMuzzNDyuabE3L340NDBy7Tzwb+1xNT2uMQ7PGJyIC8+CgnS1LywttS0y7PM0PK9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odHRwOi8vd3d3Lm5lYXRwaWMuY29tIj5ORUFUUElDPC9hPiAJPGEgdGFyZ2V0PSJfYmxhbmsiIGhyZWY9Imh0dHA6Ly92aWtqYXZldi5uby9oaWdoc2xpZGUvP3VzZXI9MSI+aGlnaHNsaWRlPC9hPiA8YSB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iaHR0cDovL3d3dy5jenloeC5jbiI+0e7V+TwvYT4gPGEgdGFyZ2V0PSJfYmxhbmsiIGhyZWY9Imh0dHA6Ly9vZmNuLmNuLyI+eHVvbjwvYT4";

			print("<body>\n");
			print("<div class=\"showDirList\" style=\"width:".$widths."px;margin-bottom:2px;line-height:20px;\"><center><span style=\"font-size:14px;color:blue;\">争乐系列: PHP HighSlide + 幻灯相册程序 帮助文件</span><br /><span style=\"font-size: 12px\"> (访问 <a target=\"_blank\" href=\"http://www.tingela.cn\">争乐</a> 或 <a target=\"_blank\" href=\"http://ofcn.cn\">xuon的日志</a> 获取更多程序</a>)</span></center></div>\n");
			print("<div class=\"showDirList\" style=\"width:".$widths."px;line-height:22px;padding:18px;margin-bottom:2px;background-color:#ffffff;\">\n");
			for($i = 1 ; $i <= count($helpContent); $i++) {
				print "	".$i."."." <a href=\"#".$helpContent[$i][2]."\"><font title=\" ".$helpContent[$i][1]." \"> ".$helpContent[$i][0]."</font></a><br />\n";
			}
			print("</div>\n");

			for($i = 1 ; $i <= count($helpContent); $i++) {
				print("<div class=\"showDirList\" style=\"width:".$widths."px;padding-left:18px;border-bottom:0;\">\n");
				print "	" . $i . ".<font color='blue'>".$helpContent[$i][0]."</font><a name=\"".$helpContent[$i][2]."\"></a>\n";
				print("</div>\n");
				print("<div class=\"showDirList\" style=\"width:".$widths."px;line-height:22px;padding:18px;margin-bottom:2px;background-color:#ffffff;\">\n");
				print "	" . $this->decode($helpContent[$i][3]) . "\n";
				print("</div>\n");
			}			
			print("<div class=\"showDirList\" style=\"width:".$widths."px;text-align:center;padding:5px 0;\">\n");
			print("	<input type=\"button\" value=\"返回上页\" onclick=\"javascript:history.go(-1)\">\n");
			print("</div>\n");
			$this->usedTime();
			$this->showConfigState();
			exit;
		}
	}

	/*	错误提示	*/
	function error($msg) {
		echo "<script language=javascript>";
		echo "window.alert('$msg');";
		echo "history.go(-1);";
		echo "</script>";
		exit;
	}

	/*	输出到主页	*/
	function execute() {
		$this->showWantPass();
		$this->configDirPass();
		$this->Help();
		$this->uploadMore();
		$this->delFile();
		$this->showUpload();
		$this->gzip();
		$this->timer();
		$this->getVars();
		$this->checkError();
		$this->checkDirPass();
		$this->showtitlecss();
		$this->pathArrayInitialize();
		$this->makeOverdirect();
		$this->makeDirList();
		$this->getEachArrayNum();
		$this->makeOptionList();
		$this->makePageBar();
		$this->picset();
		$this->showState();
		$this->showDirList();
		$this->showAdmincp();
		$this->showPicList();
		$this->showPageBar();
		$this->showDirList();
		$this->usedTime();
		$this->showConfigState();
		$this->c();
	}
}

/*	页面	*/
error_reporting(0);
session_start();
header("content-Type: text/html; charset=GB2312");
$neatpic = new neatpic($configWantedPass, $configAdminPass, $configDirPWFile, $configOpenGzip, $configShowPicSize, $configExt, $strLenMax, $configEachPageMax, $configPageWidth, $configDivHeight, $configDivWidth, $configPageMax, $configTilte, $ThisPicLogined, $icp, $weburl, $statcode);
$neatpic->execute();
?>

⌨️ 快捷键说明

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