How to get s9y to detect that it is in the backend?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
NeilW
Regular
Posts: 51
Joined: Sat Jun 20, 2015 6:56 am
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by NeilW »

Still got a problem :(

When I first go into the blog page on my site, I get;

Code: Select all

Parse error: syntax error, unexpected $end in /home/mysite/public_html/member/mybusiness/blog/blog.php on line 34
If I refresh the page, it comes up fine, so it seems that it is not coming in on first attempt, any thoughts?
NeilW
Regular
Posts: 51
Joined: Sat Jun 20, 2015 6:56 am
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by NeilW »

That is this code, which has been working perfectly to this point;

Code: Select all

<?php
$string = 'serendipity';
$fullstring = $_SERVER['REQUEST_URI'];
if (strpos($fullstring,$string) !== false) {
$_REQUEST['page'] = 'blog';
// Let serendipity generate our content:
ob_start();
require 'index.php';
$blog = ob_get_contents();
ob_end_clean();

// Now we include our normal content building file.
// This one has to make use of your $blog variable to print
// the content where appropriate!
} else {
$groupswithaccess="PUBLIC";
$loginpage="http://mybusiness-mylife.com/index.php#contact";
$logoutpage="http://mybusiness-mylife.com/index.php#contact";
$allowsearchengine=false;
require_once("/home/mysite/public_html/slpw/sitelokpw.php");
sl_disqus();
$_REQUEST['page'] = 'blog';
// Let serendipity generate our content:
ob_start();
require 'index.php';
$blog = ob_get_contents();
ob_end_clean();

// Now we include our normal content building file.
// This one has to make use of your $blog variable to print
// the content where appropriate!
require 'content.php';
}
?>
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by onli »

That error is impossible :/

Try to remove the last line of the file, the ?>.
NeilW
Regular
Posts: 51
Joined: Sat Jun 20, 2015 6:56 am
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by NeilW »

I don't know what is happening at the moment, i just tried to go back into the backend and got that same message as before about the javascript files not working.

It seems that my browser cache is not fully clearing between code attempts so what looks good one minute is not the next.

I am continually doing refresh requests.
NeilW
Regular
Posts: 51
Joined: Sat Jun 20, 2015 6:56 am
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by NeilW »

OK, moved over from Safari from Firefox which had no previous site cache.

Still getting the javascript error on the backend.

Then tried to go into the blog and got this;

Code: Select all

== SERENDIPITY ERROR ==

Cannot modify header information - headers already sent by (output started at /home/mysite/public_html/slpw/plugin_disqus/config.php:140) in /home/mysite/public_html/member/mybusiness/blog/include/functions_config.inc.php on line 716
There is not even a line 716 in the config file :(

It is 5:30am here, and I have hardly slept, will catch a few hours and try to find out what is going on and let you know.
NeilW
Regular
Posts: 51
Joined: Sat Jun 20, 2015 6:56 am
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by NeilW »

Seems like a bit of sleep and a number of clears of the Firefox cache has got rid of the Firefox error at the moment.

I am wondering if there is another way to do this without directly editing the config.inc.php file?

Is it possible for me to create a separate menu.php file in the theme folder that creates a menu.tpl file that can then be called into the main templates or something similar?

Thanks again
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by Don Chambers »

What problems still exist?
=Don=
NeilW
Regular
Posts: 51
Joined: Sat Jun 20, 2015 6:56 am
Contact:

Re: How to get s9y to detect that it is in the backend?

Post by NeilW »

Hi Don,

The tough thing has been that I am also trying to fit the blog in to work with my site management software and also plugins for that.

So it has not been straight forward and a lot of trial and error along the way.

That Firefox header problem was genuine as Firefox is not as forgiving as Safari and Chrome and if you forget to empty the browser cache as often as you should some things don't always appear as they really are.

One of the management software plugins was causing the header problem so it then became a task to do something to fix that.

But the good news is I reckon I am 99% there with the help of your function code and a bit of trial and error. :D

Everything is starting to "look" great now and "seems" to be working fine, but I just need to tie up a few loose ends in the footer area and then see how everything all works with a bit of testing.

As always, the testing will be the proof of the pudding because I have probably done some weird stuff to make it all (seem to) work.

So yes, all looking good and thank you so much once again to you and onli for getting me this far. ( I was almost going to defect to that horrible WP software - even as late as yesterday :( )

As well as thoroughly recommending your Clean-Blog design I will also have to give big wraps to the serendipity_event_entryproperties plugin which has allowed me to do so much extra customization in line with my initial needs as first outlined. It truly does allow you to fully customise important areas on the blog page that are outside of the blog entry itself.

I am doing all the work and testing on a blog that is hidden away in one of my membership areas at the moment, but will duplicate the installation in my public "Hot News" blog by Monday.

So all being well, I will send you a link for that then so you can have a look at how great your theme looks. ;)

Thanks again.

- Neil
Post Reply