📄 index.php
字号:
<?php
////////////////////////////////////////////////////////////
//
// LDV个人相册系统
//
// 阿维设计编写
//
// 本程序采用文本储存数据,不需要mysql数据库支持
//
// 本程序属于免费程序,可以任意使用、拷贝、传播,
//
// 版权归阿维所有
//
// 如果需要修改程序,请事先征得作者同意。
//
// 请务必保留相册页面中的作者主页的链接!谢谢!!
//
/////////////////////////////////////////////////////////////
if(!empty($_GET['l'])&&$_GET['l']=="logout")
setcookie("LDValbum","0",time());
include_once"cfg.php";
if(!isset($_GET['adminlog'])||$_GET['adminlog']!=1)
{
if(file_exists($cachefile))
$cache=file($cachefile);
else
{
$fp=fopen($cachefile,"w");
fwrite($fp,"0\n");fwrite($fp,"0\n");fwrite($fp,"0\n");
fclose($fp);
}
if(!file_exists($namefile))
{
$fp=fopen($namefile,"w");
fwrite($fp," ");
fclose($fp);
}
$cache=getcache();
$guestnum=getguestnum();
head();
phpcode();
$rows=ceil($cache[0]/4);
while($rows)
{
echo"<tr height=\"160\">";
$r=4;
if($cache[0]<4)
$r=$cache[0];
for($i=0;$i<$r;$i++)
{
$albumnames=file($namefile);
$n=trim($albumnames[$cache[0]-$i-1]);
$ao=getinfo($n);
$ao[1]=trim($ao[1]);
echo<<<ldv
<td class=inner>
<table width="120" height="140">
<tr>
<td height="110">
<a href="album.php?name=$n"><img src="$ao[3]" width="100" height="90" border="1" color="#F9F9F9" alt="最后更新:$ao[2]图片总数:$ao[1]"></a>
</td>
</tr>
<tr>
<td>$ao[0]</td>
</tr>
</table>
</td>
ldv;
}
if($rows==1)
if($i%3!=0)
for(;;$i++)
{
echo"<td class=inner> </td>";
if($i%3==0)
break;
}
echo"</tr>";
$rows-=1;
$cache[0]-=4;
}
echo<<<ldv
</table>
</td>
</tr>
<tr>
<td height="25" bgcolor="#F2F4F2" colspan="2">欢迎您,来自IP: $guestnum 的朋友!</td>
</tr>
</table>
ldv;
}
else
{
head();
echo<<<ldv
<center>
<table width="400"><form method=post action="admin.php">
<tr>
<td height="23">相册管理员登陆</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="60">
用户名:<input type="text" name="un" size="12">
密码:<input type="password" name="pw" size="12">
</td>
</tr>
<tr>
<td height="23"><input type="submit" value="登陆后台"> <input type="button" onclick="javascript:window.location='index.php'" value="返回首页"></td>
</tr></form>
</table>
ldv;
}
PHP_pages();
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -