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

 All Forums
 Community Forums
 Graphics & Style in Snitz!
 a style for the poll mod
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

JudgeTom
Starting Member

9 Posts

Posted - 28 August 2006 :  03:37:24  Show Profile  Visit JudgeTom's Homepage
Don't know if anyone has thought to do this, but I thought I would share what I am implementing for my site.

By taking the code from the poll mod and removing the part in red:

for nCount = 1 to 15
  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 & """>" & formatStr(vAnswers(nCount)) & "</font></td>" & vbNewLine & _
      "<td nowrap><font face="""  & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><img src=""" & strImageURL & "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
next


then adding the parts in red:
dim pcolor
pcolor = array("Red", "Violet", "Purple", "Maroon", "Blue", "Teal", "Green", "Turquoise", "Yellow", "Orange", "Khaki", "Goldenrod", "Navy", "Fuchsia", "Powderblue") 

for nCount = 1 to 15
  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 & """>" & formatStr(vAnswers(nCount)) & "</font></td>" & vbNewLine & _
      "<td nowrap><font face="""  & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strDefaultFontSize & """><span style=""background-color:" & pcolor(nCount -1 ) & ";""><img src=""images/poll_left.png"" align=""absmiddle""><img src=""" & strImageURL & _
      "poll_center.png"" width=""" & nThisVal & """ height=""15"" align=""absmiddle""><img src=""images/poll_right.png"" align=""absmiddle""></span>  [" & 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
next


Just make sure that these three images are in your images folder and you will have a bar with rounded ends and a different color for every poll option. They were made to go on a white background, but you get the picture.


http://www.storygrinder.com
  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 0.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07