Log in

View Full Version : User Album Conditionals?


MikesSite
12-15-2010, 06:12 PM
I would like to display something in postbit but only if the user has a user album. Is there a conditional for this?

Thanks!

Lynne
12-15-2010, 06:19 PM
You would basically have to write a query on the table 'album' to see if they have an albumid for that userid. So, you would have to JOIN with that table ON userid to get, say MAX(albumid) and if that exists then display whatever. If it is NULL, then you wouldn't display anything.

MikesSite
12-15-2010, 06:24 PM
Okay, thanks. If I were to do this in the postbit do you think it would cause a noticeable load on the server?

Lynne
12-15-2010, 06:27 PM
If you do it by using a plugin to the post query, then I doubt you would notice a thing. If you do it by running a separate query per post, then you could notice something, but it's doubtful since it's such a small query, but that depends on your server really.

MikesSite
12-15-2010, 06:38 PM
Lynn, you are the best!! Thanks very much, I'm going to toy with this for a bit