Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Advanced Color Picker for 3.4
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 22 August 2002 :  10:23:39  Show Profile  Visit Azaniah's Homepage
Sadly not, same thing happens

Eagles fly!, but weasels don't get sucked into jet engines.
Go to Top of Page

sy
Average Member

United Kingdom
638 Posts

Posted - 22 August 2002 :  10:56:19  Show Profile  Visit sy's Homepage  Send sy a Yahoo! Message
quote:
Originally posted by pweighill

Has anyone ever done a Theme mod where you could store and use different colour/font themes?
With options to import/export them from/to text files?



Maxwebportal has theme definitions in its admin_colors pages, but they don't export to text files they are saved in the DB.

I will have a look at the code and maybe add it to my snitz, let you know how i get on. (ver 3.3 mind)

HTH,

Sy

The pessimist complains about the wind; the optimist expects it to change; the realist adjusts the sails

Go to Top of Page

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 22 August 2002 :  11:37:30  Show Profile  Visit Azaniah's Homepage
Well you can do this, it's not the neatest solution but...

in pop_color.asp change the function retinfo(v2) to read..


function retinfo(V2)
{
opnform=window.opener.document.forms['Form1'];
opnform['<%= Request.QueryString("box") %>'].value=V2;
window.opener.document.all['<%= Request.QueryString("box") %>p'].style.backgroundColor=V2;
self.close();
}


Then in admin_config_colors.asp each instance of the color picker will need something like this..


" <tr valign=""middle"">" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><strong>Base Background Color:</strong> </font></td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """><input type=""text"" name=""strPageBGColor"" size=""10"" maxLength=""20"" value=""" & chkExist(strPageBGColor) & """ onchange=""strPageBGColorp.style.backgroundColor = strPageBGColor.value;"" />" & vbNewLine & _
" <a href=""JavaScript:void(0)"" onclick=""openWindow3('pop_color.asp?box=strPageBGColor')"">" & getCurrentIcon("icon_color.gif|15|15","Select Color","align=""top""") & "</a>" & vbNewLine & _
" <a href=""JavaScript:openWindow3('pop_config_help.asp?mode=colors#colors')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a></td>" & vbNewLine & _
" <td id=""strPageBGColorp"" style=""background-color:" & strPageBGColor & ";""> </td>" & vbNewLine & _
" </tr>" & vbNewLine & _



where the id is the name of the variable+p,



Eagles fly!, but weasels don't get sucked into jet engines.

Edited by - Azaniah on 22 August 2002 11:38:19
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 22 August 2002 :  11:54:04  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
I posted the theme definition selection/import/export code above. Here is the page that posts to: admin_colour_templates.asp - this goes at the top of admin_config_colors.asp and loads color templates/saves them.
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE file="inc_top.asp" -->
<% If Session(strCookieURL & "Approval") = "15916941253" Then %>
<%
if request.Form("template")="Write" then
t_select=Request.Form("Select")
else
t_select = request.form("newtemplate")
end if

strSQL = "SELECT * FROM " & strTablePrefix & "COLOURS WHERE C_TEMPLATE='" & t_select & "'"
set rs = my_conn.execute (strSQL)

if request.Form("template")="Write" then
' BEGIN COLORMOD TEMPLATE
strCurrentTemplate = t_select
' END COLORMOD TEMPLATE
strSql = "UPDATE " & strTablePrefix & "CONFIG "
strSql = strSql & " SET C_STRDEFAULTFONTFACE = '" & rs("C_STRDEFAULTFONTFACE") & "', C_STRDEFAULTFONTSIZE='" & rs("C_STRDEFAULTFONTSIZE") & "', C_STRHEADERFONTSIZE = '" & rs("C_STRHEADERFONTSIZE") & "', "
strSql = strSql & " C_STRFOOTERFONTSIZE = '" & rs("C_STRFOOTERFONTSIZE") & "', C_STRPAGEBGCOLOR = '" & rs("C_STRPAGEBGCOLOR") & "', C_STRDEFAULTFONTCOLOR = '" & rs("C_STRDEFAULTFONTCOLOR") & "', "
strSql = strSql & " C_STRLINKCOLOR = '" & rs("C_STRLINKCOLOR") & "', C_STRLINKTEXTDECORATION = '" & rs("C_STRLINKTEXTDECORATION") & "', C_STRVISITEDLINKCOLOR = '" & rs("C_STRVISITEDLINKCOLOR") & "', "
strSql = strSql & " C_STRVISITEDTEXTDECORATION = '" & rs("C_STRVISITEDTEXTDECORATION") & "', C_STRACTIVELINKCOLOR = '" & rs("C_STRACTIVELINKCOLOR") & "', C_STRHOVERFONTCOLOR = '" & rs("C_STRHOVERFONTCOLOR") & "', "
strSql = strSql & " C_STRHOVERTEXTDECORATION = '" & rs("C_STRHOVERTEXTDECORATION") & "', C_STRHEADCELLCOLOR = '" & rs("C_STRHEADCELLCOLOR") & "', C_STRHEADFONTCOLOR = '" & rs("C_STRHEADFONTCOLOR") & "', "
strSql = strSql & " C_STRCATEGORYCELLCOLOR = '" & rs("C_STRCATEGORYCELLCOLOR") & "', C_STRCATEGORYFONTCOLOR = '" & rs("C_STRCATEGORYFONTCOLOR") & "', C_STRFORUMFIRSTCELLCOLOR = '" & rs("C_STRFORUMFIRSTCELLCOLOR") & "', "
strSql = strSql & " C_STRFORUMCELLCOLOR = '" & rs("C_STRFORUMCELLCOLOR") & "', C_STRALTFORUMCELLCOLOR = '" & rs("C_STRALTFORUMCELLCOLOR") & "', C_STRFORUMFONTCOLOR = '" & rs("C_STRFORUMFONTCOLOR") & "', "
strSql = strSql & " C_STRFORUMLINKCOLOR = '" & rs("C_STRFORUMLINKCOLOR") & "', C_STRTABLEBORDERCOLOR = '" & rs("C_STRTABLEBORDERCOLOR") & "', C_STRPOPUPTABLECOLOR = '" & rs("C_STRPOPUPTABLECOLOR") & "', "
' BEGIN COLORMOD TEMPLATE
strSql = strSql & " C_CURRENT_TEMPLATE = '" & t_select & "', "
' END COLORMOD TEMPLATE
strSql = strSql & " C_STRPOPUPBORDERCOLOR = '" & rs("C_STRPOPUPBORDERCOLOR") & "', C_STRNEWFONTCOLOR = '" & rs("C_STRNEWFONTCOLOR") & "', C_STRTOPICWIDTHLEFT = '" & rs("C_STRTOPICWIDTHLEFT") & "', "
strSql = strSql & " C_STRTOPICNOWRAPLEFT = '" & rs("C_STRTOPICNOWRAPLEFT") & "', C_STRTOPICWIDTHRIGHT = '" & rs("C_STRTOPICWIDTHRIGHT") & "', C_STRTOPICNOWRAPRIGHT = '" & rs("C_STRTOPICNOWRAPRIGHT") & "' WHERE CONFIG_ID = " & 1
my_Conn.Execute (strSql)
Application(strCookieURL & "ConfigLoaded") = ""
elseif request.Form("template")="Save" then
strSQL = "SELECT * FROM " & strTablePrefix & "CONFIG WHERE CONFIG_ID = " & 1
set rs2 = my_conn.execute (strSQL)
if not rs.EOF then
strSql = "UPDATE " & strTablePrefix & "COLOURS "
strSql = strSql & " SET C_STRDEFAULTFONTFACE = '" & rs2("C_STRDEFAULTFONTFACE") & "', C_STRDEFAULTFONTSIZE='" & rs2("C_STRDEFAULTFONTSIZE") & "', C_STRHEADERFONTSIZE = '" & rs2("C_STRHEADERFONTSIZE") & "', "
strSql = strSql & " C_STRFOOTERFONTSIZE = '" & rs2("C_STRFOOTERFONTSIZE") & "', C_STRPAGEBGCOLOR = '" & rs2("C_STRPAGEBGCOLOR") & "', C_STRDEFAULTFONTCOLOR = '" & rs2("C_STRDEFAULTFONTCOLOR") & "', "
strSql = strSql & " C_STRLINKCOLOR = '" & rs2("C_STRLINKCOLOR") & "', C_STRLINKTEXTDECORATION = '" & rs2("C_STRLINKTEXTDECORATION") & "', C_STRVISITEDLINKCOLOR = '" & rs2("C_STRVISITEDLINKCOLOR") & "', "
strSql = strSql & " C_STRVISITEDTEXTDECORATION = '" & rs2("C_STRVISITEDTEXTDECORATION") & "', C_STRACTIVELINKCOLOR = '" & rs2("C_STRACTIVELINKCOLOR") & "', C_STRHOVERFONTCOLOR = '" & rs2("C_STRHOVERFONTCOLOR") & "', "
strSql = strSql & " C_STRHOVERTEXTDECORATION = '" & rs2("C_STRHOVERTEXTDECORATION") & "', C_STRHEADCELLCOLOR = '" & rs2("C_STRHEADCELLCOLOR") & "', C_STRHEADFONTCOLOR = '" & rs2("C_STRHEADFONTCOLOR") & "', "
strSql = strSql & " C_STRCATEGORYCELLCOLOR = '" & rs2("C_STRCATEGORYCELLCOLOR") & "', C_STRCATEGORYFONTCOLOR = '" & rs2("C_STRCATEGORYFONTCOLOR") & "', C_STRFORUMFIRSTCELLCOLOR = '" & rs2("C_STRFORUMFIRSTCELLCOLOR") & "', "
strSql = strSql & " C_STRFORUMCELLCOLOR = '" & rs2("C_STRFORUMCELLCOLOR") & "', C_STRALTFORUMCELLCOLOR = '" & rs2("C_STRALTFORUMCELLCOLOR") & "', C_STRFORUMFONTCOLOR = '" & rs2("C_STRFORUMFONTCOLOR") & "', "
strSql = strSql & " C_STRFORUMLINKCOLOR = '" & rs2("C_STRFORUMLINKCOLOR") & "', C_STRTABLEBORDERCOLOR = '" & rs2("C_STRTABLEBORDERCOLOR") & "', C_STRPOPUPTABLECOLOR = '" & rs2("C_STRPOPUPTABLECOLOR") & "', "
strSql = strSql & " C_STRPOPUPBORDERCOLOR = '" & rs2("C_STRPOPUPBORDERCOLOR") & "', C_STRNEWFONTCOLOR = '" & rs2("C_STRNEWFONTCOLOR") & "', C_STRTOPICWIDTHLEFT = '" & rs2("C_STRTOPICWIDTHLEFT") & "', "
strSql = strSql & " C_STRTOPICNOWRAPLEFT = '" & rs2("C_STRTOPICNOWRAPLEFT") & "', C_STRTOPICWIDTHRIGHT = '" & rs2("C_STRTOPICWIDTHRIGHT") & "', C_STRTOPICNOWRAPRIGHT = '" & rs2("C_STRTOPICNOWRAPRIGHT") & "' WHERE C_TEMPLATE = '" & t_select & "'"
rs2.close
my_Conn.Execute (strSql)
else
strSQL = "SELECT * FROM " & strTablePrefix & "CONFIG WHERE CONFIG_ID = " & 1
set rs2 = my_conn.execute (strSQL)
my_conn.execute ( "INSERT INTO " & strTablePrefix & "COLOURS (C_TEMPLATE) VALUES ('" & t_select & "')")
strSql = "UPDATE " & strTablePrefix & "COLOURS "
strSql = strSql & " SET C_STRDEFAULTFONTFACE = '" & rs2("C_STRDEFAULTFONTFACE") & "', C_STRDEFAULTFONTSIZE='" & rs2("C_STRDEFAULTFONTSIZE") & "', C_STRHEADERFONTSIZE = '" & rs2("C_STRHEADERFONTSIZE") & "', "
strSql = strSql & " C_STRFOOTERFONTSIZE = '" & rs2("C_STRFOOTERFONTSIZE") & "', C_STRPAGEBGCOLOR = '" & rs2("C_STRPAGEBGCOLOR") & "', C_STRDEFAULTFONTCOLOR = '" & rs2("C_STRDEFAULTFONTCOLOR") & "', "
strSql = strSql & " C_STRLINKCOLOR = '" & rs2("C_STRLINKCOLOR") & "', C_STRLINKTEXTDECORATION = '" & rs2("C_STRLINKTEXTDECORATION") & "', C_STRVISITEDLINKCOLOR = '" & rs2("C_STRVISITEDLINKCOLOR") & "', "
strSql = strSql & " C_STRVISITEDTEXTDECORATION = '" & rs2("C_STRVISITEDTEXTDECORATION") & "', C_STRACTIVELINKCOLOR = '" & rs2("C_STRACTIVELINKCOLOR") & "', C_STRHOVERFONTCOLOR = '" & rs2("C_STRHOVERFONTCOLOR") & "', "
strSql = strSql & " C_STRHOVERTEXTDECORATION = '" & rs2("C_STRHOVERTEXTDECORATION") & "', C_STRHEADCELLCOLOR = '" & rs2("C_STRHEADCELLCOLOR") & "', C_STRHEADFONTCOLOR = '" & rs2("C_STRHEADFONTCOLOR") & "', "
strSql = strSql & " C_STRCATEGORYCELLCOLOR = '" & rs2("C_STRCATEGORYCELLCOLOR") & "', C_STRCATEGORYFONTCOLOR = '" & rs2("C_STRCATEGORYFONTCOLOR") & "', C_STRFORUMFIRSTCELLCOLOR = '" & rs2("C_STRFORUMFIRSTCELLCOLOR") & "', "
strSql = strSql & " C_STRFORUMCELLCOLOR = '" & rs2("C_STRFORUMCELLCOLOR") & "', C_STRALTFORUMCELLCOLOR = '" & rs2("C_STRALTFORUMCELLCOLOR") & "', C_STRFORUMFONTCOLOR = '" & rs2("C_STRFORUMFONTCOLOR") & "', "
strSql = strSql & " C_STRFORUMLINKCOLOR = '" & rs2("C_STRFORUMLINKCOLOR") & "', C_STRTABLEBORDERCOLOR = '" & rs2("C_STRTABLEBORDERCOLOR") & "', C_STRPOPUPTABLECOLOR = '" & rs2("C_STRPOPUPTABLECOLOR") & "', "
strSql = strSql & " C_STRPOPUPBORDERCOLOR = '" & rs2("C_STRPOPUPBORDERCOLOR") & "', C_STRNEWFONTCOLOR = '" & rs2("C_STRNEWFONTCOLOR") & "', C_STRTOPICWIDTHLEFT = '" & rs2("C_STRTOPICWIDTHLEFT") & "', "
strSql = strSql & " C_STRTOPICNOWRAPLEFT = '" & rs2("C_STRTOPICNOWRAPLEFT") & "', C_STRTOPICWIDTHRIGHT = '" & rs2("C_STRTOPICWIDTHRIGHT") & "', C_STRTOPICNOWRAPRIGHT = '" & rs2("C_STRTOPICNOWRAPRIGHT") & "' WHERE C_TEMPLATE = '" & t_select & "'"
rs2.close
my_Conn.Execute (strSql)
end if
End if

Application(strCookieURL & "ConfigLoaded") = ""
rs.close
%>
<meta http-equiv="Refresh" content="2; URL=admin_config_colors.asp">
<!--#INCLUDE file="inc_footer.asp" -->
<% Else
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))

End IF %>


And here is another part of it:
admin_color_impexp.asp

[code]<!--#INCLUDE FILE="config.asp" -->
<% If Session(strCookieURL & "Approval") = "15916941253" Then %>
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<%
dim strStatusMsg
dim strImportPath
strImportPath = server.mappath(".") & "\\templates\\import"
dim strExportPath
strExportPath = server.mappath(".") & "\\templates\\export\\"
dim sTemplateExtension
sTemplateExtension = "txt"
dim sTemplPrefix
sTemplPrefix = "TMPLNAME="
dim strTemplateNames
strTemplateNames=""
%>

<table border="0" width="100%">
<tr>
<td width="33%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<img src="icon_folder_open.gif" height=15 width=15 border="0"> <a href="default.asp">All
Forums</a><br>
<img src="icon_bar.gif" height=15 width=15 border="0"><img src="icon_folder_open.gif" height=15 width=15 border="0"> <a href="admin_home.asp">Admin
Section</a><br>
<img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_bar.gif" height=15 width=15 border="0"><img src="icon_folder_open.gif" height=15 width=15 border="0"> 
<a href="admin_config_colors.asp">Font/Table Color Code Configuration</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_bar.gif" height=15 width=15 border="0"> <img src="icon_folder_open_topic.gif" height=15 width=15 border="0"> 
Color Template Import/Export<br>

</font></td>
</tr>
</table>

<%
'---------------------------------------------------
function TemplateExistsInDB(sTemplateName)
TemplateExistsInDB=false

on error resume next
sTmpTemplateName = trim(sTemplateName)

' strip off the template prefix if it is the same prefix as our own system
nPrePos = InStr(1,sTmpTemplateName,":",1)

if nPrePos > 0 then
sSystem = Mid(sTmpTemplateName,1,nPrePos-1)
if LCase(sSystem) = LCase(trim(StrForumTitle)) then
sTmpTemplateName = Mid(sTmpTemplateName,nPrePos+1)
end if
end if

strSQL = "SELECT C_TEMPLATE FROM " & strTablePrefix & "COLOURS WHERE C_TEMPLATE='" & sTmpTemplateName & "'"
err.number=0

set rsCheck = my_Conn.execute (strSql)

if err.number <> 0 then
strStatusMsg = "Unable to query: " & sTmpTemplateName & ". " & err.description
exit function
end if

sTmp = trim(rsCheck("C_TEMPLATE"))
rsCheck.Close

if sTmp <> "" then
TemplateExistsInDB=true
end if

end function
'---------------------------------------------------
function IsUniqueTemplate(sTemplateName)
on error resume next
IsUniqueTemplate=true

if TemplateExistsInDB(sTemplateName)=true then
IsUniqueTemplate=false
exit function
end if

arrT = Split(strTemplateNames,",")
arrTTopIndex = ubound(arrT)

bInThere = false

for x = 0 to arrTTopIndex
if LCase(trim(arrT(x))) = LCase(trim(sTemplateName)) then
IsUniqueTemplate=false
exit function
end if
next

if strTemplateNames <> "" then
strTemplateNames = strTemplateNames & ","
end if

strTemplateNames = strTemplateNames & sTemplateName

end function
'---------------------------------------------------
' Function ImportTemplate
function ImportTemplate(str)

ImportTemplate = true
on error resume next

while Right(str,1) = " "
str = Mid(str,1,Len(str)-1)
wend
if Right(str,1) = "," then
str = Mid(str,1,Len(str)-1)
end if

' strip off the template name
str = Mid(str,Len(sTemplPrefix)+1)

nPos = InStrRev(str," SET ")
if nPos < 1 then
strStatusMsg = "Invalid import line: " & str
ImportTemplate = false
exit function
end if

sTemplateName = Mid(str,1,nPos-1)

' Make sure the template name does not already exist
if TemplateExistsInDB(sTemplateName)=true then
strStatusMsg = "Unable to import: " & sTemplateName & ". Already exists."
ImportTemplate = false
exit function
end if

str = Mid(str,nPos)

strSql = "INSERT INTO " & strTablePrefix & "COLOURS (C_TEMPLATE) VALUES ('" & sTemplateName & "')"

err.number=0
my_Conn.execute (strSql)
if err.number <> 0 then
strStatusMsg = "Unable to insert template: " & sTemplateName & ". " & err.description
exit function
end if

strSql = "UPDATE " & strTablePrefix & "COLOURS " & str & "WHERE C_TEMPLATE = '" & sTemplateName & "'"

err.number=0
my_Conn.Execute (strSql)
if err.number <> 0 then
strStatusMsg = "Unable to update template: " & sTemplateName & " using SQL: " & strSql & ". " & err.description
ImportTemplate=false
exit function
end if

end function
'------------------------------------------------------
' ImportTemplate
function ImportTemplates
on error resume next

' make sure at least one template is selected
if Request.Form("importlist") = "" then
strStatusMsg = "You must select at least 1 file to import"
exit function
end if

' parse the individual files selected into an array
arrTemplates = split(Request.Form("importlist"),"#")
' determine the top zero-based index of the array
nTemplatesTopIndex = ubound(arrTemplates)

for x = 0 to nTemplatesTopIndex

if trim(arrTemplates(x)) <> "" then
'Response.Write(" Template(" & CStr(x) & ")=" & arrTemplates(x))
if ImportTemplate(arrTemplates(x)) = false then
Response.Write("ErrCode=" & strStatusMsg)
exit function
end if
end if

next

end function

'------------------------------------------------------
' BuildExportLine - given a template name, load the fields from the database
function BuildExportLine(template)
on error resume next

template = trim(template)

strSQL = "SELECT * FROM " & strTablePrefix & "COLOURS WHERE C_TEMPLATE='" & template & "'"

err.number = 0
set rs = my_Conn.execute (strSQL)
if err.number <> 0 then
strStatusMsg = "Unable to read template using query: " & strSQL
BuildExportLine = ""
exit function
end if

s = s & " SET C_STRDEFAULTFONTFACE = '" & rs("C_STRDEFAULTFONTFACE") & "', C_STRDEFAULTFONTSIZE='" & rs("C_STRDEFAULTFONTSIZE") & "', C_STRHEADERFONTSIZE = '" & rs("C_STRHEADERFONTSIZE") & "', "
s = s & " C_STRFOOTERFONTSIZE = '" & rs("C_STRFOOTERFONTSIZE") & "', C_STRPAGEBGCOLOR = '" & rs("C_STRPAGEBGCOLOR") & "', C_STRDEFAULTFONTCOLOR = '" & rs("C_STRDEFAULTFONTCOLOR") & "', "
s = s & " C_STRLINKCOLOR = '" & rs("C_STRLINKCOLOR") & "', C_STRLINKTEXTDECORATION = '" & rs("C_STRLINKTEXTDECORATION") & "', C_STRVISITEDLINKCOLOR = '" & rs("C_STRVISITEDLINKCOLOR") & "', "
s = s & " C_STRVISITEDTEXTDECORATION = '" & rs("C_STRVISITEDTEXTDECORATION") & "', C_STRACTIVELINKCOLOR = '" & rs("C_STRACTIVELINKCOLOR") & "', C_STRHOVERFONTCOLOR = '" & rs("C_STRHOVERFONTCOLOR") & "', "
s = s & " C_STRHOVERTEXTDECORATION = '" & rs("C_STRHOVERTEXTDECORATION") & "', C_STRHEADCELLCOLOR = '" & rs("C_STRHEADCELLCOLOR") & "', C_STRHEADFONTCOLOR = '" & rs("C_STRHEADFONTCOLOR") & "', "
s = s & " C_STRCATEGORYCELLCOLOR = '" & rs("C_STRCATEGORYCELLCOLOR") & "', C_STRCATEGORYFONTCOLOR = '" & rs("C_STRCATEGORYFONTCOLOR") & "', C_STRFORUMFIRSTCELLCOLOR = '" & rs("C_STRFORUMFIRSTCELLCOLOR") & "', "
s = s & " C_STRFORUMCELLCOLOR = '" & rs("C_STRFORUMCELLCOLOR") & "', C_STRALTFORUMCELLCOLOR = '" & rs("C_STRALTFORUMCELLCOLOR") & "', C_STRFORUMFONTCOLOR = '" & rs("C_STRFORUMFONTCOLOR") & "', "
s = s & " C_STRFORUMLINKCOLOR = '" & rs("C_STRFORUMLINKCOLOR") & "', C_STRTABLEBORDERCOLOR = '" & rs("C_STRTABLEBORDERCOLOR") & "', C_STRPOPUPTABLECOLOR = '" & rs("C_STRPOPUPTABLECOLOR") & "', "
s = s & " C_STRPOPUPBORDERCOLOR = '" & rs("C_STRPOPUPBORDERCOLOR") & "', C_STRNEWFONTCOLOR = '" & rs("C_STRNEWFONTCOLOR") & "', C_STRTOPICWIDTHLEFT = '" & rs("C_STRTOPICWIDTHLEFT") & "', "
s = s & " C_STRTOPICNOWRAPLEFT = '" & rs("C_STRTOPICNOWRAPLEFT") & "', C_STRTOPICWIDTHRIGHT = '" & rs("C_STRTOPICWIDTHRIGHT") & "', C_STRTOPICNOWRAPRIGHT = '" & rs("C_STRTOPICNOWRAPRIGHT") & "' "

rs.Close

sPrefix = sTemplPrefix & strForumTitle & ":" & template

BuildExportLine = sPrefix & s

end function

'------------------------------------------------------
' ExportTemplate
function ExportTemplates()
on error resume next

' Get and validate the output filename
sFile = trim(Request.Form("exportfile"))
if sFile = "" then
strStatusMsg = "You must provide a filename for export."
exit function
end if

' make sure at least one template is selected
if Request.Form("exportlist") = "" then
strStatusMsg = "You must select at least 1 template to export"
exit function
end if

' parse the individual forum IDs selected into an array
arrTemplates = split(Request.Form("exportlist"),",")
' determine the top zero-based index of the array
nTemplatesTopIndex = ubound(arrTemplates)

err.number=0
Set fso = CreateObject("Scripting.FileSystemObject")
if err.number <> 0 then
strStatusMsg = "Error creating Scripting.FileSystemObject. " & err.description
exit function
end if

sFilename = strExportPath & sFile & "." & sTemplateExtension

err.number=0
Set MyFile = fso.CreateTextFile(sFilename, True)
if err.number <> 0 then
strStatusMsg = "Error creating export file: " & strExportPath & sFilename & ". " & err.description
exit function
end if

for each template in arrTemplates

strLine = BuildExportLine(template)
if strLine = "" then
exit function
end if

err.number=0
MyFile.WriteLine(strLine)
if err.number <> 0 then
strStatusMsg = "Error writing to export file: " & sFilename & ". " & err.description
exit function
end if

next

MyFile.Close
MyFile=nothing

fso=nothing

end function

'-------------------------------------------------------------
' Request.QueryString
if Request.QueryString("mode") = "process" then

strStatusMsg="Success"

if Request.Form("Submit") = "Export" then
ExportTemplates()
else
ImportTemplates()
end if
end if
%>

<form name="myform" method="Post" action="admin_color_impexp.asp?mode=process">
<table border="0" cellspacing="0" cellpadding="0" align="center" width="60%">
<tr>
<td bgcolor="<% =strTableBorderColor %>">
<table align="center" border="0" cellPadding="1" cellSpacing="1" width="100%">
<tr>
<td background="<%=strHeadCellBGImage%>" bgcolor="<% =strHeadCellColor %>" align="center" vAlign="top" colspan="2">
<font color="<% =strCategoryFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>
Color Template Import / Export</b></font></td>
</tr>
<tr>
<td background="<%=strHeadCellBGImage%>" bgcolor="<% =strHeadCellColor %>" align="center" vAlign="top" colspan="2"> </td>
</tr>
<tr valign="top">
<td bgColor="<% =strPopUpTableColor %>" align="right" colspan="2">
<div align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Select
a color template file to import and press "Import".
<br>
(from /templates/import directory off of main
forum directory)</font></div>
</td>
</tr>
<tr valign="top" align="center">
<td bgColor="<% =strPopUpTableColor %>" colspan="2"> Importable
color templates:
<select name="importlist" size="5" multiple>
<%
on error resume next
err.number=0
Set fso = CreateObject("Scripting.FileSystemObject")
if err.number <> 0 then
Response.Write("</select>")
Response.Write("Error creating FILESYSTEMOBJECT object: " & err.description)
Response.End
end if
Set f = fso.GetFolder(strImportPath)
if err.number <> 0 then
Response.Write("</select>")
Response.Write("Error creating FOLDER object: " & err.description)
Response.End
end if
Set fc = f.Files
if err.number <> 0 then
Response.Write("</select>")
Response.Write("Error creating FILES object: " & err.description)
Response.End
end if
For Each f1 in fc

err.number=0
Set MyFile = fso.OpenTextFile(f1.Path,1,FALSE)

if err.number <> 0 then Response.Write(" Error OpenTextFile: " & err.description)

while MyFile.AtEndOfStream <> true

str = MyFile.ReadLine

if err.number <> 0 then Response.Write(" Error Reading: " & err.description)

' only add to list if this is a color template file
if Left(str,Len(sTemplPrefix)) = sTemplPrefix then

sName = Mid(str,Len(sTemplPrefix)+1)

nPos = InStrRev(sName," SET ")

sTemplateName = Mid(sName,1,nPos-1)

if IsUniqueTemplate(sTemplateName)=true then

' strip off the template prefix if it is the same prefix as our own system
nPrePos = InStr(1,sTemplateName,":",1)

if nPrePos > 0 then
sSystem = Mid(sTemplateName,1,nPrePos-1)
if LCase(sSystem) = LCase(trim(StrForumTitle)) then
sTemplateName = Mid(sTemplateName,nPrePos+1)
end if
end if

Response.Write("<option value=""" & "#" & str & """" & ">" & sTemplateName & "</option><br>")
end if
end if
wend

MyFile.Close
MyFile=nothing


Next

fc=nothing
f=nothing
fso=nothing
%>
</select>
</td>
</tr>
<tr valign="top" align="center">
<td bgColor="<% =strPopUpTableColor %>" colspan="2">Or
</td>
</tr>
<tr valign="top" align="center">
<td bgColor="<% =strPopUpTableColor %>" colspan="2"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Or
select the templates you wish to export, enter a filename
and press "Export" <br>
(exports to /templates/export off of main forum directory)</font></td>
</tr>
<tr valign="top" align="center">
<td bgColor="<% =strPopUpTableColor %>" colspan="2"> Exportable
color templates
<select name="exportlist" size="5" multiple>
<%
' Load the listbox with the available templates
'Select the existing entries
On Error Resume Next
strSql = "SELECT " & strTablePrefix & "COLOURS.C_TEMPLATE "
strSql = strSql & " FROM " & strTablePrefix & "COLOURS ORDER BY C_TEMPLATE"
set rs = my_Conn.execute (strSql)

do until rs.EOF
Response.Write " <option value=""" & trim(rs("C_TEMPLATE")) & """"
if LCase(rs("C_TEMPLATE")) = LCase(strCurrentTemplate) then Response.Write " selected "
Response.Write ">" & rs("C_TEMPLATE") & "</option>" & vbCrLf
rs.movenext
loop
rs.Close
%>
</select>
</td>
</tr>
<tr valign="top" align="center">
<td bgColor="<% =strPopUpTableColor %>" colspan="2">Export
filename (filename only! no path,no extension):
<input type="text" name="exportfile" size="60" maxlength="256" value="<%=Request.Form("exportfile")%>">
</td>
</tr>
<tr valign="top" align="center">
<td bgColor="<% =strPopUpTableColor %>" colspan="2"><b><%=strStatusMsg%></b></td>
</tr>
<tr valign="top">
<td bgColor="<% =strPopUpTableColor %>" colspan="2" align="center">
<input type="submit" name="Submit" value="Import">
<input type="submit" name="Submit" value="Export">
<font color="<% =strCategoryFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="admin_config_colors.asp"> (Return
to admin config colors page)</a></font> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<!--#INCLUDE FILE="inc_footer.asp" -->


<% Else %>
<!-- If Session(strCookieURL & "Approval") = "15916941253" -->
<% Response.Redirect "admin_home.asp" %>
<% End IF %>

Then you just need my_edit_config.asp and my_theme.asp working

@tomic

SportsBettingAcumen.com

Edited by - @tomic on 22 August 2002 11:57:29
Go to Top of Page

avs
New Member

USA
83 Posts

Posted - 22 August 2002 :  14:23:45  Show Profile
Is it possible to add the ability to use an image for table cells, like Nathan's mod did previously?
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 22 August 2002 :  14:25:56  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Yes, easily. But that involves more than just this page as do the color templates. I planned on adding the table cell images once a few other things were done.

@tomic

SportsBettingAcumen.com
Go to Top of Page

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 23 August 2002 :  07:02:41  Show Profile  Visit Azaniah's Homepage
These two files are the pop_color.asp and admin_config_colors.asp which have been amended so that all the changes are dynamic.

It's not extremely neat but it works.

http://azaniah.co.uk/test/pop_color.txt
http://azaniah.co.uk/test/admin_config_colors.txt

It doesn't include the image backgrounds or templates.

Eagles fly!, but weasels don't get sucked into jet engines.
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 26 September 2002 :  23:38:25  Show Profile  Visit golfmann's Homepage
quote:
Originally posted by @tomic

Yes, easily. But that involves more than just this page as do the color templates. I planned on adding the table cell images once a few other things were done.

@tomic



Any chance of having this so we can add some graphics to our headers?

????
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 10 November 2002 :  09:56:23  Show Profile  Visit MarkJH's Homepage
quote:
Is it possible to add the ability to use an image for table cells, like Nathan's mod did previously?


@tomic, did you get round to adding this feature or if not, know of a 3.4 mod which includes it?

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07