<%
'***********************************************************************
'** Copyright (C) 2001 - 2004 Max Yuan All Rights Reserved
'**
'** By using this program, you are agreeing to the terms of the
'** GNU General Public License.
'**
'** This program is free software; you can redistribute it and/or
'** modify it under the terms of the GNU General Public License
'** as published by the Free Software Foundation; either version 2
'** of the License, or any later version.
'**
'** All copyright notices regarding MaxWebPortal must remain intact
'** in the scripts and in the outputted HTML.
'** The "powered by" text/logo with a link back to 
'** http://www.maxwebportal.com in the footer of the pages MUST
'** remain visible when the pages are viewed on the internet or intranet.
'**
'** Support can be obtained from support forums at:
'** http://www.maxwebportal.com
'**
'** Email: maxwebportal@hotmail.com
'** ICQ: 148111300
'***********************************************************************
%><!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_adminvar.asp" --><%If Session(strCookieURL & "Approval") = "256697926329" and instr(strWebMaster,lcase(strAdmin1UserName)&",") <> 0 and not lcase(strAdmin1UserName) = "" and not lcase(strAdmin1UserName) = " " Then %>
<!--#INCLUDE file="inc_functions.asp" -->
<!--#INCLUDE file="inc_top.asp" -->
<table border="0" width="100%" align="center">
  <tr>
    <td width="33%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    <img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="default.asp">home</a><br>
    <img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="admin_home.asp">Admin Section</a><br>
    <img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="admin_avatar_home.asp">Avatar Setup</a><br>
    <img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_folder_open_topic.gif" height=15 width=15 border="0">&nbsp;Review/Edit Avatars</font></td>
  </tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td bgcolor="<% =strTableBorderColor %>">
    <table width="100%" align="center" border="0" cellspacing="1" cellpadding="4">
      <tr>
        <td align="center" bgcolor="<% =strHeadCellColor %>" colspan="5"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Review/Edit Avatars</font></b></td>
      </tr>
      <tr>
        <td align="center" bgcolor="<% =strCategoryCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Preview</font></b></td>
        <td align="center" bgcolor="<% =strCategoryCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Avatar URL</font></b></td>
        <td align="center" bgcolor="<% =strCategoryCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Avatar Name</font></b></td>
        <td align="center" bgcolor="<% =strCategoryCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Owner</font></b></td>
        <td align="center" bgcolor="<% =strCategoryCellColor %>"><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"></font></b></td>
      </tr>
<% 
	'## Forum_SQL - Get Avatar Settings from DB
	strSql = "SELECT " & strTablePrefix & "AVATAR2.A_HSIZE"
	strSql = strSql & ", " & strTablePrefix & "AVATAR2.A_WSIZE"
	strSql = strSql & ", " & strTablePrefix & "AVATAR2.A_BORDER"
	strSql = strSql & " FROM " & strTablePrefix & "AVATAR2"

	set rsav = my_Conn.Execute (strSql)

	'## Forum_SQL - Get Avatars from DB
	strSql = "SELECT " & strTablePrefix & "AVATAR.A_ID" 
	strSql = strSql & ", " & strTablePrefix & "AVATAR.A_URL"
	strSql = strSql & ", " & strTablePrefix & "AVATAR.A_NAME"
	strSql = strSql & ", " & strTablePrefix & "AVATAR.A_MEMBER_ID"
	strSql = strSql & " FROM " & strTablePrefix & "AVATAR "
	strSql = strSql & " ORDER BY " & strTablePrefix & "AVATAR.A_ID ASC;"


	set rs = Server.CreateObject("ADODB.Recordset")
	rs.cachesize = 20
	rs.open  strSql, my_Conn, 3

	if rs.EOF or rs.BOF then  '## No replies found in DB
%>
      <tr>
        <td bgcolor="<% =strForumFirstCellColor %>" colspan="5"><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>" valign="top"><b>No Avatars Found</b></font></td>
      </tr>
<%
	else
		rs.movefirst
		rs.pagesize = strPageSize
		maxpages = cint(rs.pagecount)
		intI = 0 
		howmanyrecs = 0
		rec = 1

		do until rs.EOF '**
			if intI = 0 then
				CColor = strForumFirstCellColor
			else
				CColor = strAltForumCellColor
			end if
 %>
      <tr>
        <td bgcolor="<% =CColor %>" valign="center" align="center" nowrap><img src="<% =rs("A_URL") %>" height=<% =rsav("A_HSIZE") %> width=<% =rsav("A_WSIZE") %> border=<% =rsav("A_BORDER") %> hspace=0 alt="<% =rs("A_NAME") %>"></td>
        <td bgcolor="<% =CColor %>" valign="center" align="center">
        	<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =rs("A_URL") %></font></td>
        <td bgcolor="<% =CColor %>" valign="center" align="center">
        	<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =rs("A_NAME") %></font></td>
        <td bgcolor="<% =CColor %>" valign="center" align="center">
        	<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% if rs("A_MEMBER_ID") <> "0" then response.write (getMemberName(rs("A_MEMBER_ID")))  else response.write " - " end if %></font></td>
        <td bgcolor="<% =CColor %>" valign="center" align="center" nowrap><a href="admin_avatar_edit.asp?A_ID=<% =rs("A_ID") %>&A_NAME=<% =ChkString(rs("A_NAME"),"urlpath") %>"><img src="icon_pencil.gif" alt="Edit Avatar Properties" border="0" hspace="0"></a>
        <a href="JavaScript:openWindow('pop_avatar_delete.asp?mode=Avatar&A_ID=<% =rs("A_ID") %>&A_URL=<% =rs("A_URL") %>')"><img src="icon_trashcan.gif" alt="Delete Avatar" border="0" hspace="0"></a></td>
      </tr>
<%
		    rs.MoveNext
		    intI  = intI + 1
		    if intI = 2 then
				intI = 0
			end if
		    rec = rec + 1
		loop
	end if
	rs.close
	set rs = nothing
	set rsav = nothing
 %>
    </table></td>
  </tr>
</table>
<br>
<!--#INCLUDE file="inc_footer.asp" -->
<% else %><% Response.Redirect "admin_login.asp" %><% end if %>