Page 1 of 1

Including archive in page

Posted: Sun Apr 03, 2005 2:54 pm
by chorizo
Hi,

I'm trying to create my on theme for serendipity. The problem I have is that I want to remove the sidebar and instead have a page with the archive.

I'm trying to do this:

Code: Select all

<?php
    $serendipity_directory = '../serendipity/';

    $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 */ 
?>

<?php include("plugins/serendipity_plugin_history/serendipity_plugin_history.php"); 
	generate_content();

?>

<?php serendipity_smarty_shutdown($serendipity_directory); ?> 
But It doesn't work. I get the following:

Code: Select all

Fatal error: Call to undefined function: generate_content() in /mnt/home/chorizo/public_html/archives/index.php on line 28
Any ideas? Is there some plugin that I can use to get more statistic information on the same page as the archives?

Re: Including archive in page

Posted: Sun Apr 03, 2005 7:29 pm
by garvinhicking
Sadly your code is really wrong. You cannot cann generate_content() function, as it is a method of a plugin object which you have not yet created. You cannot only include the plugin file; you need to create/initiate a new object and then access the method:

Code: Select all

include "plugins/serendipity_plugin_history/serendipity_plugin_history.php"
$plugin = new serendipity_plugin_history();
$plugin->generate_content();
I'm not really sure I get what you want to do. Can you describe it a bit more detailed and maybe create some layouts/screenshots of what you want to have?

Regards,
Garvin