예제 #1
0
if (!class_exists('titania_type_translation')) {
    require TITANIA_ROOT . 'includes/types/translation.php';
}
// Give founders access to run this
if (phpbb::$user->data['user_type'] != USER_FOUNDER) {
    titania::needs_auth();
}
// Hopefully this helps
@set_time_limit(0);
// Delete all translations
$contrib = new titania_contribution();
$sql = 'SELECT * FROM ' . TITANIA_CONTRIBS_TABLE . ' WHERE contrib_type = ' . TITANIA_TYPE_TRANSLATION;
$result = phpbb::$db->sql_query($sql);
while ($row = phpbb::$db->sql_fetchrow($result)) {
    $contrib->__set_array($row);
    $contrib->delete();
}
phpbb::$db->sql_freeresult($result);
// All the language packs we'll need, we wont transfer inactive ones, they need to be cleaned up anyways
$sql = 'SELECT * FROM lang_packs WHERE display > 0 AND version = 3';
$result = $db->sql_query($sql);
// All the authors we'll need
$sql2 = 'SELECT * FROM lang_packs_authors WHERE lang_id IN ( SELECT lang_id FROM lang_packs WHERE display > 0 ) ';
$authors = $db->sql_fetchrowset($db->sql_query($sql2));
$i = 0;
while ($row = $db->sql_fetchrow($result)) {
    $permalink = titania_url::url_slug($row['english_name']);
    $conflict = $cnt = false;
    do {
        $permalink_test = $cnt !== false ? $permalink . '_' . $cnt : $permalink;
        $sql = 'SELECT contrib_id FROM ' . TITANIA_CONTRIBS_TABLE . '