]> git.mxchange.org Git - friendica.git/blobdiff - util/global_community_silence.php
Replace dba::select(limit => 1) by dba::selectOne
[friendica.git] / util / global_community_silence.php
index d18efd345e74f024be25e3cae401c29186b2bfce..4a324dd7448e8fd01f1ca823265abaeedc3962ca 100755 (executable)
@@ -5,16 +5,16 @@
  * @brief tool to silence accounts on the global community page
  *
  * With this tool, you can silence an account on the global community page.
- * Postings from silenced accounts will not be displayes on the community
+ * Postings from silenced accounts will not be displayed on the community
  * page. This silencing does only affect the display on the community page,
  * accounts following the silenced accounts will still get their postings.
  *
- * Usage: pass the URL of the to be silenced account as only parameter
+ * Usage: pass the URL of the profile to be silenced account as only parameter
  *        at the command line when running this tool. E.g.
  *
  *        $> util/global_community_silence.php http://example.com/profile/bob
  *
- *        will silence bob@example.com so that his postings wont appear at
+ *        will silence bob@example.com so that his postings won't appear at
  *        the global community page.
  *
  * Author: Tobias Diekershoff
@@ -22,7 +22,7 @@
  * License: AGPLv3 or later, same as Friendica
  **/
 
-if ($argc!=2 || $argv[1]=="-h" || $argv[1]=="--help" || $argv[1]=="-?") {
+if ($argc != 2 || $argv[1] == "-h" || $argv[1] == "--help" || $argv[1] == "-?") {
        echo "Usage: ".$argv[0]." [-h|profile_url]\r\n";
        echo "    -h, -?, --help ... show this help\r\n";
        echo "    profile_url ...... The URL of the profile you want to silence\r\n";
@@ -36,11 +36,11 @@ if ($argc!=2 || $argv[1]=="-h" || $argv[1]=="--help" || $argv[1]=="-?") {
 use Friendica\Database\DBM;
 use Friendica\Network\Probe;
 
-require_once("boot.php");
-require_once('include/dba.php');
-require_once("include/text.php");
+require_once 'boot.php';
+require_once 'include/dba.php';
+require_once 'include/text.php';
 $a = get_app();
-require_once ".htconfig.php";
+require_once '.htconfig.php';
 
 dba::connect($db_host, $db_user, $db_pass, $db_data);
 unset($db_host, $db_user, $db_pass, $db_data);
@@ -57,7 +57,7 @@ if (in_array($net['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) {
        exit(1);
 }
 $nurl = normalise_link($net['url']);
-$r = dba::select("contact", array("id"), array("nurl" => $nurl, "uid" => 0), array("limit" => 1));
+$r = dba::selectOne("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
 if (DBM::is_result($r)) {
        dba::update("contact", array("hidden" => true), array("id" => $r["id"]));
        echo "NOTICE: The account should be silenced from the global community page\r\n";