示例#1
0
// Poichè i processi di prima finivano con un exit, se siamo qui è solo perchè siamo loggati
$codice = $_COOKIE[$func->cookie()];
// Mi connetto al database
$db->connettidb();
$text = '
<form method="post" action="">
Titolo:<br /><input name="titolo" type="text" size="30"><br />
Categoria:<br /><select name="categoria">';
// Creo una select con tutte le categorie
$result = $db->query("SHOW COLUMNS FROM news LIKE 'categoria'");
// Conto i risultati
$righe = $db->conta($result);
for ($i = 0; $i < $righe; $i++) {
    $row = mysql_fetch_row($result);
    $options = explode("','", preg_replace("/(enum|set)\\('(.+?)'\\)/", "\\2", $row[1]));
    $num = count($options);
    for ($g = 0; $g < $num; $g++) {
        $text .= '<option value="' . $func->rescape($options[$g]) . '">' . $func->rescape($options[$g]) . '</option>';
    }
}
// Mi disconnetto dal database
$db->disconnettidb();
$text .= '</select><br />News<br />' . $func->textareabbcode('news', '') . '<br /><input name="creanews" type="submit" value="Invia"></form>';
$smarty->assign("titolo", "Crea news");
$smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
$smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
$smarty->assign("contents", $text);
$smarty->assign("url_cms", $cms->url_cms());
$smarty->assign("url_smartytpl", $cms->url_smartytpl());
$smarty->assign("cmsversion", $cms->cmsversion());
$smarty->display("admin/index/index.tpl");
示例#2
0
}
$text = '
<form method="post" action="">
Titolo:<br /><input name="newtitolo" type="text" size="30" value="' . $titolo . '"><br />
Categoria:<br /><select name="newcategoria">';
// Creo una select con tutte le categorie
$result = $db->query("SHOW COLUMNS FROM news LIKE 'categoria'");
// Conto i risultati
$righe = $db->conta($result);
for ($i = 0; $i < $righe; $i++) {
    $row = mysql_fetch_row($result);
    $options = explode("','", preg_replace("/(enum|set)\\('(.+?)'\\)/", "\\2", $row[1]));
    $num = count($options);
    for ($g = 0; $g < $num; $g++) {
        if ($categoria == $options[$g]) {
            $text .= '<option value="' . $func->rescape($options[$g]) . '" SELECTED>' . $func->rescape($options[$g]) . '</option>';
        }
        $text .= '<option value="' . $func->rescape($options[$g]) . '" ' . $selected . '>' . $func->rescape($options[$g]) . '</option>';
    }
}
// Mi disconnetto dal database
$db->disconnettidb();
$text .= '</select><br />News<br />' . $func->textareabbcode('newnews', $news) . '<br /><input type="hidden" name="minititolo" value="' . $func->escape($_POST['minititolo']) . '"><input name="modificanews" type="submit" value="Modifica"></form>';
$smarty->assign("titolo", "Modifica news");
$smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
$smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
$smarty->assign("contents", $text);
$smarty->assign("url_cms", $cms->url_cms());
$smarty->assign("url_smartytpl", $cms->url_smartytpl());
$smarty->assign("cmsversion", $cms->cmsversion());
$smarty->display("admin/index/index.tpl");
        $smarty->display("admin/index/index.tpl");
        exit;
    }
    // Altrimenti invio la news al database
    $query2 = $db->query("INSERT INTO annunci (autore, titolo, annuncio, data, ora) VALUES ('{$autore}', '{$titolo}', '{$annuncio}', '{$data}', '{$ora}')");
    // Mi disconnessione dal database
    $db->disconnettidb();
    // Mando l' avviso
    $text = 'L\' annuncio è stato creato.';
    $smarty->assign("titolo", "Crea annuncio");
    $smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
    $smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
    $smarty->assign("contents", $text);
    $smarty->assign("url_cms", $cms->url_cms());
    $smarty->assign("url_smartytpl", $cms->url_smartytpl());
    $smarty->assign("cmsversion", $cms->cmsversion());
    $smarty->display("admin/index/index.tpl");
}
// Poichè i processi di prima finivano con un exit, se siamo qui è solo perchè siamo loggati
$text = 'Creando un annuncio potrai pubblicarlo nell\'area dedicata di Ocarina così che sia alla vista di tutti coloro che hanno il permesso di accederci.<br /><br />
<form method="post" action="">
Titolo:<br /><input name="titolo" type="text" size="30"><br />
Annuncio:<br />' . $func->textareabbcode('annuncio', '') . '<br /><input name="creaannuncio" type="submit" value="Invia"></form>';
$smarty->assign("titolo", "Crea annuncio");
$smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
$smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
$smarty->assign("contents", $text);
$smarty->assign("url_cms", $cms->url_cms());
$smarty->assign("url_smartytpl", $cms->url_smartytpl());
$smarty->assign("cmsversion", $cms->cmsversion());
$smarty->display("admin/index/index.tpl");
$text = '
<form method="post" action="">
Titolo:<br /><input name="newtitolo" type="text" size="30" value="' . $titolo . '"><br />
Minititolo:<br /><input name="newminititolo" type="text" size="30" value="' . $minititolo . '"><br />
Categoria:<br /><select name="newcategoria">';
// Creo una select con tutte le categorie
$result = $db->query("SHOW COLUMNS FROM pagine LIKE 'categoria'");
// Conto i risultati
$righe = $db->conta($result);
for ($i = 0; $i < $righe; $i++) {
    $row = mysql_fetch_row($result);
    $options = explode("','", preg_replace("/(enum|set)\\('(.+?)'\\)/", "\\2", $row[1]));
    $num = count($options);
    for ($g = 0; $g < $num; $g++) {
        if ($categoria == $options[$g]) {
            $text .= '<option value="' . $func->rescape($options[$g]) . '" SELECTED>' . $func->rescape($options[$g]) . '</option>';
        }
        $text .= '<option value="' . $func->rescape($options[$g]) . '" ' . $selected . '>' . $func->rescape($options[$g]) . '</option>';
    }
}
// Mi disconnetto dal database
$db->disconnettidb();
$text .= '</select><br />Sezione<br />' . $func->textareabbcode('newcontenuto', $contenuto) . '<br /><input type="hidden" name="minititolo" value="' . $minititolo . '"><input name="modificasezione" type="submit" value="Modifica"></form>';
$smarty->assign("titolo", "Modifica sezione");
$smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
$smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
$smarty->assign("contents", $text);
$smarty->assign("url_cms", $cms->url_cms());
$smarty->assign("url_smartytpl", $cms->url_smartytpl());
$smarty->assign("cmsversion", $cms->cmsversion());
$smarty->display("admin/index/index.tpl");
$query3 = $db->query("SELECT * FROM commenti WHERE titolo='{$minititolo}'");
// Creo una tabella con i commenti e gli id
$text = '<div align="center"><table border="1">
<tr>
<td><b>Id</b></td>
<td><b>Autore</b></td>
<td><b>Commento</b></td>';
while (($riga = $db->estrai($query)) && ($riga2 = $db->estrai($query2)) && ($riga3 = $db->estrai($query3))) {
    $text .= '<tr>';
    $text .= '<td>' . $func->rescape($riga->id) . '</td>';
    $text .= '<td>' . $func->rescape($riga2->autore) . '</td>';
    $text .= '<td>' . $func->rescape($riga2->testo) . '</td>';
    $text .= '</tr>';
}
$text .= '</table></div><br /><br />';
// Mi disconnetto dal database
$db->disconnettidb();
// Creo il form dove cancellare il commento dando l' id
$text .= '<form method="post" action="">
Scrivi l\'id relativo alla news che vuoi modificare<br /><input name="id" type="text"><br />
Nuovo commento<br /> ' . $func->textareabbcode('newcommento', '') . '<br />
<input name="modificaid" type="submit" value="Modifica">
</form>';
$smarty->assign("titolo", "Modifica commento");
$smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
$smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
$smarty->assign("contents", $text);
$smarty->assign("url_cms", $cms->url_cms());
$smarty->assign("url_smartytpl", $cms->url_smartytpl());
$smarty->assign("cmsversion", $cms->cmsversion());
$smarty->display("admin/index/index.tpl");
$codice = $_COOKIE[$func->cookie()];
// Mi connetto al database
$db->connettidb();
$text = '
<form method="post" action="">
Titolo:<br /><input name="titolo" type="text" size="30"><br />
Minititolo:<br /><input name="minititolo" type="text" size="30"><br />
Categoria:<br /><select name="categoria">';
// Creo una select con tutte le categorie
$result = $db->query("SHOW COLUMNS FROM pagine LIKE 'categoria'");
// Conto i risultati
$righe = $db->conta($result);
for ($i = 0; $i < $righe; $i++) {
    $row = mysql_fetch_row($result);
    $options = explode("','", preg_replace("/(enum|set)\\('(.+?)'\\)/", "\\2", $row[1]));
    $num = count($options);
    for ($g = 0; $g < $num; $g++) {
        $text .= '<option value="' . $func->rescape($options[$g]) . '">' . $func->rescape($options[$g]) . '</option>';
    }
}
// Mi disconnetto dal database
$db->disconnettidb();
$text .= '</select><br />Sezione<br />' . $func->textareabbcode('contenuto', '') . '<br /><input name="creasezione" type="submit" value="Invia"></form>';
$smarty->assign("titolo", "Crea sezione");
$smarty->assign("cookie", $db->auth($_COOKIE[$func->cookie()]));
$smarty->assign("grado", $db->grado($_COOKIE[$func->cookie()]));
$smarty->assign("contents", $text);
$smarty->assign("url_cms", $cms->url_cms());
$smarty->assign("url_smartytpl", $cms->url_smartytpl());
$smarty->assign("cmsversion", $cms->cmsversion());
$smarty->display("admin/index/index.tpl");