Visualizzazione risultati 1 fino 11 di 11

Discussione: Lista automatica in ordine alfabetico?

  1. #1
    Guest

    Exclamation Lista automatica in ordine alfabetico?

    Ciao a tutti, vorrei creare una lista automatica in ordine alfabetica dove all'inizio del post ci sono:
    #- A - B- C - D - E - F - G -.......
    e poi se clicchi su A ti porta ai file che iniziano con A, se clicchi su B ti porta ai file che iniziano con B e poi accanto ad ogni lettera (non quelle all'inizio del post), ci sia un tasto che se cliccato mi porti di nuovo all'inizio del post dove ci sono le lettere. Inoltre, è possibile inserire qualche codice che quando io sul forum inserisco una discussione in una categoria da me indicata tramite url venga inserita automaticamente nella lista?? Grazie in anticipo a chi mi risponde!!
    P.S. Mi servirebbe il più presto possibile, please....

  2. #2
    L'avatar di matt93
    matt93 non è connesso Utente
    Data registrazione
    01-09-2008
    Messaggi
    241

    Predefinito

    Questa è quella che uso sul mio sito. Funziona con il forum phpBB3. http://matt93.altervista.org/forum/a...hp?forum_id=19 prende come parametro il viewforum.php?f={PARAMETRO} della sezione e mostra tutti i topic escludendo gli annunci e quelli importanti.

    Codice PHP:
    <?
    // Modifica inserendo i tuoi dati.
    mysql_connect("localhost","matt93","password");
    mysql_select_db("my_matt93");

    $forum_id=(isset($_GET['forum_id']) && is_numeric($_GET['forum_id'])) ? $_GET['forum_id'] : 0;

    $q=mysql_query("SELECT * FROM `forum_forums` WHERE `forum_id`='".$forum_id."' LIMIT 1;");
    if(
    mysql_num_rows($q)>0){
    $q=mysql_query("SELECT * FROM `forum_forums` WHERE `forum_id`='".$forum_id."' LIMIT 1;");
    while(
    $r=mysql_fetch_assoc($q)){
    $forum_info=$r;
    }
    }else{
    die();
    }

    echo
    '<title>'.$forum_info['forum_name'].' - Lista Automatica</title>';
    ?>
    <a id="list_main"></a>
    <h3>Lista Automatica &raquo; <?= $forum_info['forum_name'] ?></h3>

    <a href="#list_a">A</a> <a href="#list_b">B</a> <a href="#list_c">C</a> <a href="#list_d">D</a> <a href="#list_e">E</a> <a href="#list_f">F</a> <a href="#list_g">G</a> <a href="#list_h">H</a> <a href="#list_i">I</a> <a href="#list_j">J</a> <a href="#list_k">K</a> <a href="#list_l">L</a> <a href="#list_m">M</a> <a href="#list_n">N</a> <a href="#list_o">O</a> <a href="#list_p">P</a> <a href="#list_q">Q</a> <a href="#list_r">R</a> <a href="#list_s">S</a> <a href="#list_t">T</a> <a href="#list_u">U</a> <a href="#list_v">V</a> <a href="#list_w">W</a> <a href="#list_x">X</a> <a href="#list_y">Y</a> <a href="#list_z">Z</a> <a href="#list_0">0</a> <a href="#list_1">1</a> <a href="#list_2">2</a> <a href="#list_3">3</a> <a href="#list_4">4</a> <a href="#list_5">5</a> <a href="#list_6">6</a> <a href="#list_7">7</a> <a href="#list_8">8</a> <a href="#list_9">9</a>
    <?
    // inserisci qui il prefisso delle tabelle di phpBB3
    $prefix='phpbb3_';
    $q=mysql_query("SELECT * FROM `".$prefix."topics` WHERE `forum_id`='".$forum_id."' AND `topic_type`='0' ORDER BY `topic_title` ASC");
    $last_letter='';
    while(
    $r=mysql_fetch_assoc($q)){
    if(
    $last_letter!==$r['topic_title']{0}){
    $last_letter=$r['topic_title']{0};
    ?><a id="list_<?= $last_letter ?>"></a><h4><?= $last_letter ?> <a href="#list_main" style="font-size:10px;">[Torna SU]</a></h4><?

    }
    ?>
    <a href="viewtopic.php?t=<?= $r['topic_id'] ?>"><?= $r['topic_title'] ?></a><br/>
    <?
    }
    Ultima modifica di matt93 : 07-02-2010 alle ore 23.49.02

  3. #3
    Guest

    Predefinito

    Ehm... raga non riesco a farlo funzionare..... Mi dice:
    Codice:
    Parse error: syntax error, unexpected '<' in /membri/nokiastore/applicazioni.php on line 83

  4. #4
    Guest

    Predefinito

    Posta dalla riga 80 alla 85, per favore.

  5. #5
    Guest

    Predefinito

    Ecco a te dalla riga 80 all'85....
    Codice:
    echo '<title>'.$forum_info['forum_name'].' - Lista Automatica</title>';
    ?>
    <a id="list_main"></a>
    <h3>Lista Automatica &raquo; <?= $forum_info['forum_name'] ?></h3>
    
    <a href="#list_a">A</a> <a href="#list_b">B</a> <a href="#list_c">C</a> <a href="#list_d">D</a> <a href="#list_e">E</a> <a

  6. #6
    Guest

    Predefinito

    Non so, strano. Prova a correggere così, per compatibilità con alcune configurazioni:
    Codice PHP:
    echo '<title>'.$forum_info['forum_name'].' - Lista Automatica</title>';
    ?>
    <a id="list_main"></a>
    <h3>Lista Automatica &raquo; <?php echo $forum_info['forum_name']; ?></h3>

    <a href="#list_a">A</a> <a href="#list_b">B</a> <a href="#list_c">C</a> <a href="#list_d">D</a> <a href="#list_e">E</a> <a

  7. #7
    Guest

    Predefinito

    Niente.... Lo stesso errore di prima......

  8. #8
    Guest

    Predefinito

    posta tutta la pagina applicazioni.php l'errore si trova nella riga 83....

  9. #9
    Guest

    Predefinito

    Ecco qui tutta la pagina...
    Codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title>Nokia Store</title>
    </head>
    <body background="http://img294.imageshack.us/img294/8648/2525135200000016f6c6cdd.png" bgcolor="#ffffff">
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;"><img src="http://img205.imageshack.us/img205/4825/senzatitolo2s.png" alt="Nokia Store" width="397" height="150" /></p>
    <p style="text-align: center;"><a title="Home" href="http://nokiastore.altervista.org"><img src="http://img109.imageshack.us/img109/9241/homeds.gif" alt="Home" width="100" height="29" /></a>&nbsp;<a title="Forum" href="http://nokiastore.altervista.org/forum"><img src="http://img168.imageshack.us/img168/9766/forumg.gif" alt="Forum" width="100" height="29" /></a>&nbsp;<a title="Contattaci" href="http://nokiastore.altervista.org/contattaci"><img src="http://img200.imageshack.us/img200/1329/contattacip.gif" alt="Contattaci" width="100" height="29" /></a></p>
    <p style="text-align: center;"><span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px;"><br /></span></span></p>
    <table style="border-color: #ffffff; border-width: 2px;" border="2" align="center">
    <tbody>
    <tr>
    <td>&nbsp;<a title="Banner" href="http://nokiastore.altervista.org/forum/viewtopic.php?f=3&amp;t=4"><img src="http://i48.tinypic.com/2jfyvtk.jpg%20border=" alt="banner" width="208" height="128" /></a></td>
    <td>
    <h1><span style="font-size: large;"><span style="color: #ffffff;">Aiutaci a sostenere Nokia Store!</span></span></h1>
    <h1><span style="font-size: large;"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input name="cmd" type="hidden" value="_donations" /> <input name="business" type="hidden" value="sweet.years97@hotmail.it" /> <input name="lc" type="hidden" value="IT" /> <input name="item_name" type="hidden" value="Nokia Store" /> <input name="currency_code" type="hidden" value="EUR" /> <input name="bn" type="hidden" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest" />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<input alt="PayPal - Il sistema di pagamento online pi&ugrave; facile e sicuro!" name="submit" src="https://www.paypal.com/it_IT/IT/i/btn/btn_donate_LG.gif" type="image" /> <img src="https://www.paypal.com/it_IT/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /> </form> </span></h1>
    </td>
    <td>&nbsp;<a title="Banner" href="http://nokiastore.altervista.org/forum/viewtopic.php?f=3&amp;t=4"><img src="http://i48.tinypic.com/2jfyvtk.jpg%20border=" alt="banner" width="208" height="128" /></a></td>
    </tr>
    <tr>
    <td>
    <script type="text/javascript">// <![CDATA[
    	document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=125X125/r='+new Date().getTime()+'"><\/s'+'cript>');
    // ]]></script>
    </td>
    <td>&nbsp;<a title="Banner" href="http://nokiastore.altervista.org/forum/viewtopic.php?f=3&amp;t=4">
    <p style="text-align: center;"><img src="http://i48.tinypic.com/2jfyvtk.jpg%20border=" alt="banner" width="208" height="128" /></p>
    </a></td>
    <td>
    <script type="text/javascript">// <![CDATA[
    	document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=125X125/r='+new Date().getTime()+'"><\/s'+'cript>');
    // ]]></script>
    </td>
    </tr>
    </tbody>
    </table>
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;"><span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: x-small;"><br /></span></p>
    <hr />
    <p>&nbsp;</p>
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;"><a href="http://nokiastore.altervista.org/5th.php"><img src="http://img246.imageshack.us/img246/1436/applicazioni.png" alt="applicazioni" width="67" height="66" /></a></p>
    <?
    // Modifica inserendo i tuoi dati.
    mysql_connect("localhost","nokiastore","");
    mysql_select_db("my_nokiastore");
    
    $forum_id=(isset($_GET['forum_id']) && is_numeric($_GET['forum_id'])) ? $_GET['forum_id'] : 0;
    
    $q=mysql_query("SELECT * FROM `forum_forums` WHERE `forum_id`='".$forum_id."' LIMIT 1;");
    if(mysql_num_rows($q)>0){
        $q=mysql_query("SELECT * FROM `forum_forums` WHERE `forum_id`='".$forum_id."' LIMIT 1;");
        while($r=mysql_fetch_assoc($q)){
            $forum_info=$r;
        }
    }else{
        die();
    }
    
    echo '<title>'.$forum_info['forum_name'].' - Lista Automatica</title>';
    ?>
    <a id="list_main"></a>
    <h3>Lista Automatica &raquo; <?php echo $forum_info['forum_name']; ?></h3>
    
    <a href="#list_a">A</a> <a href="#list_b">B</a> <a href="#list_c">C</a> <a href="#list_d">D</a> <a href="#list_e">E</a> <a href="#list_f">F</a> <a href="#list_g">G</a> <a href="#list_h">H</a> <a href="#list_i">I</a> <a href="#list_j">J</a> <a href="#list_k">K</a> <a href="#list_l">L</a> <a href="#list_m">M</a> <a href="#list_n">N</a> <a href="#list_o">O</a> <a href="#list_p">P</a> <a href="#list_q">Q</a> <a href="#list_r">R</a> <a href="#list_s">S</a> <a href="#list_t">T</a> <a href="#list_u">U</a> <a href="#list_v">V</a> <a href="#list_w">W</a> <a href="#list_x">X</a> <a href="#list_y">Y</a> <a href="#list_z">Z</a> <a href="#list_0">0</a> <a href="#list_1">1</a> <a href="#list_2">2</a> <a href="#list_3">3</a> <a href="#list_4">4</a> <a href="#list_5">5</a> <a href="#list_6">6</a> <a href="#list_7">7</a> <a href="#list_8">8</a> <a href="#list_9">9</a> 
    <?
    // inserisci qui il prefisso delle tabelle di phpBB3
    $prefix='phpbb3_';
    $q=mysql_query("SELECT * FROM `".$prefix."topics` WHERE `forum_id`='".$forum_id."' AND `topic_type`='0' ORDER BY `topic_title` ASC");
    $last_letter='';
    while($r=mysql_fetch_assoc($q)){
        if($last_letter!==$r['topic_title']{0}){
            $last_letter=$r['topic_title']{0};
            ?><a id="list_<?= $last_letter ?>"></a><h4><?= $last_letter ?> <a href="#list_main" style="font-size:10px;">[Torna SU]</a></h4><?
    
        }
        ?>
        <a href="viewtopic.php?t=<?= $r['?f=7'] ?>"><?= $r['topic_title'] ?></a><br/>
        <?
    }
    </body>
    </html>

  10. #10
    Guest

    Predefinito

    prova cosi....
    Codice PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title>Nokia Store</title>
    </head>
    <body background="http://img294.imageshack.us/img294/8648/2525135200000016f6c6cdd.png" bgcolor="#ffffff">
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;"><img src="http://img205.imageshack.us/img205/4825/senzatitolo2s.png" alt="Nokia Store" width="397" height="150" /></p>
    <p style="text-align: center;"><a title="Home" href="http://nokiastore.altervista.org"><img src="http://img109.imageshack.us/img109/9241/homeds.gif" alt="Home" width="100" height="29" /></a>&nbsp;<a title="Forum" href="http://nokiastore.altervista.org/forum"><img src="http://img168.imageshack.us/img168/9766/forumg.gif" alt="Forum" width="100" height="29" /></a>&nbsp;<a title="Contattaci" href="http://nokiastore.altervista.org/contattaci"><img src="http://img200.imageshack.us/img200/1329/contattacip.gif" alt="Contattaci" width="100" height="29" /></a></p>
    <p style="text-align: center;"><span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px;"><br /></span></span></p>
    <table style="border-color: #ffffff; border-width: 2px;" border="2" align="center">
    <tbody>
    <tr>
    <td>&nbsp;<a title="Banner" href="http://nokiastore.altervista.org/forum/viewtopic.php?f=3&amp;t=4"><img src="http://i48.tinypic.com/2jfyvtk.jpg%20border=" alt="banner" width="208" height="128" /></a></td>
    <td>
    <h1><span style="font-size: large;"><span style="color: #ffffff;">Aiutaci a sostenere Nokia Store!</span></span></h1>
    <h1><span style="font-size: large;"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input name="cmd" type="hidden" value="_donations" /> <input name="business" type="hidden" value="sweet.years97@hotmail.it" /> <input name="lc" type="hidden" value="IT" /> <input name="item_name" type="hidden" value="Nokia Store" /> <input name="currency_code" type="hidden" value="EUR" /> <input name="bn" type="hidden" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest" />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<input alt="PayPal - Il sistema di pagamento online pi&ugrave; facile e sicuro!" name="submit" src="https://www.paypal.com/it_IT/IT/i/btn/btn_donate_LG.gif" type="image" /> <img src="https://www.paypal.com/it_IT/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /> </form> </span></h1>
    </td>
    <td>&nbsp;<a title="Banner" href="http://nokiastore.altervista.org/forum/viewtopic.php?f=3&amp;t=4"><img src="http://i48.tinypic.com/2jfyvtk.jpg%20border=" alt="banner" width="208" height="128" /></a></td>
    </tr>
    <tr>
    <td>
    <script type="text/javascript">// <![CDATA[
    document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=125X125/r='+new Date().getTime()+'"><\/s'+'cript>');
    // ]]></script>
    </td>
    <td>&nbsp;<a title="Banner" href="http://nokiastore.altervista.org/forum/viewtopic.php?f=3&amp;t=4">
    <p style="text-align: center;"><img src="http://i48.tinypic.com/2jfyvtk.jpg%20border=" alt="banner" width="208" height="128" /></p>
    </a></td>
    <td>
    <script type="text/javascript">// <![CDATA[
    document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=125X125/r='+new Date().getTime()+'"><\/s'+'cript>');
    // ]]></script>
    </td>
    </tr>
    </tbody>
    </table>
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;"><span style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: x-small;"><br /></span></p>
    <hr />
    <p>&nbsp;</p>
    <p style="text-align: center;">&nbsp;</p>
    <p style="text-align: center;"><a href="http://nokiastore.altervista.org/5th.php"><img src="http://img246.imageshack.us/img246/1436/applicazioni.png" alt="applicazioni" width="67" height="66" /></a></p>
    <?
    // Modifica inserendo i tuoi dati.
    mysql_connect("localhost","nokiastore","");
    mysql_select_db("my_nokiastore");

    $forum_id=(isset($_GET['forum_id']) && is_numeric($_GET['forum_id'])) ? $_GET['forum_id'] : 0;

    $q=mysql_query("SELECT * FROM `forum_forums` WHERE `forum_id`='".$forum_id."' LIMIT 1;");
    if(
    mysql_num_rows($q)>0){
    $q=mysql_query("SELECT * FROM `forum_forums` WHERE `forum_id`='".$forum_id."' LIMIT 1;");
    while(
    $r=mysql_fetch_assoc($q)){
    $forum_info=$r;
    }
    }else{
    die();
    }

    echo
    '<title>'.$forum_info['forum_name'].' - Lista Automatica</title>';
    ?>
    <a id="list_main"></a>
    <h3>Lista Automatica &raquo; <?php echo $forum_info['forum_name']; ?></h3>

    <a href="#list_a">A</a> <a href="#list_b">B</a> <a href="#list_c">C</a> <a href="#list_d">D</a> <a href="#list_e">E</a> <a href="#list_f">F</a> <a href="#list_g">G</a> <a href="#list_h">H</a> <a href="#list_i">I</a> <a href="#list_j">J</a> <a href="#list_k">K</a> <a href="#list_l">L</a> <a href="#list_m">M</a> <a href="#list_n">N</a> <a href="#list_o">O</a> <a href="#list_p">P</a> <a href="#list_q">Q</a> <a href="#list_r">R</a> <a href="#list_s">S</a> <a href="#list_t">T</a> <a href="#list_u">U</a> <a href="#list_v">V</a> <a href="#list_w">W</a> <a href="#list_x">X</a> <a href="#list_y">Y</a> <a href="#list_z">Z</a> <a href="#list_0">0</a> <a href="#list_1">1</a> <a href="#list_2">2</a> <a href="#list_3">3</a> <a href="#list_4">4</a> <a href="#list_5">5</a> <a href="#list_6">6</a> <a href="#list_7">7</a> <a href="#list_8">8</a> <a href="#list_9">9</a>
    <?
    // inserisci qui il prefisso delle tabelle di phpBB3
    $prefix='phpbb3_';
    $q=mysql_query("SELECT * FROM `".$prefix."topics` WHERE `forum_id`='".$forum_id."' AND `topic_type`='0' ORDER BY `topic_title` ASC");
    $last_letter='';
    while(
    $r=mysql_fetch_assoc($q)){
    if(
    $last_letter!==$r['topic_title']{0}){
    $last_letter=$r['topic_title']{0};
    ?><a id="list_<?= $last_letter ?>"></a><h4><?= $last_letter ?> <a href="#list_main" style="font-size:10px;">[Torna SU]</a></h4><?

    }
    ?>
    <a href="viewtopic.php?t=<?= $r['?f=7'] ?>"><?= $r['topic_title'] ?></a><br/>
    <?
    }
    ?>
    </body>
    </html>

  11. #11
    Guest

    Predefinito

    Questa volta mi visualizza la pagina, ma non mi visualizza le lettere.... (A-B-C-D...)

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •