Ejemplo n.º 1
0
 function indatabase($allusers = "FALSE")
 {
     if (!$allusers) {
         $allusers = KUsers::getusers();
     }
     if (array_key_exists(urlTitle($_POST[comment][name]), $allusers)) {
         $match = array("match" => true, "type" => "name", "name" => $_POST[comment][name]);
     } else {
         $usernicks = KUsers::getnicks($allusers);
         if (array_key_exists($_POST[comment][name], $usernicks)) {
             $match = array("match" => true, "type" => "nick", "name" => $_POST[comment][name], "user" => $usernicks[$_POST[comment][name]]);
         }
     }
     return $match;
 }
Ejemplo n.º 2
0
 function indatabase($allusers = "FALSE", $user = false)
 {
     if (!$allusers) {
         $allusers = KUsers::getusers();
     }
     if ($user) {
         $checkuser = $user;
     } else {
         $checkuser = $_POST[comment][name];
     }
     if (array_key_exists(urlTitle($checkuser), $allusers)) {
         $match = array("match" => true, "type" => "name", "name" => $checkuser, "avatar" => $allusers[$checkuser][avatar]);
     } else {
         $usernicks = KUsers::getnicks($allusers);
         if (array_key_exists($checkuser, $usernicks)) {
             $match = array("match" => true, "type" => "nick", "name" => $checkuser, "user" => $usernicks[$checkuser], "avatar" => $allusers[$usernicks[$checkuser]][avatar]);
         }
     }
     return $match;
 }