Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 02-01-2005, 08:01 AM
Jayphen Offline
forum loafer
 
Join Date: Feb 2005
Location: Sydney, Australia
Posts: 17
Send a message via MSN to Jayphen
php includes

I've converted my template files to .php (and referenced them correctly in index.php) and I want to include test.php in image view..

ie:

Code:
<?php include('test.php'); ?>
how would I go about doing this? it doesn't work when I put it into the template file.
Reply With Quote
  #2  
Old 02-01-2005, 08:04 AM
Connie
Guest
 
Posts: n/a
Sorry,

I can't see any sense in this..

Why do you want to do this?
what are the advantages?

I never saw that an includefile includes a second-level... I don't think that this is even possible

:?:
Reply With Quote
  #3  
Old 02-01-2005, 09:16 AM
Jayphen Offline
forum loafer
 
Join Date: Feb 2005
Location: Sydney, Australia
Posts: 17
Send a message via MSN to Jayphen
well currently I am running a community forum on medio-core.com. I am going to be changing the main page to my photoblog ( it's currently unfinished at http://medio-core.com/pblog ) .. I want to use includes to call a php file with information such as latest posts and members etc on my photoblog in a sidebar, so it can be seen when the index page is accessed.
Reply With Quote
  #4  
Old 02-01-2005, 09:39 AM
Connie
Guest
 
Posts: n/a
well, please look at this from the PHP-reference:

Quote:
When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags.
so the include-file must contain
Code:
<?

?>
tell us if this helps
Reply With Quote
  #5  
Old 02-01-2005, 11:02 AM
Jayphen Offline
forum loafer
 
Join Date: Feb 2005
Location: Sydney, Australia
Posts: 17
Send a message via MSN to Jayphen
yup, the file being included contains <? and ?> .. it doesn't work.
Reply With Quote
  #6  
Old 02-01-2005, 12:00 PM
Connie
Guest
 
Posts: n/a
well, I think your deal is too complicated than to find a quick solution whithout knowing the source code

to really find the way how to do this we should look into the source code of the whole thing, and I must admit, I have no time for that :?
Reply With Quote
  #7  
Old 02-02-2005, 02:12 AM
Jayphen Offline
forum loafer
 
Join Date: Feb 2005
Location: Sydney, Australia
Posts: 17
Send a message via MSN to Jayphen
okay, thanks for your help..

hopefully there will be a way to do this in a future version.
Reply With Quote
  #8  
Old 03-01-2005, 05:28 AM
seedoubleyou Offline
forum loafer
 
Join Date: Mar 2005
Posts: 2
PHP Includes

I was looking to do the same thing to show ad banners.
I had the same problem.
You can get around it by creating a wrapper. For example, create a file called test.php that contains:

<?php include'yourpixelpostindex.php'; ?>
<?php include'yourotherfile.php'; ?>

Simple as that.
CSS positioned DIVs can be used to place content wherever you want without messing with the templates.
Reply With Quote
  #9  
Old 03-01-2005, 05:41 AM
Connie
Guest
 
Posts: n/a
this looks interesting...

please keep in mind, that if you include some files in different levels, it could happen that some includes are required too often and problems will occur (same can happen to "require.")

so I would suggest to use "include_once"...

but anyway this question is interesting enough to keep it in mind for the modification forum, so I will move it there :wink:
Reply With Quote
  #10  
Old 03-01-2005, 06:06 PM
seedoubleyou Offline
forum loafer
 
Join Date: Mar 2005
Posts: 2
Quote:
Originally Posted by Connie
this looks interesting...

please keep in mind, that if you include some files in different levels, it could happen that some includes are required too often and problems will occur (same can happen to "require.")

Quote:
Originally Posted by seedoubleyou
Yes, this can get a little bit out of control if not used carefully :wink:

In fact, you will eventually lose that 'wrapper' I mentioned whilst clicking through a pixelpost site if you don't make other modifications. It is still worth playing with though.
I take that back!
Pixelpost can successfully be run this way with no other modifications. I created my own index.php which consisted of divs and includes and had it call pixelpost via an include. Looks like it works fine. You can see it in action on www.chefryanmartin.com
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 03:24 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs