Jump to content

Urgent


kenny117

Recommended Posts

Hi can anyone tell me whats wrong with this?

 

Parse error: syntax error, unexpected '<' in /customers/syeddrivertraining.co.uk/syeddrivertraining.co.uk/httpd.www/core/views/view.php(17) : eval()'d code on line 1

 

Parse error: syntax error, unexpected '<' in /customers/syeddrivertraining.co.uk/syeddrivertraining.co.uk/httpd.www/core/views/view.php(17) : eval()'d code on line 1

 

Parse error: syntax error, unexpected '<' in /customers/syeddrivertraining.co.uk/syeddrivertraining.co.uk/httpd.www/core/views/view.php(17) : eval()'d code on line 1

 

Parse error: syntax error, unexpected '<' in /customers/syeddrivertraining.co.uk/syeddrivertraining.co.uk/httpd.www/core/views/view.php(17) : eval()'d code on line 1

 

 

/*****************************************************************
           Universal CMS Frame ver 0.01
           Autor: Aaron Hanburg aka blinki bill 
*****************************************************************/
<?
class view{

//private $content = array();

private function __construct(){

}

public function build_block($module, $template){
global $config_data;
$block  = file_get_contents('templates/'.$config_data['template_folder'].'/'.$module.'/'.$template.'.html');
eval($block);
$block_content = ob_get_contents();
ob_end_clean();
ob_start();
return $block_content;
}

public function build_template($content,$template){
global $config_data;
$template  = file_get_contents('templates/'.$config_data['template_folder'].'/'.$template);
$arr1 = array();
$arr2 = array();
foreach($content as $k=>$v){
$arr1[] = '{'.$k.'}';
$arr2[] = $v;
}
$arr1[] = '{meta}';
$arr2[] = $this->meta;
$this->content['meta'].= $this->meta;
$template = str_replace($arr1,$arr2,$template);
eval($template);
}

public function add_style($stylefile){
$this->meta .= '
<link rel="stylesheet" type="text/css" href="/templates/'.$stylefile.'" />';
}
public function add_js($jsfile){
$this->meta .= '
<script type="text/javascript" src="/js/'.$jsfile.'"></script>';
}

public function add_canonical($link){
$this->meta .= '
<link rel="canonical" href="'.$link.'" />';
}

public function set_data($d){
foreach($d as $k=>$v){$this->$k = $v;}
}

public function add_button($action,$text,$controller,$element='',$onclick='',$style='',$class='sbutt'){
return '<a href="/admin/'.$controller.'/'.$action.'/'.($element?'id/'.$element:'').'" class="'.$class.'"'.($style?' style="'.$style.'"':'').($onclick?' onclick="'.$onclick.'"':'').'>'.$text.'</a>';
}

public function get_post(){
return controller::get_post();
}

public function get_template_dir(){
global $config_data;
return 'templates/'.$config_data['template_folder'].'/';
}

public function get_skin_dir(){
global $config_data;
return 'templates/'.$config_data['template_folder'].'/skin/';
}

public function get_header(){
global $config_data;
eval(file_get_contents('templates/'.$config_data['template_folder'].'/'.$config_data['template_settings'][$this->page['template']]['header']));
}

public function get_footer(){
global $config_data;
eval(file_get_contents('templates/'.$config_data['template_folder'].'/'.$config_data['template_settings'][$this->page['template']]['footer']));
}

}
?>

Link to comment
https://forums.phpfreaks.com/topic/213440-urgent/
Share on other sites

The error message is fairly self explanatory - there is an unexpected < on line 1 of the php code being passed through the eval() statement. What is line one of the file that is being processed?

 

Given that you appear to be passing it a .html template and not php code, you would need to put a closing php tag ?> to drop out of php mode. If your template does not contain any php code, there's no point in using eval() on it.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111206
Share on other sites

Thanks this is it.

 

 

/***************************************************************** Universal CMS Frame ver 0.01 Autor:  below are all the predefined variables *****************************************************************/ ?> 

blok['title'] && $this->blok['location']==2 && $this->blok['sort_order']==1):?> 

blok['title'])?>

blok['title']):?>

blok['title'])?>

blok['location']==1 || $this->blok['location']==4):?> blok['content'])?> blok['location']==2):?> 

blok['content'])?> 

blok['content'])?>

Link to comment
https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111211
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.