' Author: Lars Berg
' Date: March 10 2001
' Mod Name: Random Signature
' Mod Versjon: 1.0
' Snitz versjon: 3.1 sr4
' Files to modify: inc_functions.asp
' Description: This mod adds the ability to use multiple signatures
in your profile. All signatures should be placed in your
profile and seperated with '|'.
' Sample signature: This is sig 1|This is sig 2|This is sig 3|This is sig 4
This mod is very simple. Find this this code:
function GetSig(fUser_Name)
'## Forum_SQL
strSql = "SELECT M_SIG "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_NAME = '" & Request.Form("UserName") & "'"
set rsSig = my_Conn.Execute (strSql)
if rsSig.EOF or rsSig.BOF then
'## Do Nothing
else
GetSig = rsSig("M_SIG")
end if
rsSig.close
set rsSig = nothing
end function
Replace it with this code:
function GetSig(fUser_Name)
'## Forum_SQL
strSql = "SELECT M_SIG "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_NAME = '" & Request.Form("UserName") & "'"
set rsSig = my_Conn.Execute (strSql)
if rsSig.EOF or rsSig.BOF then
'## Do Nothing
else
GetSig = RandomQuote(rsSig("M_SIG"))
end if
rsSig.close
set rsSig = nothing
end function
Then, add this code:
Function RandomQuote(byval Quotes)
'Quotes should be in the format:
' rnd1|rnd2|rndx
Randomize
QuoteCount = (Len(Replace(Quotes, "|", "|*")) - Len(Quotes)) + 1
SelectedQuoteNumber = Int((QuoteCount - 1 + 1) * Rnd + 1)
For X = 1 To SelectedQuoteNumber - 1
'Remove leading Quotes
Quotes = Right(Quotes, Len(Quotes) - InStr(Quotes, "|"))
Next
If InStr(Quotes, "|") > 0 Then
'Remove trailing quotes
Quotes = Left(Quotes, InStr(Quotes, "|") - 1)
End If
RandomQuote = Quotes
End Function
Good Luck