Hi
Ok! Here is my try. Its working for me, but I would prefer to use the plugin a soon as possible when s9y.0.8 is released!
You´ll need some additional hacks inside the style.css and/or gallery stylesheets.
There has to be a entry link in the nav bar (left or right). You should use the php nugget plugin for this e.g. <a href="/gallery/">gallery</a>
/gallery/html_wraps
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php
// $Id: wrapper.header,v 1.01 2004/10/23 18:24:02 ian Exp $
// This header indicates, that Gallery is embedded
if (!preg_match('@/albums_embedded.php$@', $_SERVER['REQUEST_URI'])) {
include('serendipity_embedded.php');
}
?>
<!-- normal header procedure -->
##########################################
/gallery/html_wraps
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php # $Id: serendipity_embedded.php,v 1.02 2004/10/23 19:33:32 ian Exp $
define('IS_installed', file_exists($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/serendipity_config_local.inc.php'));
if ( IS_installed === true ) {
define('IN_serendipity', true);
}
include_once($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/compat.php');
?>
<div id="serendipity_banner">
<h1>Title</h1>
<h2>Subtitle</h2>
</div>
<table id="mainpane">
<tr>
<td align="left" valign="top">
<!-- plugin sidebar start -->
<table class="embedded_border_bug">
<tr>
<!-- serendipity include start -->
<?php
global $serendipity;
$serendipty['GET']['action'] = 'insidegallery';
/*
* Load DB configuration information
* Load Functions
*/
include_once($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/serendipity_config_local.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/serendipity_functions.inc.php');
/*
* Attempt to connect to the database
*/
if (!serendipity_db_connect()) {
die(DATABASE_ERROR);
}
/*
* Load Configuration options from the database
*/
serendipity_load_configuration();
/*
* Load main language file again, because now we have the preferred language
*/
include($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/serendipity_lang.inc.php');
if ($serendipity['embed'] && ($serendipity['embed'] === 'true' || $serendipity['embed'] === true)) {
$serendipity['baseURL'] = 'http://' . $_SERVER['HTTP_HOST'] . $serendipity['serendipityHTTPPath'];
}
include_once($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/serendipity_plugin_api.php');
include_once($_SERVER['DOCUMENT_ROOT'] . $gallery->app->geeklog_dir . '/s9y/serendipity_sidebar_items.php');
if (!$serendipity['embed'] || $serendipity['embed'] === 'false' || $serendipity['embed'] === false) {
serendipity_plugin_api::generate_plugins('left', 'td');
}
?>
<!-- serendipity include end -->
</tr>
</table>
<!-- plugin sidebar end -->
</td>
<td align="left" valign="top" class="embedded_main" cellspacing=0 cellpadding=0>
############################################################
/s9ypath/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php # $Id: layout.php,v 1.03 2004/10/07 10:26:00 ian Exp $
include_once('./serendipity_config.inc.php');
include_once(S9Y_INCLUDE_PATH . 'serendipity_plugin_api.php');
include_once(S9Y_INCLUDE_PATH . 'serendipity_sidebar_items.php');
include_once(S9Y_INCLUDE_PATH . 'embedded_extended_functions.inc.php');
?>
[...]
// show gallery page
case "gallery":
serendipity_printGallery();
break;
############################################################
/s9ypath/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php # $Id: embedded_extended_entries.inc.php,v 1.02 2004/12/04 13:52:00 ian Exp $
[...]
else if (preg_match('@/gallery$@', $uri)) {
header('Content-Type: text/html; charset=ISO-8859-1');
$serendipity['GET']['action'] = 'gallery';
/* while we need the session var to enable or disable them, we have to start the */
session_start();
/* which makes the use of ob_start(); - include page -
* than ob_get_contents(); and ob_end_flush(); obsolet. */
include_once('serendipity_genpage.inc.php');
}
############################################################
/s9ypath/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php # $Id: embedded_extended_functions.inc.php,v 1.01 2004/10/07 10:26:00 ian Exp $
if($serendipty['GET']['action'] == 'insidegallery') {
include_once("/home/www/your/dirs/to/s9y/serendipity_db.inc.php");
include_once("/home/www/your/dirs/to/s9y/compat.php");
include_once("/home/www/your/dirs/to/s9y/serendipity_functions_config.inc.php");
include_once("/home/www/your/dirs/to/s9y/bundled-libs/XML/RPC.php");
include_once("/home/www/your/dirs/to/s9y/serendipity_plugin_api.php");
include_once("/home/www/your/dirs/to/s9y/serendipity_functions_images.inc.php");
include_once("/home/www/your/dirs/to/s9y/serendipity_functions_installer.inc.php");
}
[...]
function serendipity_printGallery() {
global $serendipity;
$serendipity['GET']['showgallery'] = false;
## close forgetten $_SESSION vars, but !!! ATTENTION !!! not the active SESSION VAR!
unset($_SESSION['.....']);
## include gallery page
include_once '/home/www/your/dirs/to/gallery/albums.php';
}
######################################################################################################
/s9ypath/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php # $Id: serendipity_functions.inc.php,v 1.454.2.1 2004/11/09 19:10:56 garvinhicking Exp $
# Copyright (c) 2003-2004, Jannis Hermanns
# All rights reserved. See LICENSE file for licensing details
/* need to include this, while using gallery script */
if (!defined('S9Y_INCLUDE_PATH')) {
define('S9Y_INCLUDE_PATH', dirname(__FILE__) . '/');
}
#####################################################################################################
/s9ypath/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php # $Id: serendipity_genpage.inc.php,v 1.35 2004/10/14 11:41:14 jhermanns Exp $
[...]
<html>
<head>
<title><?php echo htmlspecialchars($serendipity['blogTitle']) . (isset($serendipity['blogSubTitle']) ? ' - '. htmlspecialchars($serendipity['blogSubTitle']) : '') ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo LANG_CHARSET; ?>" />
<meta name="Powered-By" content="Serendipity v.<?php echo $serendipity['version'] ?>" />
<?php
$bdir = '';
if($serendipity['GET']['action'] == 'gallery') {
$GALLERY_EMBEDDED_INSIDE = 's9y';
$bdir = ' dir="ltr"';
include_once '/home/www/your/dirs/to/gallery/config.php';
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" />
Well, I am not shure about this if() phrase, give it a try!
###################################################################################################
/gallery/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* $Id: albums.php,v 1.156.2.5 2004/08/20 06:03:16 cryptographite Exp $
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* $Id: slideshow.php Exp $
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* $Id: view_album.php Exp $
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* $Id: view_photo.php Exp $
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[...]
/*
** when direction is ltr(left to right) everything is fine)
** when rtl(right to left), like in hebrew, we have to switch the alignment at some places.
*/
if ($gallery->direction == 'ltr') {
$left="left";
$right="right";
}
else {
$left="right";
$right="left";
}
//////////////////////////////////////// s9y import start////////////////////////////////
/* URI paths
* These could be defined in the language headers, except that would break
* backwards URL compatibility
*/
@define('PATH_ARCHIVES', 'archives');
@define('PATH_ARCHIVE', 'archive');
@define('PATH_UNSUBSCRIBE', 'unsubscribe');
@define('PATH_DELETE', 'delete');
@define('PATH_APPROVE', 'approve');
@define('PATH_FEEDS', 'feeds');
@define('PATH_ADMIN', 'admin');
@define('PATH_ENTRIES', 'entries');
@define('PATH_CATEGORIES', 'categories');
@define('PATH_PLUGIN', 'plugin');
/* URI patterns
* Note that it's important to use @ as the pattern delimiter. DO NOT use shortcuts
* like \d or \s, since mod_rewrite will use the regexps as well and chokes on them.
*/
@define('PAT_FILENAME', '0-9a-z\.\_!;,\+\-');
@define('PAT_UNSUBSCRIBE', '@/'.PATH_UNSUBSCRIBE.'/(.*)/([0-9]+)@');
@define('PAT_APPROVE', '@/'.PATH_APPROVE.'/(.*)/(.*)/([0-9]+)@');
@define('PAT_DELETE', '@/'.PATH_DELETE.'/(.*)/(.*)/([0-9]+)@');
@define('PAT_ARCHIVES', '@/'.PATH_ARCHIVES.'/([0-9]+)\.html@');
@define('PAT_ARCHIVES_SHORT', '@/'.PATH_ARCHIVES.'/([0-9]+)[_\-]short\.html@');
@define('PAT_COMMENTSUB', '@/([0-9]+)[_\-][' . PAT_FILENAME . ']*\.html@i');
@define('PAT_FEEDS', '@/'.PATH_FEEDS.'/@');
@define('PAT_FEED', '@/(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$@');
@define('PAT_ADMIN', '@/'.PATH_ADMIN.'$@');
@define('PAT_ENTRIES', '@/'.PATH_ENTRIES.'$@');
@define('PAT_ARCHIVE', '@/'.PATH_ARCHIVE.'$@');
@define('PAT_CATEGORIES', '@/'.PATH_CATEGORIES.'/([0-9]+)@');
@define('PAT_PLUGIN', '@/' . PATH_PLUGIN . '/(.*)@');
@define('USERLEVEL_ADMIN', 255);
@define('USERLEVEL_CHIEF', 1);
@define('USERLEVEL_EDITOR', 0);
@define('VIEWMODE_THREADED', 'threaded');
@define('VIEWMODE_LINEAR', 'linear');
if (!$GALLERY_EMBEDDED_INSIDE) {
doctype();
?>
<html>
<head>
<title><?php echo $gallery->app->galleryTitle ?></title>
<?php
common_header(); /* calls embedded_style.css in skin/_*_/css folder */
echo "\n"; /* wrap line to next link */
/* prefetching/navigation */
if ($navigator['page'] > 1) { ?>
<link rel="top" href="<?php echo makeGalleryUrl('albums.php', array('set_albumListPage' => 1)) ?>" />
<link rel="first" href="<?php echo makeGalleryUrl('albums.php', array('set_albumListPage' => 1)) ?>" />
<link rel="prev" href="<?php echo makeGalleryUrl('albums.php', array('set_albumListPage' => $navigator['page']-1)) ?>" />
<?php }
if ($navigator['page'] < $maxPages) { ?>
<link rel="next" href="<?php echo makeGalleryUrl('albums.php', array('set_albumListPage' => $navigator['page']+1)) ?>" />
<link rel="last" href="<?php echo makeGalleryUrl('albums.php', array('set_albumListPage' => $maxPages)) ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="/s9y/serendipity.css.php" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="/s9y/feeds/index.rss2" />
<link rel="alternate" type="application/x.atom+xml" title="Atom" href="/s9y/feeds/atom.xml" />
///////// s9y import end ////////////////////////////////////////////////////////
<?php
if (strtolower($serendipity['extCSS'])!='') {
?>
##############################################################################################
/gallery/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* $Id: util.php,v 1.410.2.9 2004/08/23 00:41:43 cryptographite Exp $
[...]
function doctype() {
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo "\n\n";
}
function common_header() {
// Do some meta tags
metatags();
// Import CSS Style_sheet
echo getStyleSheetLink();
}
function metatags() {
global $gallery;
#echo '<meta http-equiv="content-style-type" content="text/css">';
echo "\n ". '<meta http-equiv="content-style-type" content="text/css">';
echo "\n ". '<meta http-equiv="content-type" content="Mime-Type; charset='. $gallery->charset .'">';
echo "\n ". '<meta name="content-language" content="' . str_replace ("_","-",$gallery->language) . '">';
echo "\n\n";
}