Page 1 of 1

BLANK - Then Errors on upgrade

Posted: Thu Apr 13, 2006 10:02 pm
by vinman
I tried to upgrade to the latest version from 0.7.1

At first the pages were just blank. Now there are errors and
my whole site is down.

www.cybermidi.com/default.php

at the top of this page, is the code

Code: Select all

<?php 
if (!preg_match('@/plugin/@', $_SERVER['REQUEST_URI'])) { 
?>
then around line 283 (where the error is)

Code: Select all

<?php 
} 
ob_start(); 

chdir('/www/c/y/cybermidi.com/htdocs/news'); 
require '/www/c/y/cybermidi.com/htdocs/news/index.php'; 
$blog_data = ob_get_contents(); 
ob_end_clean(); 

echo $blog_data; 
chdir('/www/c/y/cybermidi.com/htdocs'); 
if (preg_match('@/plugin/@', $_SERVER['REQUEST_URI'])) { 
  exit; 
} 
?> 
The error is Parse error: syntax error, unexpected '}' in /www/c/cybermidi/htdocs/default.php on line 283

which never happened until i upgraded
Now if i try

http://cybermidi.com/news/index.php

It kind of works (without reading my templates)

but if i do this

http://cybermidi.com/news/

the same error

UPDATE: Now without changing anything, the pages are just blank

Lastly, I use a blog.php for wrapping, and the htaccess file points to this
(in configuration, the index file is names blog.php, which contains

<?php
chdir('/www/c/y/cybermidi.com/htdocs/');
require 'default.php';
?>

please help

thank you

Re: BLANK - Then Errors on upgrade

Posted: Fri Apr 14, 2006 3:39 am
by garvinhicking
Since 0.7.1 a lot has happened. Many of your custom code might make problems now.

Please post your full default.php file.

Regards,
Garvin

Posted: Fri Apr 14, 2006 5:00 am
by vinman
Garvin,
I sent you the entire default.php by PM.

I hope you can determine the problem

thanks

Posted: Sat Apr 15, 2006 5:16 am
by vinman
Here's a shortened version of the default file which won't work

Code: Select all

<?php 
if (!preg_match('@/plugin/@', $_SERVER['REQUEST_URI'])) { 
include("/www/c/cybermidi/opencon.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.1 Transitional//EN">
<html>
<head>

</head>

<BODY>

<div align="center">
YADA YADA

<table align="center">
<tr>
<td>
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="450" HEIGHT="120"
CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT></td>
</tr></table>
<HR width="100%" color="#c0c0c0" noShade SIZE=1>
<br>

<?php 
} 
ob_start(); 

chdir('/www/c/y/cybermidi.com/htdocs/news'); 
require '/www/c/y/cybermidi.com/htdocs/news/index.php'; 
$blog_data = ob_get_contents(); 
ob_end_clean(); 

echo $blog_data; 
chdir('/www/c/y/cybermidi.com/htdocs'); 
if (preg_match('@/plugin/@', $_SERVER['REQUEST_URI'])) { 
  exit; 
} 
?> 

</TD>
</td></tr></table>

</BODY>
</HTML>


Posted: Sat Apr 15, 2006 3:37 pm
by garvinhicking
Hi!

The serendipity framework should first of all be included before you send any output! That means the ob_start()...include... parts should happen at the top of the file.

Basically since serendipity has Smarty support now, the whole way you did before is no longer really required and is much easier with smarty templating. I'd suggest you to go that route! The s9y.org docs about embedding is also a bit more specific about that.

The parse error seems to come from a different problem; did you upgreade your PHP? Can it be that your php "short_tags" are no longer enabled? This would explain the problem of the "{" and "}" bracket matching...

Best regards,
Garvin

Posted: Sat Apr 15, 2006 4:41 pm
by vinman
I simply do not understand this embedding stuff. I will need to roll back to 0.7.1 and find another solution.

Posted: Sat Apr 15, 2006 4:50 pm
by garvinhicking
Using Smarty instead of embedding is much easier.

Posted: Sat Apr 15, 2006 5:24 pm
by vinman
That's another area where i don't have a clue :(

Posted: Sat Apr 15, 2006 5:38 pm
by garvinhicking
Smarty is pretty easy. Just have a look at the existing templates/defaultes/ files. You'll immediately get it, I'm sure of that.

Smarty.php.net has very good documentation. You can also embed PHP code there, if you disable the security via a config.inc.php in your template directory:

Code: Select all

$serendipity['smarty']->security = false;
Regards,
Garvin