Exemplo n.º 1
0
 public function onCommand(CommandSender $sender, Command $cmd, $label, array $sub)
 {
     if (!(isset($sub[1]) && $sub[0] && $sub[1])) {
         return false;
     }
     $mm = "[NickName] ";
     $nn = $this->nn;
     $ik = $this->isKorean();
     $n = strtolower(array_Shift($sub));
     $nick = implode(" ", $sub);
     if (!isset($nn[$n])) {
         $r = $mm . $n . ($ik ? "는 잘못된 플레이어명입니다." : " is invalid player");
     } elseif (strlen($nick) > 20 || strlen($nick) < 3) {
         $r = $mm . ($ik ? " 닉네임이 너무 길거나 짧습니다.." : "NickName is long or short") . " : {$nick}";
     } else {
         $r = $mm . $n . ($ik ? "' 닉네임 : " : "' NickName : ") . $nick;
         $nn[$n] = $nick;
     }
     if (isset($r)) {
         $sender->sendMessage($r);
     }
     if ($this->nn !== $nn) {
         $this->nn = $nn;
         $this->saveYml();
     }
     return true;
 }
Exemplo n.º 2
0
 public function see()
 {
     $path = G_TEMPLATES . G_STYLE . DIRECTORY_SEPARATOR . G_STYLE_HTML . DIRECTORY_SEPARATOR;
     $html_arr = scandir($path);
     array_Shift($html_arr);
     array_Shift($html_arr);
     $thistemplate = G_STYLE;
     $temps = $this->db->GetList("SELECT * FROM `@#_template` where `template` = '{$thistemplate}'", array('key' => 'template_name'));
     if (count($temps) != count($html_arr)) {
         foreach ($html_arr as $html) {
             if (!isset($temps[$html])) {
                 $temps[$html]['template_name'] = $html;
                 $temps[$html]['des'] = '';
                 $temps[$html]['template'] = $thistemplate;
             }
         }
     }
     unset($thistemplate);
     include $this->tpl(ROUTE_M, 'template.see');
 }
Exemplo n.º 3
0
 public function see()
 {
     $temp_dir = safe_replace($this->segment(4));
     $temp_htm = safe_replace($this->segment(5));
     if ($temp_dir) {
         $path = G_TEMPLATES . $temp_dir . DIRECTORY_SEPARATOR . $temp_htm . DIRECTORY_SEPARATOR;
     } else {
         $path = G_TEMPLATES . G_STYLE . DIRECTORY_SEPARATOR . G_STYLE_HTML . DIRECTORY_SEPARATOR;
         $temp_dir = G_STYLE;
     }
     $html_arr = file_exists($path) ? scandir($path) : false;
     if (!$html_arr) {
         $temps = array();
     } else {
         array_Shift($html_arr);
         array_Shift($html_arr);
         $thistemplate = $temp_dir;
         $temps = $this->db->GetList("SELECT * FROM `@#_template` where `template` = '{$thistemplate}'", array('key' => 'template_name'));
         if (count($temps) != count($html_arr)) {
             foreach ($html_arr as $html) {
                 if (!isset($temps[$html])) {
                     if (is_dir($path . $html)) {
                         $html = "<a style=\"color:#0c0;font-size:14px;\" href=\"#\">" . $html . "</a>";
                     }
                     $temps[$html]['template_name'] = $html;
                     $temps[$html]['des'] = '';
                     $temps[$html]['template'] = $thistemplate;
                 }
             }
         }
         unset($thistemplate);
     }
     include $this->tpl(ROUTE_M, 'template.see');
 }