Far comparire ultimi topic nella homepage

ultrazzurra

Utente Attivo
18 Feb 2005
42
0
0
39
Napoli
ultrazzurri.altervista.org
Salve a tutti
uso un forum phpbb2 e vorrei che gli ultimi topic inseriti comparissero nella homepage del mio sito. mi hanno fatto scaricare un file zip in cui si trovava un index.php e un file install.txt
Ora deduco che dovrei cambiare qualcosa in questi file ma cosa?

nel file install.txt c'e' scritto questo:


#
#-----[ OPEN ]------------------------------------------------
#
index.php

#
#-----[ ACTION Find ]-----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM (( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}

$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
$db->sql_freeresult($result);

if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}

//
// Obtain a list of topic ids which contain

#
#-----[ REPLACE WITH ]----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_last_post_id " .
" FROM ((( " . FORUMS_TABLE . " f " .
" LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )" .
" LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) " .
" LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id ) " .
" ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}

$forum_data = array();
$topic_last_ary = array();
$i=0;
while( $row = $db->sql_fetchrow($result) )
{
if (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0) {
$topic_last_ary=$row['topic_last_post_id'];
$i++;
$forum_data[] = $row;
}
}
unset($topic_last_ary);
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}

//
// Filter topic_title not allowed to read
//
if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
$auth_read_all = array();
$auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$auth_data = '';
for($i=0; $i<count($forum_data); $i++)
{
if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
$forum_data[$i]['topic_title']='';
}
}
}

//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Obtain a list of topic ids which contain


#
#-----[ ACTION Find ]-----------------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
...
}


#
#-----[ ACTION Replace With ]---------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$topic_title = $forum_data[$j]['topic_title'];
$topic_title2 = $forum_data[$j]['topic_title'];

//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
$topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
}

if (strlen($topic_title)>27) {
$topic_title = substr($topic_title,0,24) . '...';
}

$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
$last_post .= $last_post_time . '&nbsp;<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . '&nbsp;';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
}

#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------
#
 
Discussioni simili
Autore Titolo Forum Risposte Data
J Far comparire e scomparire un div con un select Javascript 1
otto9due Al Click su optgroup di un select, far comparire le option annidate jQuery 2
G Ciclo if php per far comparire un pulsante solo nel caso in cui una variabile sia 0 PHP 2
D cliccare sul tasto per far comparire una scritta tipo PHP 0
I come fare a far comparire il mio sito nelle ricerche?? SEO e Posizionamento 3
G far comparire un div Javascript 2
F E' possibile far comparire una scritta in un div al cambio di un valore di un form text??? Javascript 2
C Far comparire o scomparire dei div al clik del mouse Javascript 10
D Far comparire div al click Javascript 0
R Piacere di far parte di questa community Presentati al Forum 0
D Devo far funzionare un form di contatti PHP 4
J Far partire Angular Javascript 1
MarcoGrazia Se non sai se riceverai da GET o da POST, puoi verificarlo e far scegliere allo script. Snippet PHP 0
T Far sparire dalla pagina div che saranno inseriti successivamente jQuery 0
Shyson Far apparire le l'icona Back To Top in fondo jQuery 8
D [Java] far partire JProgressBar all'apertura di un JFrame Java 1
Monital [PHP]Far riconoscere stringa o numerico epr creazione campo tabella PHP 6
Q Problema su come far aggiornare i campi su un database Mysql PHP 17
W [PHP] Come far funzionare un form di selezione PHP 12
M Riadattamento funzioni per far scomparire un menu. jQuery 4
momeraths [HTML] Come non far scaricare video HTML e CSS 1
trattorino [Javascript] FAR sparire campo dopo top caratteri Javascript 2
T [Javascript] Far partire script al raggiungimento del div/section Javascript 0
M [PHP] Far rimanere biffata checkbox dopo aggiornamento pagina PHP 24
M [Javascript] far scomparire il menu al click Javascript 0
Bryan [PHP] Far mostrare tutte le tabelle contenenti in un database PHP 2
maurogiarrizzo È un piacere far parte di questo sito Presentati al Forum 1
C [PHP] DEVO FAR SPUNTARE SOLO LE CONSONANTI DI UNA STRINGA PHP 1
R Come faccio a far tradurre un mio video su Youtube? Social Media Marketing 2
SimooRu [PHP] Non riesco a far passare i dati con i form PHP 4
D script per far funzionare l'animazione Javascript 4
D script per far funzionare l'animazione Presentati al Forum 1
M Creazione codice html per far prelevare un banner HTML e CSS 3
M Far partire una funzione/codice php con javascript Javascript 1
S Far partire in automatico una slide all'apertura della pagina Javascript 0
U Far partire una funzione JavaScript premendo bottone in html Javascript 13
Mr. Alex D. Come far apparire un testo preimpostato in una casella di un form di uno script php? PHP 1
S Se voglio far scorrere le immagini dello sfondo di una pagina (oviamente html) come faccio? HTML e CSS 1
S Come faccio a far scorrere delle immagini come sfondo di una pagina? Discussioni Varie 1
I Far conoscere un sito SEO e Posizionamento 4
Shyson Far apparire o scomparire div jQuery 1
P far apparire immagine sotto testo con rollover Javascript 2
D Come far ripartire una gif quando si rivisita la pagina dello slideshow WordPress 1
K Far scorrere il menu dal fondo al top della pagina HTML e CSS 6
P Codice per far aprire un <div> al click di un immagine? HTML e CSS 0
piccino Far pubblicare un solo articolo WordPress 0
C Far apparire segno + PHP 1
G Come far passare un valore attraverso il metodo POST utiliazzando PHP a jQuery PHP 4
S Far scrivere un testo ad un utente registrato..... PHP 3
L Come far commentare/scrivere agli altri utenti?? Windows e Software 10

Discussioni simili