Page 1 of 1
Error in gbook
Posted: Mon Dec 12, 2005 9:02 pm
by kor
Script URL:
http://www.test.lesboulesfleuries.nl/gb ... /gbook.php
Version of script: 1.33
Version of PHP: ?
Hosting company: ? Unix
Have you searched THIS FORUM for your problem: Yes
(if not please do before posting)
If so, what terms did you try:
Write your message below:
I try to implement the by henrie van der locht modified scrip gbook for the dutch lanquage. I implemented it following the instruuctions in the read file. Bud now i got the following error messages.
What did i wrong? I implemented original version1.34 and translated all items in Dutch and that works fine. I dont know much of PHP because i use frontpage but i need this script because the frontpage Gbook don't work on the unix profider
Warning: Cannot modify header information - headers already sent by (output started at /home/kmiddel/public_html/gbook133_xhtml/languages/langset_nl.php:116) in /home/kmiddel/public_html/gbook133_xhtml/gbook.php on line 686
Warning: printdownhtml(../footer.txt): failed to open stream: No such file or directory in /home/kmiddel/public_html/gbook133_xhtml/gbook.php on line 725
Posted: Mon Dec 12, 2005 11:41 pm
by Klemen
Hi,
Can you copy lines 110 - 120 from your langset_nl.php file?
Regards
Posted: Tue Dec 13, 2005 12:50 am
by Henrie
Hello Kor (and Klemen),
I found there were some errors in the script in the zip file(faulty links to file settings.php and header.txt and footer.txt because they had been translated to dutch). I had zipped the wrong gbook.php file.
And there where empty lines at the end of the language files.
I had already discovered these and have been busy correcting this and have been adding new features which have been mentioned in the forums.
I have now changed the code to GBook version 1.34 and added a few new features.
I wanted to make an image which shows the different div's that have been used for making it easier to modify the stylesheets but because of this question in the forum have made this new xhtml version already available without the image.
You can download the new file
HERE
Greetings,
Henrie
gbook dutch error
Posted: Tue Dec 13, 2005 11:44 am
by kor-middel
Gbook works fine with the new update Thanks Henrie. However i encouter now an error in the smileys.php As you know i don't know PHP and for that i don't see what's wrong. Can you give me a clue? Thanks in advance Kor.
I got this error.
Parse error: parse error, unexpected T_STRING in /home/kmiddel/public_html/gbook134_xhtml/smileys.php on line 9
Posted: Tue Dec 13, 2005 5:41 pm
by Henrie
That's strange. I have downloaded the zip-file myself and tested it and it works fine for me.
Have you changed anything in the smileys.php file?
Otherwise, copy the code of your smileys.php file in this forum (just the beginning to the <body> will do).
But while testing i discovered a small error. The back to website link did not work because the variable was not set correctly. I have updated the zip file with a correct gbook.php file. So please replace it.
Greetings Henrie.
smiley error
Posted: Tue Dec 13, 2005 6:43 pm
by kor-middel
Henrie,
The requested coding.
I changed no thing.
best regards
<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once('settings.php');
$language = $settings['filter_lang'];
$langfile = "languages/langset_".$language.".php";
require_once($langfile);
?>
<?xml version="1.0" encoding="<?php echo $settings[encoding] ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="<?php echo $settings[encoding] ?>" >
<head>
<title>Smileys</title>
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $settings[encoding] ?>" />
<link href="style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
<!--
function insertSmiley(text) {
var space=" ";
//parent.opener.document.form.comments.value += space + text + space; //uses name tag
parent.opener.document.getElementById("comments").value += space + text + space; //uses id tag
}
//-->
</script>
</head>
Posted: Tue Dec 13, 2005 8:03 pm
by Henrie
Hi kor-middel,
I don't know how, but somehow an error has occurred in the code.
Change the following line of code
Code: Select all
<?xml version="1.0" encoding="<?php echo $settings[encoding] ?>
to
Code: Select all
<?xml version="1.0" encoding="<?php echo $settings[encoding] ?>" ?>
The change is the extra
" ?> at the end of the line.
I don't know how this can have disappeared because it is there in the smileys.php file in the zip-file but this is what causes the error.
Greetings Henrie.
Posted: Wed Dec 14, 2005 10:03 am
by Klemen
Hello both,
I think I know what the problem is - PHP short tags is enabled on your server and it tries to execute the code within
<?xml version="1.0" encoding="<?php echo $settings[encoding] ?>" ?>
as PHP code (because <? is the opening short tag). I tested it myself and it does give a parse error with short tags ON.
I would blame your hosting company for even enabling short tags in XML age, but this should work ok:
Change this code:
Code: Select all
<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once('settings.php');
$language = $settings['filter_lang'];
$langfile = "languages/langset_".$language.".php";
require_once($langfile);
?>
<?xml version="1.0" encoding="<?php echo $settings[encoding] ?>" ?>
To this:
Code: Select all
<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once('settings.php');
$language = $settings['filter_lang'];
$langfile = "languages/langset_".$language.".php";
require_once($langfile);
echo '<?xml version="1.0" encoding="'.$settings['encoding'].'" ?>';
?>
Regards,
smiley error
Posted: Wed Dec 14, 2005 2:42 pm
by kor middel
Klemen Henrie,
Klemen i think your solution is correct. It works!
Do you think i should inform the profider?
Thank you,
Regards
Kor.
Ps
Henrie where i will find the new files for the return to url error?
Posted: Wed Dec 14, 2005 6:11 pm
by Klemen
You can contact your provider and tell them that enabling PHP short tags (<? ?>) breaks XML declaration tag within PHP scripts as it tries to process it as PHP code.
On the other hand you can just correct it and leave with it

Posted: Wed Dec 14, 2005 7:05 pm
by Henrie
Hoi Kor,
I changed the smileys.php page with the suggested code by Klemen.
You can find the updated file
here
Groeten,
Henrie
It works
Posted: Thu Dec 15, 2005 10:09 pm
by Kor Middel
Henrie Klemen,
It works fine now!
Thanks and best reards
Kor middel