Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Birthday Greetings On Log-in

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
richfed Posted - 19 July 2008 : 09:09:39
A while back, I noticed that on my birthday, when I visited this site, there was a "Happy Birthday" message to me up by the log-in area of the forum header.

Does anyone have the code to add this to my forum? It was pretty neat!<
12   L A T E S T    R E P L I E S    (Newest First)
balexandre Posted - 22 July 2008 : 03:29:56
just as a reminder...

the idea is ok, but:

on your birthday you can be "out" of the PC and the message should be something like...

for the day: "We didn't forgot about you... Happy birthday!", and then never show the message again

for the day after and until the user log in and ... not more than 2/3 weeks: "Hey, hey... we hope that you got a pleasant birth day", and then never show the message again for that year


just my opinion
<
leatherlips Posted - 21 July 2008 : 09:12:01
I added the code that RichardKinser posted and it is working fine. I tried to add what HuwR said in red:

if isbday() = "yes" then

but that caused it not to work any longer. I removed the () and it is working fine. Do I really need to have the ()?<
richfed Posted - 20 July 2008 : 08:20:23
Thank you, Lads!<
Carefree Posted - 20 July 2008 : 04:05:16
I knew something didn't look right about that function, mind playing tricks on me again.

Tx HuwR<
HuwR Posted - 20 July 2008 : 03:36:22
no, but you need to change this line in callgreeting
if isbday = "yes" then

to be
if isbday() = "yes" then<
Carefree Posted - 20 July 2008 : 03:23:49
OK - then in our "inc_header.asp", we'd have to call isbday just before calling getGreeting().<
HuwR Posted - 20 July 2008 : 02:44:54
yes you could, but if you wanted to use it in the future you would then have to re-extract the isbdy function, so I owuld leave it as 2 functions, makes no difference in terms of execution and makes it more flexible.<
Carefree Posted - 19 July 2008 : 21:50:53
quote:
Originally posted by RichardKinser

This is how it's implemented here ....


Richard, there's no call to "isbday" function that way. Since nothing else uses the functions, couldn't you combine them (as below) & call isbday instead?

function isbday
	if strAgeDOB = "1" and MemberID > 0 then
		set rsbday = my_Conn.Execute ("SELECT M_DOB FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & MemberID & " AND M_DOB <> ''")
		if rsbday.EOF then
			isbday = "no"
		else
			if day(StrToDate(rsbday("M_DOB") & "000000")) = day(strForumTimeAdjust) and month(StrToDate(rsbday("M_DOB") & "000000")) = month(strForumTimeAdjust) then
				isbday = "yes"
			else
				isbday = "no"
			end if
		end if
		set rsbday = nothing
	else
		isbday = "no"
	end if
	if isbday = "yes" then
		Response.Write "Happy Birthday!"
	else
		Response.Write "You are logged on as"
	end if
end function
<
leatherlips Posted - 19 July 2008 : 21:35:59
You can also add a little graphic before the birthday such as a birthday cake. I have the events calendar mod installed so I just used it.

I changed this line:
Response.Write "Happy Birthday!"

To this:
Response.Write "" & getCurrentIcon(strCalIconBDay,"Happy Birthday!","vAlign=""middle""") & " <b>Happy Birthday!</b>"
<
leatherlips Posted - 19 July 2008 : 21:16:00
That's nice! I didn't know it did that. I've never input my birthday before. I just added it to my site. <
RichardKinser Posted - 19 July 2008 : 20:43:30
This is how it's implemented here:

First add the following to inc_func_common.asp:

function isbday
	if strAgeDOB = "1" and MemberID > 0 then
		set rsbday = my_Conn.Execute ("SELECT M_DOB FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & MemberID & " AND M_DOB <> ''")

		if rsbday.EOF then
			isbday = "no"
		else
			if day(StrToDate(rsbday("M_DOB") & "000000")) = day(strForumTimeAdjust) and month(StrToDate(rsbday("M_DOB") & "000000")) = month(strForumTimeAdjust) then
				isbday = "yes"
			else
				isbday = "no"
			end if
		end if
		set rsbday = nothing
	else
		isbday = "no"
	end if
end function


function getGreeting()
	if isbday = "yes" then
		Response.Write "Happy Birthday!"
	else
		Response.Write "You are logged on as"
	end if
end function


Then in inc_header.asp around line #392 find:

"                <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>You are logged on as<br />"

and replace with:
"                <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>"
call getGreeting()
Response.Write  "<br />" & vbNewLine
<
Carefree Posted - 19 July 2008 : 15:41:23
You could embed this routine wherever you want the HB to show:


	if strAgeDOB > "" then
		strSql="SELECT M_DOB FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME='" & strDBNTUserName & "'"
		set rsHB=my_Conn.Execute(strSql)
		Member_DOB=rsHB("M_DOB")
		rsHB.Close
		set rsHB=Nothing
		TDay=DoubleNum(Month(Date())) & DoubleNum(Day(Date()))
		if mid(Member_DOB, 5, 4) = TDay then
			Response.Write	"	<tr>" & vbNewLine & _
				"		<td align=""right"">Happy Birthday!</td>" & vbNewLine & _
				"	</tr>" & vbNewLine
		end if
	end if
<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000 Version 3.4.07