Pagina 1 di 3

errore nelle liste atuomatiche di bingo dopo trasferimento

Inviato: 04/05/2010, 23:57
da gennyna
Dopo aver trasferito il mio sito su un altro server; quando lancio le liste automatiche mi esce il seguente errore:

Codice: Seleziona tutto

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4380: Cannot modify header information - headers already sent by (output started at /tlist_simple.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4382: Cannot modify header information - headers already sent by (output started at /tlist_simple.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4383: Cannot modify header information - headers already sent by (output started at /tlist_simple.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4384: Cannot modify header information - headers already sent by (output started at /tlist_simple.php:1)
Qui la prova: http://www.clonedb.tk/community/tlist_simple.php?f=8

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 07/05/2010, 15:54
da Micogian
A parte che la tlist_simple è di T@by e non mia, di solito quell'errore è dovuto alla presenza di spazi o righe vuote all'inizio del codice php.

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 07/05/2010, 18:51
da gennyna
quella è la tua :S

l'ho rinominata con quella di t@by per non cambiare tutti i link nel forum. ..


*ho riuppato più volte il file funzionante che ho anche sullìaltro dominio.. e qui mi da sempre lo stesso errore..

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 07/05/2010, 21:11
da Micogian
Resto sempre convinto che sia un problema legato al file php, causato da uno spazio o una riga vuota.

Dal manuale di PHP:

Bisogna ricordare che la funzioneheader() va chiamata prima di qualsiasi output HTML o PHP (anche righe o spazi vuoti). E' un errore comune leggere files con funzioni include(), o require() (o altre funzioni capaci di accedere a files), che possano emettere in output spazi o linee vuote prima di una chiamata della funzione header(). Lo stesso problema esiste nell'utilizzare file PHP/HTML.

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 07/05/2010, 22:39
da Carlo
Il nuovo phpBB gira su un VPS che personalmente ho configurato per gennyna, con Apache, PHP 5.2.6 e MySQL, server mail, ecc.

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 07/05/2010, 23:52
da gennyna
ecco il file php in questione:

Codice: Seleziona tutto

    <?php
    /**
    *
    * @package phpBB3
    * @version $Id: user_topic_list.php 2009 11 30 Bingo $
    * @copyright (c) 2005 phpBB Group
    * @license http://opensource.org/licenses/gpl-license.php GNU Public License
    *
    */

    /**
    * @ignore
    */
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    global $icons;
    // Start session
    $user->session_begin();
    $auth->acl($user->data);
        //$user->setup('viewforum', $forum_data['forum_style']);
    $user->setup('viewforum');
    // Start initial var setup
    // 1) inserire le barre iniziali alla riga seguente se si sceglie l'opzione 2) con questa il Forum richiesto viene inserito nell'URL (http://..../user_topic.php?f=1)
    $forum_id   = request_var('f', 0);
    // 2) Togliere le barre iniziali alla riga seguente se viene scelta questa opzione e inserire il forum_id voluto
    //$forum_id   = "1";
    if (!$forum_id)
    {
       trigger_error('NO_FORUM');
    }
    // Redirect to login upon emailed notification links
    if (isset($_GET['e']) && !$user->data['is_registered'])
    {
       login_box('', $user->lang['LOGIN_NOTIFY_FORUM']);
    }

    $sql = "SELECT f.*
       FROM ".FORUMS_TABLE." f
       WHERE f.forum_id = $forum_id";
    $result = $db->sql_query($sql);
    $forum_data = $db->sql_fetchrow($result);
    $db->sql_freeresult($result);

    if (!$forum_data)
    {
       trigger_error('NO_FORUM');
    }
    // Permissions check
    if (!$auth->acl_gets('f_list', 'f_read', $forum_id) || ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link'] && !$auth->acl_get('f_read', $forum_id)))
    {
       if ($user->data['user_id'] != ANONYMOUS)
       {
          trigger_error('SORRY_AUTH_READ');
       }

       login_box('', $user->lang['LOGIN_VIEWFORUM']);
    }
    // Forum is passworded ... check whether access has been granted to this
    // user this session, if not show login box
    if ($forum_data['forum_password'])
    {
       login_forum_box($forum_data);
    }

    //Obtain forum name
    $forum_name = $forum_data['forum_name'];   //
    $template->assign_var('FORUM_NAME', $forum_name);   
    $template->assign_var('U_VIEWFORUM',append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id));
    $icons = $cache->obtain_icons();
    //query per una lista di forum_id
    $sql = "SELECT
    pt.topic_id, pt.icon_id, pt.topic_title, pt.topic_views, pt.topic_first_poster_name, pt.topic_time, pf.parent_id, pf.forum_id, pf.forum_name AS forum_name_cor,
    UCASE(LEFT(TRIM(LEADING '[' FROM pt.topic_title), 1)) AS first_char
    FROM ". TOPICS_TABLE." pt,". FORUMS_TABLE. " pf
    WHERE pt.forum_id = pf.forum_id
    AND pt.topic_type = 0
    AND pt.forum_id = $forum_id
    ORDER BY UCASE(TRIM(LEADING '[' FROM pt.topic_title))";

    $db->sql_query($sql);
    $result = $db->sql_query($sql);
    $current_char = '';
    $template->assign_block_vars('topic_list', array(
       'TOPIC_ICON_IMG'   => '',
       'TOPIC_TITLE'   => "%",
       'TOPIC_LINK'   => '',
       'FORUM_NAME'   => "%",
       'TOPIC_AUTHOR'   => "%",
       'VIEWS'        => "%"
    ));

    $string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    while ($row = $db->sql_fetchrow($result))
    {
       if (strchr("0123456789", $row['first_char']) && $current_char == ''){
          $current_char = '0';
          $template->assign_block_vars('topic_list', array(
             'TOPIC_ICON_IMG'   => '',
             'TOPIC_TITLE'   => "0-9",
             'TOPIC_LINK'   => '',
             'TOPIC_AUTHOR'   => '',
             'VIEWS'        => ''
          ));
       } else if (strchr($string, $row['first_char']) ){
          if ($row['first_char'] != $current_char) {
             chapter($current_char, $row['first_char']);
             $current_char = $row['first_char'];
          }
       }
       $template->assign_block_vars('topic_list', array(
          'TOPIC_ICON_IMG'   => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : 'misc/empty.gif',
          'TOPIC_TITLE'   => $row['topic_title'],
          'TOPIC_LINK'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't='.$row['topic_id']),
          'FORUM_NAME_COR'   => $row['forum_name_cor'],
          'VIEWS'      => $row['topic_views'],
          'TOPIC_AUTHOR'   => $row['topic_first_poster_name'],
          'FIRST_POST_TIME'   => date("d.m.Y",$row['topic_time']) //$user->format_date($row['topic_time'])
       ));
    }
    $db->sql_freeresult($result);
    chapter($current_char, "-");

    // Dump out the page header and load template
    page_header($user->lang['VIEW_FORUM'] . $forum_name);

    $template->set_filenames(array(
       'body' => 'tlist_simple.html')
    );
    page_footer();

    function chapter($start, $current)
    {
    global $template;
       $letters = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
       $letters_array = explode (",", $letters);
       foreach ($letters_array as $key => $row) {
          if ($row > strtoupper($start)){
             $template->assign_block_vars('topic_list', array(
                'TOPIC_ICON_IMG'      => '',
                'TOPIC_TITLE'   => "$row",
                'TOPIC_LINK'      => '',
                'FORUM_NAME_COR'   => "$row",
             ));
          }
          if ($row == strtoupper($current)){
             return;
          }
       }
    }
    ?>

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 08/05/2010, 7:05
da Micogian
Passami anche il file "tlist_simple.html" e dimmi che stile usi (+ derivazione)

Hai provato in locale ?

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 08/05/2010, 7:14
da Carlo
Ha ragione bingo, infatti prima del tag <?php ci sono degli spazi.

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 08/05/2010, 7:42
da Micogian
Ecco, mi pareva, è un'indentazione che non si nota ma che non dovrebbe esserci prima di <?php

Può darsi che derivi da un copia-incolla già nel file originale della Mod, era già successo con altri.

Re: errore nelle liste atuomatiche di bingo dopo trasferimen

Inviato: 08/05/2010, 14:45
da gennyna
era un copia e incolla errato.

Ti ho allegato il file.. scaricalo e vedi eventualmente dove sono questi spazi vuoti.. perchè io davvero non ne trovo XDXDXD


Ti ringrazio subito per l'assistenza che mi stai fornendo..