[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.8

Adding a Column to an ASP Script and Deleting Some if Statements

Asked by coreybryant in Active Server Pages (ASP), Web Languages/Standards

Currently I have the script below that I am working with.  (I have not "updated" it to 'better' HTML yet, I just wanted to get this post out there.

Lines 4 - 11:
      if Rec("hotLink") = 1 then
            strRsp =  strRsp & "<font style=""font-size:16px"">"
            else
            strRsp =  strRsp & "<font style=""font-size:14px"">"            
      end if

      strRsp = strRsp & ("<a href="""& appUrl &"/links/"& Rec("linkID") & ".asp"">")
      strRsp = strRsp & (Rec("linkName") & "</a></font></b>" & vbnewline )

I really do not need, I just would like that to be an <h3> tag.   I know I could do:
      if Rec("hotLink") = 1 then
            strRsp =  strRsp & "<h3>"
            else
            strRsp =  strRsp & "<h3>"            
      end if

      strRsp = strRsp & ("<a href="""& appUrl &"/links/"& Rec("linkID") & ".asp"">")
      strRsp = strRsp & (Rec("linkName") & "</a></h3>" & vbnewline )

but I was hoping for something maybe a little bit cleaner if there are any ideas.

Right now, the code below creates two columns.  I would like to create three columns.

Basically broken down, the code creates something like:
<table style="width: 99%; border-collapse:collapse">
      <tr>
            <td style="width:60%; text-align:left">linkName</td>
            <td style="width:70px; text-align:right">image</td>
      </tr>
</table>

But I would like something like:
<table style="width: 99%; border-collapse:collapse">
      <tr>
            <td style="width:60%; text-align:left">linkName</td>
            <td style="text-align:left">sponsor</td>
            <td style="width:70px; text-align:right">image</td>
      </tr>
</table>


Thanks!

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
strRsp = strRsp & ("<table id=""tbl_func_dir144"" style=""border:0px; border-collapse:collapse; width:100%; text-align:right; background-color:#abcadc;"" cellspacing=""0"" cellpadding=""0"">" & VbCrLf)	
	strRsp = strRsp & ("<tr><td style=""padding:4px; border-bottom:1px #111111 solid; width:60%; background-color:#c3d9e6; text-align:right;"">" & vbNewLine )
	if Rec("hotLink") = 1 then 
		strRsp =  strRsp & "<h3>"
		else
		strRsp =  strRsp & "<h3>"		
	end if
 
	strRsp = strRsp & ("<a href="""& appUrl &"/links/"& Rec("linkID") & ".asp"">")
	strRsp = strRsp & (Rec("linkName") & "</a></h3>" & vbnewline )
	if Rec("hotLink") = 1 then 
	strRsp =  strRsp & "<font style=""font-size:8pt"">"		
	strRsp = strRsp & ("&nbsp;<sup>[<font color=""#cc0000"">sponsor</font>]</sup></font>")
	end if
 
	if Rec("submitDate") > date - 5 then	
		strRsp = strRsp &  "&nbsp;&nbsp;<img border=""0"" src="""& appUrl &"/images/new.gif"">"
	end if
 
	strRsp = strRsp & ("</td><td style=""padding:4px; border-bottom:1px #111111 solid; background-color:#c3d9e6; width:70px; text-align:right"">")
	strRsp = strRsp & (" <b>&nbsp;" & vbNewLine )
			if Rec("cVotes") = 0 then
				rating = 0 
			else
				rating = cint(Rec("Rating") / Rec("cVotes")) 
			end if
	strRsp = strRsp &  ("<a href=""javascript:openWindowRating('"& appUrl &"/rate.asp?linkID=" & Rec("linkID")& "')"">")
	strRsp = strRsp &  ("<img src="""& appUrl & "/images/star_"& rating & ".gif"" border=""0""></a>" & vbnewline)
 
	strRsp = strRsp & ("</td>" & vbnewline )
	strRsp = strRsp & ("</tr></table>" & vbnewline )
[+][-]09/10/09 12:21 PM, ID: 25303352Accepted Solution

Your question has an Asker Certified™ answer! coreybryant verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zones: Active Server Pages (ASP), Web Languages/Standards
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 1
Solution Grade: A
 
[+][-]09/10/09 10:44 AM, ID: 25302549Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/09 11:15 AM, ID: 25302829Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/09 11:20 AM, ID: 25302867Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/09 11:48 AM, ID: 25303096Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/09 01:33 PM, ID: 25303981Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/11/09 07:20 AM, ID: 25309765Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/01/09 12:12 PM, ID: 25946144Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100301-EE-VQP-131 - Hierarchy / EE_QW_3_20080625