<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp" -->
<!--#include file="inc/plus_check.asp"-->
<!--#include file="Dv_Plus/Avatar/Plus_Avatar_Const.asp"-->
<%
Dim SumAmount, i, j
Dim AvatarArray, ItemCount, AvatarStr, TempArray()

Dv_Plus.Name = "Plus_Avatar"
Dv_Plus.CheckLogin
Dvbbs.LoadTemplates "Avatar"
Dvbbs.Stats = Template.Strings(23)
Dvbbs.ActiveOnline
v_FoundErr = False
If Dvbbs.Forum_Setting(82) <> "0" Then
	v_ErrCodes = "<li>该论坛尚未开启虚拟形象功能，不能粘贴形象！"
	v_FoundErr = True
Else
	AvatarStr = Trim(Request("Avatar"))
	ItemCount = Avatar_GetInfo(AvatarStr, AvatarArray)
	If ItemCount = 0 Then
		If v_ErrCodes <> "" Then v_ErrCodes = v_ErrCodes & "<br>"
		v_ErrCodes = v_ErrCodes & "<li>粘贴的数据有错误！"
		v_FoundErr = True
	ElseIf Not Avatar_FilterBadSexItem(AvatarArray, v_CurSex) Then
		If v_ErrCodes <> "" Then v_ErrCodes = v_ErrCodes & "<br>"
		v_ErrCodes = v_ErrCodes & "<li>粘贴的数据有错误！"
		v_FoundErr = True
	Else
		Call Main
	End If
End If
If v_FoundErr Then
	Call ShowErr(False)
End If
Dvbbs.Footer
Set Dv_Plus = Nothing

Sub Main()
	Dim i, TempStr
	
	TempStr = ""
	For i = 0 To UBound(AvatarArray)
		If i > 0 Then TempStr = TempStr & "|"
		TempStr = TempStr & AvatarArray(i)
	Next
	Call ShowSuc("<li>已经成功地粘贴了所有符合性别的商品！", False)
	Response.write "<script>if(window.opener) window.opener.document.getElementById('AvatarShow').PutAvatar('" & TempStr & "');</script>"
End Sub
%>