kenny117 Posted September 15, 2010 Share Posted September 15, 2010 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 More sharing options...
PFMaBiSmAd Posted September 15, 2010 Share Posted September 15, 2010 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 More sharing options...
kenny117 Posted September 15, 2010 Author Share Posted September 15, 2010 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 More sharing options...
PFMaBiSmAd Posted September 15, 2010 Share Posted September 15, 2010 A) I don't think that is the template in question. B) I tried searching for the author's web site based on the bits of information in the comments in that code, but did not find anything. Could you post a link to that script's web site? Link to comment https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111221 Share on other sites More sharing options...
kenny117 Posted September 15, 2010 Author Share Posted September 15, 2010 http://www.syeddrivertraining.co.uk Link to comment https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111222 Share on other sites More sharing options...
kenny117 Posted September 15, 2010 Author Share Posted September 15, 2010 any ideas? Link to comment https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111223 Share on other sites More sharing options...
PFMaBiSmAd Posted September 15, 2010 Share Posted September 15, 2010 any ideas? Yes, that's a link to your web site, not the author's site of the script you are using. Link to comment https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111231 Share on other sites More sharing options...
kenny117 Posted September 16, 2010 Author Share Posted September 16, 2010 http://www.ideastoempires.com.au Link to comment https://forums.phpfreaks.com/topic/213440-urgent/#findComment-1111518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.