News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

50+ Queries?

Started by anunlike, October 03, 2005, 03:41:17 PM

Previous topic - Next topic

anunlike

Hi.

I'm wondering about something that just kind of started. I have no idea why it's doing this.

My forum states that, when I access the board index, there are 50+ (usually 54) queries. I have no idea why it's saying there are so many as I've done nothing substantial to make so many queries.

I have added some buttons, a little "box" (like the 'User Info' "box"), and an 'Add to favorites' text link at the top, as well as other changes (I'm attempting to make my own theme) and another "box" at the bottom containing all the copyright stuff as well as a few links to more info and some links for SPAM bots, to index.template.php. I've modified BoardIndex.template.php quite a bit as well. However, ALL this stuff was done prior and never seemed to adversely affect the number of queries.

I've added three mods and a few other things from the 'Tips and Tricks' child board, but again, that was prior and never seemed to adversely affect the number of queries.

So, any ideas as to what could be going on here?

Grudge

I'd guess at a badly written mod - which mods?
I'm only a half geek really...

anunlike

Googlebot & Spiders Mod
SimpleDownload
Static Page Mod

I don't know, I've had these installed for quite some time, I think the last one I installed was the Googlebot & Spiders Mod about a week ago, and I've never seen so many queries before yesterday.

Also, in case it wasn't clear, it only does this on the board index.


Thanks for the help.

Ben_S

Try removing the mods and seeing if it helps, one at a time preferably.
Liverpool FC Forum with 14 million+ posts.

anunlike

OK. I figured it out. Figures it'd be something I just overlooked.

I'd been trying to make it so that my boards alternate colors, rows that is, not columns. I accidently left in: class="', $board['alternate'] == 0 ? 'windowbg' : 'windowbg2', '"and now that it's out, it's back to normal.


BTW, I know this should probably get it's own topic, but how would I go about alternating the row colors on the board index? I've tried the above and:<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
and I put them in the correct <tr>, but neither of them seem to work.

I'll add this to the 'Tips and Tricks' child board...


Again, thanks.

Compuart

You'd need to initialize the variable and alternate it.

Step 1. Initialization of the variable (done before the foreach loop):
$alternate false


Step 2: Alternating the variable (done inside the foreach loop):
$alternate = !$alternate;


Step 3: Change the class depending on the current alternation state:
<tr class="windowbg', $alternate ? '2' : '', '">



So in total (BoardIndex.template.php):
	
	
	
foreach (
$category['boards'] as $board)
	
	
	
{
	
	
	
	
echo 
'
	
	
	
<tr>



becomes:
	
	
	
$alternate false;
	
	
	
foreach (
$category['boards'] as $board)
	
	
	
{
	
	
	
	
$alternate = !$alternate;
	
	
	
	
echo 
'
	
	
	
<tr class="windowbg'
$alternate '2' '''">

Hendrik Jan Visser
Former Lead Developer & Co-founder www.simplemachines.org
Personal Signature:
Realitynet.nl -> ExpeditieRobinson.net / PekingExpress.org / WieIsDeMol.Com

anunlike

Awesome! Thanks much.

I'll soon add a topic in the 'Tips and Tricks' child board. I hope it can get added to the stickied 'Tips and Tricks (index)'.

anunlike

Ok, well, apparently I can't start a new topic on that board, so if someone else could, I'm sure it would be benefit more than just me.

xenovanis

Hi,

Just start your topic in SMF Coding Discussion, I'll move it to Tips and Tricks. We disabled posting as too many supportrequest were posted in that board.
"Insanity: doing the same thing over and over again and expecting different results."

anunlike


Advertisement: