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.
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.
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
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.
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
$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
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.
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;
0/5
1
2
3
4
5
This thread is closed, so you cannot post a reply.
Comments on Warning: strstr(): Empty delimiter.
Beginner
Usergroup: Customer
Joined: Mar 16, 2004
Total Topics: 3
Total Comments: 4
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.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
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
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
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.
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
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
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Sounds like you have an old or incorrect template.
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
I downloaded and installed the software on Sep 27, so it should be up to date.
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
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.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
This might be related. In prestart.php after add
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
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
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.
Member
Usergroup: Customer
Joined: Sep 27, 2005
Location: Canada
Total Topics: 12
Total Comments: 32
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;