intendevo, per installare l'estensione va messa dentro alla root, nella cartella ext e bisogna creare la cartella staffit e la cartella toptentopics.brunino ha scritto:...non ho capito bene.... le estensioni hanno una modalità di installazione non cambiabile...ovvero copiare i file dell'estensione nelle corrette directory. non é una cosa che possiamo fare noi, ma che nemmeno faranno probabilmente quelli che sviluppano phpbb...3- non sono un asso nell'installare, ma perché le estensioni non metterle da caricare direttamente dalla root del forum e lasciare a chi crea l'estensione a pensare dove vada inserita? come infondo erano le MOD?? ( ci ho messo mezzo'ora per capire la posizione)
quindi prima di zippare per upparla lo sviluppatore potrebbe creare le altre due cartelle (ext e staffit) le quali si contengono e quindi l'utente deve solo spostare l'estensione scaricata e decompressa nella root.
esatto era questa, ma io avevo la necessita di mettere anche 1 e 3 mesi che non c'erano e ho modificato il codice, spero non sia un problemaMicogian ha scritto:E' vero, in una delle ultime varianti alla Mod avevo inserito la possibilità di scegliere il periodo. http://www.actafungorum.org/actaforum/index.php
Diciamo che era utile più per I Topics più visti che per gli "ultimi", tra i più visti ci poteva essere uno particolarmente datato, in questo caso la scelta del periodo poteva tornare utile.
Questa la parte php:Il template invece è: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 TagliaStringa($stringa, $max_char){ if(strlen($stringa)>$max_char){ $stringa_tagliata=substr($stringa, 0,$max_char); $last_space=strrpos($stringa_tagliata," "); $stringa_ok=substr($stringa_tagliata, 0,$last_space); return $stringa_ok."..."; }else{ return $stringa; } } 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 -----------// //---------- 10 Topics più Visti start -----------// // modifica Mod: inserisce la selezione del periodo di valutazione $data_cor = time() ; // timestamp data corrente $data_6 = ($data_cor - 15811200) ; // timestamp di 182 giorni fa $data_12 = ($data_cor - 31536000) ; // timestamp di 365 giorni fa $data_views = $_POST['sel_views'] ; // opzione selezionata // assegnazione dell'opzione scelta, per default è Tutto if ($data_views == '' || $data_views == '3') { $template->assign_var('TIME_SELECTED', '3'); $data_ini = '0' ; } if ($data_views == '1' ) { $template->assign_var('TIME_SELECTED', '1'); $data_ini = $data_6 ; } if ($data_views == '2') { $template->assign_var('TIME_SELECTED', '2'); $data_ini = $data_12 ; } // fine modifica Modifica periodo di valutazione $sql2 = "SELECT tt.topic_id, tt.forum_id, tt.topic_title, tt.topic_first_poster_name, tt.topic_views,tt.topic_time, ft.forum_id, ft.forum_name FROM " . TOPICS_TABLE . " tt, " . FORUMS_TABLE . " ft WHERE tt.forum_id = ft.forum_id AND tt.topic_time > $data_ini ORDER BY tt.topic_views 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']) > 30) { $topic_title2 = substr($row2['topic_title'],0,28) . "..."; }else{ $topic_title2 = $row2['topic_title']; } $view_topic_link[$n2] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row2['forum_id'] . "&t=" . $row2['topic_id']); $view_topic_title[$n2] = $row2['topic_title']; $view_topic_title_short[$n2] = $topic_title2; $view_topic_forum[$n2] = $row2['forum_name']; $view_topic_author[$n2] = $row2['topic_first_poster_name']; $view_topic_views[$n2] = $row2['topic_views']; ++$n2 ; }else{ break ; } } } //---------- 10 Topics più visti end -----------// //---------- 10 Ultimi posts start -----------// $sql4 = "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_post_subject, tt.topic_last_post_time, 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_last_post_time DESC LIMIT 0,$list_rec"; $result4 = $db->sql_query($sql4); $n4 = 0; while ($row4 = $db->sql_fetchrow($result4)) { if ($auth->acl_get('f_read', $row4['forum_id']) == 1) { if ($n4 < $list_view) { $post_subject = str_replace("Re: ", "", $row4['topic_last_post_subject']) ; if (strlen($post_subject) > 30) { $post_title = substr($post_subject,0,27) . "..."; }else{ $post_title = $post_subject ; } $last_post_link[$n4] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row4['forum_id'] . "&t=" . $row4['topic_id'] . "&p=" . $row4['topic_last_post_id'] . "#p" . $row4['topic_last_post_id']); //$last_post_link[$n4] = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row4['forum_id'] . "&t=" . $row4['topic_id'] . "p#" . $row4['topic_last_post_id']); $last_post_title[$n4] = $row4['topic_last_post_subject']; $last_post_title_short[$n4] = $post_title; $last_post_forum[$n4] = $row4['forum_name']; $last_post_author[$n4] = $row4['topic_last_poster_name']; ++$n4 ; }else{ break ; } } } //---------- 10 Ultimi posts 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_TOPIC_LINK' => $last_topic_link[$x], 'LAST_TOPIC_TITLE' => $last_topic_title[$x], 'LAST_TOPIC_TITLE_SHORT' => $last_topic_title_short[$x], 'LAST_TOPIC_FORUM' => $last_topic_forum[$x], 'LAST_TOPIC_AUTHOR' => $last_topic_author[$x], 'LAST_TOPIC_DATA' => $last_topic_data[$x], 'VIEW_TOPIC_LINK' => $view_topic_link[$x], 'VIEW_TOPIC_TITLE' => $view_topic_title[$x], 'VIEW_TOPIC_TITLE_SHORT' => $view_topic_title_short[$x], 'VIEW_TOPIC_FORUM' => $view_topic_forum[$x], 'VIEW_TOPIC_AUTHOR' => $view_topic_author[$x], 'VIEW_TOPIC_VIEWS' => $view_topic_views[$x], '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' => $last_post_forum[$x], 'LAST_POST_AUTHOR' => $last_post_author[$x] )); }
Consideriamo che questa Mod è stata scritta molto tempo fa, adesso fa un pò sorridere ma per lo meno funziona ancora.Codice: Seleziona tutto
<div class="forabg"> <div class="inner"><span class="corners-top"><span></span></span> <ul class="topiclist"> <li class="header"> <dl class="icon"> <dd style="width: 34%"> Ultimi Topics</dd> <dd style="width: 33%"> <form action="index.php" method="post"> <div> Topics più visti <select style="font: 10px Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; background: #859D90; width: 150px;" name="sel_views" onchange='this.form.submit()'> <!-- IF TIME_SELECTED == '1' --><option value='1' selected="selected"><!-- ELSE --><option value='1'><!-- ENDIF -->ultimi 6 mesi</option> <!-- IF TIME_SELECTED == '2' --><option value='2' selected="selected"><!-- ELSE --><option value='2'><!-- ENDIF -->ultimi 12 mesi</option> <!-- IF TIME_SELECTED == '3' --><option value='3' selected="selected"><!-- ELSE --><option value='3'><!-- ENDIF -->tutto</option> </select> </div> </form> </dd> <dd> Ultimi Posts</dd> </dl> </li> </ul> <ul class="topiclist forums" > <!-- BEGIN topten_list --> <li> <dl> <dd style="width: 34%; padding: 1px">{topten_list.LAST_TOPIC_DATA} <a style="font-weight: bold" href="{topten_list.LAST_TOPIC_LINK}" title="{topten_list.LAST_TOPIC_TITLE} (in: {topten_list.LAST_TOPIC_FORUM})">{topten_list.LAST_TOPIC_TITLE_SHORT}</a> <span style="color: #708090">(di {topten_list.LAST_TOPIC_AUTHOR})</span></dd> <dd style="width: 33%; padding: 1px">{topten_list.VIEW_TOPIC_VIEWS} <a style="font-weight: bold" href="{topten_list.VIEW_TOPIC_LINK}" title="{topten_list.VIEW_TOPIC_TITLE} (in: {topten_list.VIEW_TOPIC_FORUM})">{topten_list.VIEW_TOPIC_TITLE_SHORT}</a> <span style="color: #708090">(di {topten_list.VIEW_TOPIC_AUTHOR})</span></dd> <dd style="padding: 1px"><a style=" font-weight: bold" href="{topten_list.LAST_POST_LINK}" title="{topten_list.LAST_POST_TITLE} (in: {topten_list.LAST_POST_FORUM})">{topten_list.LAST_POST_TITLE_SHORT}</a> <span style="color: #708090">(di {topten_list.LAST_POST_AUTHOR})</span></dd> </dl> </li> <!-- END topten_list --> </ul> <span class="corners-bottom"><span></span></span></div> </div>

altro consiglio:
4-inoltre andrebbe implementata la funzione che se imposto forum non pubblici (visibile solo allo staff) che i topic e messaggi non siano visualizzati