Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #106  
Old 31 Dec 2009, 12:41
rEd86's Avatar
rEd86 rEd86 is offline
 
Join Date: May 2009
Thanks for a great tutorial. I have some custom pages I am creating and it only took a few minutes to do so by following this example code.

I didn't see this mentioned in the thread but there is one slight problem with the code as it exists. (or at least there was when I implemented it on my site)

In the php code, you load the page title in to variable pagetitle but in the template you have vboptions.bbtitle so the title for the page shows up as forums.

I changed the line in the template from:
<title>{vb:raw vboptions.bbtitle}</title>
to
<title>{vb:raw pagetitle}</title>

and it worked as expected.

Take care!

--Ed
Reply With Quote
  #107  
Old 31 Dec 2009, 19:02
garretbyrne's Avatar
garretbyrne garretbyrne is offline
 
Join Date: Nov 2009
Real name: Garret Byrne
Thanks Lynne it was extremely helpful and easy.. was able to create loads of pages in a matter of minutes... Cheers
Reply With Quote
  #108  
Old 01 Jan 2010, 00:29
mandingo's Avatar
mandingo mandingo is offline
 
Join Date: Jun 2008
How would I add my forum's sidebar,getting kinda stuck,brain turning to spaghetti.
a nudge in the right direction may be all I need.
Reply With Quote
  #109  
Old 01 Jan 2010, 16:00
SuperGLS SuperGLS is offline
 
Join Date: Nov 2004
Couple questions about this one.

When I try to add any HTML code underneath the ###Your Custom Code Goes Here### section I get this error.

Parse error: syntax error, unexpected '<' in /home/elantrax/public_html/forums/cotm.php on line 41

When I just add regular text underneath the ###Your Custom Code Goes Here### section it only displays the word "text" no matter what I have typed in.

Here's the URL. Everything else seems to be working fine.

http://www.elantraxd.com/forums/cotm.php
Reply With Quote
  #110  
Old 01 Jan 2010, 16:49
simon157 simon157 is offline
 
Join Date: Jul 2009
Hi, could someone please, please help me as I'm struggling adding code containing php code to my template. It's driving me nuts !! The code I want to add is the following so it loads within the forum environment, but I'm completely stuck...


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

Hope you can help

Simon
Reply With Quote
  #111  
Old 01 Jan 2010, 17:02
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by mandingo View Post
How would I add my forum's sidebar,getting kinda stuck,brain turning to spaghetti.
a nudge in the right direction may be all I need.
I have no idea how to add sidebars. That is a template thing and you can probably find a tutorial or mod that will show you the code to add to your template to do that.

Originally Posted by SuperGLS View Post
Couple questions about this one.

When I try to add any HTML code underneath the ###Your Custom Code Goes Here### section I get this error.

Parse error: syntax error, unexpected '<' in /home/elantrax/public_html/forums/cotm.php on line 41

When I just add regular text underneath the ###Your Custom Code Goes Here### section it only displays the word "text" no matter what I have typed in.

Here's the URL. Everything else seems to be working fine.

http://www.elantraxd.com/forums/cotm.php
You don't just add text in a php file. You need to assign it to a variable and then out put the variable in the template. Or, just put the text in the template.
Originally Posted by simon157 View Post
Hi, could someone please, please help me as I'm struggling adding code containing php code to my template. It's driving me nuts !! The code I want to add is the following so it loads within the forum environment, but I'm completely stuck...

Hope you can help

Simon
You do not put php in templates. You put the php in the php page and then assign the output to a variable and put the variable in the template. Don't forget to register the variable for use in the template first.
__________________
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
  #112  
Old 01 Jan 2010, 17:07
simon157 simon157 is offline
 
Join Date: Jul 2009
Thanks Lynne, but could you possibly help me with the coding for the first one. Once I have an idea then I will be able to cover the rest of my pages. Sorry, if I'm asking to much, but I'm by no means a programmer and new to vbulletin. Thanks very much.

Simon
Reply With Quote
  #113  
Old 01 Jan 2010, 17:16
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
You should post out in the main forums for help with converting your code for use in a page (that really isn't what this article is about and your stuff will get lost in here among other posts). You may also want to look at how vbulletin does it in their pages. You will probably want a second template for your while loop stuff also.
__________________
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
  #114  
Old 01 Jan 2010, 17:52
SuperGLS SuperGLS is offline
 
Join Date: Nov 2004
I see. So can you give me an example of what type of "stuff" should go underneath the ###### YOUR CUSTOM CODE GOES HERE ##### part of the xxxxxx.php file that you've instructed us to make?

EDIT- I know this is newb question!
Reply With Quote
  #115  
Old 02 Jan 2010, 09:39
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Originally Posted by SuperGLS View Post
I see. So can you give me an example of what type of "stuff" should go underneath the ###### YOUR CUSTOM CODE GOES HERE ##### part of the xxxxxx.php file that you've instructed us to make?

EDIT- I know this is newb question!
There already is an example in the code given. Assigning a value to the variable $pagetitle, then registering $pagetitle for use in the template.
__________________
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
  #116  
Old 02 Jan 2010, 14:42
SuperGLS SuperGLS is offline
 
Join Date: Nov 2004
Ohhh, I think I understand now, so...


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

Make the template from the code in the first post, but don't change anything there, right?

Upload whatever .php file you want to call to the yoursite/forum/ folder.

So, does everything I've <<<<<'d next to and everything I've marked in red look ok? Thanks in advance!
Reply With Quote
  #117  
Old 02 Jan 2010, 16:09
simon157 simon157 is offline
 
Join Date: Jul 2009
Originally Posted by Lynne View Post
You should post out in the main forums for help with converting your code for use in a page (that really isn't what this article is about and your stuff will get lost in here among other posts). You may also want to look at how vbulletin does it in their pages. You will probably want a second template for your while loop stuff also.
I've posted my issue out in the forums as suggested but still no response. I've come to a complete stand still until I can get this sorted. Any chance of some help.

Thanks

Simon
Reply With Quote
  #118  
Old 02 Jan 2010, 16:20
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Originally Posted by SuperGLS View Post
Ohhh, I think I understand now, so...
Sorry to say: No, you don't...

Make the template from the code in the first post, but don't change anything there, right?

Upload whatever .php file you want to call to the yoursite/forum/ folder.
Both is wrong. Of course you can change the template, that's what templates are for, and the only php file is the one where you put the php-code from firstpost. Where it says to put your custom code, you need to put your custom code.

Have you tried to get it running as is, i.e. exactly like explained in the article before making any changes?

What exactly are you trying to do anyway? What php-code do you want to execute?
__________________
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
  #119  
Old 02 Jan 2010, 16:59
simon157 simon157 is offline
 
Join Date: Jul 2009
Originally Posted by cellarius View Post
Sorry to say: No, you don't...


Both is wrong. Of course you can change the template, that's what templates are for, and the only php file is the one where you put the php-code from firstpost. Where it says to put your custom code, you need to put your custom code.

Have you tried to get it running as is, i.e. exactly like explained in the article before making any changes?

What exactly are you trying to do anyway? What php-code do you want to execute?
I have the same problem Cellarius. I'm trying to run the following code in a new template and I've completely stuck. Can you help at all?? I've tried everything, but I'm not a coder.


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

Thanks Simon
Reply With Quote
  #120  
Old 03 Jan 2010, 03:04
SuperGLS SuperGLS is offline
 
Join Date: Nov 2004
Originally Posted by cellarius View Post
Sorry to say: No, you don't...
Haha, ok, don't feel bad, can't hurt my feelings!
Originally Posted by cellarius View Post
Both is wrong. Of course you can change the template, that's what templates are for, and the only php file is the one where you put the php-code from firstpost. Where it says to put your custom code, you need to put your custom code.

Have you tried to get it running as is, i.e. exactly like explained in the article before making any changes?

What exactly are you trying to do anyway? What php-code do you want to execute?
I know you can change the template, but I don't need to change anything in it, right?

From what you are saying here I understand now I'm supposed to have just one template and one php file (the one included above that will include all of my custom code).

Right now I have it running exactly how it is. See here.

http://www.elantraxd.com/forums/cotm.php

The template works great and it seems ok, but whenever I try to add anything to the ###add your custom code### section of that PHP file I throw errors.

Maybe this isn't the right thing for me. I don't need to add php stuff I guess, just HTML code, but I figured that would still be possible. Guess not? If not that's ok too, I can jump on another solution. Basically I want it to look like this:

http://www.elantraxd.com/forums/misc...&template=cotm

I just found this HOW TO guide from Lynne after I used a different HOW TO guide to make that above. The reason I wanted to use this one from Lynne is because the URL would be a lot better.

So, am I out of luck or what? Thanks a great deal for any help!
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 14:42.

Layout Options | Width: Wide Color: