diff --git a/include/Core/Config.php b/include/Core/Config.php index 5235728864..7b7045a9ee 100644 --- a/include/Core/Config.php +++ b/include/Core/Config.php @@ -97,7 +97,7 @@ class Config { dbesc($family), dbesc($key) ); - if (dbm::is_result($ret)) { + if (count($ret)) { // manage array value $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$family][$key] = $val; diff --git a/include/Core/PConfig.php b/include/Core/PConfig.php index 49b69a1f7a..43735018e4 100644 --- a/include/Core/PConfig.php +++ b/include/Core/PConfig.php @@ -92,7 +92,7 @@ class PConfig { dbesc($key) ); - if (dbm::is_result($ret)) { + if (count($ret)) { $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $a->config[$uid][$family][$key] = $val; diff --git a/include/diaspora.php b/include/diaspora.php index 00d11add52..4076059c7c 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1906,20 +1906,23 @@ class Diaspora { $author = unxmlify($data->author); $recipient = unxmlify($data->recipient); - if (!$author || !$recipient) + if (!$author || !$recipient) { return false; + } // the current protocol version doesn't know these fields // That means that we will assume their existance - if (isset($data->following)) + if (isset($data->following)) { $following = (unxmlify($data->following) == "true"); - else + } else { $following = true; + } - if (isset($data->sharing)) + if (isset($data->sharing)) { $sharing = (unxmlify($data->sharing) == "true"); - else + } else { $sharing = true; + } $contact = self::contact_by_handle($importer["uid"],$author); @@ -1937,7 +1940,7 @@ class Diaspora { // Normally we needn't to do so, but the first message could have been vanished. if (in_array($contact["rel"], array(CONTACT_IS_FRIEND, CONTACT_IS_FOLLOWER))) { $u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($importer["uid"])); - if($u) { + if ($u) { logger("Sending share message to author ".$author." - Contact: ".$contact["id"]." - User: ".$importer["uid"], LOGGER_DEBUG); $ret = self::send_share($u[0], $contact); } diff --git a/mod/crepair.php b/mod/crepair.php index 2661deaeed..c141958e8b 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -30,7 +30,6 @@ function crepair_init(App &$a) { } } - function crepair_post(App &$a) { if (! local_user()) { return; diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 34c1213c3f..dc54b912d7 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -588,7 +588,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($decrypted_source_url), intval($local_uid) ); - if(! dbm::is_result($ret)) { + if(! count($ret)) { if(strstr($decrypted_source_url,'http:')) $newurl = str_replace('http:','https:',$decrypted_source_url); else @@ -598,7 +598,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($newurl), intval($local_uid) ); - if(! dbm::is_result($ret)) { + if(! count($ret)) { // this is either a bogus confirmation (?) or we deleted the original introduction. $message = t('Contact record was not found for you on our site.'); xml_status(3,$message); diff --git a/mod/install.php b/mod/install.php index 80a4cb799e..9adeac604e 100755 --- a/mod/install.php +++ b/mod/install.php @@ -565,7 +565,6 @@ function check_imagik(&$checks) { } } - function manual_config(App &$a) { $data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8'); $o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'); diff --git a/mod/network.php b/mod/network.php index 6c9bf75799..f433277076 100644 --- a/mod/network.php +++ b/mod/network.php @@ -6,12 +6,13 @@ function network_init(App &$a) { } $is_a_date_query = false; - if(x($_GET['cid']) && intval($_GET['cid']) != 0) + if (x($_GET['cid']) && intval($_GET['cid']) != 0) { $cid = $_GET['cid']; + } - if($a->argc > 1) { - for($x = 1; $x < $a->argc; $x ++) { - if(is_a_date_arg($a->argv[$x])) { + if ($a->argc > 1) { + for ($x = 1; $x < $a->argc; $x ++) { + if (is_a_date_arg($a->argv[$x])) { $is_a_date_query = true; break; } @@ -26,7 +27,7 @@ function network_init(App &$a) { // fetch last used network view and redirect if needed - if(! $is_a_date_query) { + if (! $is_a_date_query) { $sel_tabs = network_query_get_sel_tab($a); $sel_nets = network_query_get_sel_net(); $sel_groups = network_query_get_sel_group($a); diff --git a/mod/suggest.php b/mod/suggest.php index 4c08db8b6c..6ded66286a 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -16,8 +16,8 @@ function suggest_init(App &$a) { // so add any arguments as hidden inputs $query = explode_querystring($a->query_string); $inputs = array(); - foreach($query['args'] as $arg) { - if(strpos($arg, 'confirm=') === false) { + foreach ($query['args'] as $arg) { + if (strpos($arg, 'confirm=') === false) { $arg_parts = explode('=', $arg); $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]); } diff --git a/mod/videos.php b/mod/videos.php index 00c7c6dfa1..64838998f1 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -167,8 +167,9 @@ function videos_post(App &$a) { $url = App::get_baseurl(); $drop_id = intval($i[0]['id']); - if($i[0]['visible']) + if ($i[0]['visible']) { proc_run(PRIORITY_HIGH, "include/notifier.php", "drop", $drop_id); + } } } diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index 485e4c233e..acea9947bf 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -4,7 +4,6 @@ */ - function theme_content(App &$a){ if (!local_user()) { return; diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 1a5a9c0213..0c619569a0 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -3,8 +3,6 @@ * Theme settings */ - - function theme_content(App &$a){ if (!local_user()) { return; @@ -35,8 +33,8 @@ function theme_post(App &$a){ function theme_admin(App &$a){ $align = get_config('quattro', 'align' ); $color = get_config('quattro', 'color' ); - $tfs = get_config("quattro","tfs"); - $pfs = get_config("quattro","pfs"); + $tfs = get_config("quattro","tfs"); + $pfs = get_config("quattro","pfs"); return quattro_form($a,$align, $color, $tfs, $pfs); } @@ -45,31 +43,35 @@ function theme_admin_post(App &$a){ if (isset($_POST['quattro-settings-submit'])){ set_config('quattro', 'align', $_POST['quattro_align']); set_config('quattro', 'color', $_POST['quattro_color']); - set_config('quattro', 'tfs', $_POST['quattro_tfs']); + set_config('quattro', 'tfs', $_POST['quattro_tfs']); set_config('quattro', 'pfs', $_POST['quattro_pfs']); } } /// @TODO $a is no longer used here -function quattro_form(&$a, $align, $color, $tfs, $pfs){ +function quattro_form(App &$a, $align, $color, $tfs, $pfs){ $colors = array( - "dark"=>"Quattro", - "lilac"=>"Lilac", - "green"=>"Green" + "dark" => "Quattro", + "lilac" => "Lilac", + "green" => "Green", ); - - if ($tfs===false) $tfs="20"; - if ($pfs===false) $pfs="12"; - + + if ($tfs === false) { + $tfs = "20"; + } + if ($pfs === false) { + $pfs = "12"; + } + $t = get_markup_template("theme_settings.tpl" ); $o .= replace_macros($t, array( - '$submit' => t('Submit'), + '$submit' => t('Submit'), '$baseurl' => App::get_baseurl(), - '$title' => t("Theme settings"), - '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))), - '$color' => array('quattro_color', t('Color scheme'), $color, '', $colors), - '$pfs' => array('quattro_pfs', t('Posts font size'), $pfs), - '$tfs' => array('quattro_tfs',t('Textareas font size'), $tfs), + '$title' => t("Theme settings"), + '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))), + '$color' => array('quattro_color', t('Color scheme'), $color, '', $colors), + '$pfs' => array('quattro_pfs', t('Posts font size'), $pfs), + '$tfs' => array('quattro_tfs',t('Textareas font size'), $tfs), )); return $o; }