Simple PHP Blog Integration
kilbad2
Joined: 2005-07-14
Posts: 3 |
Posted: Thu, 2005-07-14 07:00 |
I am currently using Simple PHP Blog (http://www.simplephpblog.com) for a site that I am running and I want to embed/integrate gallery 2 into it. The makers of this script provide a template file to include html and php code within the blog wrapper (I have included the template code below). MY QUESTION: Is there some way to include the pieces of the blog template code in the global.tpl file in the gallery templates/local directory? My current website structure is such that the gallery2 and simplephpblog have their own directories. WHAT I TRIED: Initially, I tried to created symbolic links in the gallery directory to connect over to the blog directory so I could keep the ‘require’ references in the blog template the same (for the script and language directories) as I attempted to insert it into the global.tpl file. I also inserted all the sections of php code from the blog template file between {php}{/php} tags. However, all of this did not result in success. Can someone help me through this, I feel like it should not be that hard? The Simple PHP Blog Template (also here): <?php require('scripts/sb_functions.php'); global $logged_in; $logged_in = logged_in( false, true ); read_config(); require('languages/' . $blog_config[ 'blog_language' ] . '/strings.php'); sb_language( 'index' ); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo( $lang_string['html_charset'] ); ?>" /> <link rel="stylesheet" type="text/css" href="themes/<?php echo( $blog_theme ); ?>/style.css" /> <?php require('themes/' . $blog_theme . '/user_style.php'); ?> <script type="text/javascript" language="javascript" src="scripts/sb_javascript.js" /> <title><?php echo($blog_config[ 'blog_title' ]); ?></title> </head> <?php function page_content() { $entry_array = array(); $entry_array['subject'] = "Subject Line"; $entry_array['entry'] = "Body Content i.e. GALLERY 2"; echo( theme_staticentry( $entry_array ) ); ?> <?php } theme_pagelayout(); ?> </html> |
|
Posts: 32509
any customizations you do with your current g2 version are lost when upgrading to the current version or to beta 4.
the layout / theme system was changed.
so please first get the latest nightly snapshot:
http://codex.gallery2.org/index.php/Gallery2:faq#How_to_upgrade_Gallery2.3F
and then customize it in themes/matrix/templates/local/*.tpl
- yes, you can include your own html in the template files.
- yes you can add your own php in the template files in {php}print "hello world"; {/php} tags
. i don't see the g2 integration code, can't tell you if you're doing anything wrong.
Posts: 3
First, let me thank you for your prompt response. I am so impressed with Gallery and your great technical support.
Since your reply, I downloaded the snapshot and upgraded with no problem. Then I made symbolic links in the gallery 2 directory to all the simplephpblog directories. After that, I attempted to integrate the simplephpblog template into the gallery 2 themes .tpl file. The result is that when I access the gallery 2 (main.php) I get a page that displays the blog wrapper, which I was pleased to see, but an error where the gallery 2 should be embedded. Below I have included the error and the code of my .tpl file. Can you help me fix this?
Thanks again!
The error:
Fatal error: Call to a member function on a non-object in /web/kilbad.com/wa2000/gallery2/g2data/smarty/templates_c/%%3617484692/%%3A^3A8^3A818B59%%theme.tpl.php on line 49
My themes .tpl file (for matrix):
Also, incase you visit my website, I have restored the default .tpl file until I resolve this. Therefore, the result of this modified .tpl file is not avalible on my server (if you yould like it to be, please indicate that in your reponse).
Posts: 31
Was there any update on this? I am looking to do something similar.