Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

custom page with include???

Asked Modified Viewed 5,532 times
H
hivtop
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

HI all.. I'm new to php-fusion so please be kind... lol

I am trying to make a custom page that will load a php page from a dir I have which has lots of pdf files for others to download (without using the download section cuz there is way to many to upload one at a time).

the path to the dir is public_html/Books (one off the root)

i am using PHPFusion-7.02.07 on a fedora box with
apache 2.2.17
php 5.3.6
PHP interface - apache2handler

when called via any browser the php page loads fine.....

the following stuff loads a title header in a bar and the footer but not the page I need included...


<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";

include BASEDIR. "Books/index.php";

require_once THEMES."templates/footer.php";

?>


I have tried the follow also:

include BASEDIR. "/Books/index.php";


can someone tell me what I am missing?????
Edited by PeaceLaced on 30-03-2014 02:51,
0 replies

12 posts

P
PHPar
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
answered
Member

php fusion in the main dir public_html/

or on specific dir

explain plz :)
0 replies
H
hivtop
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

yes it is... don't know what else to explain????
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi,

Can you show me book/index.php please?

Thanks
0 replies
T
Talocha
T
  • Member, joined since
  • Contributed 90 posts on the community forums.
  • Started 10 threads in the forums
answered
Member

try this
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
include BASEDIR."books.php";
require_once THEMES."templates/footer.php";
?>

create books.php
Edited by Talocha on 29-03-2014 13:37,
0 replies
H
hivtop
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

maybe my question was worded wrong so let's try this again everyone....

info first:
1. standard NEW install of the newest PHPFusion-7.02.07 in my root dir on a working Linux dedicated server (with 9 other sites running other scripts with no problems, so server side is fine)
2. PHPFusion-7.02.07 is running Great as the out-of the-box install...
3. I have added one (1) dir to the base dir structure called Books with a index.php file that will list all the sub-directories and files in the Books dir (which works fine when loaded in my browser as http://www.mysite.com/Books/index.php)
4. in standard php I would simply add the Syntax:
include ('dir/filename'wink;
or better yet:
require ('dir/filename'wink;
5. for a big site The best practice for this is to define a 'ABSOLUTE_PATH' constant that contains the directory that everything is located under. as follows:
define("ABS_PATH", $_SERVER['DOCUMENT_ROOT']);
then call it like this:
include(ABS_PATH . "/path/to/file"wink;

NOW for the QUESTION...
what is the syntex/code to add an "include" or "require" to a custom page and still keep the script intact and stay within the AGPL Copyright notice??????
OR.......
is there an INFUSION that will do what #3 above will do????

thanks
hivtop

If it isn't fun... Don't do it!
Remember... The mind is like a parachute. It works only when open.

Merged on Mar 29 2014 at 14:16:24:
sorry forgot to answer jib and Talocha

jib... the dir listing script is not mine but you can see it here:
Directory Listing Script - Version 3
====================================
[removed link]

Talocha... the file is not books.php it is index.php in the Books dir

thanks for your replys

Merged on Mar 29 2014 at 14:18:36:
sorry #2 forgot to disable smilies so code was right
Edited by PeaceLaced on 30-03-2014 02:51,
0 replies
P
PHPar
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
answered
Member

give me link for your site

and link for books dir
0 replies
H
hivtop
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

i'm not being rude. but....

PHPar what are you looking for???? the answer is not in the books/index.php file.. again it is:

what is the syntex/code to add an "include" or "require" to a custom page and still keep the script intact and stay within the AGPL Copyright notice??????
OR.......
is there an INFUSION that will do what #3 above will do????

if you need to see the file please go here and download it:
[removed link]
Edited by PeaceLaced on 30-03-2014 02:50,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi there,

Hopefully I can help you.

The link above provided does not lead to a PHPFusion site so it's a little hard for me to find the file book.php do you have a direct link to the file?

Regards
0 replies
P
PeaceLaced
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
answered
Member

Lets try this again. Please do not post any links to external downloads or ask for IP addresses again.

This is the code you tried.

include BASEDIR. "Books/index.php";


Try one of these two, both have space removed from basedir. and one is lowercase B

include BASEDIR."books/index.php";


include BASEDIR."Books/index.php";


Let us know the results and we will move forward.
0 replies
H
hivtop
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

hi all.. I would like to start off by apologizing for not reading the CoC and being a paranoid bad boy... sorry my bad...

to answer the question I asked in the beginning, for all you who are interested, the proper syntex/code to add an "include" or "require" to a custom page and still keep the script intact (running smoothly) and stay within the AGPL Copyright notice (load the "Powered by" info) is:

<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";

include BASEDIR."directory/filename";
/* or just the file name if it is in your main dir */

require_once THEMES."templates/footer.php";

?>


the above code will load the page you want in the main frame, show header-navigation-side boxes-etc and footer... BUT and this is a big BUT... you CAN NOT HAVE ANY LINKS WITHIN THAT FRAME/page... ONLY INFORMATION because when you click on the link it will just send you back to the home page without a bunch of tweaking... it may work right in an iframe but I didn't try that...

I simply wanted it to load a page that would list a bunch of pdf/epud/mobi files for others to view/download. It listed them but the links would not go to them ...

I have owned and built websites since the Internet started in the early '90s (ya I'm an old geezer) and must say "php-fusion is the BEST, easiest to use CMS script I tried for my new site".. and I tried 12 of them but the CMS scripts have become bloated "my space"/"face book" clones which is not what "I wanted"... if you do then by all means use php-fusion it will make your life easy and your site sing & dance...

thanks
hivtop

If it isn't fun... Don't do it!
Remember... The mind is like a parachute. It works only when open.
0 replies
P
PeaceLaced
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
answered
Member

No worries on the CoC. I can be over zealous at times so part of the problem is with me.

Reading through your last post I get the impression you are able to see the links in the index.php that point to your files in the dir. The problem is that when you click the link it does not have the desired effect you are looking for (download a file, open PDF in the browser, etc.). Is this correct?
0 replies
H
hivtop
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

yes BrandonBlack that is exactly what happens.. it just throws me back to the home page....

since I am an information junky and getting older I decided to start a site called SharingLibrary.com with all the stuff I have collected over the past 30 years (about 40 Tera gigs worth ((mostly tutorials... no pron, software, movies or music)) if you want to know how to write html-cgi-php-C++ or build a ram pump to lift water 100 feet without power or need a science project for class, it will be there .. hahaha) so that all the kids out there could have access to it...

I don't need a blog, forum, news section or any of the interactive stuff cuz I just want to put the stuff I have out there for others. Most of it is eBooks (pdf/epud/mobi), tutorial movies (avi/mp4/flv) and pictures (jpg/gif/psd)...

that's why I have been trying the CMS scripts for their photo/video galleries, download sections and membership parts all rolled into one... of the 12 I've installed and tested over the past three months PHP-fusion came the closest to what I need but I am getting too old to go digging through miles of script to tweak things when I can be playing in my garden with my grand kids and great grand kids... hahahaha

If there is a quick easy fix for what I need (ftp upload - on the fly dynamic listing of directories (i have one page scripts for this) - server side thumbnail creation (i have one page scripts for this) and membership management) in a pretty package like php-fusion please let me know...

if not then I will just build a template driven php site with the scripts I have written or have found and give up on the CMS packages... "Back in the day" Content Management scripts were just that, "Content Management" not full of blogs, forums and tons of interactive addons so I may be looking at the wrong scripts.

I do appreciate your help and keep up the good work with php-fusion!!!!!!!!

thanks
hivtop

If it isn't fun... Don't do it!
Remember... The mind is like a parachute. It works only when open.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 12 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

P
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
P
P
PHPar 10
  • Member, joined since
  • Contributed 118 posts on the community forums.
  • Started 7 threads in the forums
T
T
  • Member, joined since
  • Contributed 90 posts on the community forums.
  • Started 10 threads in the forums
H
H
hivtop 10
  • Newbie, joined since
  • Contributed 6 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet