BLANK - Then Errors on upgrade

Having trouble installing serendipity?
Post Reply
vinman
Regular
Posts: 16
Joined: Thu Apr 13, 2006 9:47 pm

BLANK - Then Errors on upgrade

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: BLANK - Then Errors on upgrade

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
vinman
Regular
Posts: 16
Joined: Thu Apr 13, 2006 9:47 pm

Post by vinman »

Garvin,
I sent you the entire default.php by PM.

I hope you can determine the problem

thanks
vinman
Regular
Posts: 16
Joined: Thu Apr 13, 2006 9:47 pm

Post 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>

garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
vinman
Regular
Posts: 16
Joined: Thu Apr 13, 2006 9:47 pm

Post by vinman »

I simply do not understand this embedding stuff. I will need to roll back to 0.7.1 and find another solution.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Using Smarty instead of embedding is much easier.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
vinman
Regular
Posts: 16
Joined: Thu Apr 13, 2006 9:47 pm

Post by vinman »

That's another area where i don't have a clue :(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply