coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Mike_PL on July 26, 2006, 10:13:39 AM

Title: How insert code PHP in foot - please help!
Post by: Mike_PL on July 26, 2006, 10:13:39 AM
How insert code php:

<?php

ini_set
("include_path",ini_get("include_path").":../:../../:../../../:../../../../"); 
include_once 
"linkuj_inc.php";
$separator=" | ";
echo 
implode($separator,$linki); 

?>


in footer?
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 26, 2006, 01:07:55 PM
 ???
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 26, 2006, 01:24:31 PM
put it under footer.php and copy footer.php to root of your gallery and enable footer on
config=>Themes settings=>Path to custom footer include
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 26, 2006, 02:15:17 PM
Path to custom footer include


I write: footer.php, but i don't see new footer?
Title: Re: How insert code PHP in foot - please help!
Post by: Abbas Ali on July 26, 2006, 06:45:06 PM
Write a plain echo statement in footer.php to test whether it comes or not...


<?php
  
echo "This is custom footer";
?>



If this comes fine then something wrong in your above code. I see that you are including some file in footer.php The path should be relative to the coppermine root folder. Else the include won't work.
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 26, 2006, 07:37:53 PM
Not work. I don't see text "This is custom footer" in footer...

my gallery: http://www.galeria-gryzonie.info/
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 26, 2006, 07:39:59 PM
- you already have some link on footer !
- if your issue didn't solved PM me your admin user I'll check it for you
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 26, 2006, 08:00:49 PM
Ok. A code:

<?php
  
echo "This is custom footer";
?>


its fine. I see it in footer.

but when i'm paste in footer.php code:

<?php

ini_set
("include_path",ini_get("include_path").":../:../../:../../../:../../../../"); 
include_once 
"linkuj_inc.php";
echo 
implode(" ",$linki); 

?>


it's not fine. I don't see not in footer. This code is correct.
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 26, 2006, 08:05:15 PM
if the code that abbas give you works fine then you have error on your own code!
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 26, 2006, 08:18:57 PM
But this code its correct ;(

<?php

ini_set
("include_path",ini_get("include_path").":../:../../:../../../:../../../../"); 
include_once 
"linkuj_inc.php";
echo 
implode(" ",$linki); 

?>


When i'm paste then in theme.php it's works fine....

;(
Title: Re: How insert code PHP in foot - please help!
Post by: Joachim Müller on July 26, 2006, 11:03:53 PM
What's the first actual code line suppossed to do? It looks silly imo. What does linkuj_inc.php do? Why don't you include it directly?

After all,
Quote from: bmossavari on July 26, 2006, 08:05:15 PM
if the code that abbas give you works fine then you have error on your own code!
is correct, there's nothing more to add.
Title: Re: How insert code PHP in foot - please help!
Post by: Abbas Ali on July 27, 2006, 07:05:42 AM
Quote from: Abbas Ali on July 26, 2006, 06:45:06 PM
I see that you are including some file in footer.php The path should be relative to the coppermine root folder. Else the include won't work.
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 27, 2006, 08:46:11 AM
QuoteWhat's the first actual code line suppossed to do?
I don't now...

QuoteWhat does linkuj_inc.php do?
It's Link Exchange. This code in theme.php like this:

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimages1.fotosik.pl%2F118%2Ffc21dc9d4378d59e.gif&hash=574c2f8a429fbf0a8b22920e6f59b3bb697ea312)

but in header It does not look beautiful....
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 27, 2006, 09:05:12 AM
as abbas suggested:
do you have "linkuj_inc.php" under root of gallery?
Title: Re: How insert code PHP in foot - please help!
Post by: Joachim Müller on July 27, 2006, 09:17:03 AM
The strange chars come from differences in encoding. Coppermine uses utf-8 (unicode) out of the box. The script you're trying to include probably is encoded in iso8859-something.
Quite frankly: you're lacking the needed skills to accomplish this - the answer
Quote from: Mike_PL on July 27, 2006, 08:46:11 AMI don't now...
clearly shows this.
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 27, 2006, 09:34:12 AM
Quotedo you have "linkuj_inc.php" under root of gallery?
Yes....

Case is simple. Code works in theme.php - ( http://www.galeria-gryzonie.info in header) but this code inserted in footer.php doesn't works. Encoding is unimportant.
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 27, 2006, 03:06:20 PM
if that code works with theme.php then your issue is wrong path on your code
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 27, 2006, 03:34:09 PM
Where in path on code is wrong? As correct path should look?
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 27, 2006, 03:58:38 PM
- sorry it's not the path because theme.php will execute under root path
- anyway your header links are comes before head and body tags you should add them after them
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 27, 2006, 04:07:02 PM
My footer.php like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html>

<?php

ini_set
("include_path",ini_get("include_path").":../:../../:../../../:../../../../"); 
include_once 
"linkuj_inc.php";
echo 
implode(" ",$linki); 

?>


<head>


</head>
<body>


but further dont works..

:'( :'( :'(
Title: Re: How insert code PHP in foot - please help!
Post by: Sami on July 27, 2006, 04:11:44 PM
my point was to header not footer!
your footer.php should be contain only php code:

<?php

ini_set
("include_path",ini_get("include_path").":../:../../:../../../:../../../../"); 
include_once 
"linkuj_inc.php";
echo 
implode(" ",$linki); 
?>


Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 27, 2006, 07:13:15 PM
I don't understand. How edit theme.php?

my theme.php in Attach:
Title: Re: How insert code PHP in foot - please help!
Post by: Joachim Müller on July 28, 2006, 07:07:19 AM
Quote from: Mike_PL on July 27, 2006, 04:07:02 PM
but further dont works..
This is not very surprising, as it contains lots of errors. There mustn't be any HTML tags in it like <head> or <body>, because this can't exist twice in a page and already is being defined elsewhere. You have a lot of reading up to do. This thread is leading nowhere. If all the included script is suppossed to do is have some links from a link exchange program displayed, then add them in manually. You'll need to learn the basics (i.e. HTML) before doing more advanced stuff like using PHP includes.
Title: Re: How insert code PHP in foot - please help!
Post by: Mike_PL on July 28, 2006, 05:57:02 PM
So, you will not help even as I will add in attach theme.php and footer.php?

:'( :'( :'( :'(
Title: Re: How insert code PHP in foot - please help!
Post by: Joachim Müller on July 28, 2006, 07:30:34 PM
It's not that I don't want to, but imo you're beyond help.