Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Colour-grading bars in poll mod
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  17:21:28  Show Profile  Visit MarkJH's Homepage
I've looked high and low through Snitz for the answer to this but it's either never been explained or i'm looking in the wrong places. Anyway...

I've seen on some forums that the bars which graph the poll results are colour-graded. How would I go about implementing this on my site? Is it something that would appear on all browsers?

Thanks.

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/

Edited by - MarkJH on 23 July 2002 17:27:21

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  17:37:44  Show Profile  Visit HuwR's Homepage
it is just 2 graphics


<SPAN style="layer-background:URL('<%= strImageUrl %>bar2.gif');background:URL('<%= strImageUrl %>bar2.gif');"><img src="<%= strImageUrl %>spacer.gif" width="<%=nThisVal/1.6%>" height="10"></SPAN>


Here is the bar2.gif


Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  17:41:01  Show Profile  Visit MarkJH's Homepage
Great stuff, the graphic too! Thanks, Huw.

Okay, where would I place this line of code in the err, code?

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  17:50:11  Show Profile  Visit HuwR's Homepage
it would go where you your image tag is at present, I'm not sure what the original code looked like, so it is a bir difficult to tell you exactly.


Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  17:58:47  Show Profile  Visit MarkJH's Homepage
Okay, i've found two instances of bar.gif (the original graphic) in the forum code.

In default.asp:

If trim(vAnswers(nCount)) <> "" Then
nThisVal = FormatNumber(vCount(nCount)/nMaxValue * nMaxWidth,0)
Response.Write " <tr>" & vbNewline & _
" <td width=""30%""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vAnswers(nCount) & "</font></td>" & vbNewline & _
" <td nowrap><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><img src=""bar.gif"" width=""" & nThisVal & """ height=""10"">  (" & vPercent(nCount) & "%)</font></td>" & vbNewline & _
" <td nowrap width=""10%""><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """>" & vCount(nCount) & " votes</font></td>" & vbNewline & _
" </tr>" & vbNewline

End If


In topic.asp:

If trim(vAnswers(nCount)) <> "" Then
nThisVal = FormatNumber(vCount(nCount)/nMaxValue * nMaxWidth,0)
%>
<tr>
<td width="30%"><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>"><%=vAnswers(nCount)%></font></td>
<td nowrap><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>"><img src="bar.gif" width="<%=nThisVal%>" height="10">  (<%=vPercent(nCount)%> %)</font></td>
<td nowrap width="10%"><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>"><%=vCount(nCount)%> votes</font></td>
</tr>
<%
End If


I can't think of anywhere else the image tag would be present.

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/

Edited by - MarkJH on 23 July 2002 17:59:16
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  18:04:14  Show Profile  Visit HuwR's Homepage
okay, just replace this bit
<img src=""bar.gif"" width=""" & nThisVal & """ height=""10"">

with the code I posted

Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  18:15:42  Show Profile  Visit MarkJH's Homepage
Tried that on default.asp and got this error:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/forum/Default.asp, line 311

" <td nowrap><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><SPAN style="layer-background:URL('<%= strImageUrl
----------------------------------------------------------------------------------------------------------------------------------------------^


bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  18:25:48  Show Profile  Visit HuwR's Homepage
in your default.asp code, it is a string so you will need to modify the code I posted by
changing the " to "" , the <%= to " & and the %> to & "

Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  18:47:29  Show Profile  Visit MarkJH's Homepage
Like this?

<SPAN style=""layer-background:URL('" & strImageUrl & "bar2.gif');background:URL('" & strImageUrl & "bar2.gif');""><img src=""" & strImageUrl & "spacer.gif"" width=""" &nThisVal/1.6& """ height=""10""></SPAN>

Okay, it works in default.asp (the active poll) although for some reason, it looks like the first four results in the active poll have got a white box around them... strange.

It didn't work in topic.asp (example: http://www.bandlink.net/forum/topic.asp?TOPIC_ID=7664) there was no graphic at all displayed.

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  18:51:23  Show Profile  Visit HuwR's Homepage
I said you oly needed to modify my code for DEFAULT.asp not topic.asp

Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  19:01:55  Show Profile  Visit MarkJH's Homepage
Ack, sorry. Combination of lack of ASP knowledge, a drink, too high a screen rez, tiredness and the late hour caused me misread your instructions.

Okay, it works all round. Thanks for your help Huw!



bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  19:03:59  Show Profile  Visit MarkJH's Homepage
Except it doesn't work at all on Netscape. Why can't all browsers be the same???

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  19:17:26  Show Profile  Visit HuwR's Homepage
it should work in netscape, that is why it has two background styles in the span tag

Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  19:26:39  Show Profile  Visit MarkJH's Homepage
Well, it's not working for me on Netscape 6.2 for topic.asp or default.asp

There is something strange though. When the page loads, the graphics do appear then disappear again almost instantaneously.

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 23 July 2002 :  19:39:24  Show Profile  Visit HuwR's Homepage
if you do a view source on the page, what do the <span and <img tags look like.

Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 23 July 2002 :  19:44:41  Show Profile  Visit MarkJH's Homepage
From default.asp:

<td nowrap><font face="arial" color="white" size="2"><span style="layer-background:URL('bar2.gif');background:URL('bar2.gif');"><img src="spacer.gif" width="125" height="10"></span>  (44.5%)</font></td>

bandlink.net - http://www.bandlink.net/
bandlink music forums - http://www.bandlink.net/forum/
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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 0.67 seconds. Powered By: Snitz Forums 2000 Version 3.4.07