if(strlen($el["cond"]) > 2) $new[$name]["conditions"][0] = $el["cond"]; $args = get_args($el["func"]); if(count($args) > 0) { foreach($args as $n => $arg) { $tmp = split_var($arg); $args[$n] = $tmp[1]; } $new[$name]["param"] = $args; } if(get_return($el["func"]) !== false) $new[$name]["return"][0] = ""; } /* Compare and merge both */ $merged = array(); foreach($new as $name => $el) { if(isset($input[$name])) { $merged[$name] = $input[$name]; $merged[$name]["conditions"] = $new[$name]["conditions"]; if(strlen($el["group"][0]) > 0) $merged[$name]["group"] = $el["group"];
MOO; foreach(get_newest() as $line) { echo "\n".clean_func($line["func"])."\n"; if(strlen($line["group"]) > 0) echo " \\group ".$line["group"]."\n"; if(strlen($line["cond"]) > 2) echo " \\conditions "._simplify($line["cond"])."\n"; foreach(get_args($line["func"]) as $param) { if(strlen($param) > 0 && $param != "...") { $param = split_var($param); $param = $param[1]; echo " \\param $param\n"; } } if(get_return($line["func"]) !== false) echo " \\return\n"; echo " \\description\n"; } echo "\n# END\n"; ?>
$MessageInfo['pubdate'] = date("Y-m-d H:i:s"); $IsOk = $DB->insertArray('article', $MessageInfo); if (!$IsOk) { $err = '1'; $msg = '\'文章新建失败!\''; } $new_cent = 1; get_return($callback, $err, $msg, $new_cent); } else { $err = '0'; $msg = '\'获取成功!\''; if ($type == 'pc') { $pc_cent = $article_info['pc_cent'] + 1; $DB->updateArray('article', array('pc_cent' => $pc_cent), array('article_id' => $article_id)); } else { $phone_cent = $article_info['phone_cent'] + 1; $DB->updateArray('article', array('phone_cent' => $phone_cent), array('article_id' => $article_id)); } $new_cent = $article_info['pc_cent'] + $article_info['phone_cent'] + 1; get_return($callback, $err, $msg, $new_cent); } function get_return($callback = '', $err = '', $msg = '', $new_cent = '') { if ($callback == '') { $return_rs = '{"err":' . $err . ',"msg":' . $msg . ',"data":{"viewcount":' . $new_cent . '}}'; } else { $return_rs = $callback . '({"err":' . $err . ',"msg":' . $msg . ',"data":{"viewcount":' . $new_cent . '}})'; } echo $return_rs; exit; }