Issue 3873

Replace deprecated functions with new syntax
This commit is contained in:
Adam Magness 2017-11-06 18:55:24 -05:00
parent 72474dc2f6
commit 48dcbc6f3f
61 changed files with 1036 additions and 920 deletions

View file

@ -9,6 +9,8 @@
*
*/
use Friendica\Core\PConfig;
function nsfw_install() {
register_hook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body', 10);
register_hook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
@ -69,8 +71,8 @@ function nsfw_addon_settings(&$a,&$s) {
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/nsfw/nsfw.css' . '" media="all" />' . "\r\n";
$enable_checked = (intval(get_pconfig(local_user(),'nsfw','disable')) ? '' : ' checked="checked" ');
$words = get_pconfig(local_user(),'nsfw','words');
$enable_checked = (intval(PConfig::get(local_user(),'nsfw','disable')) ? '' : ' checked="checked" ');
$words = PConfig::get(local_user(),'nsfw','words');
if(! $words)
$words = 'nsfw,';
@ -104,10 +106,10 @@ function nsfw_addon_settings_post(&$a,&$b) {
return;
if($_POST['nsfw-submit']) {
set_pconfig(local_user(),'nsfw','words',trim($_POST['nsfw-words']));
PConfig::set(local_user(),'nsfw','words',trim($_POST['nsfw-words']));
$enable = ((x($_POST,'nsfw-enable')) ? intval($_POST['nsfw-enable']) : 0);
$disable = 1-$enable;
set_pconfig(local_user(),'nsfw','disable', $disable);
PConfig::set(local_user(),'nsfw','disable', $disable);
info( t('NSFW Settings saved.') . EOL);
}
}
@ -116,11 +118,11 @@ function nsfw_prepare_body(&$a,&$b) {
$words = null;
if(get_pconfig(local_user(),'nsfw','disable'))
if(PConfig::get(local_user(),'nsfw','disable'))
return;
if(local_user()) {
$words = get_pconfig(local_user(),'nsfw','words');
$words = PConfig::get(local_user(),'nsfw','words');
}
if($words) {
$arr = explode(',',$words);