Page 1 of 1
rewrite url issue- fatal error
Posted: Tue Nov 21, 2006 6:26 am
by manoj
Hi,
we are integrating Serendipity with some other application.
So there is a need that we have to call serendipity_admin.php directly. So we are redirecting index.php to serendipity_admin.php.
But when we redirect it , it is not showing GUI (stylesheet). But all the links and login page is displayed without gui.
sometimes we got the fatal error also.. mentioned below.
Fatal error: Call to undefined function: serendipity_rewriteurl() in
/serendipity_admin.php on line 28
i.e. on this line.
$css_file = serendipity_rewriteURL('serendipity_admin.css');
Can we redirect the index.php to serendipity_admin.php? or will it create any problem?
We are not interested in "View Blogs" link.
Please provide any suggestion...
Thanks,
Manoj
Re: rewrite url issue- fatal error
Posted: Tue Nov 21, 2006 9:51 am
by garvinhicking
Hi!
How are you doing the redirect exactly?
Serendipity relies on the 'serendipity_admin.php' URL in some cases, but if you seamlessly redirect to a file IN THE SAME DIRECTORY that should not be a problem.
Best regards,
Garvin
Posted: Tue Nov 21, 2006 10:45 am
by manoj
Hi,
What exactly is serendipity_rewriteurl function in function_permalinks.inc.php file doing.
It is being called from serendipity_admin.php file for generating the href value in <link rel="stylesheet" type="text/css" href="">.
This is changing the look and feel when the value is href="
http://localhost/serendipity-1.0.1/sere ... _admin.css".
But when the value is href="serendipity.css.php?serendipity[css_mode]=serendipity_admin.css" the exact look and feel of serendipity is displayed.
Any solution for this problem?
Thanks,
Manoj
Posted: Tue Nov 21, 2006 11:07 am
by garvinhicking
Hi!
That functions creates an URL to entries, categories and authors corresponding to the input parameters. Check the file for the PHPdoc function description.
Sadly I don't know what exactly you are doing, but since you are customizing serendipity in a way that is not meant to be, you must know what you'Re doing yourself. *g* So just check the function in the PHP file and you should see what it outputs etc.
HTH,
Garvin
Posted: Wed Nov 22, 2006 6:58 am
by manoj
Hi,
We placed the the serendipity code is placed in "admin/serendipity" folder.
So when we try to access serendipity_admin.php the url looks like
http://IP/admin/serendipity/serendipity_admin.php.
Because of placing the code in admin folder the following if block in index.php is called.
else if (preg_match(PAT_ADMIN, $uri)) {
$serendipity['view'] = 'admin';
$base = $serendipity['baseURL'];
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$base = str_replace('http://', 'https://', $base);
}
header("Location: {$base}serendipity_admin.php");
exit;
}
and is getting redirected to serendipity_admin.php file. In serendipity_admin.php file the href value for embedding style sheet is
Will the value for href have any effect on including the look and feel...
How exactly is the style sheet included in serendipity_admin.php?
Thanks.
manoj
Posted: Wed Nov 22, 2006 10:47 am
by garvinhicking
Hi!
Phew. I don't know if what you do will ever work, so good luck with that.
Regarding the stylesheet: It's no problem to make it use the absolute URL like you have shown. The CSS is fetched via index.php, where a switch/case is performed on the CSS location URL. Then the blog's stylesheet file is loaded and returned.
Best regards,
Garvin
Posted: Wed Nov 22, 2006 10:59 am
by manoj
Hi Garvin,
The CSS is fetched via index.php, where a switch/case is performed on the CSS location URL. Then the blog's stylesheet file is loaded and returned.
In which file, this switch case being performed? Please give approximate line number so that we can check for that CSS.
Thanks,
Manoj
Posted: Wed Nov 22, 2006 11:14 am
by garvinhicking
Hi!
As I wrote, the switch/case is in index.php *g*
Just search for 'css'.
Best regards,
Garvin