function bbcode_install() { $bbcode_tags = get_bbcode_tags('available'); foreach ($bbcode_tags as $tag) { insert_into_config('bbcode_control_tag_' . $tag . '_show', '1'); insert_into_config('bbcode_control_tag_' . $tag . '_process', '1'); } insert_into_config('bbcode_control_tag_img_localhost_only', '0'); insert_into_config('bbcode_control_tag_img_max_width', '0'); insert_into_config('bbcode_control_tag_img_max_height', '0'); return true; }
cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); } pageheader("BBCode Control - " . $lang_gallery_admin_menu['admin_lnk']); $superCage = Inspekt::makeSuperCage(); global $lang_common; // language detection $lang = isset($CONFIG['lang']) ? $CONFIG['lang'] : 'english'; include 'plugins/bbcode_control/lang/english.php'; if (in_array($lang, $enabled_languages_array) == TRUE && file_exists('plugins/bbcode_control/lang/' . $lang . '.php')) { include 'plugins/bbcode_control/lang/' . $lang . '.php'; } // add recently added BBCodes to database $bbcode_tags = get_bbcode_tags('available'); foreach ($bbcode_tags as $tag) { insert_into_config('bbcode_control_tag_' . $tag . '_show', '1'); insert_into_config('bbcode_control_tag_' . $tag . '_process', '1'); } if ($superCage->post->keyExists('submit')) { if (!checkFormToken()) { global $lang_errors; cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } foreach ($bbcode_tags as $tag) { if ($superCage->post->keyExists('show_' . $tag)) { cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getInt('show_' . $tag) . "' WHERE name = 'bbcode_control_tag_{$tag}_show'"); } cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getInt('process_' . $tag) . "' WHERE name = 'bbcode_control_tag_{$tag}_process'"); } if (is_numeric($superCage->post->getInt('limit_image_width'))) { if ($superCage->post->getInt('limit_image_width') >= 0) { cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getInt('limit_image_width') . "' WHERE name = 'bbcode_control_tag_img_max_width'");