PDA

View Full Version : evaluate code based on styleid


Acers
11-24-2005, 06:59 AM
planning to have a right column sidebar on my forums on the main default style.

But on other styles it won't be there

What i wanna know is if its possible that some php code (specifically query) can be run only if that style is selected by user and not for other styles..(saving query otherwise when guys are on diff style. and being faster therefore)

eg i want to put a gallery preview on sidebar. But since sidebar is on one style only, so the query code for geting the pictures from sidebar is executed only when that style is selected. and not otherwise.

eg *pseudo code
if(styleid==%style number%)
EXECUTE QUERY CODE
end if

something like above? if yes how?
thanks

merk
11-24-2005, 07:00 AM
you've almost got it.

STYLEID is defined with the styleid.

so


if(STYLEID == XX)
{
//stuff
}

Of course, you'd have to find the right location to use it.

Acers
11-24-2005, 07:22 AM
yep thankyou :D