Firefox PHP

Dev Phorum

Posted by Brian Moon 
Dev Phorum
April 24, 2003 10:52PM
This is the new developers forum. If you have questions about the how code works, how to make a module, etc., this is the place for you.



Edited 1 time(s). Last edit at 05/22/2003 05:12PM by (n/a).
Re: Dev Phorum
May 08, 2003 12:41PM
Ok, version 5 running smooth on my sites. Now I am working on finding my way's through the tpl files. Basicly I had this question and hope someone can give me an example of how to do this.

The phorum runs with header and footers in the template directory. I run Nuked site ( I know not all like them but they make my live easier ;-)) ) and I wish to use the Nuke header and footer in the forum so it can appear in the site.

What changes do I need to make? Before it was just simply stating include header.php in the index file. I am not formiliar on how to work with the tpl files. Can I make the same statement in the index.php file saying to include the header or does it need more work?

Your help is apreciated.

Thnx
Re: Dev Phorum
May 08, 2003 01:10PM
I use it the other way around. (No Nuke thou) I have also a default header for my other pages. I added my default header to header.tpl and that was all I had to do. Well actually I modified and stripped unnecessary css rules from my css and put those into the header.tpl also.

I'm sorry if there's something special with nuke-header-files, in which case this doesn't help you much :)

Panu
Re: Dev Phorum
May 08, 2003 03:17PM
Yes, you can have PHP in the .tpl files.
Re: Dev Phorum
May 08, 2003 04:36PM
ok, so that basicly means I need to adapt the tpl files. So cut and paste the Nuke header and footer in the tpl file.

I will experimente with it.

Thnx
Re: Dev Phorum
May 08, 2003 09:12PM
Panu, could you send me a copy of your header.tpl file so I can see how you did it. I merged a php command in the header file in the beginning to get the standard Nuke header but nothing happens.

Thnx in advance
Re: Dev Phorum
May 08, 2003 10:08PM
Sorry, I don't have any PHP in it, just pure html and css rules. Can you post relevant part of the header so we can have a look what might be the problem.

I am not familiar with Nuke at all so what does the nuke header normally do?

Panu

Re: Dev Phorum
May 08, 2003 11:26PM
Here is the coding of the header file, this is the header in the root, with Nuke you can create themes which are in a different directory. But including this header, it will include the theme header.

**************************************************
<?php

/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* [phpnuke.org] */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (eregi("header.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

require_once("mainfile.php");

##################################################
# Include some common header for HTML generation #
##################################################

$header = 1;

function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
$ThemeSel = get_theme();
include("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<title>$sitename $pagetitle</title>\n";

include("includes/meta.php");
include("includes/javascript.php");

if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
}

echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
include("includes/my_header.php");
echo "\n\n\n</head>\n\n";
themeheader();
}

online();
head();
include("includes/counter.php");
global $home;
if ($home == 1) {
message_box();
blocks(Center);
}

?>
***************************************************

That is it, let me know if you grasp it, because I am not at the moment when it comes to integrating these two.

Re: Dev Phorum
May 09, 2003 12:16AM
it won't work this way.
there are relative paths in the file which will be simply wrong if you include this in the phorum-header, you are at another place then.
Re: Dev Phorum
May 09, 2003 01:01AM
I agree, it wont fit.

You can try couple of things.

You may take the actual source produced by nuke script and fit phorum inside it. (keep navigation etc.)

Or you can make an iframe and fit phorum inside it.

or third way is to make a Nuke module for P5 :)

The two first one will limit Nuke functionality a little and iframe isn't supported on nn4.

I used to have P3 with as much functionality as my "normal" pages had, but in the end when users use phorum they don't care about news of statistics (which I had in the page also) So now I just have the main navigation bar.

btw. is the theme user selectable? if it is you have to put some Nuke code in the header. (or you can adapt the thee into a P5 theme for the user to select)

Sorry to be so little help,

Panu
Re: Dev Phorum
May 09, 2003 05:26AM
Yeah, I hate that about all those CMS apps. They are all so arrogant in the way they include files.
Re: Dev Phorum
May 09, 2003 11:21AM
Yes themes are user selectable if you wish to allow them. I prefer myself to have a Nuke module. I think it will be easier to create, so I will check things out and read the doc files again on the hooks and so forth.

Thnx!!
Re: Dev Phorum
May 12, 2003 09:47PM
Np, I am working on a complete mod.

Tlk to yu laterz!
Sorry, only registered users may post in this forum.

Click here to login