Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/08/2016, 08:52
Rebuilding
 
Fecha de Ingreso: julio-2014
Mensajes: 161
Antigüedad: 9 años, 9 meses
Puntos: 4
trabaja bien en php 5.4.7 pero no en php 7

Bueno en mi localhost tengo instalado PHP 5.4.7 y funciona bien el siguiente script, pero en mi Virtual Private Server con php 7.0.9 no funciona me dice Internal Server Error, a que se debe?



Código PHP:
Ver original
  1. define('IN_MYBB', 1);
  2. require_once './global.php';
  3. class blog{
  4.     function mostrar(){
  5.         global $mybb,$db, $templates, $parser, $forum;
  6.         //Esto lo agarre del foro, para que me agarre los saltos de linea automaticamente.
  7.         $parser_options['allow_html'] = $forum['allowhtml'];
  8.         $parser_options['allow_mycode'] = $forum['allowmycode'];
  9.         $parser_options['allow_smilies'] = $forum['allowsmilies'];
  10.         $parser_options['allow_imgcode'] = $forum['allowimgcode'];
  11.         $parser_options['allow_videocode'] = $forum['allowvideocode'];
  12.         $parser_options['me_username'] = $post['username'];
  13.         $parser_options['filter_badwords'] = 1;
  14.         $sql="SELECT pid, tid, subject, message FROM mybb_posts WHERE fid = '14' ORDER BY pid ASC";
  15.         $resultado = $db->query($sql);
  16.         $g=1;
  17.         while ($res=$db->fetch_array($resultado)){
  18.             $query = $db->simple_select("attachments", "*", "pid=".$res['pid']);
  19.             $adjunto=$db->fetch_field($query, 'attachname');
  20.             $nombre_archivo=$mybb->settings['uploadspath']."/".$adjunto;
  21.             $texto=substr($res['message'],0,350);
  22.             $texto=$parser->parse_message($texto, $parser_options);
  23.             $texto.="...";
  24.             eval('$blog_ciclo.= "'.$templates->get('EC_BLOG_CICLO').'";');
  25.         }
  26.         $cabecera=$this->cabecera();
  27.         eval('$html= "'.$templates->get('EC_BLOG_COMPLETO').'";');
  28.  
  29.         return $html;
  30.     }
  31.     function cabecera(){
  32.         global $mybb, $templates;
  33.         $usuario=$mybb->user['username'];
  34.         if($mybb->user['uid']==0){
  35.     //  $captcha=$this->mostrarcaptcha();
  36. //          eval('$registrofacil= "'.$templates->get('EC_registrofacil').'";');
  37.             eval('$manejousuario= "'.$templates->get('EC_sinlogear').'";');
  38.         }else{
  39.             $logout=md5($mybb->user['loginkey']);
  40.             eval('$manejousuario= "'.$templates->get('EC_logeado').'";');
  41.         }
  42.         eval('$header = "'.$templates->get('header').'";');
  43.         return $header;
  44.     }
  45. }
  46. $blog=new blog;
  47. $datos=$blog->mostrar();
  48. //output_page($datos,1);
  49. print($datos);