How to include other php files in templates

Tutorials for <a href="http://www.phpbbstyles.com/viewtopic.php?t=356">eXtreme Styles mod</a> for phpBB 2.0.

Moderator: Moderators

Postby PostBot on Wed Apr 14, 2004 1:50 pm

You need to contact Fred or Yann about format - probably they changed format since i've been gone from that project. If they didn't change then they should know better about format anyway because i don't remember anything about it.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby ZandPilooT on Wed Apr 14, 2004 1:52 pm

Ok, I'll do that.

Thanks for your time anyway :wink:
I'm still trying to finish chapter 2 of "php for dummies" :)
[HollandsGlorie Network] | [ModelSpoorBouw Forum]
ZandPilooT
Registered User
Registered User
 
Posts: 7
Joined: Sat Apr 10, 2004 11:32 pm
Location: Dorrestad.nl

Postby sweetplum on Tue Sep 07, 2004 7:15 pm

i saw you post this earlier in the thread
Code: Select all
before <!-- END topicrow --> put this code:

<?php if($topicrow_i == 5) { ?>

<tr><td class="row1" align="center" valign="middle"><span class="gen">here is ad code</span></td></tr>

<?php } ?>


This is a whacko question but is there a way to do it so that it only shows up in certain forum id's and certain topic numbers?

What i want it to say is kind of

if forum_id == 1 AND $topicrow_i == 5

or similarly

if forum_id != 1 AND $topicrow_i == 5

or similarly

if topic_id == 1 AND $topicrow_i == 5

etc etc.. and advice?
sweetplum
Registered User
Registered User
 
Posts: 3
Joined: Tue Sep 07, 2004 7:05 pm

Postby PostBot on Tue Sep 07, 2004 7:27 pm

Put this on top of that tpl file:
Code: Select all
<?php global $forum_id; ?>
and in those if() use code like this:
Code: Select all
<?php if($topicrow_i == 5 && $forum_id == 1) { ?>
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby sweetplum on Tue Sep 07, 2004 7:30 pm

Ohh I get it! Cool - I need to find a php for dummies website lol
sweetplum
Registered User
Registered User
 
Posts: 3
Joined: Tue Sep 07, 2004 7:05 pm

Postby PostBot on Tue Sep 07, 2004 7:48 pm

Here is best such site: http://www.php.net/manual/en/ - better than any book.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby sweetplum on Tue Sep 07, 2004 7:58 pm

Yes I was over there plenty of times, it's a little complicated, I'm just now trying to memorize all the operators and stuff - syntax etc. php is a really cool language - awesome. Hey thanks cyberalien
sweetplum
Registered User
Registered User
 
Posts: 3
Joined: Tue Sep 07, 2004 7:05 pm

Postby Kiss News on Fri Nov 19, 2004 1:36 pm

Hello!

My Board is located here:
http://kissfanshop.ki.funpic.de/phpbb2/index.php

in the "who is online" box I have all the birthdays featured. But since this feature takes 11 seconds to load, I have made an Iframe to make the index page show up much faster .
But Iframes are not variable in height, so I would like to include the Birthday file, which is located here.
http://kissfanshop.ki.funpic.de/phpbb2/Birthday.php
as you can see it is placed in the root directory and takes much longer to load.

I have tried many ways to include this file in the index_body.tpl, but nothing worked.
I tried:
1)
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left" colspan="2">
<?php include($phpbb_root_path . 'Birthday.php');?>
</td>
</tr>
<!-- End add - Birthday MOD -->


2)
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left" colspan="2">
<?php include($phpbb_root_path . 'Birthday.'.$phpEx);?>
</td>
</tr>
<!-- End add - Birthday MOD -->


3)
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left" colspan="2"><?php @readfile('http://kissfanshop.ki.funpic.de/phpbb2/Birthday.php'); ?>

</td>
</tr>
<!-- End add - Birthday MOD -->


nothing worked...

Could you plaese give me an advise how the correct code should look like?
In the meantime I have put it back to include it as an Iframe.

Thanks.
Kiss News
Registered User
Registered User
 
Posts: 10
Joined: Fri Nov 19, 2004 1:27 pm

Postby PostBot on Fri Nov 19, 2004 1:45 pm

Use <div src="http://kissfanshop.ki.funpic.de/phpbb2/Birthday.php"></div> instead of iframe.
And third method should have worked, unless sockets are disabled on your server.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby Kiss News on Fri Nov 19, 2004 1:55 pm

thanks for the fast reply!
you mean a code like this:
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left" colspan="2">
<div src="http://kissfanshop.ki.funpic.de/phpbb2/Birthday.php"></div>
</td>
</tr>
<!-- End add - Birthday MOD -->


it also doesn't work:
http://kissfanshop.ki.funpic.de/phpbb2/index.php
the cell is empty where the file should show up... exactly like in method 3, which should have worked... I have no idea or power in what is abled or disabled on the server, it's on Funpic.de, a free one (not mine) :roll:
Kiss News
Registered User
Registered User
 
Posts: 10
Joined: Fri Nov 19, 2004 1:27 pm

Postby PostBot on Fri Nov 19, 2004 4:00 pm

Try <div src="http://kissfanshop.ki.funpic.de/phpbb2/Birthday.php" />
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby Kiss News on Fri Nov 19, 2004 4:20 pm

well, I tried this now:

<tr>
<td class="row1" align="left" colspan="2"><span class="gensmall">{TOTAL_USERS_ONLINE}
&nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />
{RECORD_USERS}<br />
{LOGGED_IN_USER_LIST}</span></td>
</tr>
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left" colspan="2">
<div src="http://kissfanshop.ki.funpic.de/phpbb2/Birthday.php" />
</td>
</tr>
<!-- End add - Birthday MOD -->
<tr>
<td class="row1" align="left" colspan="2"><span class="gensmall">{TOTAL_CHATTERS_ONLINE}&nbsp;&nbsp;&nbsp;
<!-- BEGIN switch_user_logged_out --> [ {L_LOGIN_TO_JOIN_CHAT} ] <!-- END switch_user_logged_out -->

still, the file doesn't show up:
http://kissfanshop.ki.funpic.de/phpbb2/index.php
ther cell is empty :roll:
Kiss News
Registered User
Registered User
 
Posts: 10
Joined: Fri Nov 19, 2004 1:27 pm

Postby PostBot on Fri Nov 19, 2004 4:28 pm

Sorry, I ran out of ideas. I guess you'll have to use usual iframe or get normal host that supports sockets.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

Postby Kiss News on Sun Nov 21, 2004 10:25 am

I think this is correct:
<?php @readfile('./Birthday.php'); ?>
or
<?php @readfile($_SERVER['DOCUMENT_ROOT'].'/phpbb2/Birthday.php'); ?>
direct URLs are not allowed on my server.

Anyhow, when I do this, it includes some text file (looks like a sql...) but not the PHP file as such as a result.
So I am wondering if I have installed the extreme files Mod correct. Can I do something wrong by installing it?
I deleted the old version the the admin folder (nit in other folders though), and I uploaded all the files. It looks fine in the ACP.

How can I check out, if I have this mod installed correct? Or is it possible, that it doesn't work on my server?
Kiss News
Registered User
Registered User
 
Posts: 10
Joined: Fri Nov 19, 2004 1:27 pm

Postby PostBot on Sun Nov 21, 2004 10:32 am

Most likely that script works only as standalone script and doesn't allow to be included from other file.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars

PreviousNext

Return to eXtreme Styles mod tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron