Ejemplo n.º 1
0
 public function work_over($work_desc, $file_id, $modify = 0)
 {
     global $_K, $_lang;
     $work_info = $this->work_exists('', " uid = '{$this->_uid}'");
     if (in_array($this->_task_status, array(5, 6)) && $work_info) {
         $work_obj = new Keke_witkey_task_work_class();
         if (CHARSET == 'gbk') {
             $work_desc = kekezu::utftogbk($work_desc);
         }
         $work_obj->setWhere(" work_id = '{$work_info['work_id']}'");
         $work_obj->setWork_desc($work_desc);
         $work_obj->setWork_file($file_id);
         $res = $work_obj->edit_keke_witkey_task_work();
         if ($res) {
             if ($modify) {
                 $noti = $_lang['work_modify_success'];
             } else {
                 $this->set_task_status(6);
                 db_factory::execute(sprintf("update %switkey_task set end_time = %d where task_id=%d", TABLEPRE, time() + $this->_task_config['confirm_hour'] * 3600, $this->_task_id));
                 $noti = $_lang['work_over_success'];
             }
             $g_notice = array($_lang['description'] => $_lang['wiki'] . $noti . $_lang['please_accept_quickly'], $_lang['task_title'] => $this->_notice_url);
             $this->notify_user('match_task', $this->_model_name . $noti, $g_notice);
             return true;
         } else {
             return $_lang['system_is_busy'] . $noti . $_lang['failed'];
         }
     } else {
         return $_lang['system_is_busy'] . $noti . $_lang['failed'];
     }
 }
Ejemplo n.º 2
0
 public function work_hand($work_desc, $file_ids, $hidework = '2', $work_hidden = '0')
 {
     global $_K;
     global $_lang;
     $resText = $this->check_if_can_hand();
     if (true === $resText) {
         $work_obj = new Keke_witkey_task_work_class();
         $work_obj->_work_id = null;
         $work_obj->setTask_id($this->_task_id);
         $work_obj->setUid($this->_uid);
         $work_obj->setUsername($this->_username);
         $work_obj->setVote_num(0);
         $work_obj->setWork_status(0);
         $work_obj->setWork_hidden($work_hidden);
         $work_obj->setWork_title($this->_task_title . $_lang['de_work']);
         if ($this->_task_info['workhide'] == 1) {
             $work_obj->setWorkhide(1);
         }
         $work_obj->setWork_desc(stripcslashes($work_desc));
         $work_obj->setWork_time(time());
         if ($file_ids) {
             $file_arr = array_unique(array_filter(explode(',', $file_ids)));
             $f_ids = implode(',', $file_arr);
             $work_obj->setWork_file(implode(',', $file_arr));
             $work_obj->setWork_pic($this->work_pic($f_ids));
         }
         $work_id = $work_obj->create_keke_witkey_task_work();
         $hidework == '1' and keke_payitem_class::payitem_cost("workhide", '1', 'work', 'spend', $work_id, $this->_task_id);
         if ($work_id) {
             $f_ids and db_factory::execute(sprintf(" update %switkey_file set work_id='%d',task_title='%s',obj_id='%d' where file_id in (%s)", TABLEPRE, $work_id, $this->_task_title, $work_id, $f_ids));
             $this->plus_work_num();
             $this->plus_take_num();
             $notice_url = "<a href=\"" . $_K['siteurl'] . "/index.php?do=task&id=" . $this->_task_id . "\">" . $this->_task_title . "</a>";
             $g_notice = array($_lang['user'] => $this->_username, $_lang['call'] => $_lang['you'], $_lang['task_title'] => $notice_url);
             $this->notify_user("task_hand", $_lang['task_hand'], $g_notice);
             $feed_arr = array("feed_username" => array("content" => $this->_uid, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}"));
             kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'task_tur', $this->_task_id);
             $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '被投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}"));
             $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($this->_task_id));
             kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'task_tur_bei', $this->_task_id);
             return true;
         }
         return '很遗憾,交稿失败';
     } else {
         return $resText;
     }
 }
Ejemplo n.º 3
0
 public function work_hand($work_desc, $file_ids, $hidework = '2', $work_hidden = '0', $url = '', $output = 'normal')
 {
     global $_lang;
     global $_K;
     $strText = $this->check_if_can_hand($url, $output);
     if ($strText === true) {
         $strCheckWork = $this->check_work_if_standard('hand');
         if ($strCheckWork === true) {
             $work_obj = new Keke_witkey_task_work_class();
             $work_obj->setHide_work($hidework);
             $work_obj->setTask_id($this->_task_id);
             $work_obj->setUid($this->_uid);
             $work_obj->setUsername($this->_username);
             $work_obj->setWork_desc(stripcslashes($work_desc));
             $work_obj->setWork_status(0);
             $work_obj->setWork_hidden($work_hidden);
             $work_obj->setWork_title($this->_task_title);
             $work_obj->setWork_time(time());
             if ($this->_task_info['workhide'] == 1) {
                 $work_obj->setWorkhide(1);
             }
             if ($file_ids) {
                 $file_arr = array_unique(array_filter(explode(',', $file_ids)));
                 $f_ids = implode(',', $file_arr);
                 $work_obj->setWork_file($f_ids);
                 $work_obj->setWork_pic($this->work_pic($f_ids));
             }
             $work_id = $work_obj->create_keke_witkey_task_work();
             $hidework == '1' and keke_payitem_class::payitem_cost("workhide", '1', 'work', 'spend', $work_id, $this->_task_id);
             if ($work_id) {
                 $f_ids and db_factory::execute(sprintf("update %switkey_file set work_id='%d',task_title='%s',obj_id='%d' where file_id in (%s)", TABLEPRE, $work_id, $this->_task_title, $work_id, $f_ids));
                 $this->plus_work_num();
                 $this->plus_take_num();
                 $notice_url = "<a href=\"{$_K['siteurl']}/index.php?do=task&id={$this->_task_id}\">{$this->_task_title}</a>";
                 $g_notice = array($_lang['user'] => $this->_username, $_lang['call'] => $_lang['you'], $_lang['task_title'] => $notice_url);
                 $this->notify_user('task_hand', $_lang['task_hand'], $g_notice, '2', $this->_guid);
                 $feed_arr = array("feed_username" => array("content" => $this->_uid, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}"));
                 kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'task_tur', $this->_task_id);
                 $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '被投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}"));
                 $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($this->_task_id));
                 kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'task_tur_bei', $this->_task_id);
                 return true;
             } else {
                 return $_lang['hand_work_fail_and_operate_agian'];
             }
         } else {
             return $_lang['hand_work_fail_for_the_work_full'];
         }
     } else {
         return $strText;
     }
 }