Página 1 de 1

Problema con Viewtopic.php

Publicado: 04 Jun 2011, 22:25
por itachija
Buenas. Sigo teniendo problemas en mi foro ( Realmente muchos) pero quiero corregir uno por uno por eso en este tema expongo el siguiente error:
Este error aparece gracias al modo DEBUG del phpbb3

Código: Seleccionar todo

[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1619: Undefined variable: posts_per_day
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1723: Undefined variable: level_posts_for_this
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4558: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4560: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4561: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4562: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3691)
Este error no produce ningun desjuste en el foro solo que sale arriba del foro por el modo debug y al ser un error quiero correjirlo lo antes posible para no tener errores amontonados, Este error aparecio justo despues de instalar el mod Level Bar 0.0.1b
El cual da la posibilidad de poner el NIVEL y EXP faltante para subir de nivel en el perfil de los usuarios al momento de hacer un post.... de seguro el error tiene ese origen pero no se lo que pueda ser... gracias de antemano
Adjuntare ambos archivos por si les sirve de algo

Re: Problema con Viewtopic.php

Publicado: 04 Jun 2011, 22:49
por angelismo
Prueba este viewtopic.php ,he corregido un cambio del mod mal hecho.
Del functions.php ,no puede ser el error ,porque el mod no toca dicho archivo.

Re: Problema con Viewtopic.php

Publicado: 04 Jun 2011, 23:05
por itachija
Razon si tienes. el error tiene que estar en el viewtopic.php..... he colocado el viewtopic que has adjuntado ahora lanza otro error ..

Código: Seleccionar todo

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/a8464488/public_html/foro/viewtopic.php on line 1138
Como lo podes ver en este tema http://kyup.co.cc/foro/viewtopic.php?f=2&t=2 y cual quier otro tema del foro... parece que algo que has modificado no ha quedado bien quisas han quedado dos < o > voy a revisar no se mucho de programacion pero voy a ver si puedo hacer algo.....

Re: Problema con Viewtopic.php

Publicado: 04 Jun 2011, 23:07
por itachija
Pues he revisado en la linea 1138 y lo que esta es el siguiente codigo

Código: Seleccionar todo

// Level Bar 0.0.1 [ http://www.TeskilatForum.neT ] - Start
                'user_regdate'      => $row['user_regdate'],
	// Level Bar 0.0.1 [ http://www.TeskilatForum.neT ] - End
asi que no se de que arrow esta hablando que dice que tiene doble arrow

Re: Problema con Viewtopic.php

Publicado: 04 Jun 2011, 23:30
por angelismo
Fallo mio ,vuelve al archivo original ,pues todos los cambios del mod estan correctamente hechos ,por lo que error parace ser un bug del propio mod.

Re: Problema con Viewtopic.php

Publicado: 04 Jun 2011, 23:43
por itachija
Significa que el error es del propio codificador del mod, bueno digamos que el error no molesta a nadie si desactivo el modo debug y de momento no he tenido fallos referente a ese mod asi que esperaremos a ver si alguien tiene alguna respuesta viable para corregir ese error de momento hare otro tema para poder solucionar los demas errores del foro...

Re: Problema con Viewtopic.php

Publicado: 05 Jun 2011, 05:03
por leviatan21
itachija escribió:Significa que el error es del propio codificador del mod, bueno digamos que el error no molesta a nadie si desactivo el modo debug y de momento no he tenido fallos referente a ese mod asi que esperaremos a ver si alguien tiene alguna respuesta viable para corregir ese error de momento hare otro tema para poder solucionar los demas errores del foro...
Así es, es un error del MOD, y creo que puedo ayudar a resolverlos, sigue estas instrucciones :

Abrir :

Código: Seleccionar todo

raíz/viewtopic.php
Buscar : (resuelve el error en la linea 1619)

Código: Seleccionar todo

         if($posts_per_day >= $level_avg_ppd)
Reemplazar, por :

Código: Seleccionar todo

         if($level_user_ppd >= $level_avg_ppd)
Buscar : (resuelve el error en la linea 1723)

Código: Seleccionar todo

      $level_exp = $user_cache[$poster_id]['posts'] . ' / ' . $level_posts_for_next;
Reemplazar, por :

Código: Seleccionar todo

      $level_posts_for_this = $user_cache[$poster_id]['posts'] . ' / ' . $level_posts_for_next;

Re: Problema con Viewtopic.php

Publicado: 22 Nov 2012, 04:47
por Morph
Hola:

Lo instale en phpbb 3.11 y a parte de tus arreglos daba otro error en el viewtopic.php

Código: Seleccionar todo

'POSTER_EXP' => $level_exp,
Busque y encontré esta solución y es definitiva. En lugar de tus cambios si da error también esa linea. Cuando pide el cambio grande, en lugar del que trae el mod poner este:

Código: Seleccionar todo

    // Level Bar 0.0.1 [ www.TeskilatForum.neT ] - Start
       //

       /* Determine Level
       *
       * A users level is determined by their total number of posts.
       * We use a nice mathmatical formula to translate a post count
       * into a level.
       * Note, a user with zero posts is level 0
       *
       */
       
       if($user_cache[$poster_id]['posts'] < 1)
       {
             $level_level = 0;
       }
       else
       {
             $level_level = floor( pow( log10( $user_cache[$poster_id]['posts'] ), 3 ) ) + 1;
       }

       /* Determine HP
       *
       * HP is based on user activity.
       * Max HP is based on the users level, and will be the same for
       * all users of the same level.
       *
       * Current HP is based on the users posts per day.
       * The higher the users posts per day (ppd), the more hp
       * they will have. A user with average ppd (as set below)
       * will have 50% of their hp. As a user goes over the average
       * ppd, they will have more hp, but the gains will lessen
       * as the users ppd goes up. This makes it difficult, but not
       * impossible to have 100% hp.
       *
       * For users with under the average ppd, they will have
       * hp equal to 1/2 the percentage their ppd is of average.
       * ie- a user with 2.5 ppd, and an average ppd of 5
       * will have 25% hp.
       *
       * Users who miraculously manage to get higher than 100%
       * of their max health. (by posting far more than average)
       * will get a bonus to their max hp.
       *
       * Note that a user with a level of zero, has 0 / 0 hp.
       *
       */

       /*
       * This value determines what the 'average' posts per day is
       * Users above this value will have more hp, and users below
       * will have less. A user with exactly this posts per day
       * will have 50% of his max hp.
       *
       * This variable should NOT be zero.
       * You may set this to a decimal amount (eg 5.1, 2.35)
       */
          $level_avg_ppd = 5;

       /*
       * this value sets how hard it is to achieve 100%
       * hp. The higher you set it, the harder it is to
       * get full hp.
       *
       * to judge how high to set it, a user must have
       * posts per day equal to the $level_avg_ppd plus
       * the number set below.
       *
       * This should NOT be zero.
       */
          $level_bonus_redux = 5;

       /*
       * We need to calculate the user's
       * posts per day because it's not done for us,
       * unlike in profile.php
       */
         $level_user_ppd = ($user_cache[$poster_id]['posts'] / max(1, round( ( time() - $user_cache[$poster_id]['user_regdate'] ) / 86400 )));

       if($level_level < 1)
       {
             $level_hp = '0 / 0';
             $level_hp_percent = 0;
       }
       else
       {
             $level_max_hp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (1.5) );
       
             {
                   $level_hp_percent = floor( (.5 + (($level_user_ppd - $level_avg_ppd) / ($level_bonus_redux * 2)) ) * 100);
             }
       
             if($level_hp_percent > 100)
             {
                   //Give the User bonus max HP if they have more than 100% hp
                   $level_max_hp += floor( ($level_hp_percent - 100) * pi() );
                   $level_hp_percent = 100;
             }
             else
             {
                   $level_hp_percent = max(0, $level_hp_percent);
             }
       
             $level_cur_hp = floor($level_max_hp * ($level_hp_percent / 100) );
       
             //Be sure that a user has no more than max
             //and no less than zero hp.
             $level_cur_hp = max(0, $level_cur_hp);
             $level_cur_hp = min($level_max_hp, $level_cur_hp);
       
             $level_hp = $level_cur_hp . ' / ' . $level_max_hp;
       }


       /* Determine MP
       *
       * MP is calculated by how long the user has been around
       * and how often they post.
       *
       * Max MP is based on level, and increases with level
       * Each post a user makes costs them mp,
       * and a user regenerates mp proportional to how
       * many days they have been registered
       *
       */

       //Number of days the user has been at the forums.
       $level_user_days = max(1, round( ( time() - $user_cache[$poster_id]['user_regdate'] ) / 86400 ));

       //The mp cost for one post.
       //Raising this value will generally decrease the current
       // mp for most posters.
       //This may be set to a decimal value (eg, 2, 2.1, 3.141596)
       //This should NOT be set to 0
       $level_post_mp_cost = 1;

       //This determines how much mp a user regenerates per day
       //Raising this value will generally increase the current
       // mp for most posters.
       //This may be set to a decimal value (eg, 3, 3.5, 2.71828)
       //This should NOT be set to 0
       $level_mp_regen_per_day = 4;

       if($level_level < 1)
       {
             $level_mp = '0 / 0';
             $level_mp_percent = 100;
       }
       else
       {
             $level_max_mp = floor( (pow( $level_level, (1/4) ) ) * (pow( 10, pow( $level_level+2, (1/3) ) ) ) / (pi()) );
       
             $level_mp_cost = $user_cache[$poster_id]['posts'] * $level_post_mp_cost;
       
             $level_mp_regen = max(1, $level_user_days * $level_mp_regen_per_day);
       
             $level_cur_mp = floor($level_max_mp - $level_mp_cost + $level_mp_regen);
             $level_cur_mp = max(0, $level_cur_mp);
             $level_cur_mp = min($level_max_mp, $level_cur_mp);
       
             $level_mp = $level_cur_mp . ' / ' . $level_max_mp;
       
             $level_mp_percent = floor($level_cur_mp / $level_max_mp * 100);
       }


       /* Determine EXP percentage
       *
       * Experience is determined by how far the user is away
       * from the next level. This is expressed as a percentage.
       *
       * Note, a user of level 0 has 100% experience. Making one post
       * will put them at level 1. Also, a user that is shown to have 100%
       * experience, will go up a level on their next post.
       *
       */

       if($level_level == 0)
       {
             $level_exp = '0 / 0';
             $level_exp_percent = 100;
       }
       else
       {
             $level_posts_for_next = floor( pow( 10, pow( $level_level, (1/3) ) ) );

          $level_exp = $user_cache[$poster_id]['posts'] . ' / ' . $level_posts_for_next;
          $level_exp_percent = floor( ($user_cache[$poster_id]['posts']) / max(1,($level_posts_for_next)) * 100);   
       }

       //
       // Level Bar 0.0.1 [ www.TeskilatForum.neT ] - End
Fuente: https://www.phpbb.de/community/viewtopi ... 6&t=222578 Saludos. :cerveza: