PDA

View Full Version : PHP include?


netlist
05-03-2005, 09:43 PM
How do i do a php include on a page i created in the admin panel. Can you provide me with the steps on how to do this?

Chris S
05-04-2005, 03:14 AM
Hi,

Where do you want it to show? (and to make sure I'm understanding properly, you want to include it in the admin control panel - not on the front - where the public views the site0 ?

How do i do a php include on a page i created in the admin panel. Can you provide me with the steps on how to do this?

netlist
05-04-2005, 04:56 AM
Hi Chris, I created a page in the admin area. that will provide a page on the top navagation header. I named this "Weather". I have a php script that will provide current weather feeds. So i need to somehow include this script into that page it created. How is this done?

thanks

Chris S
05-05-2005, 02:16 AM
Hi,

The 'page' you created comes from the database, it doesn't create a physical page/file.

The header is called 'PageHeader.html', you can put a link in there somewhere to your weather script and have that standalone (a separate weather.php script)....

Though that won't then include the header/footer from articlelive :/

Hi Chris, I created a page in the admin area. that will provide a page on the top navagation header. I named this "Weather". I have a php script that will provide current weather feeds. So i need to somehow include this script into that page it created. How is this done?

thanks

tariqali
05-12-2005, 08:20 PM
Hi,

I am trying to use PHP include in my articlelive installation but no success. I created a new panel "RightColumnAds" which I want to display in the right column. I tried using PHP include in there but it is not working.

How can I get it done please?

thanks.

Chris S
05-13-2005, 01:19 AM
Hi,

Are you sure the "RightColumnAds" panel is being included?

How are you including that ?

Hi,

I am trying to use PHP include in my articlelive installation but no success. I created a new panel "RightColumnAds" which I want to display in the right column. I tried using PHP include in there but it is not working.

How can I get it done please?

thanks.

tariqali
05-13-2005, 03:20 AM
In the DefaultRightColumnPanel.php file I included the following:
$parsedPanelData .= $GLOBALS["AL_CLASS_TEMPLATE"]->_GetPanelContent("RightColumnAds");

Then I create two files RightColumnAds.php and RightColumnAds.html

If I add in the RightColumn.php file the Generic Parsing class code and add any text in the html file it is displayed correctly. But I want to add a PHP code for my banner ad system. I have the banner ad feed file stored in a central folder in my server to use with other files.

I tried including it in the RightColumnAds.php by using regular PHP include function but that didn't work right. So I am asking how can I get it included in my templates?

Thanks.

Amit (Interspire Staff)
05-13-2005, 12:47 PM
Hi Tariqali,

Below is an article I wrote recently for the Interspire newsletter. Though it's about integrating RSS feeds into AL, you can use it as a reference to create custom panels for your weather scripts. Take it from Step 3 onwards. Also note that I used my own naming conventions so might need to make a few adjustments.

http://www.interspire.com/whitepapers/html/ArticleLiveRSS.html

Hope it helps!

Cheers,
Amit

tariqali
05-13-2005, 01:39 PM
Hi Tariqali,

Below is an article I wrote recently for the Interspire newsletter. Though it's about integrating RSS feeds into AL, you can use it as a reference to create custom panels for your weather scripts. Take it from Step 3 onwards. Also note that I used my own naming conventions so might need to make a few adjustments.

http://www.interspire.com/whitepapers/html/ArticleLiveRSS.html

Hope it helps!

Cheers,
Amit


Thanks. This is what I have done so far to create my custom panel. But the problem here is I have a PHP code the I need to use inside the panel. In your example, you inserted the Javascript code in the html file. Apperantly that won't work for the PHP code that I have.

Where can I insert my PHP code to get this done?

DWA
05-13-2005, 03:34 PM
You need to create 2 files and modify 1 default file if the origin file is html

I help to improve my client's website by adding a Google small search panel at the right column

So I created and modified
1. GooglePanel.html; is a new working search form template
2. GooglePanel.php; is a new php file to parse the template
3. Modifed DefaultRightColumnPanel.php; is to include it

Look at the attachment, copy & paste, upload the following files:
1. ../Panels/GooglePanel.html
2. ../Panels/GooglePanel.php
3. ../Panels/DefaultRightColumnPanel.php

If the origin file is "RightColumnAds.php", as long as it has the structure required, you just need to create a blank "RightColumnAds.html"

tariqali
05-13-2005, 05:12 PM
Thanks DWA but that still doesn't answer my question. The original file that I am trying to include in my Panels is a PHP code. PHP will not run if I put the code in the html version of the Panel file.

It has to be done in a PHP file. The "RightColumnAds.php" file that I have only has the generic PHP code to parse RightColumnAds.html.

It seems like I keep getting the same answer from support on how to create the panels, but that is not what I am looking for. I know how to create the panels, all I need help with is how to include my PHP code in these panels.

Is this clear? Can this be done?

DWA
05-13-2005, 05:52 PM
I don't know your script looks like, but you may try to parse it via DefaultRightColumnPanel.php by adding 1 line either:

1. $parsedPanelData .= include("/path/to/RightColumnAds.php"); or
2. $parsedPanelData .= file_get_contents("/path/to/RightColumnAds.php");

But, the second one is most likely to work

Let's give it a try

Chris S
05-17-2005, 02:51 AM
Hi,

Articlelive won't let you randomly include php files the way you want it to. It has to be done through a panel as everybody has mentioned.

When you parse the supporting HTML file, you can put in whatever you like for the content. See ViewAuthorPanel.php for how it gets a list of blogs, articles and so on for each author.

Does that help?

Thanks DWA but that still doesn't answer my question. The original file that I am trying to include in my Panels is a PHP code. PHP will not run if I put the code in the html version of the Panel file.

It has to be done in a PHP file. The "RightColumnAds.php" file that I have only has the generic PHP code to parse RightColumnAds.html.

It seems like I keep getting the same answer from support on how to create the panels, but that is not what I am looking for. I know how to create the panels, all I need help with is how to include my PHP code in these panels.

Is this clear? Can this be done?