Page 1 of 1

Holy Cow am I lost lol.

Posted: Tue Sep 21, 2004 8:18 pm
by warduke
I know jack about php to be honest. I barely get html since it has been sooooo long since I worked with it and alot has changed since then. I designed a simple website, just the main index page and a phpbb forum. Those that the only two links I have done atm. You can see where I am so far at http://bladesoflineage.info

I have the blog up and running @ http://bladesoflineage.info/serendipity/index.php

The blog works fine. No problems and I think you did an outstanding job!

My problem is simple(i think anyways), looking at index.htm page you can see where I probably want embedded blog to reside. Over on the right side if you don't. I don't understand what to do to make that work there. I am using Dreamweaver to create the site. I read your tutorial on embedding but I don't understand it as I don't understand php.

Is there a way to put the blog in that area? I assume I have to create files or something. Though I don't understand it hehe. I am sure that a search for stuff like this can be done here but it wont help me much as I wont understand the answers givin there. If it's possible, could you explain it to me on this post. Maybe as you would a child as I know jack about php. Near as I can figure it's like java. Which I also don't know jack lol.

Thanx for any help you can give me. If you cannot explain it to me perhaps you can point me to a sight that teaches folks about php and how to use it?

I just want to use it to update news on the main website. I am working on a project with a friend and he knows less then I do. A blog seems like the easiest way to keep the webpage current when I is completed.

Re: Holy Cow am I lost lol.

Posted: Wed Sep 22, 2004 12:47 pm
by garvinhicking
Hi!

Actually you should be able to get that done quite easily. I guess you only want to see the entries in your webpage area, not all the sidebar plugins and stuff? Because I think you're going out of screen space if you want that visible as well. ;-)

First of all, open your serendipity configuration page and set the embed mode to true. Leave the indexFile set to 'index.php'.

Anyways - just open the layout.php template file of the serendipity template you chose. This will most probably be templates/default/layout.php in your case.

Then edit it to only contain this:

Code: Select all

<?php # $Id: layout.php,v 1.7 2004/08/25 08:58:18 garvinhicking 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');

if (!isset($serendipity['GET']['range']) || !is_numeric($serendipity['GET']['range'])) {
    $serendipity['GET']['range'] = date('Ymd');
}

// The main area
switch ($serendipity['GET']['action']) {
    // User wants to read the diary
    case 'read':
        if (isset($serendipity['GET']['id'])) {
            serendipity_printEntries(array(serendipity_fetchEntry('id', $serendipity['GET']['id'])), 1);
        } else {
            serendipity_printEntries(serendipity_fetchEntries($serendipity['GET']['range'], true, 15));
        }
        break;

    // User searches
    case 'search':
        $r = serendipity_searchEntries($serendipity['GET']['searchTerm']);
        if ( strlen($serendipity['GET']['searchTerm']) <= 3 ) {
            echo SEARCH_TOO_SHORT;
            break;
        }

        if ($r === true) {
            printf(NO_ENTRIES_BLAHBLAH, $serendipity['GET']['searchTerm']);
            break;
        }

        printf(YOUR_SEARCH_RETURNED_BLAHBLAH, $serendipity['GET']['searchTerm'], count($r));
        serendipity_printEntries($r);
        break;

    // Show the archive
    case 'archives':
        serendipity_printArchives();
        break;


    // Welcome screen or whatever
    default:
        serendipity_printEntries(serendipity_fetchEntries(null, true, 15));
}
?>
If you compare my file with your current layout.php, you will see that I stripped all unneccesary output (headers, footers, sidebars) and only preserve the main content area.

But you must pay attention that your own surrounding HTML file sends all headers and necessary CSS style includes. See the file serendipity_genpage.inc.php to see what serendipity is using by default, if you don't have embedding enabled.

I hope that helps!

Best regards,
Garvin.

Posted: Wed Sep 22, 2004 6:55 pm
by warduke
wow that worked great! I had to change the design to met the blog a bit better. looks outstanding though. thanks alot!!!