Webmastersite.net
Register Log In

Warning: strstr(): Empty delimiter.
nothing works.

Comments on Warning: strstr(): Empty delimiter.

zaner
Beginner

Usergroup: Customer
Joined: Mar 16, 2004

Total Topics: 3
Total Comments: 4
zaner
Posted Sep 12, 2005 - 9:41 PM:

fresh install.

whent through everything 6 times.




Warning: strstr(): Empty delimiter. in /home/xxxxxx/classes/template.php on line 17
You've removed the body from your wrapper template! This means there's no way to know where to put the page and it will just be appended after your wrapper. Edit your wrapper to re-include the <!-- BODY GOES HERE --> line.

I removed nothing. I did nothing.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 13, 2005 - 6:27 PM:

If you didn't remove it, that means you've made your wrapper template inacceessible, as you could see by trying to load in your web browser. If you can't see templates/default/wrapper.tpl in your web browser, then the script won't be able to see it either. Read the manual entry on chmoding.
Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
Posted Oct 06, 2005 - 7:08 AM:

I'm getting the same error message, after playing around with a new template. It was working earlier, then the next time I went to access the directory - it fails. The wrapper is unchanged.

The problem is fixed if I patch template.php - [since its gettting a null value for $templatesdir] - to force a value of

templatesdir="/home/......./wsnlinks/templates/default"; { ... is system dependant}

I have exactly the same problem in a second installation I did for another site.
I've reviewed the chmods and they are all correct

Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
Posted Oct 06, 2005 - 8:49 AM:

I have discovered that deleting the cookies for the site and removing the session record from wsnlinks_sessions will make the error go away.

However, the problem will appear again once I switch templates. As a test I copied the unmodified default templates to a sub-directory default2. As soon as I switch to it, I get the error again. But this only happens as long as I am not logged in to the the admin menu. If I am logged in, the error will not happen until I logout.

At this point, it seems that the cookie that sets the default template, is set differently, if the admin menu is active, and the settings get mixed up and conflict with each other.
Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
Posted Oct 06, 2005 - 3:40 PM:

Further debugging indicates the following - at this point I'm totally lost, but maye it helps solve the problem

If there are two identical templates 'default' and 'default2' then I can switch back and forth between the two templates, as long as I am logged in the admin screen. Once I log out, then even selecting the current template causes the crash. Once it crashes, I have to remove the cookie 'templatesdir'

Note if I am logged in the admin screen, then the cookie does not get created [this is probably done by start.php when it tests if ($thismember->usergroup > 1) - when deciding to write a cookie]

The problem occurs when index.php tries to create new template("movedtopic.tpl"); at which point the class [template.php] does not find a value for $templatesdir which causes

else if (!strstr($file, $templatesdir)) to fail

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 07, 2005 - 5:43 PM:

Sounds like you have an old or incorrect template.
Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
Posted Oct 08, 2005 - 9:02 PM:

I downloaded and installed the software on Sep 27, so it should be up to date.
Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
Posted Oct 09, 2005 - 2:12 AM:

One more time. Downloaded version 3.16, installed to a site which did not previously have WSNLinks installed with a new mySQL database.

I do not get the error with 3.16.

Then downloaded 3.27 and did an upgrade.

Copied templates/default to templates/default2, in admin - set Template Selector on - no other changes, or patches or customization.

Open a new window and go to index.php and I can - in the top left, select either template:default or template:default2 and it works.

Logged out of admin window, go to index.php, in the top left, select template:default2 and it crashes.

I've spent many many hours messing with this, and it's getting frustrating.




Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Oct 13, 2005 - 6:50 AM:

This might be related. In prestart.php after
if ($templatesdir == '') $templatesdir = $settings->templatesdir;
add
$settings->templatesdir = $templatesdir;
Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
#10 - Quote - Permalink
Posted Oct 14, 2005 - 12:57 AM:

Thnks, but it still does not fix it.

Put a trace an classes/templates.php

global $settings, $templatesdir, $inadmindir, $thismember;

echo '*** Settings ' . $settings->templatesdir . '<BR>';
echo '*** Templatesdir ' . $templatesdir . '<BR>';

gives

*** Settings templates/default
*** Templatesdir

$settings->templatesdir is ok, it's just $templatesdir is empty when it gets to templates.php, even though I know from some other traces it just executed the presetart.php code

However If I put

$templatesdir=$settings->templatesdir;

after the global, it works, but I'm not sure whether that will cause other problems
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#11 - Quote - Permalink
Posted Oct 14, 2005 - 2:20 AM:

Since the line if ($templatesdir == '') $templatesdir = $settings->templatesdir; is already there, it's rather senselessly repetitive. Perhaps you have some invisible but non-blank value there somehow.
Nicky32
Member

Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada

Total Topics: 12
Total Comments: 32
Nicky32
#12 - Quote - Permalink
Posted Oct 14, 2005 - 10:18 AM:

if ($templatesdir == '') $templatesdir = $settings->templatesdir; is in prestart.php, and presumably works there, however, when it gets to template.php, $templatesdir is empty.

The change I made was to template.php by adding

$templatesdir=$settings->templatesdir; at the start of the code

Until I made these changes, both templates.php and prestart.php were unchanged as received in the download

PRESTART.PHP
if ($templatesdir == '') $templatesdir = $thismember->template;
if ($templatesdir == '') $templatesdir = $_COOKIE['templatesdir'];
if ($templatesdir == '') $templatesdir = $settings->templatesdir;
$settings->templatesdir = $templatesdir; // it seems this is needed otherwise the template change is only temporary

echo '****SET ' . $templatesdir; // this shows a that a vlue exists

TEMPLATE.PHP
global $settings, $templatesdir, $inadmindir, $thismember;
// echo $templatesdir is empty here
$templatesdir=$settings->templatesdir; // added



//MDG echo '****SET ' . $settings->templatesdir;
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.