Intigrating blog into a site

Skinning and designing Serendipity (CSS, HTML, Smarty)
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Intigrating blog into a site

Post by StarF »

Hi

i am trying to intigrate this blog into my site.
http://eskape.dk/

what i need, is someway to add my stuff to the index.php file. or someway to call the diffrent components from my default.php file. so i could move the calendar out just above the mos news section i got.
and move the rss feed under my menu, along whit the seach option. and put the blog code inside my default, so it could work whit my simple get file php code..

Code: Select all

<?php


$page = $_GET['page']; 
if (($page == "velkommen") or ($page =="")) { 
include('http://eskape.dk/serendipity/index.php'); 
} else if($page == "ruslandhistorie") { 
include('side_ruslandhistorie.php'); 
} else if($page == "b_behavior") { 
include('side_business_bahavior.php'); 
} else if($page == "sdu") { 
include('side_sdu.php');
} else if($page == "arkiv") { 
include('side_arkiv.php');
} else if($page == "links") { 
include('side_links.php'); 
} else if($page == "ommig") { 
include('side_ommig.php'); 
} else if($page == "omside") { 
include('side_omside.php'); 
} else if($page == "end") { 
include('end.html');
}
?>
is this possible? becaus looking at the site, and the foum, just makes me even more confused.. please enlighten me :)
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

alright got the wrapper working

http://www.eskape.dk/serendipity/wrapper.php

but how do i move the content around into other places?
like.. the calender out into the right side, and the rss feed/search,power by serendipity logo, out in the left side?

Code: Select all

<?php
$_REQUEST['page'] = 'blog';
// Let serendipity generate our content:
ob_start();
require 'index.php';
$blog_data = ob_get_contents();
ob_end_clean();

// Now we include our normal content building file.
// This one has to make use of your $blog_data variable to print
// the content where appropriate!
require 'default.php';
?>

/edit

hmm mabye it isent working, had forgot i had a link to the index.php file :(

the velkommen link in the left, links to a php file, with this code

Code: Select all

<?php
echo $blog_data;
?>
should this not load the blog ?
all i get is a empty page ?
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

alright
i got the blogger working in my site

http://eskape.dk/serendipity/default.php

now how to i move:
1: The Rss Feed, Archive, search, Blod admin link, and powered by out in the blue left bar ?

2: how do i move calender in ther right blue bar just above my news?

i tought there was a easy way, like just say

require 'calender.php';
require 'rss.php';

or something similar...
i am hoping some one will be able to give me a hand.. its driving me crazy now :P
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

The plugins are arranged by just going to your s9y Admin suite, go to "configure plugins" and move/delete the sidebar plugins, or re-arrange them. :)

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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

all i can see there is i can move them around. How do i place them a spefic place? all i can do here is move them around the middle wrapper?

like my page is made up of a left side, middle and right side php file. how do i move them spefic in one of the sides?
i thought where was some way to call them?
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

alright this is what i have done:

i got a wrapper that includes my content.php (wich before was my default.php, my whole site)
this content.php got 3 includes file
a header
a mid and a bottom

on the included mid i tryed to put this code, so it would load in the side

Code: Select all

serendipity_plugin_api::generate_plugins('left','div'); 
serendipity_plugin_api::generate_plugins('right','div'); 
but that dident load the modules, is this the right way? or am i missing something?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

What you want to be doing just cries for using the Smarty Template API. You should change your framework to utilize Smarty, as this would be the easiest way. Then you could use the generate_plugins() function easily.

The other way is, the call to generate_plugins() returns the HTML code of the sidebars; so you need to either echo that or store the return in a variable and mangle it later in your framework.

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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

garvinhicking wrote:What you want to be doing just cries for using the Smarty Template API. You should change your framework to utilize Smarty, as this would be the easiest way. Then you could use the generate_plugins() function easily.
sadly that isent a option atm.. but i recon the next time i will be doing it, i will go that way around it
garvinhicking wrote: The other way is, the call to generate_plugins() returns the HTML code of the sidebars; so you need to either echo that or store the return in a variable and mangle it later in your framework.
Sould u give me a coding example or link to something? aint that good in php.. asp was more my area

tnx for all your help tough
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Sure:

Code: Select all

$left = serendipity_plugin_api::generate_plugins('left','div');
$right =serendipity_plugin_api::generate_plugins('right','div');
echo $left;
echo $right;
:-)

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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

garvinhicking wrote:Sure:

Code: Select all

$left = serendipity_plugin_api::generate_plugins('left','div');
$right =serendipity_plugin_api::generate_plugins('right','div');
echo $left;
echo $right;
:-)

Regards,
Garvin
tnx works.. BUT it shows up both inside and where i put the pligin api

http://www.eskape.dk/

guess i have to manualy remove the plugin api from the index.php ?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Yes, you must put the "echo $left" and "echo $right" calls to the place in your framework where you want the output :)

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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

garvinhicking wrote:Yes, you must put the "echo $left" and "echo $right" calls to the place in your framework where you want the output :)

Regards,
Garvin
i done that, and it works :)

but if u look at the link http://www.eskape.dk/
you will see that the content also shows up on index.php so its shown 2 times on the page now. just ignore the errors i am just playing whit getting it to work proberly...

what file should i edit, in order to remove it from the index.php ? so it only shows up, out in the left bar?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

For that you must edit the index.tpl template of Serendipity and remove the output of the sidebars there! :)

(If no index.tpl is in the template directory, copy it from default/index.tpl!)

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/
StarF
Regular
Posts: 66
Joined: Thu Sep 29, 2005 4:53 pm
Location: Denmark
Contact:

Post by StarF »

garvinhicking wrote:For that you must edit the index.tpl template of Serendipity and remove the output of the sidebars there! :)

(If no index.tpl is in the template directory, copy it from default/index.tpl!)

Regards,
Garvin
isent the default the serendipity ?

this is what is says in the info file

Code: Select all

Name: Serendipity v2.3
Author: Tom Sommer
Date: 12/8-2004
Require Serendipity: 0.8
if so, i cant find any traces of

Code: Select all

$left = serendipity_plugin_api::generate_plugins('left','div'); 
$right =serendipity_plugin_api::generate_plugins('right','div'); 
echo $left; 
echo $right; 
in the index.tpl
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

In your index.tpl this code emits the Sidebar:

Code: Select all

{serendipity_printSidebar side="left"}
[...]
{serendipity_printSidebar side="right"}
(This is Smarty markup, and the Smarty functions call the serendipity_plugin_api::functions.)

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