Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #1126  
Old 04 Jul 2009, 01:08
nirvana43's Avatar
nirvana43 nirvana43 is offline
 
Join Date: Oct 2007
Location: Pune, India
Real name: Aditya Hajare
Hello
I'm trying to design one custom page while keeping vbulletin header, navbar and footer on it.
I've referred to following topics :
http://www.vbulletin.org/forum/showt...ight=logicians
http://www.vbulletin.org/forum/showthread.php?t=217075
http://www.vbulletin.com/forum/showthread.php?t=197563

Here is the custom page i wanna have headers and footers on.
http://www.projectsplanet.org/forums/testverify.php
Enter code 1234test to test above page.

When i try to put my code as follows in custom template created in Vbulletin admin CP, i'm getting error :
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header

$navbar

[MY CODE GOES HERE]

$footer
</body>
</html>
When i try to save above template, i get following error :

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

I guess its because i'm also trying to write php code within template.
Please check attached php file testverify.php
Please tell me how do i put vbulletin header, navbar and footer there.

Following are the contents of attached testverify.php if you do not wish to download it :

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




Detailed instructions are much appreciated.
Regards
Attached Files
File Type: php testverify.php (2.9 KB, 9 views)
Reply With Quote
  #1127  
Old 04 Jul 2009, 01:49
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You should follow Gary King's article that you linked to. In it, you'll see that you don't do your php page like you have written above at all. Your template will be fine as long as you don't put php in it. Start with the stuff in Gary's article and then add your custom code to it.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #1128  
Old 04 Jul 2009, 21:18
pspmodandcfw pspmodandcfw is offline
 
Join Date: Jun 2008
Real name: Brandon
Is there any way i can do PHP with this like

Header & Navbar

PHP Code Here

Footer
Reply With Quote
  #1129  
Old 05 Jul 2009, 12:11
amcd amcd is offline
 
Join Date: Oct 2004
Originally Posted by pspmodandcfw View Post
Is there any way i can do PHP with this like
no.

You are supposed to do this:

something.php

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

and in the template:

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

More or less, that is the general idea.
__________________
eXBii.com - Indian community
no XB no fun know XB know fun !
Reply With Quote
  #1130  
Old 06 Jul 2009, 04:18
pspmodandcfw pspmodandcfw is offline
 
Join Date: Jun 2008
Real name: Brandon
Thank you my good Sir. Ill try that out

Edit - What do you mean output of PHP code, the HTML form?

Last edited by pspmodandcfw; 06 Jul 2009 at 04:35.
Reply With Quote
  #1131  
Old 06 Jul 2009, 05:27
amcd amcd is offline
 
Join Date: Oct 2004
Yes, if that is what you want to show. The html (design and fixed data) part of the form can be put directly into the template, and any dynamic data can be displayed through variables set in the php code.

The basic purpose of templating (whether vbulletin or otherwise) is to separate the front end design from the business logic. The template holds just enough code (actually html with conditionals, not programming code) to show whatever needs to be shown. The template is simply 'shown', and that is why you cannot have php code in there.

The vbulletin manual has a section on templates, and reading the default vb templates can be very instructive for newcomers.

--------------- Added 06 Jul 2009 at 05:31 ---------------

This will work:

php:

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

template:

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

But that is not how it is intended to be. You are not supposed to write any HTML at all in the PHP. Otherwise the whole purpose of templating is defeated.
__________________
eXBii.com - Indian community
no XB no fun know XB know fun !

Last edited by amcd; 06 Jul 2009 at 05:31. Reason: Auto-Merged DoublePost
Reply With Quote
  #1132  
Old 07 Jul 2009, 07:34
pspmodandcfw pspmodandcfw is offline
 
Join Date: Jun 2008
Real name: Brandon
Thanks AMCD i finally got it to work.
Reply With Quote
  #1133  
Old 08 Jul 2009, 15:31
Davidx3 Davidx3 is offline
 
Join Date: Feb 2009
Sorry, but this makes no sence at all to me

anyone care to explain it in more detail for me?

Sorry Gary, i just dont find your instructions very clear at all :S
Reply With Quote
  #1134  
Old 08 Jul 2009, 16:02
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Davidx3 View Post
Sorry, but this makes no sence at all to me

anyone care to explain it in more detail for me?

Sorry Gary, i just dont find your instructions very clear at all :S
It is explained as well as it can be. The best thing to do is just copy exactly what he did and then analyze it yourself after you get it up and working. If you need further help, the best thing to do is to create your own thread in the main forums and post the exact php file you wrote and the exact template you wrote (both using the php/html tags).
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #1135  
Old 12 Jul 2009, 18:07
ilrglen's Avatar
ilrglen ilrglen is offline
 
Join Date: Jun 2008
Real name: Glen Kohut
Code to make page viewable by nonmembers

Okay, I accidentally deleted my test file that I finally got working and really can't spend another week reading through all 76 pages of this topic, fun as that was the first time, to find the answer to this simple question. What do I change in this code to make this page viewable by nonmembers?

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'TEST'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'TEST',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
if (!$vbulletin->userinfo['userid']) print_no_permission();

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Test Page';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');

?>
If somebody could change the code for me in the above quoted code and highlight the change in a different color that would make my day. Thanks.
Reply With Quote
  #1136  
Old 12 Jul 2009, 19:40
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Remove

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

And please, next time when posting code, use the code tags. They are there for a reason
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #1137  
Old 13 Jul 2009, 02:26
ilrglen's Avatar
ilrglen ilrglen is offline
 
Join Date: Jun 2008
Real name: Glen Kohut
Sorry, I couldn't figure out those tags. And thanks for the help. Much appreciated.

Originally Posted by cellarius View Post
Remove

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

And please, next time when posting code, use the code tags. They are there for a reason
Reply With Quote
  #1138  
Old 13 Jul 2009, 02:31
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Real name: Brooks
They're the same as the quote tags..... just php, code, and html
__________________
"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time!"
"It's important to only think about what you desire, not what you fear to achieve your ultimate goal!!
Reply With Quote
  #1139  
Old 19 Jul 2009, 19:55
Kottonmouth801's Avatar
Kottonmouth801 Kottonmouth801 is offline
 
Join Date: Apr 2009
Talking

Originally Posted by Digital Jedi View Post
Depends in if Ultimate Side Columns requires you to make any template edits.
Got ya.....

I have fixed issue...

It was a template issue.

Thanks 4 your time & help.


Last edited by Kottonmouth801; 19 Jul 2009 at 22:31. Reason: spelling
Reply With Quote
  #1140  
Old 21 Jul 2009, 10:06
sheep92032 sheep92032 is offline
 
Join Date: Jun 2008
is there any way to insert html into the template, something like this:

eval('$showhtml = "' .$showhtml . '";'); // with $showhtml containing html

I want to convert one of my scripts but if I can't do this it'll be a huge headache.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:18.

Layout Options | Width: Wide Color: