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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 515
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 128
  • Total: 128

how to put in theme dependant link?

Started by CloverCreek, October 12, 2007, 07:34:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CloverCreek

Hi

I want to use multiple themes. I have a side block with a graphic that provides the link to a chatroom. The graphic used will be different according to the theme selected. I have the graphics identically named within the various themes images folder, but of course if I hard code the link in the block the graphic will remain unchanged when the theme is altered. So I need the conditional statement that will switch to the graphic within each theme. Along the lines of

http://domain.com/Themes/theme_name_/images/chat.gif for example

Can anyone give me a quick answer?

Thanks

IchBin

If its in each themes image folder, hard code the link like this:

<img src="',$settings['images_url'],'/image.jpg" />

This way it picks up the different path for each theme.

jacortina

Make sure you add $settings to your globals (if not already there).

CloverCreek

ok I added $settings to my globals. but using the link from IchBin I'm still not getting it to work - me not thinking straight no doubt - what would I put to get the relevant theme in the 'images_url' part?. does it need  a variable for the theme folder itself? As it stands I have them in the path of
theme1/images/image.gif
theme2/images/image.gif

and so on, so is there are variable that would tell it theme1 or theme 2 etc?

jacortina

That's what that $settings value should be holding. There's $settings['theme_url'] and $settings['images_url'] and they should be filled with the appropriate pointers for the theme being used.

Can you look at the page source and find out what it's point at (what value is ending up being echo'ed out)?

CloverCreek

Ok that worked fine once I was past my brain freeze, thanks guys

CloverCreek

As a follow on question on the same link to a chatroom, there is a facility to compile a login url for the chat that combines the chat url, the forum username, forum profile and avatar. I'm not interested in the avatar as that will just slow the thing down, but I would like to add the profile. Once successful a name in chat can be highlighted and a menu with a profile option appears, clicking that launches the profile.

I used $user_settings[memberName] as the value to extract the username without problem, but I'm struggling to find the profile equivalent. Ca nanyone help or point me in the right direction please.

IchBin

$context['user']['name'] = display name and $context['user']['id'] = id number for the profile.

Don't know where you're loading everything from, so not sure how to tell you how you can do it. But thats where the info is stored.

This website is proudly hosted on Crocweb Cloud Website Hosting.