Non Risolta
Menu
Ciao a tutti!
voelvo chiedere se per caso esiste un modulo che permette una discreta personalizzazione magari anche con aggiunta di icone del menu!
Grazie
Simplenews
Utilizzo simplenews con il relativo bloccoper far iscrivere gli utenti, vorrei anche fare in modo che una volta iscritto il blocco sparisse e non fosse visualizzato dagli utenti iscritti alla newsletter.
Qualcuno sa come fare, lo ha già fatto o può consigliarmi qualcosa??
Grazie mille!!
Liquid VS Freelinking
Ciao a tutti!
Quale modulo è meglio, secondo voi, tra Liquid e Freelinking??
Entrambi servono ad aggiungere funzionalità wiki a drupal..
Io ho provato entrambi i moduli e non vedo grosse differenze, però magari sono sfuggite a me e un occhio più esperto le conosce...
Aspetto le vostre risposte,
ciao!
Attilio
Splash Screen
Ciao a tutti! Mi è sorto un piccolo problema: sto lavorando a un sito in cui, prima della homepage di Drupal (la solita index.php), dovrebbe comparire uno splash screen introduttivo in flash.
Pensavo fosse sufficiente mettere lo splash screen su un file index.html, in modo che, come succede di solito, all'avvio del sito la preferenza ricadesse su quest'ultimo.
Il ragionamento, di per sè, fila. Infatti, se uso Firefox come browser, tutto funziona perfettamente.
Il problema nasce se uso Explorer: in questo caso, infatti, la prima pagina che viene letta è index.php e non index.html... e il mio splash screen, quindi, non viene visualizzato!
creazione modulo
Ho creato il mio primo modulo con l'aiuto del manuale in inglese con drupal 4.7.
Il nodo è tipo quello che c'è in questo sito per il forum che visualizza gli ultimi argomenti.
Ecco il modulo da me creato visualizza i nodi creati l'ultima settimana.
crea un blocco come quello che c'è qui sulla sinistra e se clicco su i vari link mi mostra i nodi nel content.
Funziona correttamente l'unica cosa è che se clicco su leggi tutto non mi trova il nodo.
Praticamente la pagina 'q=lastweekposts' non esiste.
come mai? non riesco a capirlo.
ho anche controllato le differenze tra 4.6 e 4.7 ma non trovo l'errore
vi passo il codice cosi capite meglio e potete capire dove sbaglio.
function lastweekposts_help($section='')
{
$output = '';
switch ($section)
{
case "admin/modules#description":
$output = t("Mostra i link dei nodi creati l'ultima settimana'");
break;
case "admin/help#lastweekposts":
$output = t("ora ti spiego:questo modulo mostra i link creati da te o da altri l'ultima settimana");
break;
}
return $output;
}
function lastweekposts_perm()
{
return array('acces content','acceslastweekposts','admister lastweekposts');
}
function lastweekposts_menu()
{
$item = array();
$item[] = array('path' => 'lastweekposts',
'title' => t('lastweekposts'),
'callback' => '_lastweekposts_all',
'acces' => user_access('access content'),'type' => MENU_CALLBACK);
return $items;
}
function lastweekposts_block($op='list',$delta=0) {
if ($op=="list") {
$blocks[0]["info"] = t('Last Week Posts');
return $blocks;
} else if ($op=="view" && user_access('access lastweekposts')) {
switch ($delta) {
case 0 :
$block['subject'] = 'Last Week Posts';
$block['content'] = _lastweekposts_block_content();
break;
}
return $block;
}
}
function _lastweekposts_block_content() {
$block_content = '';
// Get today's date
$today = getdate();
// calculate midnight one week ago
$start_time = mktime(0, 0, 0,$today['mon'],($today['mday'] - 7), $today['year']);
// we want items that occur only during the last week, so calculate 7 days
$end_time = $start_time + 604800;
// 60 * 60 * 24 * 7= 604800 seconds in a week
$limitnum = variable_get("lastweekposts_maxdisp", 5);
$query = "SELECT nid, title, created FROM " . "{node} WHERE created >= '" . $start_time ."' AND created <= '". $end_time . "' LIMIT " . $limitnum;
// get the links
$queryResult = db_query($query);
while ($links = db_fetch_object($queryResult)) {
$block_content .= l($links->title, 'node/'.$links->nid) .'
';
}
// add in our block a 'more' link that displays the page with all the links
$block_content .= "
".l(t("more"), "lastweekposts", array("title" => t("More posts.")))."
";
// check to see if there was any content before setting up the block
if ($block_content == '') {
// no content from a week ago, return nothing.
return;
} else {
return $block_content;
}
}
function lastweekposts_settings() {
// only administrators can access this module
if (!user_access("admin lastweekposts")) {
return message_access();
}
$form['lastweekposts_maxdisp'] = array('#type'=>'textfield',
'#title'=>t('Maximum number of links'),
'#default_value'=>variable_get("lastweekposts_maxdisp", "5"),
'#description' => t("The maximum number of links to display in the block."),
'#maxlength'=>2,
'#size'=>2
);
return $form;
}
function _lastweekposts_all(){
// content variable that will be returned for display
$page_content = '';
// Get today's date
$today = getdate();
// calculate midnight one week ago
$start_time = mktime(0, 0, 0, $today['mon'], ($today['mday'] - 7), $today['year']);
// we want items that occur only on the day in question,
// so calculate 1 day
$end_time = $start_time + 86400;
// 60 * 60 * 24 = 86400 seconds in a day
$query = "SELECT nid, title, created FROM " .
"{node} WHERE created >= '" . $start_time .
"' AND created <= '". $end_time . "'";
// get the links (no range limit here)
$queryResult = db_query($query);
while ($links = db_fetch_object($queryResult)) {
$page_content .= l($links->title, 'node/'.$links->nid).'
