不知道大家有沒有興趣作成php
camera.cgi
代碼: 選擇全部
#!/usr/bin/perl
############################################################################
# 社區虛擬形象系統照相館 版本:3FACE V1.1P-XP Luckybird Hacker v1.7
#
# 版權所有: 隨心社區
# (http://www.pcgametown.com/cgi-bin/forums.cgi?forum=14)
#
# 製作人 : luckybird
#
########################以下部分不需要做任何修改##############################
use Benchmark;
$TT0 = new Benchmark;
BEGIN {
$LBPATH = '.';
my $pgm = $0;
$pgm =~s/\\\/\//g;
$pgm =~s/^.*\/([^\/]+)$/$1/g;
unless (-e $LBPATH.'/'.$pgm) {
foreach ($0, $ENV{'SCRIPT_FILENAME'}, $ENV{'PATH_TRANSLATED'}) {
s!\\\!/!g; s/^(.*)\/[^\/]+$/$1/g;
if (-e $_ . '/' .$pgm) { $LBPATH = $_; last; }
}
}
unshift (@INC, "$LBPATH");
}
use LBCGI;
use URI::Escape;
$LBCGI::POST_MAX=2000;
$LBCGI::DISABLE_UPLOADS = 1;
$LBCGI::HEADERS_ONCE = 1;
require "data/boardinfo.cgi";
require "data/styles.cgi";
require "lb.lib.pl";
require "data/cityinfo.cgi";
require "face/config.pl";
require "face/facelib.pl";
require "plugin.lib.pl";
$|++;
$thisprog = "camera.cgi";
$faceprog = "face.cgi";
$query = new LBCGI;
if ($COOKIE_USED eq 1) {$cookiepath ="";}
else {
$boardurltemp =$boardurl;
$boardurltemp =~ s/http\:\/\/(\S+?)\/(.*)/\/$2/;
$cookiepath = $boardurltemp;
$cookiepath =~ s/\/$//;
# $cookiepath =~ tr/A-Z/a-z/;
}
&ipbanned; #封殺$hkone些 ip
$inmembername = $query->cookie("amembernamecookie");
$inpassword = $query->cookie("apasswordcookie");
&error("普通錯$hkwrong&老大,別亂黑我的程序呀!") if (($inmembername =~ m/\//)||($inmembername =~ m/\\\/)||($inmembername =~ m/\.\./));
if ($inmembername eq "" || $inmembername eq "客人" ) {
&error("不能進入 $plugname &你目前的身份是訪客,請先登陸!");
exit;
} else {
&getmember("$inmembername");
&error("普通錯$hkwrong&此用戶根本不存在!") if ($userregistered eq "no");
&error("普通錯$hkwrong&密碼與用戶名不相符,請重新登錄!") if ($inpassword ne $password);
}
&error("$plugname暫時關閉&$plugname維護中,請稍後訪問!") if($close_plug eq 'close');
&error("普通錯$hkwrong&你的社區性別為保密,不能進入本系統,請先修改你的個人資料!") if($sex eq 'no');
&title;
$equiplayer = $query->cookie("tempequip");
$tempmembername = $membername;
$tempmembername =~ s/ /\_/g;
$tempmembername =~ tr/A-Z/a-z/;
$mymoney = $numberofposts * $addmoney + $numberofreplys * $replymoney + $visitno * $loginmoney + $mymoney - $postdel * $delmoney;
$filetoopen = "$lbdir" . "face/userdata/$tempmembername.cgi";
$filetoopen = &stripMETA($filetoopen);
if (!( -e "$filetoopen")) # 判斷用戶文件是否存在\r
{
$equiplayer = $sex eq 'f' ? $fairsex : $mansex if ($equiplayer eq '');
$filenobeling = 1;
$equipcookie = cookie(-name => "tempequip", -value => "$equiplayer", -path => "$cookiepath/", -expires => "-1m");
print header(-cookie=>[$equipcookie], -charset=>big5);
}
else
{
&initface("$tempmembername") if ($equiplayer eq '');
}
print $query->header(-charset=>big5);
$helpurl = &helpfiles("camera");
$helpurl = qq~$helpurl照相幫助</a>~;
if ($boardlogo =~ /\.swf$/i) {
$forumgraphic = qq~<PARAM NAME=PLAY VALUE=TRUE><PARAM NAME=LOOP VALUE=TRUE><PARAM NAME=QUALITY VALUE=HIGH><embed src=$imagesurl/myimages/$boardlogo quality=high width=$boardlogow height=$boardlogoh pluginspage="http:\/\/www.macromedia.com\/shockwave\/download\/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application\/x-shockwave-flash"><\/embed>~;
} else {
$forumgraphic = qq~<img src=$imagesurl/myimages/$boardlogo>~;
}
$output .= qq~
<!--3FACE Camera V1.7 Powered By Luckybird-->
<SCRIPT LANGUAGE="JavaScript">
function album(action,username)
{
var Win=window.open("getansface.cgi?action="+action+"&username="+username,"BUY",'width=600,height=460,resizable=0,scrollbars=1,');
}
</SCRIPT>
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth align=center><tr><td width=30% rowspan=2 valign=top>$forumgraphic</td><td valign=top><font color=$fontcolormisc> <img src=$imagesurl/images/closedfold.gif width=15 height=11> <a href="leoboard.cgi">$boardname</a><br> <img src=$imagesurl/images/bar.gif width=15 height=15><img src=$imagesurl/images/openfold.gif width=15 height=11> <a href=$thisprog>$plugname</a>
</td></tr></table><BR>
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr bgcolor=$miscbacktwo><td colspan="2" align=center>
<table width=100% border=0 cellspacing=0 cellpadding=5>
<tr><td background=http://www.imodediy.com.tw/i/HKASK02/11.gif align=right><a href="$faceprog?action=perset">個人設置</a> | <a href="$faceprog?action=mylog&id=1">系統記錄</a> | <a href="$faceprog?action=mybureau">我的衣櫃</a> | <a href="$faceprog?action=splist">購物</a> | <a href="$thisprog">照相館</a> | $helpurl</td>
</tr></table>
</td></tr><tr bgcolor=$miscbackone><td width=150 valign=top>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td align=center><a href="$thisprog?action=setcamera">照相館設置</a></td></tr>
<tr><td align=center><a href="$thisprog?action=camera">照相館大廳</a></td></tr>
</table>
</td><td valign=top>~;
$action = $query -> param('action');
my %Mode = ('camera'=> \&camera,'photo'=> \&photo,'photoset'=> \&photoset,'setcamera'=> \&setcamera);
if ($Mode{$action})
{$Mode{$action} -> () ;}
else
{&facehelp;}
$output .= qq~</td></tr></table></td></tr></table>~;
sub facehelp
{
$output .= qq~
<table cellspacing=1 cellpadding=5 width=100% bgcolor=$tablebordercolor border=0 align="center">
<tr align=middle bgcolor=$miscbacktwo><td>系 統 說 明</td></tr>
<tr align=middle bgcolor=$forumcolortwo><td align="left" valign="top">~;
$filetoopen = "$lbdir" . "help/camera.dat";
$filetoopen = &stripMETA($filetoopen);
open (FILE, "$filetoopen");
@helpdata = <FILE>;
close (FILE);
foreach (@helpdata) {
$output .= $_;
}
$output .= qq~</td></tr></table>~;
}
sub setcamera
{
my $setok = $query -> param('setok');
&readcamera($tempmembername);
&readface($tempmembername);
&error("個人設置錯$hkwrong&你的形象數據不存在,請購買相應的商$hkbeh!") if($equip eq "");
if($setok ne "y")
{
$tempoutput = "<input type=radio name=agreecaremra value=\"y\"> 啟用 <input type=radio name=agreecaremra value=\"n\"> 關閉";
$tempoutput =~ s/value=\"$agreecaremra\"/value=\"$agreecaremra\" checked/;
$tempoutput2 = "<input type=radio name=sethead value=\"y\"> 啟用 <input type=radio name=sethead value=\"n\"> 關閉";
$tempoutput2 =~ s/value=\"$sethead\"/value=\"$sethead\" checked/;
$tempoutput3 = "<input type=radio name=setalbum value=\"y\"> 啟用 <input type=radio name=setalbum value=\"n\"> 關閉";
$tempoutput3 =~ s/value=\"$setalbum\"/value=\"$setalbum\" checked/;
$output .= qq~
<table cellspacing=1 cellpadding=5 width=90% bgcolor=$tablebordercolor border=0 align="center">
<form action="$thisprog" method="post" name="FORM">
<input type=hidden name="action" value="setcamera">
<input type=hidden name="setok" value="y">
<tr align=middle bgcolor=$miscbacktwo background=http://www.imodediy.com.tw/i/HKASK02/11.gif><td colspan="2">照 相 館 個 人 設 置</td></tr>
<tr align=left bgcolor=$forumcolortwo><td>是否允\許\\別人和你照相</td><td>$tempoutput</td></tr>
<tr align=left bgcolor=$forumcolortwo><td>是否允\許\\把你照片放置在首頁</td><td>$tempoutput2</td></tr>
<tr align=left bgcolor=$forumcolortwo><td>是否允\許\\別人瀏覽你的相冊</td><td>$tempoutput3</td></tr>
<tr align=middle bgcolor=$miscbacktwo><td colspan="2"><input type=submit value="我 要 修 改"> <input type=reset value=重 置></td></tr>
</form>
</table>~;
return;
}
else
{
my $newagreecaremra = $query -> param('agreecaremra');
my $newsethead = $query -> param('sethead');
my $newsetalbum = $query -> param('setalbum');
if($newagreecaremra eq $agreecaremra && $newsethead eq $sethead && $newsetalbum eq $setalbum)
{
$output .= qq~<meta http-equiv="refresh" content="0; url=$thisprog?action=setcamera">~;
return;
}
&error("個人設置錯$hkwrong&請選擇是否允\許\\別人和你照相!") if($newagreecaremra eq "");
&error("個人設置錯$hkwrong&請選擇是否允\許\\把你照片放置在首頁!") if($newsethead eq "");
&error("個人設置錯$hkwrong&請選擇是否允\許\\別人瀏覽你的相冊!") if($newsetalbum eq "");
$filetoopen = "$lbdir" . "face/camerauser/$tempmembername.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE, ">$filetoopen");
flock(FILE, 2) if ($OS_USED eq "Unix");
print FILE "$newagreecaremra\t$newsethead\t$newsetalbum\t";
close(FILE);
$output .= qq~<meta http-equiv="refresh" content="0; url=$thisprog?action=setcamera">~;
return;
}
}
sub camera{
&whosonline("$membername\t$plugname\tnone\t照相館\t");
$filetoopen = "$lbdir" . "face/userdata/$tempmembername.cgi";
$filetoopen = &stripMETA($filetoopen);
&error("照相錯$hkwrong&非常抱歉,您沒有設置虛擬形象不能照相!") if (!( -e "$filetoopen")); # 如果沒有此用戶\r
&phototitle;
$output .=qq~<table cellspacing=1 cellpadding=2 width=100% bgcolor=$tablebordercolor border=0><tr><td colspan=2 bgcolor=$miscbacktwo>最新合影相片</td></tr>~;
$i = 0;
my $filetoopen = "$lbdir" . "face/cameradata/cameradata.pl";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my @sp_list=<FILE>;
$sp_list = @sp_list;
close(FILE);
my $page = $query -> param('page');
$page = 1 if ($page eq "");
my $allnum = @sp_list;
my $temp = $allnum / 4;
my $allpages = int($temp);
$allpages++ if ($allpages != $temp);
$page = 1 if ($page < 1);
$page = $allpages if ($page > $allpages);
my $showpage = "";
if (!$allpages)
{
$showpage .= "當前沒有記錄";
}
elsif ($allpages == 1)
{
$showpage .= "當前記錄只有 1 頁";
}
else
{
$showpage = "共 <b>$allpages</b> 頁:[";
$showpage .= qq~ <a href=$thisprog?action=camera&page=1>第$hkone頁</a>~ if ($page > 1);
$i = $page - 1;
$showpage .= qq~ <a href=$thisprog?action=camera&page=$i>上$hkone頁</a>~ if ($page > 1);
$i = $page + 1;
$showpage .= qq~ <a href=$thisprog?action=camera&page=$i>下$hkone頁</a>~ if ($page < $allpages);
$showpage .= qq~ <a href=$thisprog?action=camera&page=$allpages>最後$hkone頁</a>~ if ($page < $allpages);
$showpage .= " ]";
}
if ($allnum > 0){
for ($i = $allnum - $page * 4 + 3; $i >= $allnum - $page * 4 && $i >= 0; $i--)
{
($ca_id,$sendname,$sendequip,$receivename,$receiveequip,$backpic,$situation,$picly,$pictitle,$picstate,$resultime)=split(/\t/,@sp_list[$i]);
$pic_time = &longdate("$ca_id"); # 文件時間戳\r
$result_time = &longdate("$resultime"); # 照片生成時間
my $filetoopen = "$lbdir" . "face/camera/background.pl";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my @class2=<FILE>;
close(FILE);
foreach $background(@class2)
{
($backpic_id,$postype_id,$backpic_name)=split(/\t/,$background);
$backpic_id =~s /\.gif//;
if ($backpic == $backpic_id)
{
last;
}
}
my $filetoopen = "$lbdir" . "face/camera/postype.pl";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my @class3=<FILE>;
close(FILE);
foreach $postype(@class3)
{
($pt_id,$state,$var1,$var2)=split(/\t/,$postype);
if ($postype_id == $pt_id && $situation == $state)
{
last;
}
}
$output .= qq~<tr>~ if ($ii==0);
$output .= qq~<td bgcolor=$miscbackone align=center>
<table cellspacing=1 cellpadding=2 width=280 border=0>
<tr><td><img src=http://maiweb.oushu.com/photo.gif border=0 width=280 height=5><DIV id="Show$i" style='padding:0;position:relative;top:0;left:0;width:280;height:226'></div>
<SCRIPT LANGUAGE="JavaScript">
var maleface = '$sendequip';
var femaleface = '$receiveequip';
var m_showArray = maleface.split('-');
var f_showArray = femaleface.split('-');
var s="<IMG src=$imagesurl/face/camera/$backpic.gif style='padding:0;position:absolute;top:0;left:0;width:280;height:226;z-index:0;'>";
for (var i=5; i<=21; i++)
{
if(m_showArray[i] != '0' && m_showArray[i] != 'multi')
{
var j= i+ 13;
s+="<IMG id=s"+i+" src=$imagesurl/face/"+i+"/"+m_showArray[i]+".gif style='padding:0;position:absolute;top:0;left:$var1;width:140;height:226;z-index:"+j+";'>";
}
}
for (var i=5; i<=21; i++)
{
if(f_showArray[i] != '0' && f_showArray[i] != 'multi')
{
var j = i - 4;
s+="<IMG id=s"+i+" src=$imagesurl/face/"+i+"/"+f_showArray[i]+".gif style='padding:0;position:absolute;top:0;left:$var2;width:140;height:226;z-index:"+j+";'>";
}
}
s+="<IMG src=$imagesurl/face/blank.gif style='padding:0;position:absolute;top:0;left:0;width:280;height:226;z-index:50;'>";
Show$i.innerHTML=s;
</script><img src=http://maiweb.oushu.com/photo.gif border=0 width=280 height=5></td></tr>
<tr><td bgcolor=$miscbacktwo>發起人:<span style="cursor:hand" onClick="javascript:O9('$sendname')">$sendname</span> <a href="javascript:album('myalbum','$sendname')"><img src=$imagesurl/images/album.gif border=0 width=16 align=absmiddle></a></td></tr>
<tr><td bgcolor=$miscbacktwo>響應人:<span style="cursor:hand" onClick="javascript:O9('$receivename')">$receivename</span> <a href="javascript:album('myalbum','$receivename')"><img src=$imagesurl/images/album.gif border=0 width=16 align=absmiddle></a></td></tr>
<tr><td bgcolor=$miscbacktwo>照片名稱:$pictitle</td></tr>
<tr><td bgcolor=$miscbacktwo>照相日期:$result_time</td></tr>
</table></td>~;
$output .= qq~</tr>~ if ($ii==1);
if ($ii<1)
{$ii++;} else {$ii=0;}
}
$output .= qq~<td bgcolor=$miscbackone align=center width=50%> </td>~ if ($ii == 1);
}
$output .= qq~<tr><td colspan=2 bgcolor=$miscbacktwo align=right>$showpage</td></tr></table>~;
}
sub photo
{
$recename = $query -> param('recename'); # 接受者ID
&error("沒有這個用戶&非常抱歉,社區中不存在此用戶名!") if (!( -e "$lbdir/$memdir/$recename.cgi")); # 如果沒有此用戶\r
&readcamera($recename);
&error("照相館操作錯$hkwrong&對方不允\許\\與人合影,無法合影") if($agreecaremra eq "n");
&readface($tempmembername);
&error("用戶形象數據錯$hkwrong&你的個人形象數據不存在,無法合影") if($equip eq "");
&readface($recename);
&error("用戶形象數據錯$hkwrong&該用戶個人形象數據不存在,無法合影") if($equip eq "");
&error("用戶形象數據錯$hkwrong&你頭腦還清醒嗎?怎麼能和自己◎#¥%※?!!") if($recename eq $tempmembername);
&whosonline("$membername\t$plugname\tnone\t照相館\t");
&phototitle;
$output .=qq~<table cellspacing=1 cellpadding=3 width=100% bgcolor=$tablebordercolor border=0>
<tr><td colspan=2 bgcolor=$miscbacktwo>向<font color=red> $recename </font>發起合影</td></tr>
<tr bgcolor=$miscbacktwo><td>使用說明:</td></tr>
<tr bgcolor=$miscbackone><td>
<b>操$hkedit步驟:</b><br>
1、輸入你要給對方的留言<br>
2、輸入你給照片起的名字<br>
3、選擇背景圖<br>
4、選擇你和接受方的位置<br>
<b>其他說明:</b><br>
1、費用 $photofee $moneyname/張<br>
2、你需要預先支付費用,如果對方拒絕我們將退還所發生的費用。<br>
<font color=red><b>提示:</b><br>
您目前的現金是:$mymoney $moneyname</font>
</td></tr>~;
my $filetoopen = "$lbdir" . "face/camera/background.pl";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my @class2=<FILE>;
close(FILE);
my $back = "";
my $i = 0;
my $firstpic = "";
foreach (@class2)
{
($backpic,$postype_id,$backpic_name,$x)=split(/\t/,$_);
$backpic =~s /\.gif//;
my $sel = "";
$sel = "selected" if($i == 0);
$firstpic = $backpic if($i == 0);
$back .= qq~ <OPTION value=$backpic $sel>$backpic_name</OPTION>~;
$i++;
}
$back .= qq~ </SELECT><INPUT type=hidden value=$firstpic name=bgno>~;
$output .= qq~<tr bgcolor=$miscbackone align=center><td>
<form action="$thisprog" method="post" name="photoset">
<input type=hidden name="action" value="photoset">
<input type=hidden name="ph_receiveequip" value="$equip">
<input type=hidden name="ph_receivename" value="$recename">
<table cellspacing=1 cellpadding=1 width=100% border=0>
<tr valign=top><td width=600>
<table cellspacing=1 cellpadding=2 width=600 border=0>
<tr align=center valign=top><td>
<table cellspacing=1 cellpadding=1 width=100% border=0>
<tr align=center valign=top><td>
<table cellspacing=1 cellpadding=1 width=100% border=0>
<tr><td bgcolor=$miscbacktwo> 您想發起的合影請求</td></tr>
<tr><td><br><br> <TEXTAREA name=ph_picly rows=5 cols=25></TEXTAREA> (100字以內) <br><br></td></tr>
<tr><td bgcolor=$miscbacktwo> 您為合影起的名字</td></tr>
<tr><td><br><br> <INPUT maxLength=20 name=ph_pictitle> (20字以內) <br><br></td></tr>
</table>
</td><td>
<table cellspacing=1 cellpadding=1 width=100% border=0>
<tr><td bgcolor=$miscbacktwo> 合影對像目前形象預覽</td></tr>
<tr align=center><td>
<DIV id="SHOW" style='padding:0;position:relative;top:0;left:0;width:140;height:226'></div>
<SCRIPT LANGUAGE="JavaScript">
var currface = "$equip";
var showArray = currface.split('-');
var s="";
for (var i=0; i<=25; i++)
{
if(showArray[i] != '0' && showArray[i] != 'multi')
{
s+="<IMG src=$imagesurl/face/"+i+"/"+showArray[i]+".gif style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:"+i+";'>";
}
}
s+="<IMG src=$imagesurl/face/blank.gif style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:50;'>";
SHOW.innerHTML=s;
</script>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
<tr align=center valign=top><td>
<table cellspacing=1 cellpadding=1 width=100% border=0>
<tr><td bgcolor=$miscbacktwo> 請選擇您要的背景</td></tr>
<tr><td align=center>
<table cellspacing=1 cellpadding=1 width=350 border=0>
<tr align=center valign=top><td width=300>
<IMG id=bgimg height=226 src="$imagesurl/face/camera/0001.gif" width=280>
<SCRIPT>
function changebg(bgno)
{
document.photoset.bgno.value = bgno;
document.photoset.bgimg.src="$imagesurl/face/camera/"+bgno+".gif";
}
</SCRIPT>
</td><td width=50>
<SELECT onchange=changebg(document.photoset.ph_backpic.options[document.photoset.ph_backpic.selectedIndex].value) size=15 name=ph_backpic>
$back
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
<tr align=center valign=top><td>
<table cellspacing=1 cellpadding=1 width=100% border=0>
<tr><td bgcolor=$miscbacktwo> 請選擇兩個人的距離</td></tr>
<tr><td align=center>
<table cellspacing=1 cellpadding=1 width=300 border=0>
<tr align=center><td>
<IMG src="$imagesurl/face/camera/basic/s1.gif">
</td><td>
<IMG src="$imagesurl/face/camera/basic/s2.gif">
</td></tr>
<tr align=center><td>
<INPUT type=radio value=1 name=ph_situation>
</td><td>
<INPUT type=radio value=2 name=ph_situation>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
<tr align=center valign=top><td><INPUT onclick="return checkphoto();" type=submit value="確 定"> <INPUT type=reset value="取 消"></td></tr>
</table>
<SCRIPT language=javascript>
function checkphoto()
{
if(document.photoset.ph_picly.value.length < 1)
{
alert("您就不說點什麼?");
document.photoset.ph_picly.focus();
return false;
}
if(document.photoset.ph_picly.value.length > 100)
{
alert("字數請勿超過100!");
document.photoset.ph_picly.focus();
return false;
}
if(document.photoset.ph_pictitle.value.length < 1)
{
alert("您不想給合影起個名字嗎?");
document.photoset.ph_pictitle.focus();
return false;
}
var checkflag = 0;
for(i=0;i<document.photoset.ph_situation.length; i++)
{
if(document.photoset.ph_situation[i].checked)
checkflag = 1;
}
if(checkflag != 1)
{
alert("請選擇兩人距離!");
return false;
}
if(!confirm("確認信息:你確認和 $recename 合影麼?如果對方同意你需要支付 $photofee $moneyname"))return false;
}
</SCRIPT>
</form></td></tr>
</table>
</td></tr></table>
</td></tr>~;
$output .= qq~</table>~;
}
sub phototitle
{
my $filetoopen = "$lbdir" . "face/cameradata/$tempmembername.pl";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my @class=<FILE>;
close(FILE);
$tempinfo1 = 0;
$tempinfo2 = 0;
$tempinfo3 = 0;
$tempinfo4 = 0;
foreach (@class) #計算各個數量
{
($ca_id,$sendname,$sendequip,$receivename,$receiveequip,$backpic,$situation,$picly,$pictitle,$picstate,$resultime)=split(/\t/,$_);
if ($tempmembername eq $receivename && $picstate eq 'u') #等待您確認的合影請求
{$tempinfo1++;}
if ($tempmembername eq $sendname && $picstate eq 'n') #您已被對方拒絕的合影請求
{$tempinfo2++;}
if ($tempmembername eq $sendname && $picstate eq 'u') #等待對方確認的合影請求
{$tempinfo3++;}
if ($tempmembername eq $receivename && $picstate eq 'n') #您拒絕過的合影請求
{$tempinfo4++;}
}
$output .= qq~
<SCRIPT LANGUAGE="JavaScript">
function O9(id) {if(id!="")window.open("profile.cgi?action=show&member="+id);}
function request(action)
{
var Win=window.open("getansface.cgi?action="+action,"BUY",'width=600,height=460,resizable=0,scrollbars=1,');
}
</script>
<table cellspacing=1 cellpadding=5 width=100% bgcolor=$tablebordercolor border=0>
<tr align=middle>
<td bgcolor=$miscbacktwo width=65% height=70><font size=6><b>照 相 館</b></font></td>
<td rowspan=2 bgcolor=$miscbackone>
<table cellspacing=1 cellpadding=2 width=100% border=0 align="center">
<tr align=middle><td colspan=2 bgcolor=$miscbacktwo>我的合影記錄</td></tr>
<tr><td width=2%>◎</td><td><a href="javascript:request('perbyou')">等待您確認的合影請求</a> $tempinfo1 (條)</td></tr>
<tr><td width=2%>◎</td><td><a href="javascript:request('rejectoyou')">您已被對方拒絕的合影請求</a> $tempinfo2 (條)</td></tr>
<tr><td width=2%>◎</td><td><a href="javascript:request('perforyou')">等待對方確認的合影請求 </a> $tempinfo3 (條)</td></tr>
<tr><td width=2%>◎</td><td><a href="javascript:request('rejectbyou')">您拒絕過的合影請求</a> $tempinfo4 (條)</td></tr>
<tr><td></td><td align="right">>>> <a href="javascript:album('myalbum','$tempmembername')">查看我的合影</a></td></tr>
</table>
</td>
</tr>
<tr align=middle>
<td bgcolor=$miscbackone valign=center>
<form action="$thisprog" method="post" name="photo">
<input type=hidden name="action" value="photo">
請輸入合影對象的ID:<INPUT size=10 name=recename> <INPUT type=submit value=" GO ">
</form>
</td>
</tr></table><br>~;
}
sub photoset
{
$ph_receivename = $query -> param('ph_receivename'); # 接受者ID
$ph_receiveequip = $query -> param('ph_receiveequip'); # 接受者當前配置\r
$ph_backpic = $query -> param('ph_backpic'); # 背景圖片
$ph_situation = $query -> param('ph_situation'); # 相對狀態
$ph_picly = $query -> param('ph_picly'); # 留言
$ph_picly = &cleaninput($ph_picly);
$ph_pictitle = $query -> param('ph_pictitle'); # 留言標題
$ph_pictitle = &cleaninput($ph_pictitle);
$ph_sendname = $tempmembername; # 發起者ID
&readface($tempmembername);
$ph_sendequip = $equip; # 發起者當前配置\r
$ph_id = time();
&error("現金不夠&非常抱歉,您的現金不夠支付照相費用!") if ($mymoney < $photofee);
$filetoopen = "$lbdir" . "face/cameradata/$tempmembername.pl"; # 打開發起者用戶文件\r
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
@class=<FILE>;
close(FILE);
$newstate = 'u';
open(FILE,">$filetoopen");
print FILE "$ph_id\t$ph_sendname\t$ph_sendequip\t$ph_receivename\t$ph_receiveequip\t$ph_backpic\t$ph_situation\t$ph_picly\t$ph_pictitle\t$newstate\t\t
";
for($i=0;$i<@class;$i++)
{
($ca_id,$sendname,$sendequip,$receivename,$receiveequip,$backpic,$situation,$picly,$pictitle,$picstate,$resultime)=split(/\t/,@class[$i]);
if($ca_id ne $ph_id)
{
print FILE "$ca_id\t$sendname\t$sendequip\t$receivename\t$receiveequip\t$backpic\t$situation\t$picly\t$pictitle\t$picstate\t$resultime\t
";
}
}
close(FILE);
$filetoopen = "$lbdir" . "face/cameradata/$ph_receivename.pl"; # 打開接受者用戶文件\r
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
@class=<FILE>;
close(FILE);
$newstate = 'u';
open(FILE,">$filetoopen");
print FILE "$ph_id\t$ph_sendname\t$ph_sendequip\t$ph_receivename\t$ph_receiveequip\t$ph_backpic\t$ph_situation\t$ph_picly\t$ph_pictitle\t$newstate\t\t
";
for($i=0;$i<@class;$i++)
{
($ca_id,$sendname,$sendequip,$receivename,$receiveequip,$backpic,$situation,$picly,$pictitle,$picstate,$resultime)=split(/\t/,@class[$i]);
if($ca_id ne $ph_id)
{
print FILE "$ca_id\t$sendname\t$sendequip\t$receivename\t$receiveequip\t$backpic\t$situation\t$picly\t$pictitle\t$picstate\t$resultime\t
";
}
}
close(FILE);
&updateuserinfo("$tempmembername",0,0,0,0,0,-$photofee,0); #扣掉照相費用\r
&zengmessage($ph_receivename, "照相訊息", "你的朋友 <font color=blue>$tempmembername</font> ,向您提出了照相申請。<br>為此次合影他(她)預先支付了 $photofee $moneyname 。<br><a href=showphoto.cgi?action=showphoto&username=$ph_receivename&id=$ph_id target=_blank>請點擊此處預覽照片</a>,如果您同意照相請 <a href=camera.cgi?action=camera target=_blank>這裡</a> $hkedit出您的選擇");
$output .= qq~<meta http-equiv="refresh" content="0; url=$thisprog?action=camera">~;
return;
}
sub zengmessage #給用戶發短消息(調用參數:收取人、主題、內容)
{
my ($receivemember, $topic, $content) = @_;
#$receivemember =~ s/ /\_/sg;
#$receivemember =~ tr/A-Z/a-z/;
my @filedata;
my $filetomake = $lbdir . $msgdir . "/in/" . $receivemember . "_msg.cgi";
$filetomake = &stripMETA($filetomake);
my $currenttime = time;
&winlock($filetomake) if ($OS_USED eq "Unix" || $OS_USED eq "Nt");
if (-e $filetomake)
{
open(FILE, "$filetomake");
flock(FILE, 1) if ($OS_USED eq "Unix");
@filedata = <FILE>;
close(FILE);
}
@filedata = ("*#!&*$plugname\tno\t$currenttime\t$topic\t$content<br><br>-----------<br><a href=face.cgi target=_blank>$plugname</a><br><br>
", @filedata);
open(FILE, ">$filetomake");
flock(FILE, 2) if ($OS_USED eq "Unix");
foreach (@filedata)
{
chomp;
print FILE "$_
";
}
close(FILE);
&winunlock($filetomake) if ($OS_USED eq "Unix" || $OS_USED eq "Nt");
return;
}
sub plug_output {
my %args = ( -Title => "", -ToPrint => "", -Version => "", @_, );
my $title = $args{-Title};
my $output = $args{-ToPrint};
my $versionnumber = $args{-Version};
my $filetoopen = "$lbdir" . "data/template.cgi";
open(FILE,"$filetoopen");
my $templatedata=join('',<FILE>);
close(FILE);
my $copyright;
$copyright = qq~
<center><hr width=380 size=1><table width=80% align=center cellpadding=0 cellspacing=0><tr><$td>
程序版權所有: <a href=$myweb target=_blank>隨心論壇</a> 程序編製:Luckybird 版本:<a h$myw3web>$plugver $cversion</a></td></tr></table></center>
$footmark~;
$coolmeta = qq~<META http-equiv="Page-Enter" content="revealTrans(Transition=$cinoption,Duration=$timetoshow)">
<META http-equiv="Page-Exit" content="revealTrans(Transition=$cinoption,Duration=$timetoshow)">~ if ($pagechange eq "yes");
$templatedata=~ s/\$lbbody/$lbbody/;
$templatedata=~ s/\$page_title/$title/;
$templatedata=~ s/\$imagesurl/$imagesurl\/images/isg;
$templatedata=~ s/\$lbboard_main/$output
$copyright
/;
$templatedata=~ s/\$coolwin/$coolwindow/;
$templatedata=~ s/\$coolmeta/$coolmeta/;
$templatedata=~ s/\$coolclick/$coolclick/;
print $templatedata;
$TT1 = new Benchmark;
$td = Benchmark::timediff($TT1, $TT0);
$td = Benchmark::timestr($td);
$td =~ /(\d+)\s*wallclock secs \(\s*?(\d*?\.\d*?)\s*usr\s*\+\s*(\d*?\.\d*?)\s*sys/i;
print "<center><font color=$cpudispcolor>程序佔用 CPU 時間:$2 usr + $3 sys";
exit;
}
&plug_output(-Title => $plugname,-ToPrint => $output,-Version => $versionnumber);代碼: 選擇全部
$mansex = "0-0-0-0-0-0-0-init-init-init-0-init-0-init-0-init-0-0-init-0-0-0-0-0-0-0";
#######################################################################
# 社區虛擬形象系統(適合LBXP版本使用) 版本:3FACE V1.2P-XP
#
# 版權所有: 三元社區
# (http://www.lzeweb.com/cgi-bin/city/forums.cgi?forum=19)
#
# 製作人 : 阿強 (CPower)
#
########################以下部分不需要做任何修改#######################
$fairsex = "0-0-0-0-0-0-0-initf-initf-initf-0-initf-0-initf-initf-0-0-0-initf-0-0-0-0-0-0-0";
sub readface {
my $nametocheck = shift;
$filetoopen = "$lbdir" . "face/userdata/$nametocheck.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my $facedata=<FILE>;
close(FILE);
sub readcamera {
my $nametocheck = shift;
$filetoopen = "$lbdir" . "face/camerauser/$nametocheck.cgi";
$filetoopen = &stripMETA($filetoopen);
open(FILE,"$filetoopen");
my $cameradata=<FILE>;
close(FILE);
($agreecaremra,$sethead,$setalbum)=split(/\t/,$cameradata);
}
($equip,$layer1,$layer2,$layer3,$layer4,$layer5,$layer6,$layer7,$layer8,$layer9,$layer10,$layer11,$layer12,$layer13,$layer14,$layer15,$layer16,$layer17,$layer18,$layer19,$layer20,$layer21,$layer22,$layer23,$layer24,$layer25,$loadface,$sendinfo)=split(/\t/,$facedata);
@equip=split(/\-/,$equip);
@buy_sp = ("B","$layer1","$layer2","$layer3","$layer4","$layer5","$layer6","$layer7","$layer8","$layer9","$layer10","$layer11","$layer12","$layer13","$layer14","$layer15","$layer16","$layer17","$layer18","$layer19","$layer20","$layer21","$layer22","$layer23","$layer24","$layer25");
}
sub get_faceinfo {
my ($membername,$useravatar) = @_;
my $onlinetimehour = int($onlinetime/3600);
my $onlinetimemin = int(($onlinetime%3600)/60);
my $onlinetimesec = int(($onlinetime%3600)%60);
$onlinetimehour = "0$onlinetimehour" if ($onlinetimehour <10);
$onlinetimemin = "0$onlinetimemin" if ($onlinetimemin <10);
$onlinetimesec = "0$onlinetimesec" if ($onlinetimesec <10);
$membername =~ s/ /\_/g;
$membername =~ tr/A-Z/a-z/;
$perfiletoopen = "$lbdir" . "face/userdata/$membername.cgi";
$perfiletoopen = &stripMETA($perfiletoopen);
$loadface = "";
if (( -e "$perfiletoopen"))
{ # 如果存在形象文件\r
$lckfiletoopen = "$lbdir" . "data/face.lck";
if (( -e "$lckfiletoopen"))
{ # 如果系統開放使用LB字段,則直接讀取LB用戶庫數據
require "face/config.pl";
$loadinfo = $useradd3 if($load_spare_num eq '3');
$loadinfo = $useradd6 if($load_spare_num eq '6');
$loadinfo = $useradd7 if($load_spare_num eq '7');
$loadinfo = $useradd8 if($load_spare_num eq '8');
@UserInfo = split(/\|/,$loadinfo);
$equip = @UserInfo[0];\r
$loadface = @UserInfo[1];
}
else
{&readface($membername);}
}
my ($mystatus, $mysaves, $mysavetime, $myloan, $myloantime, $myloanrating, $bankadd1, $bankadd2, $bankadd3, $bankadd4, $bankadd5) = split(/,/, $useradd4);
unless ($mystatus eq "1" || $mystatus eq "-1" || $useradd4 eq "") {
$mysaves = "沒開戶";
$myloan = "沒貸款";
}
else {
if ($mystatus) {
$mysaves = "$mysaves $moneyname";
if ($myloan) {
$myloan = "$myloan $moneyname";
} else {
$myloan = "沒貸款";
}
} else {
$mysaves = "沒開戶";
$myloan = "沒貸款";
}
}
$mysaves = "<font title=$mysaves>>999999999</font>" if ($mysaves > 999999999 );
$myloan = "<font title=$myloan>>999999999</font>" if ($myloan > 999999999 );
if($loadface ne 'y')
{
$useravatar_t = qq~
$useravatar{$membername}
~;\r
}
else
{
$useravatar_t = qq~
<DIV id="SHOW$editpostnumber" style='padding:0;position:relative;top:0;left:0;width:140;height:226'></div>
<SCRIPT LANGUAGE="JavaScript">Face_Info("$equip",SHOW$editpostnumber,"$imagesurl");</SCRIPT>~;
}
return $useravatar_t;
}
sub get_userface { # 只提取圖片,其它信息省略\r
my ($membername,$useravatar) = @_;
$membername =~ s/ /\_/g;
$membername =~ tr/A-Z/a-z/;
$perfiletoopen = "$lbdir" . "face/userdata/$membername.cgi";
$perfiletoopen = &stripMETA($perfiletoopen);
$loadface = "";
if (( -e "$perfiletoopen"))
{ # 如果存在形象文件\r
$lckfiletoopen = "$lbdir" . "data/face.lck";
if (( -e "$lckfiletoopen"))
{ # 如果系統開放使用LB字段,則直接讀取LB用戶庫數據
require "face/config.pl";
$loadinfo = $useradd3 if($load_spare_num eq '3');
$loadinfo = $useradd6 if($load_spare_num eq '6');
$loadinfo = $useradd7 if($load_spare_num eq '7');
$loadinfo = $useradd8 if($load_spare_num eq '8');
@UserInfo = split(/\|/,$loadinfo);
$equip = @UserInfo[0];
$loadface = @UserInfo[1];
}
else
{&readface($membername);}
}
if($loadface eq 'y')
{
$useravatar = qq~
<DIV id="SHOW$editpostnumber" style='padding:0;position:relative;top:0;left:0;width:140;height:226'></div>
<SCRIPT LANGUAGE="JavaScript">Face_Info("$equip",SHOW$editpostnumber,"$imagesurl");</SCRIPT>~;
}
return $useravatar;
}
sub initface
{
my $nametocheck = shift;
&readface($nametocheck);
$output .= qq~<SCRIPT LANGUAGE="JavaScript">document.cookie = "tempequip=" + "$equip" + ";";</SCRIPT>~;
}
sub upuserfaceinfo {
my($nametocheck,$newloadinfo) = @_;
# 用戶名,當前裝備情況
my $nametochecktemp = $nametocheck;
$nametocheck =~ s/ /\_/g;
$nametocheck =~ tr/A-Z/a-z/;
$userregistered = "";
my $filetoopen = "$lbdir" . "$memdir/$nametocheck.cgi";
$filetoopen = &stripMETA($filetoopen);
if (-e $filetoopen) {
&winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
open(FILE,"$filetoopen");
flock (FILE, 1) if ($OS_USED eq "Unix");
my $filedata = <FILE>;
close(FILE);
chomp($filedata);
(my $membername, my $password, my $membertitle, my $membercode, my $numberofposts, my $emailaddress, my $showemail, my $ipaddress, my $homepage, my $oicqnumber, my $icqnumber ,my $location ,my $interests, my $joineddate, my $lastpostdate, my $signature, my $timedifference, my $privateforums, my $useravatar, my $userflag,my $userxz, my $usersx, my $personalavatar, my $personalwidth, my $personalheight, my $rating, my $lastgone, my $visitno,my $addjy,my $meili, my $mymoney, my $postdel, my $sex, my $education, my $marry, my $work, my $born, my $chatlevel,my $chattime, my $jhmp,my $useradd3,my $useradd4,my $onlinetime,my $userquestion, my $useradd6, my $useradd7, my $useradd8) = split(/\t/,$filedata);
require "face/config.pl";
$useradd3 = $newloadinfo if($load_spare_num eq '3');
$useradd6 = $newloadinfo if($load_spare_num eq '6');
$useradd7 = $newloadinfo if($load_spare_num eq '7');
$useradd8 = $newloadinfo if($load_spare_num eq '8');
if (($membername ne "")&&($password ne "")) {
if (open(FILE,">$filetoopen")) {
flock (FILE, 2) if ($OS_USED eq "Unix");
$lastgone=time;
print FILE "$nametochecktemp\t$password\t$membertitle\t$membercode\t$numberofposts\t$emailaddress\t$showemail\t$ipaddress\t$homepage\t$oicqnumber\t$icqnumber\t$location\t$interests\t$joineddate\t$lastpostdate\t$signature\t$timedifference\t$privateforums\t$useravatar\t$userflag\t$userxz\t$usersx\t$personalavatar\t$personalwidth\t$personalheight\t$rating\t$lastgone\t$visitno\t$addjy\t$meili\t$mymoney\\t$postdel\t$sex\t$education\t$marry\t$work\t$born\t$chatlevel\t$chattime\t$jhmp\t$useradd3\t$useradd4\t$onlinetime\t$userquestion\t$useradd6\t$useradd7\t$useradd8\t
";
close(FILE);
}
}
&winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
}
}