Page Index Toggle Pages: 1
Topic Tools
Normal Topic [Solved] I need a theme-concious string (Read 1,052 times)
Lopa
Junior Member
**
Offline



Posts: 95
Location: Australia
Re: I need a theme-concious string
Reply #2 - Oct 6th, 2010 at 9:32pm
Post Tools
Yes JonB $templatesdir is crucial in the string, but maybe it needs the argument rearranged to determine the theme in use first? Also I need to call a file and the theme, not just the theme and that's the part that I don't fully understand how it works. Cry

If I could put a require in the "default.html" file for example, which wont work - I wouldn't even be asking this question.  Grin

Code
Select All
if ($Boardconfig == $User_SELECTED_theme || -e "$templatesdir/$User_SELECTED_theme/ThemeCfg.pl") {require "$templatesdir/$User_SELECTED_theme/ThemeCfg.pl"; }  



Dunno?, I'll dig it out if I have to - But I thought it would be nice if someone could help me with it. Wink

Edit:

I think I've worked it out and it seems to obey all of the rules - BUT! whether it's exactly in the right location - I'm not sure? So if someone can confirm either way - That'd be nice.  Wink

Subs.pl
Code (Perl)
Select All
	if (!$usehead) { $usehead = qq~default~; }
		if (-e "$templatesdir/$useboard/ThemeCfg.pl") {require "$templatesdir/$useboard/ThemeCfg.pl";}
	$yytemplate = "$templatesdir/$usehead/$usehead.html";
	fopen(TEMPLATE, $yytemplate) || die("$maintxt{'23'}: $yytemplate");
	$output = join('', <TEMPLATE>);
	fclose(TEMPLATE); 

« Last Edit: Oct 7th, 2010 at 2:59am by Lopa »  

I make mistakes - That's how I learn.
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,785
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: I need a theme-concious string
Reply #1 - Oct 6th, 2010 at 11:27am
Post Tools
AFAIK, YaBB themes are only distinguished by the folder name in which they reside. (or the name assigned to that combination when you do a template configuration in the CSS Editor.)

And since that is a drop-down choice in the User Control Panel - and what drives the display, it would appear to be a persistent variable.

I'm betting on $templatesdir

pure speculation - not a 'known' fact (at least to me).  I'm sure one of the template gurus will slap me into shape, LOL.

Roll Eyes

  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Lopa
Junior Member
**
Offline



Posts: 95
Location: Australia
[Solved] I need a theme-concious string
Oct 6th, 2010 at 7:34am
Post Tools
Ok Anyone and Everyone, I really do need some help!

This means a lot to me but unfortunately perl is not my hottest attribute at the moment.

I need to call the theme in current use by the user and suspect it would look something like this - for the want of anything correct here!  Grin

Code
Select All
if (-e "$templatesdir/$User_SELECTED_theme/ThemeCfg.pl") {require "$templatesdir/$User_SELECTED_theme/ThemeCfg.pl"; } 



The gist is - It must call the ThemeCfg.pl for the selected template "only" in much the same way as the yabb css is called.
« Last Edit: Oct 7th, 2010 at 3:16am by Lopa »  

I make mistakes - That's how I learn.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top