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)
 MOD: Random Signature
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

LarsBerg
Starting Member

10 Posts

Posted - 09 March 2001 :  20:05:23  Show Profile
' 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

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 09 March 2001 :  20:30:13  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Works Great :)

----------------
Da_Stimulator
Need a Mod?
My Snitz Test Center
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 09 March 2001 :  20:42:45  Show Profile
wouldn't there be a signature size issue? Only can hold 255 characters.
So basically you only can get short multiple signatures. *shrugs*

Nice mod Lars

Go to Top of Page

LarsBerg
Starting Member

10 Posts

Posted - 09 March 2001 :  21:41:38  Show Profile
Converting M_SIG to memo should not be too dificult?

Maybe it could be converted to a memo field in the next version of snitz?

Lars...
Go to Top of Page
  Previous Topic Topic Next Topic  
 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 2.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07