The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Installation embed at root level

Having trouble installing serendipity?
deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Sat Nov 07, 2009 8:18 pm

Hi, I need to embed at the root level of a web site. After looking at all the documentation, seems they call from a directory above. Question is this wrapper.php, how can it call index.php when I need index.php to be the home page?
Thanks in advance!

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Sun Nov 08, 2009 12:14 am

What? :) Can you be more specific, maybe with actual URLs and what the goal and setup is? :)

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/

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Sun Nov 08, 2009 7:04 pm

Sorry to have not been clear. When viewing the embedding page tutorial it has:
<?php
chdir("<serendipity_dir>");
require("index.php");
chdir("<original_dir>");
?>
which is used to create a "wrappper.php"
My query is I only want the blog in the middle of the index page, where it says BLOG GOES HERE.
The page I am working with is http://www.leeofsted.com/index.php

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Nov 09, 2009 10:39 am

Hi!

The wrapper.php uses ob_start() to capture the "blog goes here" content. Then inside your index.php you only need to place that variable at the place where you want the blog outputs.

Bear in mind that embedding is an advanced mechanism where you should know some PHP to understand the concept. If that is too hard, we recommend not to use Embedding, but instead create a custom smarty template and place all your custom header/footer things into the index.tpl template file to create a consistent layout...

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/

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Mon Nov 09, 2009 8:16 pm

Thank you for the replies. I think I could handle the php but have been following other queries and found this onehttp://board.s9y.org/viewtopic.php?f=1&t=15923&p=91002&hilit=embedded+installs#p91002 which is clean. Seems like the best option all I need to do would be to alter the paths. Create the template folder, create: templates/ofsted/index.tbl, info.txt and styles.css then on index.php refer to these files. Am I seeing this correctly?
Thanks-Marc

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Nov 09, 2009 9:04 pm

Hi!

Yeah, exactly! :)

Just have a try, if you've got specific problems, come bakc here, we'll try to help!

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/

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Mon Nov 09, 2009 11:14 pm

Sorry I have just one more question before I go forward. Here is current head for index.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="#" />
<meta name="keywords" content="#" />
<meta name="author" content="#" />
<link rel="stylesheet" type="text/css" href="css/lee_main.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<title>Home of fictional pro golfer Lee Ofsted</title>
</head>
:D
I add this:
<meta name="Powered-By" content="Serendipity v.{$head_version}" />
<link rel="stylesheet" type="text/css" href=" :?: {template/ofsted/$head_link_stylesheet} DO I NEED TO LINK TO INDEX.TBL HERE ALSO :P " />
<link rel="alternate" type="application/rss+xml" title="{$blogTitle} RSS feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/index.rss2" />
<link rel="alternate" type="application/x.atom+xml" title="{$blogTitle} Atom feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/atom.xml" />
{if $entry_id}
<link rel="pingback" href="{$serendipityBaseURL}comment.php?type=pingback&amp;entry_id={$entry_id}" />
{/if}
{serendipity_hookPlugin hook="frontend_header"}
Cheers-Marc

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Nov 10, 2009 12:02 pm

Hi!

You copy the code from index.php to index.tpl, not the other way round, right?

That means, you only need to add what you have in your index.php to index.tpl - you leave the CSS etc. code in index.tpl intact that is already there.

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/

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Tue Nov 10, 2009 5:16 pm

Good Morning, I guess I am not being clear. Some how index.php needs to call index.tbl. Plus index php needs a php action.
I did as you said, created index.tbl out of index.php.
Thanks-Marc

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Nov 10, 2009 6:32 pm

Hi!

You actually would now no longer link to index.php when you want to display your blog, but to /serendipity/index.php (or /blog/index.php, or whatever you chose). This would then contain your layout. If you want to make serendipity appear in the root of your domain, you could simply install Serendipity into the root, so that it's index.php would be your starting point?

You could also automatically redirect people to /blog/index.php through your /index.php if you enter a code like

Code: Select all
<?php
header('Location: /blog/index.php');


Does that help? I'm not exactly sure I understand what you try to achieve :)

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/

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Tue Nov 10, 2009 7:06 pm

Thank you, this blog is at the root level, and needs to be on the index.php page. Where is on another level it would be no problems. I just need to call the blog into the lower portion of a static page.

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Nov 10, 2009 7:39 pm

Hi!

The idea of the posting you linked is to create a blog layout (instead of embedding) that goes into your index.tpl, that mimics your static layout. This is why you need to put your index.php layout into the index.tpl template file of serendipity. For that, you can include the CSS stylesheet that you also include in the index.php. Maybe go through again that link again, it's actually explained in depth there...?

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/

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Tue Nov 10, 2009 7:43 pm

I got it, almost. I just needed to subtract an extra /if, now just to work with the css.
Its located athttp://www.leeofsted.com/ Thanks for all your help.

deepspace
Regular
 
Posts: 17
Joined: Sat Nov 07, 2009 8:12 pm
Location: Upper NW Corner of Continetal US

Postby deepspace » Wed Nov 11, 2009 6:43 pm

Thanks again for the help. Looks as though I made a mountain out of a mole hill. I am wondering how it is I could run another php script now. Say I wanted to place a very simple php survey It seems as though since index.tbl is not a php file in itself <?php.... ?> would not work.
Cheers-Marc

User avatar
garvinhicking
Core Developer
 
Posts: 28944
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Thu Nov 12, 2009 12:18 pm

Hi!

deepspace wrote:Thanks again for the help. Looks as though I made a mountain out of a mole hill. I am wondering how it is I could run another php script now. Say I wanted to place a very simple php survey It seems as though since index.tbl is not a php file in itself <?php.... ?> would not work.
Cheers-Marc



Inside smarty, you can either use {include_php} or {php}...{/php} tags. You might need to create a config.inc.php file inside your template directory though with this:

Code: Select all
<?php
$serendipity['smarty']->security = false;


to allow using PHP tags.

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/

Next


Return to Installation

Who is online

Users browsing this forum: No registered users and 0 guests