Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv27785
Modified Files:
INSTALL NEWS serendipity_config.inc.php
serendipity_config_local.tpl serendipity_genpage.inc.php
Log Message:
Fixed the evaluation of the 'embed' directive, which was incorrect. Also wrote a small HowTo on how to use the 'embed' option.
Index: INSTALL
===================================================================
RCS file: /cvsroot/php-blog/serendipity/INSTALL,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- INSTALL 9 Sep 2003 20:13:21 -0000 1.6
+++ INSTALL 1 Oct 2003 09:29:02 -0000 1.7
@@ -70,6 +70,79 @@
HTML header and includes layout.php
###############################################################################
+
+###############################################################################
+# THE 'embed' CONFIGURATION DIRECTIVE #
+###############################################################################
+
+In your serendipity configuration, you can set an 'embed' option to true or false.
+
+This defines, whether you use your blog as a standalone webpage - or if you have
+different content wrapped around your blog, like the menu of your usual homepage.
+
+By setting the 'embed' option to true, you have to make sure the following things to
+get everything to work well:
+
+1. 'indexFile' option.
+
+ This configuration option needs to be set to the wrapper file you want to use.
+ Let's say you normally have a 'content.php' file for your webpage. This
+ 'content.php' file sets up your internal templates, your menu structure and such.
+ Now you want this file to be used to include your weblog. A simple content.php
+ could look like this:
+
+ <?php
+ $homepage = new Template_Class;
+ $homepage->set_template($_REQUEST['page']);
+ $homepage->output_header();
+ $homepage->output_content();
+ $homepage->output_footer();
+ $homepage->track_statistics();
+ ?>
+
+ So normally your file would be called with 'content.php?page=about' to display your
+ 'about' page of your personal homepage.
+
+ Now we want this file to be displayed, having the 'page' variable being set to 'blog'.
+
+ For this, we set up a 'wrapper.php' file:
+
+ <?php
+ $_REQUEST['page'] = 'blog';
+ // Let serendipity generate our content:
+ ob_start();
+ require 'index.php';
+ $blog_data = ob_get_contents();
+ ob_end_clean();
+
+ // Now we include our normal content building file.
+ // This one has to make use of your $blog_data variable to print
+ // the content where appropriate!
+ require 'content.php';
+ ?>
+
+ You would then set your 'indexFile' serendipity-option to the 'wrapper.php' file.
+
+ 2. Plugin panes & HTML-headers
+
+ With the example above, we only get the main blog data printed. One of the most visible
+ actions when using the 'embed' option is that the plugin panes are not generated.
+ And HTML headers/foooters are also not provided by s9y in this case, as this should be done
+ by your 'content.php' file.
+
+ So you have to include them in your 'content.php' file, to have them visible in your
+ embedded setup.
+
+ You can use this snippet:
+ <?php
+ serendipity_plugin_api::generate_plugins('left','div');
+ serendipity_plugin_api::generate_plugins('right','div');
+ ?>
+ somewhere in your 'content.php' file.
+
+The 'embed' option is therefore only recommended to be used by advanced users going for a most flexible setup!
+
+###############################################################################
Serendipity Weblog - http://s9y.org
Licensed under the BSD License
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- NEWS 30 Sep 2003 21:40:15 -0000 1.29
+++ NEWS 1 Oct 2003 09:29:02 -0000 1.30
@@ -2,6 +2,7 @@
Version 0.3 (October 1, 2003)
------------------------------------
+ * Fixed evaluation of the 'embed' variable and added a small 'HowTo' to the INSTALL file (garvinhicking)
* Fixed links to images now containing absolute URI to maintain RSS-feed validity. Relative URIs are not allowed/visible within RSS feeds. (garvinhicking)
* Fixed problem with escaping single quotes during installation (tomsommer)
* Fixed problem with dual-trailing slashes in paths during installation (tomsommer)
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- serendipity_config.inc.php 30 Sep 2003 21:22:00 -0000 1.34
+++ serendipity_config.inc.php 1 Oct 2003 09:29:02 -0000 1.35
@@ -72,7 +72,7 @@
*/
include($serendipity['serendipityPath'] .'serendipity_lang.inc.php');
-if ($serendipity['embed']) {
+if ($serendipity['embed'] && ($serendipity['embed'] == 'true' || $serendipity['embed'] === true)) {
$serendipity['baseURL'] = 'http://' . $_SERVER['HTTP_HOST'] . $serendipity['serendipityHTTPPath'];
}
Index: serendipity_config_local.tpl
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- serendipity_config_local.tpl 30 Sep 2003 20:17:07 -0000 1.18
+++ serendipity_config_local.tpl 1 Oct 2003 09:29:02 -0000 1.19
@@ -36,7 +36,7 @@
$serendipity['extCSS'] = '{External Stylesheet|extCSS|string|none}'; // You can define a stylesheet uri here, aditionally to the settings adjustable in the admin interface (enter 'none' if you don't need this)
$serendipity['wysiwyg'] = '{Use WYSIWYG editor|wysiwyg|bool|0}'; // Do you want to use the WYSIWYG editor (CAUTION: only turn this on if you use Microsoft's Internet Explorer!!!)?
$serendipity['XHTML11'] = '{Force XHTML 1.1 compliance|XHTML11|bool|0}'; // Do you want to force XHTML 1.1 compliance (may cause problems for back-/frontend on older 4th generation browsers)
-$serendipity['embed'] = '{Is serendipity embedded?|embed|bool|0}'; // If you want to embed serendipity within a regular page, set to true to discard any headers and just print the contents. You can make use of the indexFile option to use a wrapper class where you put your normal webpage headers.
+$serendipity['embed'] = '{Is serendipity embedded?|embed|bool|0}'; // If you want to embed serendipity within a regular page, set to true to discard any headers and just print the contents. You can make use of the indexFile option to use a wrapper class where you put your normal webpage headers. See the INSTALL file for more information!
$serendipity['track_exits'] = '{Track exit URLs|track_exits|bool|1}'; // Do you want to track exit targets?
$serendipity['blockReferer'] = '{Blocked Referers|blockReferer|string|;}'; // Are there any special hosts you want not to show up in the referers list? Separate the list of hostnames with ';' and note that the host is blocked by substring matches!
Index: serendipity_genpage.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_genpage.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- serendipity_genpage.inc.php 19 Aug 2003 16:06:57 -0000 1.16
+++ serendipity_genpage.inc.php 1 Oct 2003 09:29:03 -0000 1.17
@@ -1,5 +1,5 @@
<?php # $Id$
-if (!$serendipity['embed']) {
+if (!$serendipity['embed'] || $serendipity['embed'] == 'false' || $serendipity['embed'] === false) {
// serendipity is embedded into an existing structure. No need to output headers then.
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -34,7 +34,7 @@
include $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default/layout.php';
}
-if (!$serendipity['embed']) {
+if (!$serendipity['embed'] || $serendipity['embed'] == 'false' || $serendipity['embed'] === false) {
?>
</body>
</html>
|