From 28356b59becd625d13005b914f92ec1c69fd4616 Mon Sep 17 00:00:00 2001 From: Phyks Date: Sun, 8 Dec 2013 00:44:49 +0100 Subject: [PATCH] Bug corrections : * No more useless " in default constants file * Moved the content of the plugin to the repo root --- adblock.plugin.disabled.php | 8 ++++---- install.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/adblock.plugin.disabled.php b/adblock.plugin.disabled.php index 8f7ce4a..32f4624 100755 --- a/adblock.plugin.disabled.php +++ b/adblock.plugin.disabled.php @@ -26,7 +26,7 @@ function adblock_plugin_treat_events(&$events) { $configurationManager = new Configuration(); $partial = $configurationManager->get('articleView') == "partial"; - $adblock_constants = file_get_contents("plugins/adblock/adblock_constants.php"); + $adblock_constants = file_get_contents("adblock_constants.php"); $adblock_constants = explode("\n", $adblock_constants); $adblock_params = array(); @@ -148,7 +148,7 @@ function adblock_plugin_setting_link(&$myUser) { } function adblock_plugin_setting_bloc(&$myUser) { - $adblock_constants = file_get_contents('plugins/adblock/adblock_constants.php'); + $adblock_constants = file_get_contents('adblock_constants.php'); $adblock_constants = explode("\n", $adblock_constants); $adblock_params = array(); @@ -253,10 +253,10 @@ function adblock_plugin_setting_update($_) { $elegant_degradation = (int) $_["adblock_elegant_degradation"]; - if(file_put_contents("plugins/adblock/adblock_constants.php", "flash_enabled = ".$flash_enabled."\nflash_block = ".$flash_block."\nflash_list = ".$flash_list."\nimg_enabled = ".$img_enabled."\nimg_block = ".$img_block."\nimg_only_mobiles = ".$img_only_mobiles."\nimg_list = ".$img_list."\nelegant_degradation = ".$elegant_degradation)) + if(file_put_contents("adblock_constants.php", "flash_enabled = ".$flash_enabled."\nflash_block = ".$flash_block."\nflash_list = ".$flash_list."\nimg_enabled = ".$img_enabled."\nimg_block = ".$img_block."\nimg_only_mobiles = ".$img_only_mobiles."\nimg_list = ".$img_list."\nelegant_degradation = ".$elegant_degradation)) header('location: settings.php'); else - exit("Unable to write parameters to plugins/adblock/adblock_constants.php. Check permissions on the folders."); + exit("Unable to write parameters to adblock_constants.php. Check permissions on the folders."); } } diff --git a/install.php b/install.php index 956b357..1b753b6 100644 --- a/install.php +++ b/install.php @@ -2,5 +2,5 @@ $getimagesize_available = function_exists("getimagesize") && ((ini_get("allow_url_fopen") == "1") ? true : false); $getimagesize_available = ($getimagesize_available) ? 1 : 0; - if(!file_put_contents("plugins/adblock/adblock_constants.php", "flash_enabled = 0\nflash_block = 0\nflash_list = \"\"\nimg_enabled = 0\nimg_block = 0\nimg_only_mobiles = 0\nimg_list = \"\"\nelegant_degradation = ".$getimagesize_available)) - exit("An error occured while initalizing the file to store parameters (plugins/adblock/adblock_constants.php). Check the write permissions of the web server on the parent folders."); + if(!file_put_contents("adblock_constants.php", "flash_enabled = 0\nflash_block = 0\nflash_list = \nimg_enabled = 0\nimg_block = 0\nimg_only_mobiles = 0\nimg_list = \nelegant_degradation = ".$getimagesize_available)) + exit("An error occured while initalizing the file to store parameters (adblock_constants.php). Check the write permissions of the web server on the parent folders.");