UseBB Community

The official board for UseBB help and discussion

UseBB Community » Help & Support » Calling a file from index

Calling a file from index

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Mar 2006
Posts: 25
Hi,

I'm making a menu. Its Js function can show any content without refresh. Well, i have been tried several times to put an archive.php and i failed. An example:

Quote
<div class="tabshrink" id="tab_1">
<?php include("somearchive.php"); ?>
</div>

or
Quote
<div class="tabshrink" id="tab_1">
<?php require(ROOT_PATH.'somearchive.php'); ?>
</div>

Wich is the good string to call this file correctly?. Thanks in advance.
Moderator
Registered: Oct 2005
Posts: 447
Location: canada
Either one should work.

What file are you placing this in?
Member
Registered: Mar 2006
Posts: 25
Hi Gaia, thanks for help. The files are: 1) Faq [Only titles, i'm working in this file now], 2) Search and 3) Login form.
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
You can't just include a file and make it output content. Also see the question answered in the FAQ: http://www.usebb.net/community/topic-278.html
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Mar 2006
Posts: 25
Many thanks Dietrich. I did this:
Quote
<div class="tabshrink" id="tab_1">
<?php $template->add_raw_content('faq.php'); ?>
</div>

it gives me this error:

Parse error: syntax error, unexpected T_STRING in /home/user/account/forum/templates/mytemplate/global.tpl.php on line 172


Obviously PHP isn't my knowledge field (yet) ;). If you can give me a hand with this, i'll be very thankful for your kindness.
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
Where are you inserting that piece of PHP?

$template->add_raw_content() should be passed contents, not file names to be included. Anything in UseBB, including files that are included, may not output anything.

In fact you should use a template variable for that and define it in the PHP code.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Mar 2006
Posts: 25
Dietrich wrote
Where are you inserting that piece of PHP?


In global.tpl.php, underneath the top menu. It's a normal div with Js functions (show/hide). Until this moment i have been tried in many ways. For a better explanation here is the link:

gta.com.ve/foros/

Looks ugly because i don't finish it yet :). The objective is to replace the topmenu with this. It's very useful for many jobs, for example adding forum rules, login form, faq, and some dynamic jobs as forum news, active topics, etc.

This template is a personal adaptation from a joomla skin (used in web portal). I was proved with SMF forum, but it have so many validation errors :evil: and its code is so twisted... UseBB is more friendly, semantic, light and functional for my taste; so, i decided propose it to this client.

However, this Js function is not included in the job. I can disable it and continue the design work without problem. But would be result a good job if I could obtain the wanted results.

Regards.

Page: 1

UseBB Community » Help & Support » Calling a file from index

UseBB Community is powered by UseBB 1 Forum Software