PDA


View Full Version : Adding/Creating a custom PHP Page : Instructions


jim6763nva
11-13-2005, 10:07 PM
Ok - This is for everyone that has been having problems creating and adding a custom PHP Page. If you don't understand something here, please reply or email me and I'll come back and update this thread.

STEP 1: Create your PHP page as you normally would.

Example:

Test.php

<?php

// Query your database and get a result set

// Loop through your records and either echo your html and php code,
// or just emdbed your html such as:

$var = "Hello World";

?>
<!-- This will print out hello world
This line is html and should print out <?= $var; ?>
<?php
// PHP code here if needed.
?>


Place your PHP code whereever you store your custom php files. I tested with them in my web root folder.

STEP 2: Add Your PHP File as a PHP Page.

ACP => vba CMPS => Add Page => PHP Page

Page Title: Test Page
Page Identifier: testpage
Parent Name: change if needed
Custom Style for this page: change as needed
Active: Yes
Path To File: Enter the path to your php file to be included
Clean File Output: I've gotten it to work with this set to Yes and No.
Use Module Shell Template: Yes

KEY ITEM: Modules Enabled Section

Make Sure You Have The Custom Page Content Module Active for this PHP Page. If you don't your PHP Code will not be displayed. I think this is a major area that Admins don't realize.

Templates are not needed or used to display output from a PHP Page..

I hope this will help save others many hours of time and frustration. Again, let me know if I have not been clear on something and I will try to help.

Regards,
Jim

rb290
11-14-2005, 05:55 AM
thanks for this.
but im completely confused with this vb advanced cmps stuff
on how to add your own page
i wanna make mines homepage then a link to the forums on that page

www.thugonline.net - home page

www.thugonline.net/forums - forums page

rb290
11-14-2005, 06:03 AM
damn i always get this

"/usr/local/bin:/usr/bin:/bin"

ahhhh whats my cmps_index.php file supposed to look like ?

cause all mine has is:
/usr/local/bin:/usr/bin:/bin

jim6763nva
11-15-2005, 09:11 AM
thanks for this.
but im completely confused with this vb advanced cmps stuff
on how to add your own page
i wanna make mines homepage then a link to the forums on that page

www.thugonline.net - home page

www.thugonline.net/forums - forums page
Vba CMPS will be your portal home page. Then you add a link to your portal navbar to your forum. Anyway, can you tell me more about what you want to do? Try to give as much detail as you can. :)

Jim

jim6763nva
11-15-2005, 09:17 AM
damn i always get this

"/usr/local/bin:/usr/bin:/bin"

ahhhh whats my cmps_index.php file supposed to look like ?

cause all mine has is:
/usr/local/bin:/usr/bin:/bin

the path you mention doesn't sound like your $_SERVER['PATH_TRANSLATED'] path to your forum if that is what you mean. That is the only thing you need to change in your cmps_index.php when doing a fresh install. As is mentioned in the install instructions you can comment out the Chdir line if you are installing cmps_index.php in the same folder as your forum. For example if you put the forum in the root of your website.

If you are on a Unix or linux type web host, the path to your forum should be something like:

/home3/<user account name>/public_html/

or

/home3/<user account name>/public_html/forum


Can you give more detail on where you are having trouble?

Jim

rb290
11-15-2005, 11:28 AM
i just need the cmps_index.php file because everytime I download it there is nothing in the file might be damaged, can you please upload the file for me ?

CoLD FeaR
11-27-2005, 06:39 AM
Well, when i try that out it looks like this...
http://i34.photobucket.com/albums/d117/Riper123/test.jpg
whats the problem?

jim6763nva
11-27-2005, 10:14 AM
Well, when i try that out it looks like this...
http://i34.photobucket.com/albums/d117/Riper123/test.jpg
whats the problem?
Hi Cold Fear,

Can you include a link to your site or the page where you have this configured? It's a little hard to read what is going on in the thumbnail you posted.

Thanks,
Jim