FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Include php file
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Include php file [message #161782] Fri, 05 February 2010 14:17 Go to next message
btweedy is currently offline  btweedy   United States
Messages: 10
Registered: January 2010
Location: Charleston, SC
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
How do I include a php file in the header?

For example, I have navbar.php that I want included on the forums (domain.com/forums) so it displays the same information as the homepage (domain.com) and I will only have to edit the navbar.php to edit both the homepage and forums.

Is this possible? I have tried creating a tmpl for it, but it does not work. And yes, I have rebuilt the forum several times..

[Updated on: Fri, 05 February 2010 16:01]

Report message to a moderator

Re: Include php file [message #161783 is a reply to message #161782] Fri, 05 February 2010 16:29 Go to previous messageGo to next message
btweedy is currently offline  btweedy   United States
Messages: 10
Registered: January 2010
Location: Charleston, SC
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
To clarify:

I have a php file (navbar.php) that I am including on my home page (domain.com/index.php).

I want to be able to include this in the forum's header (header.tmpl) so when domain.com/forum (and all pages in the forum) will display this same navbar.php.

The problem I am having is in the header.tmpl, the nav bar is displaying where I have the {REF: navbar.tmpl} statement instead of where I have the {TEMPLATE: navbar}

Right now I have navbar.inc.t in the src folder that provides the include statement.

I then have navbar.tmpl file in the tmpl for the respected forum that takes this .inc.t file. Inside this tmpl file I have the following:

{MAIN_SECTION: navbar}
{VAR: nav}
{MAIN_SECTION: END}

The nav variable is defined in the navbar.inc.t and is set to the include statement.

Now, when I put the {REF: navbar.tmpl} statement in the header.tmpl, it displays the navbar instead of where the {TEMPLATE: navbar} statement is.
Re: Include php file [message #161785 is a reply to message #161783] Sat, 06 February 2010 01:24 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3632
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Sounds complicated. To put includes into the header should be as simple as <?php your code ?>.

Maybe <?php include 'navbar.php'; ?> ?
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Synch of newsgroup posts with web forum ?
Next Topic: Parsing a subject in a PM url
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 17 06:39:29 EST 2017

Total time taken to generate the page: 0.00726 seconds