Anh em cho hỏi về lỗi T_STRING

Thảo luận trong 'Add-on Quesions' bắt đầu bởi bumbum12, 20/9/13.

1votes
5/5, 1 vote

  1. bumbum12

    bumbum12 Member

    Bài viết:
    305
    Likes :
    91
    Mình cài addon Table, sử dụng bình thường. Hôm vừa rồi chuyển qua server khác. Khi xem bài viết thì bị lỗi :
    Parse error: syntax error, unexpected T_STRING in

    /public_html/xxx/library/Nabeel/Table/BBCode/Formatter/Base.php on line 1

    Anh em chỉ mình cách khắc phục với.

    Nội dung Base.php
    Mã:
    <?php
    
    class Nabeel_Table_BBCode_Formatter_Base extends XFCP_Nabeel_Table_BBCode_Formatter_Base
    {
        private $_colCount;
        private $_rowCount;
      
        public function getTags()
        {
            $this->_tags = parent::getTags();
            $this->_tags['table'] = array(
                    'parseCallback' => array($this, 'parseValidatePlainIfNoOption'),
                    'callback' => array($this, 'renderTagTable')
                );
            return $this->_tags;
        }
      
        public function renderTagTable(array $tag, array $rendererStates)
        {      
            //$content = $tag['children'][0];
            $content=$this->stringifyTree($tag['children']);
            $headerOption = $tag['option'];
            $rowCount=0;
            $colCount=0;
            $tableContent='';
            $tableIndex= uniqid('DataTable_');
          
    
            // remove unnecessary linebreaks
            $content = preg_replace('/^\n+|^[\t\s]*\n+/m','',$content);
          
            // remove empty line at the end of the table
            $content = preg_replace('#\n$#', '', $content);
          
          
            $parser = new XenForo_BbCode_Parser($this);
            $content=$parser->render($content);
              
            // get data rows
    
            $tableData = explode("\n",$content);
            $rowCount = count($tableData);
          
            $this->_rowCount = $rowCount;
          
            $cellSeperator = '|';
          
            // split rows into columns
            for($i=0;$i<$rowCount;$i++){
                $tableData[$i] = explode($cellSeperator, $tableData[$i]);
            }
          
            $colCount= count($tableData[0]);
            $this->_colCount= $colCount;
          
          
            // generate a table
    
            $tableStart='<table cellpadding="0" cellspacing="0" border="0" class="display" id="'.$tableIndex.'">';
            $tableEnd='</table>';
    
          
            $tableHeaderStart='<thead><tr>';
            $tableHeaderEnd='</tr></thead>';      
            $tableHeader = $tableHeaderStart;
            $istart=0; // marks the start of the actual table data
            if($headerOption=="head")
            {
                $istart=1;
                for($icol=0; $icol<$colCount; $icol++)
                {
                    $tableHeader.='<th>'.$tableData[0][$icol].'</th>';
                }
            }
            else
            {
                for($icol=0; $icol<$colCount; $icol++)
                {
                    $tableHeader.='<th>Column'.($icol+1).'</th>';
                }
                $tableHeader.=$tableHeaderEnd;
            }
              
            $tableBodyStart='<tbody>';
            $tableBodyEnd='</tbody>';
          
            $tableContent=$tableStart.$tableHeader.$tableBodyStart;
          
            $rowStart='<tr>';
            $rowEnd='</tr>';
            $cellStart='<td>';
            $cellEnd='</td>';
            for($irow=$istart; $irow<$rowCount; $irow++)
            {
                $rowContent=$rowStart;
                for($icol=0; $icol<$colCount; $icol++)
                {
                    $rowContent.=$cellStart.$tableData[$irow][$icol].$cellEnd;
                }
                $rowContent.=$rowEnd;
                $tableContent.=$rowContent;
            }
          
            $tableContent.=$tableBodyEnd.$tableEnd;
          
            if ($this->_view)
            {
                $template = $this->_view->createTemplateObject('bb_code_table_dataTable', array(
                    'content' => $tableContent,
                    'tableid' =>$tableIndex,
                ));
                return $template->render();
            }
            else
            {
                return '<div>' . $tableContent . '</div>';
            }
        }  
    }
    
    ?>

    Và trang up ảnh thì bị lỗi :
    Mã:
    Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit in 
    Link : http://**[LINK FORBIDDEN]**/upanh/
     
    Đang tải...
comments powered by Disqus

Chia sẻ trang này

Đang tải...