Hi!
First of all, don't be ashamed! You already achieved a lot!
What you now need to do is this. Edit your template's index.tpl. This is some kind of "Controller" where you can output your content.
The place where your content would show up is at the place where it reads:
This occurs twice in the andreas06 theme. The first one is the one you want to modify, since it is the one that outputs code when you are simply viewing the blog. The other position would be used when you view single entries.
So, now you want to show your plogger gallery at this point. So you insert this code just before the line, so that it reads this:
Code: Select all
{if $mypage == 'photos'}{$myphotos}{else}{$CONTENT}{/if}</div></div>
So, what we have added are two variables. The one is called $mypage and the other $myphotos. The IF-clause will check "Is this variable set?" and if it is, it will show the content of $myphotos. If it is not set it will show the usual blog content.
$mypage is a new variable that you need to set for a specific page, if you want to see that page - and $myphotos will be the variable which holds the content of your photo gallery.
Because these variables should only be set on the page where you view the photos, you need to add a new "subpage" to serendipity. You do this by setting the link of your "Photos" tab to a link like this:
Code: Select all
http://vetoweb.free.fr/index.php?serendipity[subpage]=photos
Now, this page uses the simple serendipity index file. You will now also tell serendipity somehow, that it should include your gallery.
You do that by editing the file "config.inc.php" inside your andreas06 template directory.
It currently looks like this:
Code: Select all
$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
} else {
include dirname(__FILE__) . '/lang_en.inc.php';
}
$serendipity['smarty']->assign('CONST', get_defined_constants());
but you will modify it to this:
Code: Select all
# Check if the plogger gallery is called
if ($serendipity['GET']['subpage'] == 'photos') {
# Include plogger script. Put all output in $gallery.
include('gallery.php');
ob_start();
the_gallery_head();
the_gallery();
$myphotos = ob_get_contents();
ob_end_clean(;
$serendipity['smarty']->assign('mypage', $serendipity['GET']['subpage']);
$serendipity['smarty']->assign('myphotos', $myphotos);
}
$probelang = dirname(__FILE__) . '/lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
} else {
include dirname(__FILE__) . '/lang_en.inc.php';
}
$serendipity['smarty']->assign('CONST', get_defined_constants());
As you can see, I added a few lines at the top. Those check the URL parameters you passed on to the index.php file of serendipity, and if it detects the string 'photos' in that variable, it will include the plogger gallery and pipe all output into a variable that is then passed on to the index.tpl template file where it can be displayed.
Now have a try!
The same will apply to any other new pages you might want to invent. The cycle is always the same:
1. Think of a new link to use (index.php?serendipity[subpage]=XXX)
2. Implement the output into index.tpl
3. Implement the "input" into your config.inc.php
Best regards,
Garvin