SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    May 2003
    Location
    Berlin, Germany
    Posts
    1,829
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Heredoc Syntax issue ?!

    Code:
    b>Parse error</b>:  parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in <b>PHPDocument1</b> on line <b>195</b><br />
    PHP Code:
    <?php

    class common
    {

        function 
    header$page_header )
        {
    global 
    $INFO;

    return <<<HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>
    {$page_header}</title>
    <meta http-equiv="Content-Type" content="text/html charset=iso-8859-1" />
    <link rel="shortcut icon" href="/favicon.ico" />

     <!-- Style Sheet -->
    <link rel="stylesheet" type="text/css" href="skins/
    {$INFO['current_skin']}/style.css" />

    <script src="skins/x.js" type="text/javascript"></script>
                    
    <script language="javascript" type="text/javascript">       
    function adjustLayout()  
    {  
    // Get natural heights  
    var cHeight = xHeight("contentcontent");  
    var lHeight = xHeight("lsidecontent");  
    var rHeight = xHeight("rsidecontent");  
                     
    // Find the maximum height  
    var maxHeight =  Math.max(cHeight, Math.max(lHeight, rHeight));  
                     
    // Assign maximum height to all columns  
    xHeight("content", maxHeight);  
    xHeight("lside", maxHeight);  
    xHeight("rside", maxHeight);  
                     
    // Show the footer  
    xShow("footer");  
    }
                                    
    window.onload = function()  
    {  
    xAddEventListener(window, "resize", adjustLayout, false);  
    adjustLayout();  
    }  
    </script>
                    
    </head>
    <body>
    <div id="banner">
    <div id="header_left"><img src="skins/
    {$INFO['current_skin']}/graphics/header_left.jpg" alt="{$INFO['site_name']}" /></div>
    <div id="header_right"><img src="skins/
    {$INFO['current_skin']}/graphics/header_right.jpg" alt="{$INFO['site_name']}" /></div>
    </div><div id="layouthelpl"> <div id="layouthelpr">
    <div id="container">
    <div id="navbarfooterlt"></div><div id="navbarfooterrt"></div>
    HTML;
        }


            function 
    footer()
            {
            global 
    $INFO;

    return <<<HTML
    <div id="navbarfooterlb"></div><div id="navbarfooterrb"></div>
    </div></div></div>
    <div id="footer"><div id="footer_left"><img src="skins/
    {$INFO['current_skin']}/graphics/footer_left.jpg" alt="{$INFO['site_name']}" /></div>
    <div id="footer_right"><img src="skins/
    {$INFO['current_skin']}/graphics/footer_right.jpg" alt="{$INFO['site_name']}" /></div>
    <div id="copyinfo">Copyright &copy; 2000-2003 Wildfire Games | All Rights Reserved</div>
    </div>
    </body>
    </html>
    HTML;
        }

                function 
    left_nav$cats = array(), $items = array() )
                    {
                                    global 
    $INFO;
                                     
    $text = <<<HTML
    <div id="lside"><div id="lsidecontent">
    HTML;
                         
                               foreach( 
    $cats as $key => $value )
                               {
    $text .= <<<HTML
    <h3>{$value}</h3><ul>
    HTML;
                                             foreach( 
    $items as $category_key => $value_two )
                                             {
                                                                         
    $text .= <<<HTML
    <li><a href="{$INFO['site_url']} {$items[$key][$category_key][1]}">{$items[$key][$category_key][0]}</a></li>
    HTML;
                                                }
    $text .= <<<HTML
    </ul>
    HTML;    
                              }
    return 
    $text.'</div></div>';
                }
                
            
                function right_nav( 
    $array = array() )
                    {
                             global 
    $user;
                              
    $text = <<<HTML
    <div id="rside"><div id="rsidecontent"><p>Welcome back <b>
    {$user->vars['uname']}</b></p>
    HTML;
                    
                            foreach( 
    $array as $key => $value )
                            {
    $text .= <<<HTML
    <h3>{$key}</h3>
    HTML;
                    
                                        foreach( 
    $value as $key_two => $value_two )
                                        {
    $text .= <<<HTML
    <li>{$value_two}</li>
    HTML;
                                        }
                            }
    return 
    $text.'</div></div>';
                }
            
            
            function 
    end_div$i )
            {
                            for( 
    $k 1$k $i$k++)
                            {
    $text .= <<<HTML
    </div>
    HTML;
                            }
     return 
    $text;
        }
        


        function 
    sitenav$id$array = array() )
        {
    $text = <<<HTML
    <div class="sitenavigation" id="top">
    HTML;
            foreach( 
    $array as $key => $value )
            {
    $text .= <<<HTML
    <li>{$value}</li>
    HTML;
            }
    return 
    $text.'</div>';
        }


        function 
    pagenav$array = array() )
        {
    $text = <<<HTML
    <div class="pagenavigation">
    HTML;

            foreach( 
    $array as $key => $value )
            {
    $text .= <<<HTML
    <li>{$value}</li>
    HTML;
            }
    return 
    $text.'</div>';
        }


        function 
    start_contentbox()
        {
    return <<<HTML
    <div id="content"><div id="contentcontent">
    HTML;
        }


        function 
    contenttext$page_heading$content )
        {
    return <<<HTML
    <div id="contentcont">
    <h2>
    {$page_heading}</h2>
    <div class="contentbar"></div>
    {$content}</div>
    HTML;
        }

    // end class

    ?>
    Anyone ?
    Last edited by DarkAngelBGE; Oct 12, 2003 at 00:36.

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where's line 195?
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •