coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: greetoz on June 30, 2006, 02:27:26 AM

Title: including php files
Post by: greetoz on June 30, 2006, 02:27:26 AM
I tried some searching and just looking thru the forum but could just find a straight forward anwser (although i doubt this question hasn't been asked before)

I have a coppermine running with a custom template (just to show what i mean)

http://greetoz.nl/ts/

and a site  (also just to show what i mean)

http://greetoz.nl/JWB/

as you see on the site i have a poll and nieuws on the left hand side on the index.php page i just put in this code:
<?php
include('nieuws.php');
?>



and
<?php
if (!isset($_COOKIE['voted1'])){
include(
'poll_entry1.inc.php'); }
else {
include(
'poll_results1.inc.php'); }
?>


how do i use this code in the coppermine template? obviosly just adding it doesn't work. i tried putting a function in theme.php but that gives me all kinds of errors :P

thanks in advance

Title: Re: including php files
Post by: Gizmo on June 30, 2006, 03:17:01 AM
Here's a post from today that I think deals with your question: http://forum.coppermine-gallery.net/index.php?topic=33267.0 (http://forum.coppermine-gallery.net/index.php?topic=33267.0).
Title: Re: including php files
Post by: greetoz on June 30, 2006, 11:28:57 AM
Quote from: Gizmo on June 30, 2006, 03:17:01 AM
Here's a post from today that I think deals with your question: http://forum.coppermine-gallery.net/index.php?topic=33267.0 (http://forum.coppermine-gallery.net/index.php?topic=33267.0).

I editted the template.html to look like my other files (like index.php) the post you reffer to doesn't do it that way i think..? the code on that link is:

<?php

define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');

pageheader('Your title');

/* insert php code here */

pagefooter();

?>


should i put that in nieuws.php? i don't quite understand how to use that piece of code. i just want a poll and some news to show up within the coppermine template but because the template is html and not php it does not show php code.

i just want a small include script to show some dynamic content on every page (also on the coppermine page) like a poll and some news
Title: Re: including php files
Post by: Stramm on June 30, 2006, 12:51:16 PM
if you want to be able to include php code to coppermines template file (template.html) you can either use the anycontent block or the custom header/ footer

anycontent block... serach or check the docs,
the custom header/ footer.. create a php file and include it using the config. As header, it appeares before coppermine outputs, footer... below coppermine
Title: Re: including php files
Post by: greetoz on June 30, 2006, 12:58:42 PM
Quote from: Stramm on June 30, 2006, 12:51:16 PM
if you want to be able to include php code to coppermines template file (template.html) you can either use the anycontent block or the custom header/ footer

anycontent block... serach or check the docs,
the custom header/ footer.. create a php file and include it using the config. As header, it appeares before coppermine outputs, footer... below coppermine

is there a way to change the placement of the anycontentblock? now it just shows up before the categories.. and i want it in the left site bar.. like i have in the second link i gave. http://greetoz.nl/JWB/ on the left hand side you see the poll (under agenda lol:P) i want that to show up in that place in coppermine.
Title: Re: including php files
Post by: Stramm on June 30, 2006, 01:05:35 PM
not easy, I'd say you need some core code changes