function collecter()
 {
     $type = p("type");
     $url = p("url");
     $title = p("title");
     $content = p("content");
     $other = p("other");
     if (!$title) {
         $title = trucate($content, 60);
     }
     $title2 = trucate($title, 33);
     if ($type && $title && $content && $url) {
         if ($type == "todo") {
             $this->model("private")->save(array("title" => $title, "body" => $content . "\n\n" . $url));
         }
         if ($type == "url") {
             $this->model("collection")->save(array("url" => $url, "title" => $title, "comment" => $content));
         }
         if ($type == "blogger") {
             $this->kdmail(array("from" => "*****@*****.**", "to" => '' . $other . '@blogger.com', "subject" => e("[ZZ]{$title2}"), "msg" => nl2br(e($content . ""))));
         }
         if ($type == "blog") {
             $this->model("somewordsjp")->save(array("title" => $title2, "content" => $content, "name" => "*****@*****.**"));
         }
         if ($type == "priv") {
             //if($title && $content && $content!="null"){
             $this->model("private")->save(array("title" => $title, "body" => $content . $this->get_client_info()));
             //}
             exit;
         }
         if ($type == "mailto") {
             $this->kdmail(array("from" => $this->config["site"]["mailt"], "fromname" => "TANG", "to" => p('other'), "subject" => e($title2), "msg" => nl2br(e($content))));
         }
         if ($type == "ruby") {
             $handle = fopen(ROOT . "../lang-jp.txt", 'a');
             fwrite($handle, "{$other},{$content}\n");
         }
         if ($type == "baodu") {
             $this->to_path("http://zhidao.baidu.com/q?ct=17&pn=0&tn=ikask&rn=12&word=%C8%D5%D3%EF%CE%CA%CC%E2&cm=1&lm=394496");
             exit;
         }
         $this->to_path($url);
     }
     $this->to_path("/");
 }
Exemplo n.º 2
0
 protected function outPDFTABLE($ra)
 {
     $xml_output = "";
     foreach ($ra as $one) {
         $xml_output .= "";
         foreach ($one as $i => $j) {
             $xml_output .= "";
             if ($j) {
                 $xml_output .= "<h4>{$i}</h4>" . trucate(e($j), 50);
             } else {
                 $xml_output .= "<h4>{$i}</h4> : -";
             }
             $xml_output .= "";
         }
         $xml_output .= "";
     }
     $xml_output .= "";
     //echo $xml_output;exit;
     $this->html2fpdf($xml_output);
     exit;
 }