Welcome to Geeklog, Anonymous Friday, December 27 2024 @ 08:39 pm EST

Geeklog Forums

How to pass url parameters to theme layout


desireco

Anonymous
angelic
Hello, I am trying to setup a site for a client and he really likes all but wants to have different bacground for certain links. He thinks this is small request and insists on this. I think his request is not a big deal but have really hard time finding how to deal with it. If I try to use PHP_SELF or QUERY_STRING, they are empty and I guess this is due templating system. I tried to make it as function in appropriate file but no luck. I already made multiple css files, just need help how to select them based on what module is used. If anyone has suggestions about this, I would be more than interested to hear them. Thank you very much, Zeljko
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by desireco: but wants to have different bacground for certain links.
Can you be more specific? Isn\'t this something that could be solved by using CSS?
Quote by desireco: If I try to use PHP_SELF or QUERY_STRING, they are empty
Where did you use them and how? They should work just fine in the theme\'s functions.php file, for example. bye, Dirk
 Quote

Zeljko Dakic

Anonymous
angelic
Can you be more specific? Isn\'t this something that could be solved by using CSS?
Thanks for quick reply, unfortunatelly I can\'t use just css, I need to have different css for example when you use forum or classifieds then on homepage. I tried to put $php_self or http_server_vars[\'php_self etc both on the header.thtml (as this is only place where php can be done) or at the functions.php as you suggested but no luck. I am suspecting that this is something with templating engine,so if you have any advice or expriment I could do to clear things, I will listen. I did already tried a lot. BTW, PHP is working well on those places, just those vars are not present and I don\'t know why? Kind regards, Zeljko Dakic
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Zeljko Dakic:I am suspecting that this is something with templating engine,so if you have any advice or expriment I could do to clear things, I will listen.


You\'re right, I couldn\'t get PHP_SELF etc. to work either.

I found this little workaround. It\'s not pretty, but it does the trick Cool

In the theme\'s functions.php, do something like this:

$_USER[\'myvar\'] = $HTTP_SERVER_VARS[\'PHP_SELF\'];

You can then access $_USER[\'myvar\'] in the header.thtml.

As I said, it\'s not pretty but it should work. Just make sure to chose a pretty unique/obscure name for \"myvar\" so you don\'t risk any name collision with names that Geeklog may use ...

bye, Dirk
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
embarrassed
*sigh* The forum\'s messing up the closing brackets again (Blaine, help!) but I hope you did get the idea nonetheless ... bye, Dirk
 Quote

All times are EST. The time is now 08:39 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content