Including PHP script in PHPWCMS
-
- Posts: 31
- Joined: Thu 30. Dec 2004, 15:05
- Contact:
Including PHP script in PHPWCMS
I've installed a 3rd party script on my website.
I would like to include it into my PHPWCMS setup.
So I decided to use:
[PHP]
[PHP]
include "/gallery/index.php"
[/PHP]
This however results in this error:
Parse error: parse error, unexpected '&' in /usr/home/<username>/domains/starbase01.com/public_html/include/inc_front/front.func.inc.php(2048) : eval()'d code on line 3
When I try to directly access the script:
http://www.starbase01.com/gallery/index.php
it works fine.
What could be the problem?
I would like to include it into my PHPWCMS setup.
So I decided to use:
[PHP]
[PHP]
include "/gallery/index.php"
[/PHP]
This however results in this error:
Parse error: parse error, unexpected '&' in /usr/home/<username>/domains/starbase01.com/public_html/include/inc_front/front.func.inc.php(2048) : eval()'d code on line 3
When I try to directly access the script:
http://www.starbase01.com/gallery/index.php
it works fine.
What could be the problem?
-
- Posts: 31
- Joined: Thu 30. Dec 2004, 15:05
- Contact:
-
- Posts: 31
- Joined: Thu 30. Dec 2004, 15:05
- Contact:
Maybe this?
Try an experiment... Do you get the same error with these?
May need to enable (change from 0 to 1) features in "conf.inc.php":
Code: Select all
$phpwcms["allow_cntPHP_rt"] = 0; //allow PHP replacement tags and includes in content parts
Code: Select all
{PHP:/usr/home/<USERNAME>/domains/starbase01.com/public_html/gallery/index.php}
Code: Select all
{URL:http://www.starbase01.com/gallery/index.php}
Code: Select all
$phpwcms["allow_remote_URL"] = 0; //0 = no remote URL in {PHP:...} replacement tag allowed, 1 = allowed
$phpwcms["allow_cntPHP_rt"] = 0; //allow PHP replacement tags and includes in content parts
-
- Posts: 31
- Joined: Thu 30. Dec 2004, 15:05
- Contact:
Hi,
Thanks for the tips, here are the results:
Thanks for the tips, here are the results:
No different with either 1 or 0 in that codeDeXXus wrote:Maybe this?Code: Select all
$phpwcms["allow_cntPHP_rt"] = 0; //allow PHP replacement tags and includes in content parts
Nothing loadsTry an experiment... Do you get the same error with these?Code: Select all
{PHP:/usr/home/<USERNAME>/domains/starbase01.com/public_html/gallery/index.php}
I see something of the other file, but when clicking on content it takes over the active window and no longer shows the rest of the site, just that page.Code: Select all
{URL:http://www.starbase01.com/gallery/index.php}
No changes on either 1 or 0.May need to enable (change from 0 to 1) features in "conf.inc.php":Code: Select all
$phpwcms["allow_remote_URL"] = 0; //0 = no remote URL in {PHP:...} replacement tag allowed, 1 = allowed $phpwcms["allow_cntPHP_rt"] = 0; //allow PHP replacement tags and includes in content parts
try this
make a HTML Contentpart with this
in Template add this Script into HTML-Header
make a HTML Contentpart with this
Code: Select all
<iframe id="myframe" src= "/gallery/index.php" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
Code: Select all
<script type="text/javascript">
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
</script>
-
- Posts: 31
- Joined: Thu 30. Dec 2004, 15:05
- Contact:
Looks like that did the trick!
http://www.starbase01.com/index.php?id=24,75,0,0,1,0
Thanks!
Now all that remains is to adapt the layout of the script!
Is there perhaps also a way to have the following done.
When someone for example copy pastes the URL of the gallery into a new window, that the layout of the site is loaded around it by default?
So when someone tries to access http://www.starbase01.com/gallery/* (any file in that folder) the page above is loaded automatically?
http://www.starbase01.com/index.php?id=24,75,0,0,1,0
Thanks!
Now all that remains is to adapt the layout of the script!
Is there perhaps also a way to have the following done.
When someone for example copy pastes the URL of the gallery into a new window, that the layout of the site is loaded around it by default?
So when someone tries to access http://www.starbase01.com/gallery/* (any file in that folder) the page above is loaded automatically?
-
- Posts: 31
- Joined: Thu 30. Dec 2004, 15:05
- Contact:
I have now created the page for the script in the CMS. The CMS opens the script via an Iframe.
<iframe id="mygallery" src= "/gallery/index.php" scrolling="no" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
Inside the gallery I have included this code to check if the Iframe has been loaded:
<script>
if (top == self)
{ //no frame
window.location = 'http://www.starbase01.com/index.php?id=24,0,0,1,0,0';
}
</script>
This so visitors always see the rest of the site as well.
The issue I have is when people for example try to access one of the galleries directy (for example the Airplanes) using it's URL:
http://www.starbase01.com/gallery/index ... w&gazgal=5
they end up at the index of the galleries.
Does anyone know of any way to accomplish this?
<iframe id="mygallery" src= "/gallery/index.php" scrolling="no" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
Inside the gallery I have included this code to check if the Iframe has been loaded:
<script>
if (top == self)
{ //no frame
window.location = 'http://www.starbase01.com/index.php?id=24,0,0,1,0,0';
}
</script>
This so visitors always see the rest of the site as well.
The issue I have is when people for example try to access one of the galleries directy (for example the Airplanes) using it's URL:
http://www.starbase01.com/gallery/index ... w&gazgal=5
they end up at the index of the galleries.
Does anyone know of any way to accomplish this?