Including archive in page

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
chorizo
Posts: 4
Joined: Tue Mar 08, 2005 11:43 am

Including archive in page

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Including archive in page

Post 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
# 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