<?php /** /ricerca.php (C) Giovanni Capuano 2011 */ require_once 'core/class.Ocarina.php'; $ocarina = new Ocarina(); $cercaNews = isset($_GET['news']) ? $ocarina->purge($_GET['news']) : ''; $cercaPagine = isset($_GET['pagine']) ? $ocarina->purge($_GET['pagine']) : ''; $cercaCommenti = isset($_GET['commenti']) ? $ocarina->purge($_GET['commenti']) : ''; $cerca = true; $ocarina->skin = $ocarina->isLogged() ? $ocarina->username[0]->skin : $ocarina->config[0]->skin; $ocarina->addValue('titolo', $ocarina->getLanguage('title', 9) . $ocarina->getLanguage('title', 2) . $ocarina->config[0]->nomesito); $ocarina->addValue('description', $ocarina->getLanguage('description', 9)); if ($cercaNews !== '') { !($search = $ocarina->searchNews($cercaNews)) ? $ocarina->addValue('error_news', $ocarina->getLanguage('search', 0)) : $ocarina->addValue('news', $search); $cerca = false; } elseif ($cercaPagine !== '') { !($search = $ocarina->searchPage($cercaPagine, 'wildcard')) ? $ocarina->addValue('error_page', $ocarina->getLanguage('search', 1)) : $ocarina->addValue('pagina', $search); $cerca = false; } elseif ($cercaCommenti !== '') { !($search = $ocarina->searchComment($cercaCommenti)) ? $ocarina->addValue('error_comment', $ocarina->getLanguage('search', 2)) : $ocarina->addValue('commento', $search); $cerca = false; } $ocarina->addValue('cerca', $cerca); $ocarina->isLogged() && $ocarina->username[0]->grado == 7 ? $ocarina->renderize('bannato.tpl') : $ocarina->renderize('ricerca.tpl');
$selected = isset($_POST['selected']) && $_POST['selected'] !== '' ? $ocarina->purgeSlashes($ocarina->purgeByXSS($_POST['selected'])) : ''; $submit = isset($_POST['submit']) ? true : false; $ocarina->skin = 'admin'; $ocarina->addValue('titolo', $ocarina->getLanguage('title', 23) . $ocarina->getLanguage('title', 2) . $ocarina->getLanguage('title', 10) . $ocarina->getLanguage('title', 2) . $ocarina->config[0]->nomesito); if ($ocarina->isLogged() && $ocarina->username[0]->grado < 4) { if (!$submit && $selected == '') { $result = '<form action="" method="post">' . $ocarina->getLanguage('editpage', 0) . '<select name="selected">'; if ($ocarina->username[0]->grado == 3) { $pageByUser = $ocarina->searchPageByUser($ocarina->username[0]->nickname); if ($pageByUser !== false) { foreach ($pageByUser as $v) { $result .= '<option value="' . $v->minititolo . '">' . $v->titolo . '</option>'; } } } elseif ($ocarina->username[0]->grado < 3) { $allPage = $ocarina->searchPage('', 'wildcard'); if ($allPage !== false) { foreach ($allPage as $v) { $result .= '<option value="' . $v->minititolo . '">' . $v->titolo . '</option>'; } } } $result .= '</select><input type="submit" name="sel_submit" value="' . $ocarina->getLanguage('title', 23) . '" /></form>'; $ocarina->addValue('result', $result); } elseif (!$submit && $selected !== '') { $ocarina->addValue('categorie', $ocarina->getCategory('pagine')); if ($this_pagina = $ocarina->getPage($selected)) { $ocarina->addValue('titolo_default', $this_pagina[0]->titolo); $ocarina->addValue('categoria', $this_pagina[0]->categoria); $ocarina->addValue('testo', $this_pagina[0]->contenuto); } else {
<?php /** /admin/cancellapagina.php (C) Giovanni Capuano 2011 */ require_once '../core/class.Ocarina.php'; $ocarina = new Ocarina(); $minititolo_pagina = isset($_POST['content']) && $_POST['content'] !== '' ? $ocarina->purge($_POST['content']) : ''; $submit = isset($_POST['submit']) ? true : false; $ocarina->skin = 'admin'; $ocarina->addValue('titolo', $ocarina->getLanguage('title', 13) . $ocarina->getLanguage('title', 2) . $ocarina->getLanguage('title', 10) . $ocarina->getLanguage('title', 2) . $ocarina->config[0]->nomesito); if ($ocarina->isLogged() && $ocarina->username[0]->grado < 3) { if (!$submit) { $ocarina->addValue('content', $ocarina->searchPage('', 'wildcard')); } else { if ($minititolo_pagina !== '') { if ($ocarina->deletePage($minititolo_pagina)) { $ocarina->addValue('result', $ocarina->getLanguage('deletepage', 0)); if ($ocarina->config[0]->log == 1) { $ocarina->log($ocarina->username[0]->nickname, 'Page \'' . $minititolo_pagina . '\' deleted.'); } } else { $ocarina->addValue('result', $ocarina->getLanguage('deletepage', 1)); if ($ocarina->config[0]->log == 1) { $ocarina->log($ocarina->username[0]->nickname, 'Page \'' . $minititolo_pagina . '\' deletion failed.'); } } } else { $ocarina->addValue('result', $ocarina->getLanguage('deletepage', 2)); if ($ocarina->config[0]->log == 1) {
<?php /** /archivio.php (C) Giovanni Capuano 2011 */ require_once 'core/class.Ocarina.php'; $ocarina = new Ocarina(); $ocarina->skin = $ocarina->isLogged() ? $ocarina->username[0]->skin : $ocarina->config[0]->skin; $ocarina->addValue('titolo', 'Archivio » ' . $ocarina->config[0]->nomesito); $ocarina->addValue('description', $ocarina->getLanguage('description', 0)); !($getNews = $ocarina->searchNews('')) ? $ocarina->addValue('error_news', $ocarina->getLanguage('error', 0)) : $ocarina->addValue('news', $getNews); !($getPage = $ocarina->searchPage('', 'wildcard')) ? $ocarina->addValue('error_page', $ocarina->getLanguage('error', 0)) : $ocarina->addValue('pagine', $getPage); $ocarina->isLogged() && $ocarina->username[0]->grado == 7 ? $ocarina->renderize('bannato.tpl') : $ocarina->renderize('archivio.tpl');