Esempio n. 1
0
function clearall()
{
    clearposts();
    cleartags(tcategories::i());
    cleartags(ttags::i());
    clearmenu();
    if (dbversion) {
        $do = tdboptimizer::i();
        $do->optimize();
    }
}
Esempio n. 2
0
    }
}
echo "<pre>\n";
tmigratedata::$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . litepublisher::$domain . DIRECTORY_SEPARATOR;
$data = new tmigratedata();
$linkgen = tlinkgenerator::instance();
$linkgen->archive = '/[year]/[month]/';
$linkgen->save();
clearposts();
cleartags(tcategories::instance());
cleartags(ttags::instance());
clearmenu();
if (dbversion && litepublisher::$options->version == 4.65) {
    $man = tdbmanager::instance();
    $man->alter('comusers', "modify `name` text NOT NULL");
    $man->alter('pingbacks', "modify `title` text NOT NULL");
    litepublisher::$options->version = 4.66;
}
$do = tdboptimizer::instance();
$do->optimize();
migrateoptions();
migrateposts();
migratetags(tcategories::instance());
migratetags(ttags::instance());
migratemenus();
//migratewidgets();
litepublisher::$urlmap->unlock();
litepublisher::$options->savemodified();
litepublisher::$urlmap->clearcache();
//echo  $man->performance();
echo "\nmigrated\n";
function tdownloaditemsUninstall($self)
{
    //die("Warning! You can lost all downloaditems!");
    tposts::unsub($self);
    $adminmenus = tadminmenus::i();
    $adminmenus->deletetree($adminmenus->url2id('/admin/downloaditems/'));
    $menus = tmenus::i();
    $menus->deletetree($menus->class2id('tdownloaditemsmenu'));
    $parser = tthemeparser::i();
    $parser->unbind($self);
    ttheme::clearcache();
    $classes = litepublisher::$classes;
    $classes->lock();
    $classes->delete('tdownloaditem');
    $classes->delete('tdownloaditemsmenu');
    $classes->delete('tdownloaditemeditor');
    $classes->delete('tadmindownloaditems');
    $classes->delete('tdownloaditemcounter');
    $classes->delete('taboutparser');
    $classes->unlock();
    $merger = tlocalmerger::i();
    $merger->deleteplugin(tplugins::getname(__FILE__));
    $manager = tdbmanager::i();
    $manager->deletetable($self->childtable);
    $manager->delete_enum('posts', 'class', 'tdownloaditem');
    $optimizer = tdboptimizer::i();
    $optimizer->lock();
    $optimizer->unbind($self);
    if (false !== ($i = array_search('downloaditems', $optimizer->childtables))) {
        unset($optimizer->childtables[$i]);
    }
    $optimizer->unlock();
    tjsmerger::i()->deletefile('default', '/plugins/downloaditem/downloaditem.min.js');
    litepublisher::$options->delete('downloaditem_themetag');
    litepublisher::$options->delete('downloaditem_plugintag');
    litepublisher::$options->savemodified();
}
function tticketsUninstall($self)
{
    //die("Warning! You can lost all tickets!");
    litepublisher::$classes->lock();
    //if (litepublisher::$debug) litepublisher::$classes->delete('tpostclasses');
    tposts::unsub($self);
    litepublisher::$classes->delete('tticket');
    litepublisher::$classes->delete('tticketeditor');
    litepublisher::$classes->delete('tadmintickets');
    litepublisher::$classes->delete('tadminticketoptions');
    $adminmenus = tadminmenus::i();
    $adminmenus->lock();
    $adminmenus->deletetree($adminmenus->url2id('/admin/tickets/'));
    $adminmenus->unbind($self);
    $adminmenus->unlock();
    /*
    $menus = tmenus::i();
    $menus->lock();
    foreach (array('bug', 'feature', 'support', 'task') as $type) {
      $menus->deleteurl("/$type/");
    }
    $menus->deleteurl('/tickets/');
    $menus->unlock();
    
    litepublisher::$classes->delete('tticketsmenu');
    */
    litepublisher::$classes->unlock();
    $manager = tdbmanager::i();
    $manager->deletetable($self->childtable);
    $manager->delete_enum('posts', 'class', 'tticket');
    $optimizer = tdboptimizer::i();
    $optimizer->lock();
    $optimizer->unbind($self);
    if (false !== ($i = array_search('tickets', $optimizer->childtables))) {
        unset($optimizer->childtables[$i]);
    }
    $optimizer->unlock();
    tlocalmerger::i()->deleteplugin(tplugins::getname(__FILE__));
}