vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=228112

Mythotical 18 Nov 2009 05:22

Lynne, so how would we call multiple templates for the same custom page and it actually work?

Lynne 18 Nov 2009 05:33

You would do it as before, only use the new syntax. So, something like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You would use {vb:var foo} and {vb:var bar} in your first_template to insert the variables $foo and $bar and then you would use {vb:var my_variable} in the TEST template to insert the output from $my_variable.

Mythotical 18 Nov 2009 05:37

EDIT: I'm a fruitcake, damn pain pill is kicking my butt right now.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Missing that from my print_output area.

Thanks tho, at least I understand now.

--------------- Added 18 Nov 2009 at 05:52 ---------------

Ok next question, I am reusing the same variable for different pages so I am not having a cluster of different variables within conditional statements. Right now it seems that is confusing me or its the meds, either way is it safe to say I can keep doing that or should I change it?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That var is what I am reusing for each page load of do=cat or do=file, etc. Do I need to change it to print_output or what?

LoveStream 18 Nov 2009 17:51

Thank your tutor.
I had met following error, when I using this template page, there is a cookie sent already.

Uh!
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I create scripts as phoenixjournals.php, but it occur if I logout.

How could I solve it? or what deos it mean in this case?

I hope your teaching. Thanks.

ragtek 18 Nov 2009 18:16

Be sure that there's nothing before <?php

Lynne 18 Nov 2009 19:58

Quote:

Originally Posted by Steve M (Post 1916417)
Ok next question, I am reusing the same variable for different pages so I am not having a cluster of different variables within conditional statements. Right now it seems that is confusing me or its the meds, either way is it safe to say I can keep doing that or should I change it?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That var is what I am reusing for each page load of do=cat or do=file, etc. Do I need to change it to print_output or what?

You should be able to use the same variable name on different pages - vb does that alot.

If you are wanting to register that variable on each page for use in the template, you need to put that line inbetween the $templater = vB_Template::create('whatever_template') and the $templater->render() lines.

edit: Or actually, you may be able to just preregister it at the top of you page for the template. See the article I link to in my first post to find out about preregistering variables.

cory_booth 18 Nov 2009 20:06

Replace the line:
require_one ./gobal

With:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Will allow you to put the php files anywhere on the site (i.e. mydomain.com/pages/)

LoveStream 19 Nov 2009 03:02

Quote:

Originally Posted by ragtek (Post 1916684)
Be sure that there's nothing before <?php

Yes, I double checked it but it still remains. I suspect that affected by server programs. When I logged there is no problem. It is only just for guest than member logged.

I create new my.php file. and do define this scripts refer to template files.

Regards.

--------------- Added 19 Nov 2009 at 03:04 ---------------

Quote:

Originally Posted by cory_booth (Post 1916733)
Replace the line:
require_one ./gobal

With:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Will allow you to put the php files anywhere on the site (i.e. mydomain.com/pages/)

Thanks. I do put it the same path with vB. When I trial as logged it's run very well.

Lynne 19 Nov 2009 03:10

Quote:

Originally Posted by cory_booth (Post 1916733)
Replace the line:
require_one ./gobal

With:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Will allow you to put the php files anywhere on the site (i.e. mydomain.com/pages/)

Actually, if you chdir, you don't want to then put the whole path to the global.php file. You would just go:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Mythotical 19 Nov 2009 04:52

Quote:

Originally Posted by Lynne (Post 1916727)
You should be able to use the same variable name on different pages - vb does that alot.

If you are wanting to register that variable on each page for use in the template, you need to put that line inbetween the $templater = vB_Template::create('whatever_template') and the $templater->render() lines.

edit: Or actually, you may be able to just preregister it at the top of you page for the template. See the article I link to in my first post to find out about preregistering variables.

Good point, I will look into doing that tomorrow. Need sleep first.

ragtek 19 Nov 2009 11:14

What's with
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Do we need it?
Some files in vB4 have it^^

Lynne 19 Nov 2009 15:41

You may need to add those lines depending on what you do in your code. But, every page doesn't need those lines. I *think*, but I'm not positive, that if you have hooks in your page, you will want to include those lines. But, since usually there aren't any hooks added into a custom page, then those lines aren't needed.

EidolonAH 21 Nov 2009 14:14

Brilliant, thank you Lynne.:up:

Anseur 21 Nov 2009 18:05

I've set this up on my test site, and it works OK while i'm logged in, but when I'm not logged in, and I visit this custom page, I just get a plain white screen.

looking at a source of this plain white pages shows me:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Here is the code currently used in the template for this custom .php page:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Lynne 21 Nov 2009 18:34

Quote:

Originally Posted by Anseur (Post 1918381)
I've set this up on my test site, and it works OK while i'm logged in, but when I'm not logged in, and I visit this custom page, I just get a plain white screen.

looking at a source of this plain white pages shows me:
[code]
<!-- BEGIN TEMPLATE: dkp_template -->

<!-- END TEMPLATE: dkp_template -->

What is in your error_logs? (If you don't know where they are, ask your host.) What is in your php page that you created?


All times are GMT. The time now is 16:33.

Powered by vBulletin® Version 3.8.13
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.