function pluginSettingGroupUninstall($pluginid) { global $db; $result = $db->query("SELECT id, name FROM {$db->pre}settings_groups WHERE name = 'module_{$pluginid}' LIMIT 1"); $row = $db->fetch_assoc($result); $c = new manageconfig(); $c->getdata(); $result = $db->query("SELECT name FROM {$db->pre}settings WHERE sgroup = '{$row['id']}'"); while ($row2 = $db->fetch_assoc($result)) { $c->delete(array($row['name'], $row2['name'])); } $c->savedata(); $db->query("DELETE FROM {$db->pre}settings WHERE sgroup = '{$row['id']}'", __LINE__, __FILE__); $db->query("DELETE FROM {$db->pre}settings_groups WHERE id = '{$row['id']}'", __LINE__, __FILE__); }
function updateLanguageFiles($ini) { $c = new manageconfig(); $codes = array(); $keys = array('language', 'language_de'); $codes = getLangCodesByKeys($keys); $langcodes = getLangCodes(); foreach ($langcodes as $code => $lid) { $ldat = explode('_', $code); if (isset($codes[$ldat[0]])) { $count = count($codes[$ldat[0]]); if (in_array('', $codes[$ldat[0]])) { $count--; } } else { $count = -1; } if (isset($codes[$ldat[0]]) && !empty($ldat[1]) && in_array($ldat[1], $codes[$ldat[0]])) { // Nehme Original $src = 'language_' . $code; } elseif (isset($codes[$ldat[0]]) && in_array('', $codes[$ldat[0]])) { // Nehme gleichen Langcode, aber ohne Countrycode $src = 'language_' . $ldat[0]; } elseif (isset($codes[$ldat[0]]) && $count > 0) { // Nehme gleichen Langcode, aber falchen Countrycode $src = 'language_' . $ldat[0] . '_' . reset($codes[$ldat[0]]); } else { // Nehme Standard $src = 'language'; } foreach ($ini as $file => $data) { if (!isset($data[$src])) { continue; } $c->getdata("language/{$lid}/{$file}.lng.php", 'lang'); foreach ($data[$src] as $varname => $text) { if ($text === null) { $c->delete($varname); } else { $c->updateconfig($varname, str, $text); } } $c->savedata(); } } }
&package=<?php echo IMPTYPE_PACKAGE; ?> "><?php echo $lang->phrase('admin_packages_browser_details'); ?> </a> </td> </tr> <?php } ?> </table> <?php $c = new manageconfig(); $c->getdata('admin/data/config.inc.php', 'admconfig'); $c->updateconfig('checked_package_updates', int, 1); $c->savedata(); echo foot(); } } elseif ($job == 'browser') { $pb = $scache->load('package_browser'); $types = $pb->types(); $type = $gpc->get('type', int, IMPTYPE_PACKAGE); $cats = $pb->categories($type); if (count($cats) > 0) { // Calculate random entry unset($cat); $i = 0; do { $keys = array_keys($cats);
// Delete templates $designObj = $scache->load('loaddesign'); $designs = $designObj->get(true); foreach ($designs as $row) { $tpldir = "templates/{$row['template']}/modules/{$id}/"; if (file_exists($tpldir)) { rmdirr($tpldir); } } // Delete phrases if (isset($ini['language']) && count($ini['language']) > 0) { $result = $db->query('SELECT * FROM ' . $db->pre . 'language', __LINE__, __FILE__); while ($row = $db->fetch_assoc($result)) { $path = "language/{$row['id']}/modules.lng.php"; if (file_exists($path)) { $c->getdata($path, 'lang'); foreach ($ini['language'] as $phrase => $value) { $c->delete($phrase); } $c->savedata(); } } } // Delete modules if (file_exists($dir)) { rmdirr($dir); } if ($confirm) { echo head(); ok('admin.php?action=cms&job=plugins&sort=1', 'Package successfully deleted!'); }
} ?> <tr> <td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php echo $lang->phrase('admin_lang_form_save'); ?> " /></td> </tr> </table> </form> <?php echo foot(); } elseif ($job == 'phrase_add2') { echo head(); $varname = $gpc->get('varname', none); $text = $gpc->get('text', none); $file = base64_decode($gpc->get('file', none)); $language = $gpc->get('langt', none); $c = new manageconfig(); foreach ($language as $id => $t) { if (empty($t)) { $t = $text; } $c->getdata("language/{$id}/{$file}", 'lang'); $c->updateconfig($varname, str, $t); $c->savedata(); } ok('admin.php?action=language&job=phrase_file&file=' . urlencode(base64_encode($file))); } else { viscacha_header('Location: admin.php?action=language&job=manage'); }
$config['dbpw'] = trim($_REQUEST['dbpw']); } if (isset($_REQUEST['database'])) { $config['database'] = trim($_REQUEST['database']); } if (isset($_REQUEST['pconnect'])) { $config['pconnect'] = $_REQUEST['pconnect']; } if (isset($_REQUEST['dbprefix'])) { $config['dbprefix'] = trim($_REQUEST['dbprefix']); } if (isset($_REQUEST['dbsystem'])) { $config['dbsystem'] = $_REQUEST['dbsystem']; } $c = new manageconfig(); $c->getdata('../data/config.inc.php'); $c->updateconfig('host', str); $c->updateconfig('dbuser', str); $c->updateconfig('dbpw', str); $c->updateconfig('database', str); $c->updateconfig('pconnect', int); $c->updateconfig('dbprefix', str); $c->updateconfig('dbsystem', str); $c->savedata(); ?> <div class="bfoot center">Database Settings saved!</div> <?php } require '../data/config.inc.php'; require_once '../classes/database/' . $config['dbsystem'] . '.inc.php'; $db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], false, $config['dbprefix']);
$glob = array(); $glob['board_rules'] = 'Forum Rules'; $glob['editprofile_pic_delete'] = 'Delete Avatar'; $glob['forum_is_read_only'] = 'Sorry, but you are not allowed to write a post in this forum, because this forum is read only.'; $glob['no_board_rules_specified'] = 'No forum rules specified!'; $glob['no_existing_notices'] = 'You did not store any notes!'; $glob['showtopic_options_abo_remove'] = 'Unsubscribe from this topic'; $glob['subscribed_successfully'] = 'You successfully subscribed to this topic.'; $glob['unsubscribed_successfully'] = 'You successfully unsubscribed from this topic.'; $glob['upload_error_default'] = 'An unknown error occured while uploading.'; $glob['showtopic_prefix_title'] = '[{$prefix}] '; $glob['upload_error_fileexists'] = 'File already exists.'; $glob['upload_error_maximagesize'] = 'Max. imagesize reached. Image is not allowed to be greater than {$miw} x {$mih}.'; $glob['upload_error_noaccess'] = 'Access denied. Could not copy file.'; foreach ($lngids as $lid) { $c->getdata('../language/' . $lid . '/global.lng.php', 'lang'); foreach ($glob as $key => $val) { $c->updateconfig($key, str, $val); } $c->savedata(); $c->getdata('../language/' . $lid . '/wwo.lng.php', 'lang'); foreach ($wwo as $key => $val) { $c->updateconfig($key, str, $val); } $c->savedata(); } // templates $file = '../templates/editor/rte.css'; $edit = file_get_contents($file); $edit = preg_replace("~(.rteBk tbody tr td, .rteBk tr td {[\r\n]+)~i", "\\1\tborder-width: 0px;\r\n", $edit); $filesystem->chmod($file, 0666);
</tr> </table> <?php } ?> <?php echo foot(); } elseif ($job == 'design_default') { echo head(); $id = $gpc->get('id', int); $result = $db->query("SELECT publicuse FROM {$db->pre}designs WHERE id = '{$id}' LIMIT 1"); $info = $db->fetch_assoc($result); if ($info['publicuse'] == 1) { include 'classes/class.phpconfig.php'; $c = new manageconfig(); $c->getdata(); $c->updateconfig('templatedir', int, $id); $c->savedata(); $delobj = $scache->load('loaddesign'); $delobj->delete(); ok('admin.php?action=designs&job=design'); } else { error('admin.php?action=designs&job=design', $lang->phrase('admin_design_set_design_as_default_error')); } } elseif ($job == 'design_edit') { $id = $gpc->get('id', int); $result = $db->query("SELECT * FROM {$db->pre}designs WHERE id = '{$id}' LIMIT 1"); $info = $db->fetch_assoc($result); $dir = "templates/"; $templates = array(); $d = dir($dir);
} if (isset($codes[$ldat[0]]) && !empty($ldat[1]) && in_array($ldat[1], $codes[$ldat[0]])) { // Nehme Original $src = 'language_' . $code; } elseif (isset($codes[$ldat[0]]) && in_array('', $codes[$ldat[0]])) { // Nehme gleichen Langcode, aber ohne Countrycode $src = 'language_' . $ldat[0]; } elseif (isset($codes[$ldat[0]]) && $count > 0) { // Nehme gleichen Langcode, aber falchen Countrycode $src = 'language_' . $ldat[0] . '_' . reset($codes[$ldat[0]]); } else { // Nehme Standard $src = 'language'; } foreach ($ini as $file => $data) { $c->getdata("../language/{$lid}/{$file}.lng.php", 'lang'); foreach ($data[$src] as $varname => $text) { if ($text === null) { $c->delete($varname); } else { $c->updateconfig($varname, str, $text); } } $c->savedata(); } } echo "- Language files updated.<br />"; // Set incompatible packages inactive setPackagesInactive(); echo "- Incompatible Packages set as 'inactive'.<br />"; // Refresh Cache
</table> </form> <?php echo foot(); } elseif ($job == 'phrase_add2') { echo head(); $source_id = $gpc->get('id', int); $file = $gpc->get('file', path); $varname = $gpc->get('varname', none); $text = $gpc->get('text', none); $language = $gpc->get('langt', arr_none); $c = new manageconfig(); foreach ($language as $id => $t) { $c->getdata("language/{$id}/{$file}.lng.php", 'lang'); $c->updateconfig($varname, str, iif(empty($t), $text, $t)); $c->savedata(); } if ($file == 'javascript') { $delobj = $scache->load('loadlanguage'); $delobj->delete(); } if (is_id($source_id)) ok('admin.php?action=language&job=lang_array&id='.$source_id.'&file='.$file); else ok('admin.php?action=language&job=phrase_add&file='.$file); } else {