PHP Include PHP Include
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

PHP Include

Started by jacci, June 26, 2007, 11:43:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jacci

I wanted to include a random quote script just under my banner in one of my themes.

I tried
<!-- INCLUDE PHP SCRIPT -->
<?php include ("mypath/myscript.php");?>
<!-- INCLUDE PHP SCRIPT -->


and a few variations on that in my template.html for my theme and none worked

any idea how i can get a php include to work for a theme?

thanks
jacci

Sami

You can't use php include command this way
You should create custom theme , search board for more info
‍I don't answer to PM with support question
Please post your issue to related board

jacci

I have made a custom theme, three different ones, and it was in there i was wanting to put it. It is a script that i have included into my SMF custom themes and my efiction skins too, running a random quote pulled from a .txt file, and was hoping i could get it into the coppermine, but so far, none of the include or require commands seem to work. SMF and efiction both are php for their index templates, and so it wasn't too difficult to make it happen there and had been hoping it woudl be the same here.

I did to a search using php include, including php, and found nothing of any help on either one.

What i don't want to have to do is rewrite the hundreds of quotes if i can just get the script to run from inside the gallery using my current custom themes. If it can't be done though, then i can live without my random goodness.

Sami

You can try anycontent.php ,
put your script on {gallery-root}/anycontent.php and then add anycontent to
config =>  Album list view => The content of the main page

in your case you should add it to the first of value
‍I don't answer to PM with support question
Please post your issue to related board

jacci

Thanks Sami, i didn't realise you could do anycontent that way. I renamed my file and couldnt get it to show.

I then tried putting it in the theme.php, using the require command and that showed up fine, but right at the very top, above the banner, which is not precisely where i wanted it to go.

For now, i am giving up on this, it just would have been cool to add it, and since it had been so easy on the other scripts i figured it woudl be a simple peice of coding here as well.

thanks anyway.
jacci