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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Alternate colors for topic cells in forum.asp
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

texanman
Junior Member

United States
410 Posts

Posted - 14 April 2008 :  09:48:12  Show Profile  Reply with Quote
Can this be done just as in post.asp?
Any help is appreciated.<

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 April 2008 :  10:48:05  Show Profile  Reply with Quote
Find the following on line 440 and add the code in green:
else
	intI = 0
	tT_STATUS = 0
	tCAT_ID = 1
	tFORUM_ID = 2
Find the following on line 480 and add the code in green:
		end if
		if intI = 0 then
			CColor = strAltForumCellColor
		else
			CColor = strForumCellColor
		end if
		Response.Write	"              <tr>" & vbNewLine & _
				"                <td bgcolor=""" & strForumCellColor & """ align=""center"" valign=""middle""><a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>"
Change the occurrences of strForumCellColor on lines 487, 535, 543, 544, 545, 552 & 554 to CColor.

Find the following on line 568 and add the code in green:
		rec = rec + 1 
		intI  = intI + 1
		if intI = 2 then
			intI = 0
		end if
	next
<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 14 April 2008 :  11:47:45  Show Profile  Reply with Quote
Shaggy:
You are the best. Thank you soooooooooo much.
It works very well. <
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 April 2008 :  12:13:06  Show Profile  Reply with Quote
You're welcome

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 14 April 2008 :  18:56:26  Show Profile  Reply with Quote
For your second block you could use
intI=(intI+1) mod 2
to condense it.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 April 2008 :  04:24:04  Show Profile  Reply with Quote
Oh, there's many other ways to achieve this, some, such as your suggestion, more efficient than what I posted but, for the sake of consistency, I provided code that was already in use on other pages

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 15 April 2008 :  07:03:57  Show Profile  Reply with Quote
In that case consistency of efficiency is the best choice.<
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 15 April 2008 :  15:26:28  Show Profile  Reply with Quote
quote:
Originally posted by phy1729

For your second block you could use
intI=(intI+1) mod 2
to condense it.



phy1729:

Can you elaborate what you mean?
Thanks<
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 15 April 2008 :  16:55:32  Show Profile  Visit AnonJr's Homepage  Reply with Quote
He's talking about using modulus division. I tend to use a similar (but not quite the same ) technique when doing this sort of thing in my work. While he's right that that approach is more elegant and probably more efficient, IMHO it probably won't make a noticeable difference.

Ask 10 programmers how to do something and you'll often get 20 different options at minimum. <
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 15 April 2008 :  17:27:57  Show Profile  Reply with Quote
As AnonJr said it's a diffrent way to do the same thing +1 adds one and %2 divides by two and takes the remainder.

My personal favorite way to do this is i=i?0:1 which mean is i is true (1) i=0 else (0) i=1 Unfortunately that approach doesn't work in ASP.<
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 15 April 2008 :  18:02:23  Show Profile  Reply with Quote
quote:
Originally posted by AnonJr


Ask 10 programmers how to do something and you'll often get 20 different options at minimum.



Ah!! Programers are far better than Economists then. 50 economists will give you 50 different answers to the same question.

Have you heard about the old professor of Macroeconomics who year after year gave the same exam. Only the answer changed year after year!

Thanks for the explanation.<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 20 April 2008 :  07:42:30  Show Profile  Reply with Quote
Cool tweak,,, installed and all works satisfactorily.. I have observed with the alternate colour cell (strAltForumCellColor) if the number of post causes the thread to pagenate, the page links background colour remains as the original colour (strForumCellColor) see image below. However if the original cell background has additional pages it stays as the same colour ie both strForumCellColor. I am sure a genius will provide a simple solution..




kindest regards andy<

Edited by - Andy Humm on 20 April 2008 08:16:12
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 21 April 2008 :  05:07:18  Show Profile  Reply with Quote
Find the following on line 792 of forum.asp (may be a couple of lines further down if you've already applied the changes above) and change the strForumCellColor to CColor or just delete the bgcolor attribute completely:
ref = "                      <td align=""right"" valign=""bottom"" bgcolor=""" & strForumCellColor  & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>" 
<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 21 April 2008 :  05:16:23  Show Profile  Reply with Quote
Perfick... Thank you as always..<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 21 April 2008 :  05:26:05  Show Profile  Reply with Quote
You're welcome

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07