
Il mio forum è: http://medforum.altervista.org/forum/
Codice: Seleziona tutto
if (strlen($row1['topic_title']) > 28)
{
$topic_title1 = substr($row1['topic_title'],0,27) . "...";
}else{
$topic_title1 = $row1['topic_title'];
}
Codice: Seleziona tutto
if (strlen($row1['topic_title']) > 25)
{
$topic_title1 = substr($row1['topic_title'],0,21) . "...";
}else{
$topic_title1 = $row1['topic_title'];
}
<!-- BEGIN topics_last -->
{topics_last.LAST_DATA}<a href="{topics_last.LAST_LINK}" title="{topics_last.LAST_TITLE}"> <b>{topics_last.LAST_TITLE}</b></a> (di {topics_last.LAST_AUTHOR})<br>
<!-- END topics_last -->
</td>
<td width="32%">
<!-- BEGIN topics_view -->
{topics_view.VIEW_VIEWS}<a href="{topics_view.VIEW_LINK}" title="{topics_view.VIEW_TITLE}"> <b>{topics_view.VIEW_TITLE}</b></a> (di {topics_view.VIEW_AUTHOR})<br />
<!-- END topics_view -->
</td>
<td>
<!-- BEGIN last_posts -->
<a href="{last_posts.POST_LINK}" title="{last_posts.FORUM_NAME}"><b>{last_posts.POST_TITLE}</b></a> (di {last_posts.POST_AUTHOR})<br />
<!-- END last_posts -->
{topics_last.LAST_DATA}
è la data e potrebbe essere tolta, tanto gli ultimi topics sono degli ultimi giorni.(di {topics_last.LAST_AUTHOR})
togliere parentesi e stringa "di" mi sembra semplice.{topics_last.LAST_AUTHOR}
Micogian, scusa se mi faccio vivo dopo molto tempo ma sono stato parecchio impegnato nell'ultimo mese...Micogian ha scritto:La data può diventare un problema quando il topic è recente, ad esempi "5 minuti fa".
Io nei miei Forum ho inserito una data personalizzata (giorno e mese)
http://www.actafungorum.org/actaforum/index.php
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 = 20 ; // numero di records da estrarre dalla tabella (alcuni topics potrebbero non aver il permesso di lettura)
$list_view = 10 ; // sostituire il numero della variabile $lista se si desidera diminuire/aumentare il numero dei Topics
function mod_data($data_cor)
{
$data_cor = str_replace("Jan","gen", $data_cor);
$data_cor = str_replace("Feb","feb", $data_cor);
$data_cor = str_replace("Mar","mar", $data_cor);
$data_cor = str_replace("Apr","apr", $data_cor);
$data_cor = str_replace("May","mag", $data_cor);
$data_cor = str_replace("Jun","giu", $data_cor);
$data_cor = str_replace("Jul","lug", $data_cor);
$data_cor = str_replace("Aug","ago", $data_cor);
$data_cor = str_replace("Sep","set", $data_cor);
$data_cor = str_replace("Oct","ott", $data_cor);
$data_cor = str_replace("Nov","nov", $data_cor);
$data_cor = str_replace('Dec','dic', $data_cor);
return $data_cor;
}
//---------- 10 Topics più Recenti 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.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_topic_link[$n1] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row1['forum_id'] . "&t=" . $row1['topic_id']);
$last_topic_title[$n1] = $row1['topic_title'];
$last_topic_title_short[$n1] = $topic_title1;
$last_topic_forum[$n1] = $row1['forum_name'];
$last_topic_author[$n1] = $row1['topic_first_poster_name'];
$last_topic_data[$n1] = date("d M",$row1['topic_time']);
$last_topic_data[$n1] = mod_data($last_topic_data[$n1]);
//$last_topic_data[$n1] = $user->format_date($row1['topic_time'], "|d M|");
++$n1 ;
}else{
break ;
}
}
}
//---------- 10 Topics più Recenti end -----------//
// Il resto dellla mod .......
?>
Tutto il resto non cambia perchè le date nelle altre liste non ci sono.//---------- 10 Topics più Recenti end -----------//
Visitano il forum: Nessuno e 43 ospiti