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
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
-
metal master
- Utente

- Messaggi: 122
- Iscritto il: 28/12/2010, 10:58
- Sesso: Maschio
- Versione: 3.1.3
- Server: UNIX/Linux
- PHP: 5.5.25
- Database: MySQL(i) 5.5.43-37.2
Re: Topten Topics
EDIT
-
metal master
- Utente

- Messaggi: 122
- Iscritto il: 28/12/2010, 10:58
- Sesso: Maschio
- Versione: 3.1.3
- Server: UNIX/Linux
- PHP: 5.5.25
- Database: MySQL(i) 5.5.43-37.2
Re: Topten Topics
Capito.
Praticamente la mod va ma i topic del forum con id32 non vanno a finire nella tabella evidenziata qua dalle 2 frecce:

Ma in quella gia esistente

Il forum con id32 e' quello del Fantacalcio,e gli ultimi messaggi di quel forum vanno in alto nella tabella gia esistente e non in quella nuova
Praticamente la mod va ma i topic del forum con id32 non vanno a finire nella tabella evidenziata qua dalle 2 frecce:

Ma in quella gia esistente

Il forum con id32 e' quello del Fantacalcio,e gli ultimi messaggi di quel forum vanno in alto nella tabella gia esistente e non in quella nuova
- Micogian
- 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
Ho l'impressione che ci sia tanta confusione.
Avevamo un array di nome lastpost_list, ne creiamo un altro di nome lastpost_32, anche se le variabili hanno lo stesso nome come fanno a finire nella stessa Lista se le variabili vengono richiamate con {nome_array.NOME_VARIABILE} ??????
Il primo gruppo viene richiamato da
quello nuovo da
Non possono mescolarsi, ovviamente se le cose sono fatte correttamente, cosa di cui dubito.
Avevamo un array di nome lastpost_list, ne creiamo un altro di nome lastpost_32, anche se le variabili hanno lo stesso nome come fanno a finire nella stessa Lista se le variabili vengono richiamate con {nome_array.NOME_VARIABILE} ??????
Il primo gruppo viene richiamato da
Codice: Seleziona tutto
<!-- BEGIN lastpost_list -->Codice: Seleziona tutto
<!-- BEGIN lastpost_32 -->-
metal master
- Utente

- Messaggi: 122
- Iscritto il: 28/12/2010, 10:58
- Sesso: Maschio
- Versione: 3.1.3
- Server: UNIX/Linux
- PHP: 5.5.25
- Database: MySQL(i) 5.5.43-37.2
Re: Topten Topics
Ti riporto tutti i passaggi che ho fatto.
Creazione del file mod_lastpost_32.php con questo contenuto
Creazione del file mod_lastpost32_body.html con questo contenuto
Nel file overall_header.html ho inserito questo include per far apparire la tabella creata sopra
<!-- INCLUDE mod_lastpost32_body.html -->
In index.php ho inserito:
Questo e' tutto
Creazione del file mod_lastpost_32.php con questo contenuto
Codice: Seleziona tutto
<?php
// MOD Topten Topics : Topics più recenti, Topics più visti e Posts più recenti
// created by Micogian (Bingo)
if (!defined('IN_PHPBB'))
{
exit;
}
// configurazione: numero dei recods da visualizzare nella Lista
$list_rec = 10 ; // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
$list_view = 5 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
//---------- 10 Ultimi posts start -----------//
$sql = "SELECT tt.topic_id, tt.forum_id, tt.topic_moved_id, tt.topic_last_post_id, tt.topic_last_poster_id, tt.topic_last_poster_name, tt.topic_last_poster_colour,
tt.topic_last_post_subject, tt.topic_last_post_time, tt.topic_replies, tt.topic_views, tt.topic_poster, tt.topic_first_poster_name, tt.topic_first_poster_colour,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = 32
AND tt.topic_type = 0
AND tt.forum_id = ft.forum_id
ORDER BY tt.topic_last_post_time DESC LIMIT 0,$list_rec";
$result = $db->sql_query($sql);
$n = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($auth->acl_get('f_read', $row['forum_id']) == 1)
{
if ($n < $list_view)
{
// accorcia il titolo se troppo lungo
$post_subject = str_replace("Re: ", "", $row['topic_last_post_subject']) ;
if (strlen($post_subject) > 60)
{
$post_title = substr($post_subject,0,57) . "...";
}else{
$post_title = $post_subject ;
}
// accorcia il nome del Forum se troppo lungo
$forum_title = $row['forum_name'];
if (strlen($forum_title) > 28)
{
$forum_name_short = substr($forum_title,0,25) . "...";
}else{
$forum_name_short = $forum_title ;
}
$last_post_link[$n] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row['forum_id'] . "&t=" . $row['topic_id'] . "&p=" . $row['topic_last_post_id'] . "#p" . $row['topic_last_post_id']);
$last_post_title[$n] = $row['topic_last_post_subject'];
$last_post_title_short[$n] = $post_title;
$last_post_forum_id[$n] = $row['forum_id'];
$last_post_forum_name[$n] = $row['forum_name'];
$last_post_forum_name_short[$n] = $forum_name_short ;
$last_post_last_poster_full[$n] = get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']);
$last_post_replies[$n] = $row['topic_replies'];
$last_post_views[$n] = $row['topic_views'];
$last_post_time[$n] = $user->format_date($row['topic_last_post_time']);
//echo $last_post_title_short[$n] . "<br />";
++$n ;
}else{
break ;
}
}
}
//---------- 10 Ultimi posts end -----------//
// Crea l'array "lastpost_list" che contiene le Variabili per il Template
for ($x = 0; $x < $list_view; ++$x)
{
$template->assign_block_vars('lastpost_list',array(
'LAST_POST_LINK' => $last_post_link[$x],
'LAST_POST_TITLE' => $last_post_title[$x],
'LAST_POST_TITLE_SHORT' => $last_post_title_short[$x],
'LAST_POST_FORUM_ID' => $last_post_forum_id[$x],
'LAST_POST_FORUM_NAME' => $last_post_forum_name[$x],
'LAST_POST_FORUM_NAME_SHORT' => $last_post_forum_name_short[$x],
'LAST_POST_LAST_POSTER_FULL' => $last_post_last_poster_full[$x],
'LAST_POST_REPLIES' => $last_post_replies[$x],
'LAST_POST_VIEWS' => $last_post_views[$x],
'LAST_POST_TIME' => $last_post_time[$x],
));
}
?>Codice: Seleziona tutto
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl>
<dt style="text-align: left; width: 38%;"> Ultimi Posts</dt>
<dd style="text-align: left; width: 14%;"> Nome del Forum</dd>
<dd style="text-align: center; width: 7%;"> {L_REPLIES}</dd>
<dd style="text-align: center; width: 7%;"> {L_VIEWS}</dd>
<dd style="text-align: left; width: 13%;"> Ultimo Messaggio</dd>
<dd style="text-align: left;"> Data</dd>
</dl>
</li>
</ul>
<!-- BEGIN lastpost_32 -->
<ul class="topiclist forums">
<li>
<dl>
<dt style="text-align: left; width: 38%;"><a href="{lastpost_list.LAST_POST_LINK}"><b>{lastpost_list.LAST_POST_TITLE_SHORT}</b></a></dt>
<dd style="text-align: left; width: 14%;"><a href="viewforum.php?f={lastpost_list.LAST_POST_FORUM_ID}">{lastpost_list.LAST_POST_FORUM_NAME_SHORT}</a></dd>
<dd style="text-align: center; width: 7%">{lastpost_list.LAST_POST_REPLIES}</dd>
<dd style="text-align: center; width: 7%;">{lastpost_list.LAST_POST_VIEWS}</dd>
<dd style="text-align: left; width: 13%;">{lastpost_list.LAST_POST_LAST_POSTER_FULL}</dd>
<dd style="text-align: left;">{lastpost_list.LAST_POST_TIME}</dd>
</dl>
</li>
</ul>
<!-- END lastpost_32 -->
<span class="corners-bottom"><span></span></span>
</div>
</div>
<br /> <!-- INCLUDE mod_lastpost32_body.html -->
In index.php ho inserito:
Codice: Seleziona tutto
include($phpbb_root_path . 'mod_lastpost_32.' . $phpEx);
include($phpbb_root_path . 'mod_lastpost.' . $phpEx);
include($phpbb_root_path . 'includes/functions_activity_stats.' . $phpEx);
activity_mod();
// Output pageQuesto e' tutto
- Micogian
- 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
C'erano due righe da cambiare, una che riguardava il forum_id e una il nome dell'array, incredibile.
Vediamo di chiudere, questo è il file php
Il template:
Vediamo di chiudere, questo è il file php
Codice: Seleziona tutto
<?php
// MOD Last Posts
// created by Micogian (Bingo)
if (!defined('IN_PHPBB'))
{
exit;
}
// configurazione: numero dei recods da visualizzare nella Lista
$list_rec = 10 ; // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
$list_view = 5 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
//---------- 5 Ultimi posts start -----------//
$sql = "SELECT tt.topic_id, tt.forum_id, tt.topic_moved_id, tt.topic_last_post_id, tt.topic_last_poster_id, tt.topic_last_poster_name, tt.topic_last_poster_colour,
tt.topic_last_post_subject, tt.topic_last_post_time, tt.topic_replies, tt.topic_views, tt.topic_poster, tt.topic_first_poster_name, tt.topic_first_poster_colour,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = 32
AND tt.topic_type = 0
AND tt.forum_id = ft.forum_id
ORDER BY tt.topic_last_post_time DESC LIMIT 0,$list_rec";
$result = $db->sql_query($sql);
$n = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($auth->acl_get('f_read', $row['forum_id']) == 1)
{
if ($n < $list_view)
{
// accorcia il titolo se troppo lungo
$post_subject = str_replace("Re: ", "", $row['topic_last_post_subject']) ;
if (strlen($post_subject) > 60)
{
$post_title = substr($post_subject,0,57) . "...";
}else{
$post_title = $post_subject ;
}
// accorcia il nome del Forum se troppo lungo
$forum_title = $row['forum_name'];
if (strlen($forum_title) > 28)
{
$forum_name_short = substr($forum_title,0,25) . "...";
}else{
$forum_name_short = $forum_title ;
}
$last_post_link[$n] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row['forum_id'] . "&t=" . $row['topic_id'] . "&p=" . $row['topic_last_post_id'] . "#p" . $row['topic_last_post_id']);
$last_post_title[$n] = $row['topic_last_post_subject'];
$last_post_title_short[$n] = $post_title;
$last_post_forum_id[$n] = $row['forum_id'];
$last_post_forum_name[$n] = $row['forum_name'];
$last_post_forum_name_short[$n] = $forum_name_short ;
$last_post_last_poster_full[$n] = get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']);
$last_post_replies[$n] = $row['topic_replies'];
$last_post_views[$n] = $row['topic_views'];
$last_post_time[$n] = $user->format_date($row['topic_last_post_time']);
//echo $last_post_title_short[$n] . "<br />";
++$n ;
}else{
break ;
}
}
}
//---------- 5 Ultimi posts end -----------//
// Crea l'array "lastpost_32" che contiene le Variabili per il Template
for ($x = 0; $x < $list_view; ++$x)
{
$template->assign_block_vars('lastpost_32',array(
'LAST_POST_LINK' => $last_post_link[$x],
'LAST_POST_TITLE' => $last_post_title[$x],
'LAST_POST_TITLE_SHORT' => $last_post_title_short[$x],
'LAST_POST_FORUM_ID' => $last_post_forum_id[$x],
'LAST_POST_FORUM_NAME' => $last_post_forum_name[$x],
'LAST_POST_FORUM_NAME_SHORT' => $last_post_forum_name_short[$x],
'LAST_POST_LAST_POSTER_FULL' => $last_post_last_poster_full[$x],
'LAST_POST_REPLIES' => $last_post_replies[$x],
'LAST_POST_VIEWS' => $last_post_views[$x],
'LAST_POST_TIME' => $last_post_time[$x],
));
}
?>Codice: Seleziona tutto
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl>
<dt style="text-align: left; width: 38%;"> Ultimi Posts</dt>
<dd style="text-align: left; width: 14%;"> Nome del Forum</dd>
<dd style="text-align: center; width: 7%;"> {L_REPLIES}</dd>
<dd style="text-align: center; width: 7%;"> {L_VIEWS}</dd>
<dd style="text-align: left; width: 13%;"> Ultimo Messaggio</dd>
<dd style="text-align: left;"> Data</dd>
</dl>
</li>
</ul>
<!-- BEGIN lastpost_32 -->
<ul class="topiclist forums">
<li>
<dl>
<dt style="text-align: left; width: 38%;"><a href="{lastpost_32.LAST_POST_LINK}"><b>{lastpost_32.LAST_POST_TITLE_SHORT}</b></a></dt>
<dd style="text-align: left; width: 14%;"><a href="viewforum.php?f={lastpost_32.LAST_POST_FORUM_ID}">{lastpost_32.LAST_POST_FORUM_NAME_SHORT}</a></dd>
<dd style="text-align: center; width: 7%">{lastpost_32.LAST_POST_REPLIES}</dd>
<dd style="text-align: center; width: 7%;">{lastpost_32.LAST_POST_VIEWS}</dd>
<dd style="text-align: left; width: 13%;">{lastpost_32.LAST_POST_LAST_POSTER_FULL}</dd>
<dd style="text-align: left;">{lastpost_32.LAST_POST_TIME}</dd>
</dl>
</li>
</ul>
<!-- END lastpost_32 -->
<span class="corners-bottom"><span></span></span>
</div>
</div>
<br /> -
metal master
- Utente

- Messaggi: 122
- Iscritto il: 28/12/2010, 10:58
- Sesso: Maschio
- Versione: 3.1.3
- Server: UNIX/Linux
- PHP: 5.5.25
- Database: MySQL(i) 5.5.43-37.2
Re: Topten Topics
Parse error: syntax error, unexpected T_STRING in /home/w74049/domains/solonapolifans.it/public_html/mod_lastpost_32.php on line 68
- Micogian
- 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
Mancava un apice alla riga
$template->assign_block_vars('lastpost_32,array(
Codice: Seleziona tutto
<?php
// MOD Last Posts
// created by Micogian (Bingo)
if (!defined('IN_PHPBB'))
{
exit;
}
// configurazione: numero dei recods da visualizzare nella Lista
$list_rec = 10 ; // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
$list_view = 5 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
//---------- 5 Ultimi posts start -----------//
$sql = "SELECT tt.topic_id, tt.forum_id, tt.topic_moved_id, tt.topic_last_post_id, tt.topic_last_poster_id, tt.topic_last_poster_name, tt.topic_last_poster_colour,
tt.topic_last_post_subject, tt.topic_last_post_time, tt.topic_replies, tt.topic_views, tt.topic_poster, tt.topic_first_poster_name, tt.topic_first_poster_colour,
ft.forum_id, ft.forum_name
FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft
WHERE tt.forum_id = 32
AND tt.topic_type = 0
AND tt.forum_id = ft.forum_id
ORDER BY tt.topic_last_post_time DESC LIMIT 0,$list_rec";
$result = $db->sql_query($sql);
$n = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($auth->acl_get('f_read', $row['forum_id']) == 1)
{
if ($n < $list_view)
{
// accorcia il titolo se troppo lungo
$post_subject = str_replace("Re: ", "", $row['topic_last_post_subject']) ;
if (strlen($post_subject) > 60)
{
$post_title = substr($post_subject,0,57) . "...";
}else{
$post_title = $post_subject ;
}
// accorcia il nome del Forum se troppo lungo
$forum_title = $row['forum_name'];
if (strlen($forum_title) > 28)
{
$forum_name_short = substr($forum_title,0,25) . "...";
}else{
$forum_name_short = $forum_title ;
}
$last_post_link[$n] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row['forum_id'] . "&t=" . $row['topic_id'] . "&p=" . $row['topic_last_post_id'] . "#p" . $row['topic_last_post_id']);
$last_post_title[$n] = $row['topic_last_post_subject'];
$last_post_title_short[$n] = $post_title;
$last_post_forum_id[$n] = $row['forum_id'];
$last_post_forum_name[$n] = $row['forum_name'];
$last_post_forum_name_short[$n] = $forum_name_short ;
$last_post_last_poster_full[$n] = get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']);
$last_post_replies[$n] = $row['topic_replies'];
$last_post_views[$n] = $row['topic_views'];
$last_post_time[$n] = $user->format_date($row['topic_last_post_time']);
//echo $last_post_title_short[$n] . "<br />";
++$n ;
}else{
break ;
}
}
}
//---------- 5 Ultimi posts end -----------//
// Crea l'array "lastpost_32" che contiene le Variabili per il Template
for ($x = 0; $x < $list_view; ++$x)
{
$template->assign_block_vars('lastpost_32',array(
'LAST_POST_LINK' => $last_post_link[$x],
'LAST_POST_TITLE' => $last_post_title[$x],
'LAST_POST_TITLE_SHORT' => $last_post_title_short[$x],
'LAST_POST_FORUM_ID' => $last_post_forum_id[$x],
'LAST_POST_FORUM_NAME' => $last_post_forum_name[$x],
'LAST_POST_FORUM_NAME_SHORT' => $last_post_forum_name_short[$x],
'LAST_POST_LAST_POSTER_FULL' => $last_post_last_poster_full[$x],
'LAST_POST_REPLIES' => $last_post_replies[$x],
'LAST_POST_VIEWS' => $last_post_views[$x],
'LAST_POST_TIME' => $last_post_time[$x],
));
}
?>-
metal master
- Utente

- Messaggi: 122
- Iscritto il: 28/12/2010, 10:58
- Sesso: Maschio
- Versione: 3.1.3
- Server: UNIX/Linux
- PHP: 5.5.25
- Database: MySQL(i) 5.5.43-37.2
Re: Topten Topics
Tutto ok,grazie micogian,che mal di testa che ti ho fatto venire 
La prossima volta visti i casini di tutti sti codici,e meglio che me li metti gia fatti
La prossima volta visti i casini di tutti sti codici,e meglio che me li metti gia fatti
-
pavel70
- Utente

- Messaggi: 720
- Iscritto il: 29/07/2011, 0:49
- Sesso: Maschio
- Versione: 3.2.0
- Server: UNIX/Linux
- PHP: 5.6.24
- Database: MySQL(i) 5.0.91-enterprise-gpl-log
- Contatta:
Re: Topten Topics
Ciao bingo,
noto che con altri utenti sei riuscito a far funzionare al meglio la tua mod.Io purtroppo continuo ad avere problemi, quando si posta in quasi tutte le sezioni di pronostici calcio nn si aggiorna o per meglio dire si aggiorna solo se apri un nuovo topic ma se si pubblica qualcosa in topic già esistenti non si aggiorna.Quando hai tempo potresti andare a fondo anche con me?
Grazie
noto che con altri utenti sei riuscito a far funzionare al meglio la tua mod.Io purtroppo continuo ad avere problemi, quando si posta in quasi tutte le sezioni di pronostici calcio nn si aggiorna o per meglio dire si aggiorna solo se apri un nuovo topic ma se si pubblica qualcosa in topic già esistenti non si aggiorna.Quando hai tempo potresti andare a fondo anche con me?
Grazie
- Micogian
- 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
Prima di tutto devi controllare se la Mod che hai installato corrisponde a quella più recente (quella presente nella prima pagina di questo Topic)pavel70 ha scritto:Ciao bingo,
noto che con altri utenti sei riuscito a far funzionare al meglio la tua mod.Io purtroppo continuo ad avere problemi, quando si posta in quasi tutte le sezioni di pronostici calcio nn si aggiorna o per meglio dire si aggiorna solo se apri un nuovo topic ma se si pubblica qualcosa in topic già esistenti non si aggiorna.Quando hai tempo potresti andare a fondo anche con me?
Grazie
Presumo che tu ti riferisca agli "Ultimi posts" perchè "Ultimi topics" e i "topics più visti" non dovrebbe avere problemi, nell'ultima versione è stato modificata la parte riguardante i Posts.
Dato che i dati prelevati derivano dalla tabella "topics", il risultato è lo stesso dell'ultimo messaggio presente nella lista "indice" dei Forums.
Chi c’è in linea
Visitano il forum: Nessuno e 2 ospiti