TinyPortal

Development => Support => Topic started by: CloverCreek on October 12, 2007, 07:34:35 PM

Title: how to put in theme dependant link?
Post by: CloverCreek on October 12, 2007, 07:34:35 PM
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
Title: Re: how to put in theme dependant link?
Post by: IchBin on October 12, 2007, 07:37:45 PM
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.
Title: Re: how to put in theme dependant link?
Post by: jacortina on October 12, 2007, 07:40:00 PM
Make sure you add $settings to your globals (if not already there).
Title: Re: how to put in theme dependant link?
Post by: CloverCreek on October 12, 2007, 08:53:31 PM
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?
Title: Re: how to put in theme dependant link?
Post by: jacortina on October 12, 2007, 09:33:16 PM
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)?
Title: Re: how to put in theme dependant link?
Post by: CloverCreek on October 12, 2007, 10:00:50 PM
Ok that worked fine once I was past my brain freeze, thanks guys
Title: Re: how to put in theme dependant link?
Post by: CloverCreek on October 27, 2007, 01:25:00 AM
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.
Title: Re: how to put in theme dependant link?
Post by: IchBin on October 27, 2007, 03:31:29 AM
$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.