TinyPortal

Development => Support => Topic started by: MrApples on January 03, 2007, 01:54:57 AM

Title: Showing different content within blocks according to Theme.
Post by: MrApples on January 03, 2007, 01:54:57 AM
I have google ads on my site and one of the themes are dark, while the others are light, so the white background on the ads doesn't really fit in.

How would I show different content, or different ads, within a block if the user has the darker theme?
Title: Re: Showing different content within blocks according to Theme.
Post by: G6Cad on January 03, 2007, 11:13:08 AM
The only way i can think of is if you some how manage to import the style.css to the code of the googlead layout, instead of it's own.

Cant say how this is done, but i think it's the soultion though.
Title: Re: Showing different content within blocks according to Theme.
Post by: Lesmond on January 03, 2007, 11:49:18 AM
with Google ads you are not restricted to just a white background, try different color combinations,  see what will match in with all colors on your site.
Oh boy I sound like a google salesman  :o
Title: Re: Showing different content within blocks according to Theme.
Post by: G6Cad on January 03, 2007, 12:15:18 PM
Hm, i think we got your secret out in the open Lesmond  :2funny:
Title: Re: Showing different content within blocks according to Theme.
Post by: Lesmond on January 03, 2007, 12:20:00 PM
oh no G6 you found me out :-X
Title: Re: Showing different content within blocks according to Theme.
Post by: MrApples on January 03, 2007, 11:14:29 PM
There must be a way to check if the user has a certain theme, then display google ad(dark), else display google ad(light).
Title: Re: Showing different content within blocks according to Theme.
Post by: IchBin on January 04, 2007, 01:11:47 AM
Sure there is, but how many people can code that? That would require a database call to check the theme setting for the user, then display something dependant upon that. Its possible, but beyond most people around here including me. I could probably figure it out with some hard work, but I just don't have the time to do that for you right now sorry.
Title: Re: Showing different content within blocks according to Theme.
Post by: brianjw on January 04, 2007, 01:19:10 AM
Sounds complicated :(
If i was you I would go with Lesmonds idea:
Quote from: Lesmond on January 03, 2007, 11:49:18 AM
with Google ads you are not restricted to just a white background, try different color combinations,  see what will match in with all colors on your site.
Oh boy I sound like a google salesman  :o
Title: Re: Showing different content within blocks according to Theme.
Post by: JPDeni on January 04, 2007, 01:44:29 AM
You could use a php block and include


global $user_info;


and then use $user_info['theme'] to determine which theme is being used. It's the number of the theme, with the forum default being 0. You may have to experiment a bit.
Title: Re: Showing different content within blocks according to Theme.
Post by: IchBin on January 04, 2007, 04:35:24 AM
ah, see. I learned something new today. I need to take a look at that user info aray. :)