Integrating Pages *into* Serendipity

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
digx
Regular
Posts: 9
Joined: Tue Feb 01, 2005 1:06 am

Integrating Pages *into* Serendipity

Post by digx »

I'm using the following code to try to get some pages and scripts I have to use the layout I have for Serendipity.

Code: Select all

<?php
/* SERENDIPITY HOOK START */
    $serendipity_directory = '/home/****/****/blog/';

    $cwd = getcwd();
    chdir($serendipity_directory);
    define('S9Y_INCLUDE_PATH', $serendipity_directory);
    include_once(S9Y_INCLUDE_PATH . 'serendipity_config.inc.php');
    include_once(S9Y_INCLUDE_PATH . 'include/functions.inc.php');
    include_once(S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php');
    include_once(S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php');

    $serendipity['smarty_file'] = 'index.tpl';
    $serendipity['smarty_raw_mode'] = false;
    serendipity_smarty_init();
	$serendipity['smarty']->assign(
		array(
			'leftSidebarElements'       => serendipity_plugin_api::count_plugins('left'),
			'rightSidebarElements'      => serendipity_plugin_api::count_plugins('right')
		)
	);

    chdir($cwd);
    ob_start();
/* SERENDIPITY HOOK END */ 

include("mycontent.php");

serendipity_smarty_shutdown($serendipity_directory);


?>
This is also useful in case I change my template since it'll also affect my entire site without me having to do much code editing.

Problem is, that I get what I want but the plugins on the right do not show. It is the exact same code I copied from a post about integrating some gallery scripts into Serendipity.

Hope you can help. Thanks in advance! :D
digx
Regular
Posts: 9
Joined: Tue Feb 01, 2005 1:06 am

Post by digx »

Help? :(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Did you look at your index.tpl template and see if the if-fragment for displaying the right sidebar is evaluated and executed?

Try to see if 'rightSidebarElements' variable is larger than 0 and if not, see what the count_plugins('right') function returns.

And have patience, we do not all live in the same timezone as you do :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
digx
Regular
Posts: 9
Joined: Tue Feb 01, 2005 1:06 am

Post by digx »

Heh, yeah, sorry. :P

Anyways, yes I have checked the variable when loading that page I want integrated into Serendipity and it does return an integer larger than 0 so I know it doesn't have a problem there. I also checked to make sure the function that shows the plugins is correctly placed and it is (otherwise it wouldn't work on the s9y portion of the site :P)

If you can think of anything else, I'll really appreciate it.

Thanks in advance! :D
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Then the problem seems to be that the load_plugin or enum_plugins function call does not work probably. This may happen if Serendipity is not within its path to include/require the plugin files.

Maybe you can have a look at include/plugin_api.inc.php and investigate the returns/execution of serendipity_plugin_api::generate_plugins() creates errors?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
digx
Regular
Posts: 9
Joined: Tue Feb 01, 2005 1:06 am

Post by digx »

The return it makes is pretty much the plugins!

I did

Code: Select all

echo serendipity_plugin_api::generate_plugins('right');
and it gave me what I needed, now the question is why wouldn't it show in the right place if it looks like the call is correct from the template file. Here's the sidebar portion of the template file:

Code: Select all

						</div>
					</div>
					<div id="sidebar">
						{serendipity_printSidebar side="right"}
					</div>
				</div>
Hope that helps, meanwhile I might try changing the template to default to see if it works with that outside page and compare template files.

Thanks for your help! :D

EDIT: I changed the template to the default and it still gave me the same problem where the plugins don't show, any other ideas?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Maybe you can check the Smarty function serendipity_printSidebar and see if it returns "bad" stuff. The function should reside in include/functions_smarty.inc.php.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
digx
Regular
Posts: 9
Joined: Tue Feb 01, 2005 1:06 am

Post by digx »

Well, just calling it doesn't do anything but echoing with the correct params gives the sidebar correctly. I'm going to try to investigate this a bit further and let you know of my findings. Other than that, got any other ideas?

Thanks in advance. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Sorry, no other clues. Only that maybe the path settings to the template path are wrong or so...?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply