Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If...Then Problem with my forum

Status
Not open for further replies.

Baldwin238

Technical User
Feb 23, 2005
68
US
Need some help. This if..then statement does not seem to be working. Can anyone see why? This takes some data(IF it's present in the DB) and outputs into the topic.asp under the "# of posts" area under the avatar. It does outout the data like it should, but if no data is present at all, I want it to just print a "nbsp;"...let me know what you think. Thanks.

An example of the output:
Code:
 [URL unfurl="true"]http://www.absolutelyfreerolls.com/forum/forum2/topic.asp?TOPIC_ID=70[/URL]

The first post is as it should be, but in the replies, because there are no alias' entered yet, I do not want the "ALIAS'" part ot show. Tis is a snippet from the code I am trying to implement. It seems to ignore the If...OR...THEN statements.

Code:
		if (strTitan <> "") OR (strAbsolute <> "") OR (strFair <> "") OR (strPokercom <> "") OR (strBetfred <> "") then
			Response.Write "<p align=""center"" style=""margin-bottom:2px; margin-top:5px;""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""#000000""> Poker Alias' </font></b></p>"  & vbNewLine
			if strTitan = 1 and trim(Member_Titan) <> "" then
			Response.Write	"				 <b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Titan: </b>" & ChkString(Member_Titan,"display") & "</small></font><br />" & vbNewline
			end if
			if strAbsolute = 1 and trim(Member_Absolute) <> "" then
			Response.Write	"				 <b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Absolute: </b>" & ChkString(Member_Absolute,"display") & "</small></font><br />" & vbNewline
			end if
			if strFair = 1 and trim(Member_Fair) <> "" then
			Response.Write	"				 <b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Fair: </b>" & ChkString(Member_Fair,"display") & "</small></font><br />" & vbNewline
			end if
			if strPokercom = 1 and trim(Member_Pokercom) <> "" then
			Response.Write	"				 <b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Poker.Com: </b>" & ChkString(Member_Pokercom,"display") & "</small></font><br />" & vbNewline
			end if
			if strBetfred = 1 and trim(Member_Betfred) <> "" then
			Response.Write	"				 <b><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>BetFred: </b>" & ChkString(Member_Betfred,"display") & "</small></font><br />" & vbNewline
			end if
			Response.Write "</p>" & vbNewLine
		Else
			Response.Write "<p> </p>" & vbNewLine
		End if

Jeff Baldwin
sig2.gif
 
Code:
if (strTitan <> "") OR (strAbsolute <> "") OR (strFair <> "") OR (strPokercom <> "") OR (strBetfred <> "") then

The strTitan and the other similar ones were integer variables of 1 or 0, I actually needed to check the status of

Code:
trim(Member_Absolute)

and ther other similar ones.



Jeff Baldwin
sig2.gif
 
If it's going into the frst portion of the if statement every time, then obviously one of those variables is not empty. Do a series of Response.Write's before your if statement, but enclose the variables in brackets so you can see what is coming through, something like:
Code:
Response.Write "[" & yourVariable & "]<br/>"

That way you can look at the source for the page and determine if something is truly getting set in there.

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top