Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How do I make a multiple template.html mod (Read 1139 times)
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
How do I make a multiple template.html mod
Mar 4th, 2003 at 11:19am
Print Post  
At first I would like to apologize for my bad Englich  Undecided

I would produce by link different Template ....

------------

Now I have in sup.pl this code changed...

Code
Select All
	fopen(TEMPLATE,"template.html") || die("$txt{'23'}: template.html");
	@yytemplate = <TEMPLATE>;
	fclose(TEMPLATE);
 



to

Code
Select All
	$INFO{'template'} = "template.html" if (not $INFO{'template'});

	fopen(TEMPLATE,$INFO{'template'}) || die("$txt{'23'}: $INFO{'template'}");
	@yytemplate = <TEMPLATE>;
	fclose(TEMPLATE);
 



... Now the possibility exists to open the forum template with the URL call
    "YaBB.cgi?template=temlatefile.html"

You can see an example here:

Normally:
http://www.xonder.com/cgi-bin/yabb/YaBB.cgi

With ... YaBB.cgi?template=template3d.html :
http://www.xonder.com/cgi-bin/yabb/YaBB.cgi?template=template3d.html

And here my problem:

..Now the "template3d.html" opened.... however if a user a topic opens again "template.html" used!?

Can me who help?

  

Back to top
WWW  
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #1 - Mar 4th, 2003 at 11:36am
Print Post  
look in Subs.pl and try adding the template= to the $cgi variables.

search for
Code
Select All
$scripturl = qq~$boardurl/YaBB.$yyext~;
$cgi = qq~$scripturl?board=$currentboard~;
 



add after it
Code
Select All
if ($INFO{'template'} ) {$cgi = qq~$cgi,template=$INFO{'template'}~;
 


This should take care of most cases, but there will still be certain links (in the menu for example, or the jump to box) which use the $scripturl variable instead of the $cgi variable and so won't contain the template definition. These will have to be tracked down and modified individually. (Start by searching Subs.pl for $scripturl)
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #2 - Mar 4th, 2003 at 4:07pm
Print Post  
I have found the Code:

Code
Select All
$scripturl = qq~$boardurl/YaBB.$yyext~;
if ($currentcat ne "") {$cgi = qq~$scripturl?cat=$currentcat~;}
else {$cgi = qq~$scripturl?board=$currentboard~;}

if ($currentboard && -e "$boardsdir/$currentboard.mbo" ) { require "$boardsdir/$currentboard.mbo"; }
if (-e "$vardir/boards.pwd") {require "$vardir/boards.pwd";}
if (-e "$vardir/cat.mco") {require "$vardir/cat.mco";}
 



And add after it Code:
Code
Select All
	if ($INFO{'template'} ) {$cgi = qq~$cgi,template=$INFO{'template'}~;
 



Final Code:
Code
Select All
$scripturl = qq~$boardurl/YaBB.$yyext~;
if ($currentcat ne "") {$cgi = qq~$scripturl?cat=$currentcat~;}
else {$cgi = qq~$scripturl?board=$currentboard~;}

if ($currentboard && -e "$boardsdir/$currentboard.mbo" ) { require "$boardsdir/$currentboard.mbo"; }
if (-e "$vardir/boards.pwd") {require "$vardir/boards.pwd";}
if (-e "$vardir/cat.mco") {require "$vardir/cat.mco";}
if ($INFO{'template'} ) {$cgi = qq~$cgi,template=$INFO{'template'}~;
 



It gives me a Internal Server Error ...!?
  

Back to top
WWW  
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #3 - Mar 4th, 2003 at 11:38pm
Print Post  
Sorry, should have a closing curly bracket "}" at the end of that line.

Code
Select All
if ($INFO{'template'} ) {$cgi = qq~$cgi,template=$INFO{'template'}~;} 

  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #4 - Mar 5th, 2003 at 5:22am
Print Post  
That is too much work ....  :computer:

Are unfortunately not very well in code write  :mad:

I hopes that perhaps times a "mod" for "temlate.html" is made.

I would like to thank you for your assistance !!!
  

Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #5 - Mar 5th, 2003 at 4:03pm
Print Post  
Now I found a way too show more Templates ....

Look at:
http://boardmod.yabbforum.com/yabb/YaBB.pl?board=programming;action=display;num=...

But I have still another question ...
..:X.T.C:.. wrote on Mar 4th, 2003 at 11:19am:
Now I have in sup.pl this code changed...

Code
Select All
	fopen(TEMPLATE,"template.html") || die("$txt{'23'}: template.html");
	@yytemplate = <TEMPLATE>;
	fclose(TEMPLATE);
 



to

Code
Select All
	$INFO{'template'} = "template.html" if (not $INFO{'template'});

	fopen(TEMPLATE,$INFO{'template'}) || die("$txt{'23'}: $INFO{'template'}");
	@yytemplate = <TEMPLATE>;
	fclose(TEMPLATE);
 





Can vou give me a Code for:
e.g..

Code
Select All
	if ($INFO{'template'}) = "template3d.html" {fopen(FILE, "http://www.url.com/cgi-bin/yabbBoard2/YaBB.cgi");}
 


  

Back to top
WWW  
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #6 - Mar 5th, 2003 at 8:44pm
Print Post  
That other thread gets around the problem by setting up 2 or more different forums, which refer to the same message and member information. This will work because then each board can have a different template and be accessed by a different url.

So, why are you still messing around with $INFO{'template'}?
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: How do I make a multiple template.html mod
Reply #7 - Mar 6th, 2003 at 6:54am
Print Post  
You are right ...

But I wanted to know as with a code go ...

... so that I which learn more about code writing

:bulb2:
  

Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint