phpBB Italia chiude!
phpBB Italia ringrazia tutti gli utenti che hanno dato fiducia al nostro progetto per ben 9 anni, e che, grazie al grande lavoro fatto da tutto lo Staff (rigorosamente a titolo gratuito), hanno portato il portale a diventare il principale punto di riferimento italiano alla piattaforma phpBB.

Purtroppo, causa motivi personali, non ho più modo di gestirlo e portarlo avanti. Il forum viene ora posto in uno stato di sola lettura, nonché un archivio storico per permettere a chiunque di fruire di tutte le discussioni trattate.

Il nuovo portale di assistenza per l'Italia di phpBB diventa phpBB-Store.it, cui ringrazio per aver deciso di portare avanti questo grande progetto.

Grazie ancora,
Carlo - Amministratore di phpBB Italia

TopTen Topics in tabella personalizzata

Supporto stili in generale.
Avatar utente
Micogian
Leader Programmatori
Leader Programmatori
Messaggi: 3704
Iscritto il: 07/01/2010, 8:51
Versione: 3.2.0
Server: UNIX/Linux
PHP: 5.4.36
Database: MySQL 5.1.70-log
Località: Udine
Contatta:

Re: TopTen Topics in tabella personalizzata

Messaggio da Micogian » 12/12/2011, 17:04

Shanks le roux ha scritto:Ho inserito i tuoi codici ma niente..Nella prima e nella seconda colonna escono solo degli autori nella terza nulla..
Non avevo modificato la terza query, sostituisci il file php con questo (sempre che il terzo forum sia 214):

Codice: Seleziona tutto

<?php
// MOD Topten Topics : Topics più recenti di 3 Forums diversi
// created by Micogian (Bingo)
if (!defined('IN_PHPBB'))
    {
    exit;
    }
    // configurazione: indicare i records da elaborare e quelli da visualizzare
    $list_rec = 20 ;   // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
    $list_view = 10 ;  // numero dei recods da visualizzare nella Lista/aumentare il numero dei Topics

    //---------- 10 Topics più Recenti Forum 212 - start -----------//
    $sql1 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
        ft.forum_id, ft.forum_name
        FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
        WHERE tt.forum_id = '212'
        AND tt.topic_type = 0
        AND tt.topic_moved_id = 0
        AND tt.forum_id = ft.forum_id
        ORDER BY tt.topic_time DESC LIMIT 0,$list_rec";
        $result1 = $db->sql_query($sql1);
        $n1 = 0;
        while ($row1 = $db->sql_fetchrow($result1))
        {
            if ($auth->acl_get('f_read', $row1['forum_id']) == 1)
            {
                if ($n1 < $list_view)
                {
                    if (strlen($row1['topic_title']) > 28)
                    {
                    $topic_title1 = substr($row1['topic_title'],0,27) . "...";
                    }else{
                    $topic_title1 = $row1['topic_title'];
                    }
                    $last_topic1_link[$n1]         = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row1['forum_id'] . "&t=" . $row1['topic_id']);
                    $last_topic1_title[$n1]        = $row1['topic_title'];
                    $last_topic1_title_short[$n1]  = $topic_title1;
                    $last_topic1_forum[$n1]        = $row1['forum_name'];
                    $last_topic1_author[$n1]       = $row1['topic_first_poster_name'];
                    //$last_topic1_data[$n1]         = $user->format_date($row1['topic_time'], "|d M|");
                    ++$n1 ;             
                }else{
                    break ;
                }
            }
        }
    //---------- 10 Topics più Recenti Forum 212 - end -----------//

    //---------- 10 Topics più Recenti Forum 213 - start -----------//
    $sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
        ft.forum_id, ft.forum_name
        FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
        WHERE tt.forum_id = '213'
        AND tt.topic_type = 0
        AND tt.topic_moved_id = 0
        AND tt.forum_id = ft.forum_id
        ORDER BY tt.topic_time DESC LIMIT 0,$list_rec";
        $result2 = $db->sql_query($sql2);
        $n2 = 0;
        while ($row2 = $db->sql_fetchrow($result2))
        {
            if ($auth->acl_get('f_read', $row2['forum_id']) == 1)
            {
                if ($n2 < $list_view)
                {
                    if (strlen($row2['topic_title']) > 28)
                    {
                    $topic_title2 = substr($row2['topic_title'],0,27) . "...";
                    }else{
                    $topic_title2 = $row2['topic_title'];
                    }
                    $last_topic2_link[$n2]         = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row2['forum_id'] . "&t=" . $row2['topic_id']);
                    $last_topic2_title[$n2]        = $row2['topic_title'];
                    $last_topic2_title_short[$n2]  = $topic_title2;
                    $last_topic2_forum[$n2]        = $row2['forum_name'];
                    $last_topic2_author[$n2]       = $row2['topic_first_poster_name'];
                    ++$n2 ;             
                }else{
                    break ;
                }
            }
        }
    //---------- 10 Topics più Recenti Forum 213 - end -----------//

    //---------- 10 Topics più Recenti Forum 214 - start -----------//
    $sql3 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
        ft.forum_id, ft.forum_name
        FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
        WHERE tt.forum_id = '214'
        AND tt.topic_type = 0
        AND tt.topic_moved_id = 0
        AND tt.forum_id = ft.forum_id
        ORDER BY tt.topic_time DESC LIMIT 0,$list_rec";
        $result3 = $db->sql_query($sql3);
        $n3 = 0;
        while ($row3 = $db->sql_fetchrow($result3))
        {
            if ($auth->acl_get('f_read', $row3['forum_id']) == 1)
            {
                if ($n3 < $list_view)
                {
                    if (strlen($row3['topic_title']) > 28)
                    {
                    $topic_title3 = substr($row3['topic_title'],0,27) . "...";
                    }else{
                    $topic_title3 = $row3['topic_title'];
                    }
                    $last_topic_link[$n3]         = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row3['forum_id'] . "&t=" . $row3['topic_id']);
                    $last_topic_title[$n3]        = $row3['topic_title'];
                    $last_topic_title_short[$n3]  = $topic_title3;
                    $last_topic_forum[$n3]        = $row3['forum_name'];
                    $last_topic_author[$n3]       = $row3['topic_first_poster_name'];
                    ++$n3 ;             
                }else{
                    break ;
                }
            }
        }
        //---------- 10 Topics più Recenti Forum 214 - end -----------//

        // Crea l'array "topten_list" che contiene le Variabili per il Template
        for ($x = 0; $x < $list_view; ++$x)
        {
        $template->assign_block_vars('topten_list',array(
           'LAST_TOPIC1_LINK'           => $last_topic1_link[$x],
           'LAST_TOPIC1_TITLE'          => $last_topic1_title[$x],
           'LAST_TOPIC1_TITLE_SHORT'    => $last_topic1_title_short[$x],
           'LAST_TOPIC1_FORUM'          => $last_topic1_forum[$x],
           'LAST_TOPIC1_AUTHOR'         => $last_topic1_author[$x],

           'LAST_TOPIC2_LINK'           => $last_topic2_link[$x],
           'LAST_TOPIC2_TITLE'          => $last_topic2_title[$x],
           'LAST_TOPIC2_TITLE_SHORT'    => $last_topic2_title_short[$x],
           'LAST_TOPIC2_FORUM'          => $last_topic2_forum[$x],
           'LAST_TOPIC2_AUTHOR'         => $last_topic2_author[$x],

           'LAST_TOPIC3_LINK'           => $last_topic3_link[$x],
           'LAST_TOPIC3_TITLE'          => $last_topic3_title[$x],
           'LAST_TOPIC3_TITLE_SHORT'    => $last_topic3_title_short[$x],
           'LAST_TOPIC3_FORUM'          => $last_topic3_forum[$x],
           'LAST_TOPIC3_AUTHOR'         => $last_topic3_author[$x],
           ));
        }
?>

Shanks le roux
Utente
Utente
Messaggi: 85
Iscritto il: 29/01/2011, 11:40
Sesso: Maschio
Versione: 3.0.9
Server: UNIX/Linux
Database: MySQL 5.1.49-community-log

Re: TopTen Topics in tabella personalizzata

Messaggio da Shanks le roux » 12/12/2011, 21:32

Stessa storia direi

Avatar utente
Micogian
Leader Programmatori
Leader Programmatori
Messaggi: 3704
Iscritto il: 07/01/2010, 8:51
Versione: 3.2.0
Server: UNIX/Linux
PHP: 5.4.36
Database: MySQL 5.1.70-log
Località: Udine
Contatta:

Re: TopTen Topics in tabella personalizzata

Messaggio da Micogian » 13/12/2011, 7:16

C'è un errore nel nome della variabile inserita nel Template, non è {LAST_TOPIC_TITLE3_SHORT} ma {LAST_TOPIC3_TITLE_SHORT}.
Comunque, rivisti e controllato i file, ecco come dovrebbero essere (ovviamente sostituisci forum_id=214 se non è corretto):
PHP:

Codice: Seleziona tutto

<?php
    // MOD Topten Topics : Topics più recenti di 3 Forums diversi
    // created by Micogian (Bingo)
    if (!defined('IN_PHPBB'))
        {
        exit;
        }
        // configurazione: indicare i records da elaborare e quelli da visualizzare
        $list_rec = 20 ;   // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
        $list_view = 10 ;  // numero dei recods da visualizzare nella Lista/aumentare il numero dei Topics

        //---------- 10 Topics più Recenti Forum 212 - start -----------//
        $sql1 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
            ft.forum_id, ft.forum_name
            FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
            WHERE tt.forum_id = '6'
            AND tt.topic_type = 0
            AND tt.topic_moved_id = 0
            AND tt.forum_id = ft.forum_id
            ORDER BY tt.topic_time DESC LIMIT 0,$list_rec";
            $result1 = $db->sql_query($sql1);
            $n1 = 0;
            while ($row1 = $db->sql_fetchrow($result1))
            {
                if ($auth->acl_get('f_read', $row1['forum_id']) == 1)
                {
                    if ($n1 < $list_view)
                    {
                        if (strlen($row1['topic_title']) > 28)
                        {
                        $topic_title1 = substr($row1['topic_title'],0,27) . "...";
                        }else{
                        $topic_title1 = $row1['topic_title'];
                        }
                        $last_topic1_link[$n1]         = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row1['forum_id'] . "&t=" . $row1['topic_id']);
                        $last_topic1_title[$n1]        = $row1['topic_title'];
                        $last_topic1_title_short[$n1]  = $topic_title1;
                        $last_topic1_forum[$n1]        = $row1['forum_name'];
                        $last_topic1_author[$n1]       = $row1['topic_first_poster_name'];
                        //$last_topic1_data[$n1]         = $user->format_date($row1['topic_time'], "|d M|");
                        ++$n1 ;             
                    }else{
                        break ;
                    }
                }
            }
        //---------- 10 Topics più Recenti Forum 212 - end -----------//

        //---------- 10 Topics più Recenti Forum 213 - start -----------//
        $sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
            ft.forum_id, ft.forum_name
            FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
            WHERE tt.forum_id = '53'
            AND tt.topic_type = 0
            AND tt.topic_moved_id = 0
            AND tt.forum_id = ft.forum_id
            ORDER BY tt.topic_time DESC LIMIT 0,$list_rec";
            $result2 = $db->sql_query($sql2);
            $n2 = 0;
            while ($row2 = $db->sql_fetchrow($result2))
            {
                if ($auth->acl_get('f_read', $row2['forum_id']) == 1)
                {
                    if ($n2 < $list_view)
                    {
                        if (strlen($row2['topic_title']) > 28)
                        {
                        $topic_title2 = substr($row2['topic_title'],0,27) . "...";
                        }else{
                        $topic_title2 = $row2['topic_title'];
                        }
                        $last_topic2_link[$n2]         = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row2['forum_id'] . "&t=" . $row2['topic_id']);
                        $last_topic2_title[$n2]        = $row2['topic_title'];
                        $last_topic2_title_short[$n2]  = $topic_title2;
                        $last_topic2_forum[$n2]        = $row2['forum_name'];
                        $last_topic2_author[$n2]       = $row2['topic_first_poster_name'];
                        ++$n2 ;             
                    }else{
                        break ;
                    }
                }
            }
        //---------- 10 Topics più Recenti Forum 213 - end -----------//

        //---------- 10 Topics più Recenti Forum 214 - start -----------//
        $sql3 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_time, tt.topic_moved_id, tt.topic_first_poster_name,
            ft.forum_id, ft.forum_name
            FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
            WHERE tt.forum_id = '214'
            AND tt.topic_type = 0
            AND tt.topic_moved_id = 0
            AND tt.forum_id = ft.forum_id
            ORDER BY tt.topic_time DESC LIMIT 0,$list_rec";
            $result3 = $db->sql_query($sql3);
            $n3 = 0;
            while ($row3 = $db->sql_fetchrow($result3))
            {
                if ($auth->acl_get('f_read', $row3['forum_id']) == 1)
                {
                    if ($n3 < $list_view)
                    {
                        if (strlen($row3['topic_title']) > 28)
                        {
                        $topic_title3 = substr($row3['topic_title'],0,27) . "...";
                        }else{
                        $topic_title3 = $row3['topic_title'];
                        }
                        $last_topic3_link[$n3]         = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row3['forum_id'] . "&t=" . $row3['topic_id']);
                        $last_topic3_title[$n3]        = $row3['topic_title'];
                        $last_topic3_title_short[$n3]  = $topic_title3;
                        $last_topic3_forum[$n3]        = $row3['forum_name'];
                        $last_topic3_author[$n3]       = $row3['topic_first_poster_name'];
                        ++$n3 ;             
                    }else{
                        break ;
                    }
                }
            }
        //---------- 10 Topics più Recenti Forum 214 - end -----------//

            // Crea l'array "topten_list" che contiene le Variabili per il Template
            
            for ($x = 0; $x < $list_view; ++$x)
            {        
            $template->assign_block_vars('topten_list',array(
               'LAST_TOPIC1_LINK'           => $last_topic1_link[$x],
               'LAST_TOPIC1_TITLE'          => $last_topic1_title[$x],
               'LAST_TOPIC1_TITLE_SHORT'    => $last_topic1_title_short[$x],
               'LAST_TOPIC1_FORUM'          => $last_topic1_forum[$x],
               'LAST_TOPIC1_AUTHOR'         => $last_topic1_author[$x],

               'LAST_TOPIC2_LINK'           => $last_topic2_link[$x],
               'LAST_TOPIC2_TITLE'          => $last_topic2_title[$x],
               'LAST_TOPIC2_TITLE_SHORT'    => $last_topic2_title_short[$x],
               'LAST_TOPIC2_FORUM'          => $last_topic2_forum[$x],
               'LAST_TOPIC2_AUTHOR'         => $last_topic2_author[$x],

               'LAST_TOPIC3_LINK'           => $last_topic3_link[$x],
               'LAST_TOPIC3_TITLE'          => $last_topic3_title[$x],
               'LAST_TOPIC3_TITLE_SHORT'    => $last_topic3_title_short[$x],
               'LAST_TOPIC3_FORUM'          => $last_topic3_forum[$x],
               'LAST_TOPIC3_AUTHOR'         => $last_topic3_author[$x],
               ));
            }
    ?>
HTML

Codice: Seleziona tutto

    <!--  Mod topten_topics  by Micogian start -->
        <div class="sn-cat-header">
           <ul class="topiclist">
              <li class="header">
                 <dl class="icon">
                    <dd style="width: 32%">&nbsp;Forum 1</dd>
                    <dd style="width: 32%">&nbsp;Forum 2</dd>
                    <dd style="width: 32%">&nbsp;Forum 3</dd>
                 </dl>
              </li>
           </ul>
        </div>
       <div class="sn-cat-row rtl-viewforum">
          <ul class="topiclist topics">
          <!-- BEGIN topten_list -->
             <li>
                <dl>
                   <dd style="width: 32%">&nbsp;<a style="font-weight: bold" href="{topten_list.LAST_TOPIC1_LINK}" title="{topten_list.LAST_TOPIC1_TITLE} (in: {topten_list.LAST_TOPIC1_FORUM})">{topten_list.LAST_TOPIC1_TITLE_SHORT}</a> <span style="color: #708090"> {topten_list.LAST_TOPIC1_AUTHOR}</span></dd>
                   <dd style="width: 32%">&nbsp;<a style="font-weight: bold" href="{topten_list.LAST_TOPIC2_LINK}" title="{topten_list.LAST_TOPIC2_TITLE} (in: {topten_list.LAST_TOPIC2_FORUM})">{topten_list.LAST_TOPIC2_TITLE_SHORT}</a> <span style="color: #708090"> {topten_list.LAST_TOPIC2_AUTHOR}</span></dd>
                   <dd style="width: 32%">&nbsp;<a style="font-weight: bold" href="{topten_list.LAST_TOPIC3_LINK}" title="{topten_list.LAST_TOPIC3_TITLE} (in: {topten_list.LAST_TOPIC3_FORUM})">{topten_list.LAST_TOPIC3_TITLE_SHORT}</a> <span style="color: #708090"> {topten_list.LAST_TOPIC3_AUTHOR}</span></dd>
                </dl>
             </li>   
          <!-- END topten_list -->   
          </ul>
    <!--  Mod topten_topics  by Micogian end -->
    </div><div class="sn-cat-footer"></div>

Shanks le roux
Utente
Utente
Messaggi: 85
Iscritto il: 29/01/2011, 11:40
Sesso: Maschio
Versione: 3.0.9
Server: UNIX/Linux
Database: MySQL 5.1.49-community-log

Re: TopTen Topics in tabella personalizzata

Messaggio da Shanks le roux » 13/12/2011, 22:26

Mmmh..Si sulle sezioni ora è tutto ok..Quindi se c'è un vecchio argomento che però è sempre in cima alla sezione,a causa di continui post,esso comunque non rientra giusto?E' possibile far si che comprenda il forum 212 con le sue sottosezioni ad esempio?

Avatar utente
Micogian
Leader Programmatori
Leader Programmatori
Messaggi: 3704
Iscritto il: 07/01/2010, 8:51
Versione: 3.2.0
Server: UNIX/Linux
PHP: 5.4.36
Database: MySQL 5.1.70-log
Località: Udine
Contatta:

Re: TopTen Topics in tabella personalizzata

Messaggio da Micogian » 13/12/2011, 23:44

Shanks le roux ha scritto:Mmmh..Si sulle sezioni ora è tutto ok..Quindi se c'è un vecchio argomento che però è sempre in cima alla sezione,a causa di continui post,esso comunque non rientra giusto?E' possibile far si che comprenda il forum 212 con le sue sottosezioni ad esempio?
Lo avevo spiegato più volte, gli "Ultimo Topics" è una cosa, gli "Ultimi Posts" un'altra. Non per niente nella mia Mod avevo messo sia l'una che l'altra lista, sono due cose diverse.

Le sottosezioni sono sempre Forum.

Codice: Seleziona tutto

WHERE tt.forum_id  IN (212,213,214)

Shanks le roux
Utente
Utente
Messaggi: 85
Iscritto il: 29/01/2011, 11:40
Sesso: Maschio
Versione: 3.0.9
Server: UNIX/Linux
Database: MySQL 5.1.49-community-log

Re: TopTen Topics in tabella personalizzata

Messaggio da Shanks le roux » 14/12/2011, 17:57

Perfetto grazie mille ^^

Shanks le roux
Utente
Utente
Messaggi: 85
Iscritto il: 29/01/2011, 11:40
Sesso: Maschio
Versione: 3.0.9
Server: UNIX/Linux
Database: MySQL 5.1.49-community-log

Re: TopTen Topics in tabella personalizzata

Messaggio da Shanks le roux » 14/12/2011, 20:08

Scusa Bingo,anche se c'è lo spazio i titoli vengono fermati da dei puntini..Devo eliminare last_topic_title_short per eliminare questo "limite" in modo che il titolo continua fino alla sbarra verticale?

Avatar utente
Micogian
Leader Programmatori
Leader Programmatori
Messaggi: 3704
Iscritto il: 07/01/2010, 8:51
Versione: 3.2.0
Server: UNIX/Linux
PHP: 5.4.36
Database: MySQL 5.1.70-log
Località: Udine
Contatta:

Re: TopTen Topics in tabella personalizzata

Messaggio da Micogian » 14/12/2011, 21:59

Puoi modificare la lunghezza del titolo:

Codice: Seleziona tutto

if (strlen($row2['topic_title']) > 28)
                        {
                        $topic_title2 = substr($row2['topic_title'],0,27) . "...";
                        }else{
                        $topic_title2 = $row2['topic_title'];
                        }
Vuol dire: se il titolo è più lungo di 28 caratteri prendi i primi 28 (0,27) e aggiungi i puntini, altrimenti (else) lascia il titolo originale.
Basta modificare la lunghezza.

Shanks le roux
Utente
Utente
Messaggi: 85
Iscritto il: 29/01/2011, 11:40
Sesso: Maschio
Versione: 3.0.9
Server: UNIX/Linux
Database: MySQL 5.1.49-community-log

Re: TopTen Topics in tabella personalizzata

Messaggio da Shanks le roux » 14/12/2011, 22:20

else lo metto al posto di 28 e 27?

Rispondi

Torna a “Supporto stili”

Chi c’è in linea

Visitano il forum: Nessuno e 63 ospiti