TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,022
  • Total Topics: 21,332
  • Online today: 473
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 239
  • Total: 239

Showing different content within blocks according to Theme.

Started by MrApples, January 03, 2007, 01:54:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrApples

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?

G6Cad

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.

Lesmond

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

G6Cad

Hm, i think we got your secret out in the open Lesmond  :2funny:

Lesmond


MrApples

There must be a way to check if the user has a certain theme, then display google ad(dark), else display google ad(light).

IchBin

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.

brianjw

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

JPDeni

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.

IchBin

ah, see. I learned something new today. I need to take a look at that user info aray. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.