Example #1
0
$comments = unserialize($comments);
$news_fail = 0;
$news_ok = 0;
$page_fail = 0;
$page_ok = 0;
$comments_fail = 0;
$comments_ok = 0;
foreach ($news as $v) {
    $array = array($v->autore, $ocarina->purgeSlashes($ocarina->purgeByXSS($v->titolo)), $v->minititolo, $ocarina->purgeSlashes($ocarina->purgeByXSS($v->news)), $v->categoria, $v->data, $v->ora, 1);
    if (!$ocarina->isCategory('news', $v->categoria)) {
        $ocarina->createCategory('news', $v->categoria);
    }
    if ($ocarina->isNews($v->minititolo)) {
        ++$news_fail;
    } else {
        if ($ocarina->createNews($array)) {
            ++$news_ok;
        } else {
            ++$news_fail;
        }
    }
}
foreach ($page as $v) {
    $array = array($v->autore == '' ? $v->autoreultimamodifica : $v->autore, $ocarina->purgeSlashes($ocarina->purgeByXSS($v->titolo)), $v->minititolo, $ocarina->purgeSlashes($ocarina->purgeByXSS($v->contenuto)), $v->categoria, $v->datacreazione, '00:00', 1);
    if (!$ocarina->isCategory('pagine', $v->categoria)) {
        $ocarina->createCategory('pagine', $v->categoria);
    }
    if ($ocarina->isPage($v->minititolo)) {
        ++$page_fail;
    } else {
        if ($ocarina->createPage($array)) {