Welcome, Guest. Please Login or Register.
September 29, 2024, 09:40:31 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Graphics and Templates  |  Template Troubles « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Template Troubles  (Read 2228 times)
adams
Jr. Member
**
Posts: 80


http://outersurf.com http://jadz.com

WWW
Template Troubles
« on: March 26, 2003, 06:29:25 AM »
Reply with quote

I'm using the template to make yabb into somewhat of a portal.  http://www.outersurf.com

My main site uses a top and bottom template, so with yabbse's template I just call the following.

my yabb template
<?php
include("/w3/usr/funkdoghtml/template/top.php");
?>


<table border=0 width=100%><tr><td><yabb uname><yabb im></td><td align=right><yabb time></td></tr>
<tr><td colspan=2 align=center><yabb menu></td></tr></table>


           <table cellspacing="0" cellpadding="5" width="100%" align="center" bgcolor="#ffffff" border="0">
             <tr>
               <td valign="top" width="100%">
                 <yabb main>
               </td>
             </tr>
           </table>


<table cellspacing="0" cellpadding="0" width="90%" align="center" border="0">
 <tr>
   <td nowrap="nowrap" align="right"><yabb vbstylelogin></td>
 </tr>
</table>
<br />
<center><yabb copyright></center>
<?php
include("/w3/usr/funkdog/html/template/bottom.php");
?>


My problem occurs when I call a function in top.php (which is being included in my yabbse template.

What will happen is that yabbse will not output anything before the function call.

top.php example this file is included in my yabbse template
<?php
include_once ("/w3/usr/funkdog/html/forum/Sources/JoeFunc.php");

print <<<EOT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
EOT;

if (
$username=="Guest" AND $mainpage){
print <<<EOT
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  function outersurf_loginpage_onload() {
    document.forms[0].elements[0].focus();
  }
</script>
EOT;
}

?>


<body marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0"
       topmargin="0" bgcolor="#FFFFFF" text="#000000" link="#336699"
       <?php   // jump to the login INPUT only if user is guest and we are on the frontpage
                
if($username=="Guest" AND $mainpage) {
                echo 
" onLoad=\"outersurf_loginpage_onload();\" ";
                }
        
?>

       vlink="#336699" alink="#336699">

<?php

function_from_JoeFunc
();

?>



yabbse will output the result from function_from_JoeFunc(); and nothing from before... like the <body> tag etc.


Any ideas why this is happening? Perhaps I dont' understand how the template is used in YaBBSE?

An example that I would want to have for this is show a recent POLL in the left nav column.
« Last Edit: March 26, 2003, 06:41:15 AM by adams » Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Template Troubles
« Reply #1 on: March 26, 2003, 07:26:53 AM »
Reply with quote

Does the JoeFnc function do anything with output buffering?

-[Unknown]
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Template Troubles
« Reply #2 on: March 26, 2003, 07:27:57 AM »
Reply with quote

I also recommend upgrading to 1.5.1....

-[Unknown]
Logged
adams
Jr. Member
**
Posts: 80


http://outersurf.com http://jadz.com

WWW
Re:Template Troubles
« Reply #3 on: March 26, 2003, 05:51:15 PM »
Reply with quote

Here are the functions I call

function navboxtop( $title = "" , $align = "center" ){

       print <<<EOT
       <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" BGCOLOR="#000000" WIDTH="97%"><TR><TD>
       <TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
EOT;

       if ($title!="")
       print <<<EOT
       <TR><TD ALIGN="$align" BGCOLOR="#EEEEEE"><B>
       <FONT FACE="Verdana,Helvetica,Arial" COLOR="#000000">$title</FONT></B></TD></TR>
EOT;
}


function display_topic_group($disp_group)
{
       global $db_prefix, $scripturl;
       if ($group="")
        exit;
       ob_end_clean();
       $request = "SELECT t.*,o.*,m.*
                       FROM {$db_prefix}topics as t,os_topic_groups as o, {$db_prefix}messages as m
                       WHERE (o.group='$disp_group' && o.ID_TOPIC=t.ID_TOPIC && t.ID_FIRST_MSG=m.ID_MSG)";
       //echo $request;
       $request = mysql_query($request);
while ($row = mysql_fetch_array($request))
               {
               echo '
                   <a href="' . $scripturl . '?board=' . $row['ID_BOARD'] . ';action=display;threadid=' . $row['ID_TOPIC'] , ';start=0">' . $row['subject'] . '
</a><br>';
               }

}


//
// Prints the bottom of a layout box should be called after a </td></tr>
//

function navboxbottom(){
       print <<<EOT
       </TABLE></TD></TR></TABLE><BR>
EOT;
}
Logged

adams
Jr. Member
**
Posts: 80


http://outersurf.com http://jadz.com

WWW
Re:Template Troubles
« Reply #4 on: March 26, 2003, 05:53:31 PM »
Reply with quote

heh... now that I look at my functions


ob_end_clean();


is looking at me strait in the face.
Logged

Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Graphics and Templates  |  Template Troubles « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.032 seconds with 21 queries.