function set($post) { global $MOD, $DT_TIME, $_username, $_userid; $post['edittime'] = $DT_TIME; $post['title'] = trim($post['title']); $post['listorder'] = intval($post['listorder']); clear_upload($post['content']); if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; $r = $this->get_one(); $old = $r['content']; delete_diff($new, $old); } else { $post['addtime'] = $DT_TIME; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = dsafe($content); if ($MOD['page_clear'] || $MOD['page_save']) { $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['page_clear']) { $post['content'] = clear_link($post['content']); } if ($MOD['page_save']) { $post['content'] = save_remote($post['content']); } $post['content'] = addslashes($post['content']); } return array_map("trim", $post); }
function fields_update($post_fields, $table, $itemid, $keyname = 'itemid', $fd = array()) { global $FD, $db; if (!$table || !$itemid) { return ''; } if ($fd) { $FD = $fd; } $sql = ''; foreach ($FD as $k => $v) { if (isset($post_fields[$v['name']]) || $v['html'] == 'checkbox') { $mk = $v['name']; $mv = $post_fields[$v['name']]; if ($v['html'] == 'checkbox') { $mv = implode(',', $post_fields[$v['name']]); } $mv = $v['html'] == 'editor' ? dsafe($mv) : dhtmlspecialchars(trim($mv)); $sql .= ",{$mk}='{$mv}'"; } } $sql = substr($sql, 1); if ($sql) { $db->query("UPDATE {$table} SET {$sql} WHERE `{$keyname}`={$itemid}"); } }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; $post['editor'] = $_username; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['fee'] = dround($post['fee']); $post['video'] = fix_link(trim($post['video'])); $post['video_width'] = intval($post['video_width']); $post['video_height'] = intval($post['video_height']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); if ($r['video'] != $post['video']) { delete_upload($r['video'], match_userid($r['video'])); } } else { $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; is_url($post['thumb']) or $post['thumb'] = ''; $post['filepath'] = isset($post['filepath']) && is_filepath($post['filepath']) ? file_vname($post['filepath']) : ''; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['adddate'] = timetodate($post['addtime'], 3); $post['edittime'] = $DT_TIME; $post['fee'] = dround($post['fee']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($post['content'] && isset($post['clear_link']) && $post['clear_link']) { $post['content'] = clear_link($post['content']); } if ($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($post['content'] && $post['thumb_no'] && !$post['thumb']) { $post['thumb'] = save_thumb($post['content'], $post['thumb_no'], $MOD['thumb_width'], $MOD['thumb_height']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '"/>'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '"/>'; } delete_diff($new, $old); } else { $post['username'] = $post['editor'] = $_username; $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['title'] = trim($post['title']); $post['credit'] = intval($post['credit']); $post['fee'] = dround($post['fee']); $post['hidden'] = isset($post['hidden']) && $post['hidden'] ? 1 : 0; $post['editor'] = $_username; $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); } else { $post['aid'] = 0; $post['totime'] = $DT_TIME + $MOD['overdays'] * 86400; $post['process'] = 1; $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $_username, $_userid; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? datetotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['fromtime'] = datetotime($post['fromtime'] . ' 00:00:00'); $post['totime'] = $post['totime'] ? datetotime($post['totime'] . ' 23:59:59') : 0; $post['title'] = trim($post['title']); clear_upload($post['content'] . $post['thumb']); if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = dsafe($content); if ($MOD['credit_clear'] || $MOD['credit_save']) { $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['credit_clear']) { $post['content'] = clear_link($post['content']); } if ($MOD['credit_save']) { $post['content'] = save_remote($post['content']); } $post['content'] = addslashes($post['content']); } return array_map("trim", $post); }
function set($post) { global $DT_TIME, $_username; $post['status'] = $post['status'] == 3 ? 3 : 2; if ($this->itemid) { $post['edittime'] = $DT_TIME; $post['editor'] = $_username; $new = $post['content']; $r = $this->get_one(); $old = $r['content']; delete_diff($new, $old); } else { $post['addtime'] = $DT_TIME; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = dsafe($content); $post['content'] = addslashes(save_remote(save_local(stripslashes($post['content'])))); clear_upload($post['content']); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $_username, $_userid; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['content'] = addslashes(save_remote(save_local(stripslashes($post['content'])))); $post['introduce'] = addslashes(get_intro($post['content'], 120)); $post['passport'] = addslashes(get_user($post['username'], 'username', 'passport')); if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; $r = $this->get_one(); $old = $r['content']; delete_diff($new, $old); } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); clear_upload($post['content']); return array_map("trim", $post); }
if ($r['status'] > 0) { message($L['ask_msg_edit']); } if ($submit) { $typeid = intval($typeid); if (!$typeid || !isset($TYPE[$typeid])) { message($L['pass_typeid']); } if (empty($title)) { message($L['pass_title']); } if (empty($content)) { message($L['pass_content']); } clear_upload($content); $content = dsafe(addslashes(save_remote(save_local(stripslashes($content))))); $fields = array('typeid' => $typeid, 'title' => $title); $fields = dhtmlspecialchars($fields); $fields['content'] = $content; $sql = ''; foreach ($fields as $k => $v) { $sql .= ",{$k}='{$v}'"; } $sql = substr($sql, 1); $db->query("UPDATE {$DT_PRE}ask SET {$sql} WHERE itemid={$itemid}"); dmsg($L['op_edit_success'], $forward); } else { extract($r); $type_select = type_select($TYPE, 1, 'typeid', $L['choose_type'], $typeid, 'id="typeid"'); $head_title = $L['ask_title_edit']; }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; $post['islink'] = isset($post['islink']) ? 1 : 0; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['cfg_photo'] = intval($post['cfg_photo']); $post['cfg_video'] = intval($post['cfg_video']); $post['cfg_type'] = intval($post['cfg_type']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); if ($post['content'] && isset($post['clear_link']) && $post['clear_link']) { $post['content'] = clear_link($post['content']); } if ($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } if ($post['banner']) { $new .= '<img src="' . $post['banner'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } if ($r['banner']) { $old .= '<img src="' . $r['banner'] . '">'; } delete_diff($new, $old); } else { $post['username'] = $post['editor'] = $_username; $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return $post; }
function check_add($post) { global $DT_TIME; if (isset($post['content'])) { $content = dsafe($post['content']); unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = $content; } else { $post = dhtmlspecialchars($post); } $content = addslashes(serialize($post)); $this->db->query("REPLACE INTO {$this->table_member_check} (userid,username,content,addtime) VALUES ('{$this->userid}','{$this->username}','{$content}','{$DT_TIME}')"); }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; $post['editor'] = $_username; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0; $post['discount'] = dround($post['price'] * 10 / $post['marketprice'], 1); $post['savemoney'] = dround($post['marketprice'] - $post['price']); $post['fee'] = dround($post['fee']); $post['price'] = dround($post['price']); $post['marketprice'] = dround($post['marketprice']); $post['minamount'] = dround($post['minamount']); $post['amount'] = dround($post['amount']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($post['content'] && !$post['introduce'] && $post['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); } else { $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; $post['editor'] = $_username; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['adddate'] = timetodate($post['addtime'], 3); $post['edittime'] = $DT_TIME; $post['editdate'] = timetodate($post['edittime'], 3); $post['fee'] = dround($post['fee']); $post['price'] = dround($post['price']); $post['amount'] = intval($post['amount']); $post['mycatid'] = intval($post['mycatid']); $post['elite'] = $post['elite'] ? 1 : 0; if (strpos($post['v1'], '|') === false) { $post['n1'] = $post['v1'] = ''; } if (strpos($post['v2'], '|') === false) { $post['n2'] = $post['v2'] = ''; } if (strpos($post['v3'], '|') === false) { $post['n3'] = $post['v3'] = ''; } $post['express_1'] = intval($post['express_1']); $post['express_name_1'] = trim($post['express_name_1']); $post['fee_start_1'] = dround($post['fee_start_1']); $post['fee_step_1'] = dround($post['fee_step_1']); $post['express_2'] = intval($post['express_2']); $post['express_name_2'] = trim($post['express_name_2']); $post['fee_start_2'] = dround($post['fee_start_2']); $post['fee_step_2'] = dround($post['fee_step_2']); $post['express_3'] = intval($post['express_3']); $post['express_name_3'] = trim($post['express_name_3']); $post['fee_start_3'] = dround($post['fee_start_3']); $post['fee_step_3'] = dround($post['fee_step_3']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } if ($post['thumb1']) { $new .= '<img src="' . $post['thumb1'] . '">'; } if ($post['thumb2']) { $new .= '<img src="' . $post['thumb2'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } if ($r['thumb1']) { $old .= '<img src="' . $r['thumb1'] . '">'; } if ($r['thumb2']) { $old .= '<img src="' . $r['thumb2'] . '">'; } delete_diff($new, $old); } else { $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid; $post['editor'] = $_username; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['adddate'] = timetodate($post['addtime'], 3); $post['edittime'] = $DT_TIME; $post['editdate'] = timetodate($post['edittime'], 3); $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0; $post['fee'] = dround($post['fee']); $post['total'] = intval($post['total']); $post['email'] = trim($post['email']); $post['minsalary'] = intval($post['minsalary']); $post['maxsalary'] = intval($post['maxsalary']); $post['type'] = intval($post['type']); $post['gender'] = intval($post['gender']); $post['education'] = intval($post['education']); $post['experience'] = intval($post['experience']); $post['minage'] = intval($post['minage']); $post['maxage'] = intval($post['maxage']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $new = $post['content']; $r = $this->get_one(); $old = $r['content']; delete_diff($new, $old); } else { $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
if ($submit) { captcha($captcha); $email = trim($email); if (!is_email($email)) { message($L['sendmail_pass_mailto']); } $title = trim(stripslashes($title)); if (strlen($title) < 5) { message($L['pass_title']); } $content = trim(stripslashes($content)); if (strlen($content) < 10) { message($L['pass_content']); } clear_upload($content); $content = dsafe(save_local($content)); $content = ob_template('send', 'mail'); $DT['mail_name'] = $_company; if (send_mail($email, $title, $content, '', false)) { //$_email message(lang($L['sendmail_success'], array($email)), 'sendmail.php'); } else { message($L['sendmail_fail']); } } else { $head_title = $L['sendmail_title']; $email = isset($email) ? trim(stripslashes($email)) : ''; $title = isset($title) ? trim(stripslashes($title)) : ''; $content = isset($content) ? trim(stripslashes($content)) : ''; if ($action == 'page' && isset($title) && isset($linkurl)) { $content = lang($L['sendmail_content'], array(userurl($_username), $_username, $title, $linkurl));
function set($post) { global $MOD, $DT_TIME, $DT_IP, $_username, $_userid; $post['islink'] = isset($post['islink']) ? 1 : 0; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['title'] = trim($post['title']); $post['fee'] = dround($post['fee']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($post['content'] && isset($post['clear_link']) && $post['clear_link']) { $post['content'] = clear_link($post['content']); } if ($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($post['content'] && $post['thumb_no'] && !$post['thumb']) { $post['thumb'] = save_thumb($post['content'], $post['thumb_no'], $MOD['thumb_width'], $MOD['thumb_height']); } if (strpos($post['content'], 'pagebreak') !== false) { $post['content'] = str_replace(array('[pagebreak]</p>', '<p>[pagebreak]', '[pagebreak]</div>', '<div>[pagebreak]'), array('</p>[pagebreak]', '[pagebreak]<p>', '</div>[pagebreak]', '[pagebreak]<div>'), $post['content']); } if ($post['content'] && !$post['introduce'] && $post['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $post['introduce_length'])); } if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); } else { $post['username'] = $post['editor'] = $_username; $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid, $GENDER, $MARRIAGE, $EDUCATION; $post['editor'] = $_username; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['fee'] = dround($post['fee']); $post['birthday'] = intval($post['byear']) . '-' . intval($post['bmonth']) . '-' . intval($post['bday']); $post['age'] = date('Y', $DT_TIME) - intval($post['byear']); $post['minsalary'] = intval($post['minsalary']); $post['maxsalary'] = intval($post['maxsalary']); $post['type'] = intval($post['type']); $post['marriage'] = intval($post['marriage']); $post['height'] = intval($post['height']); $post['height'] = intval($post['height']); $post['gender'] = intval($post['gender']); $post['education'] = intval($post['education']); $post['experience'] = intval($post['experience']); $post['situation'] = intval($post['situation']); $post['email'] = trim($post['email']); $post['status'] = intval($post['status']); $post['open'] = intval($post['open']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $new = $post['content']; $r = $this->get_one(); $old = $r['content']; delete_diff($new, $old); } else { $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
$msg = question($answer, $need_question, true); if ($msg) { dalert($msg); } $content = stripslashes(trim($content)); if (!$content) { dalert($L['type_answer']); } $content = save_local($content); if ($MOD['clear_alink']) { $content = clear_link($content); } if ($MOD['save_remotepic']) { $content = save_remote($content); } $content = dsafe($content); $content = addslashes($content); clear_upload($content); $url = htmlspecialchars(trim($url)); $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_answer']; $status = get_status(3, $need_check); $hidden = isset($hidden) ? 1 : 0; $expert = 0; if ($_username) { $t = $db->get_one("SELECT itemid FROM {$table}_expert WHERE username='******'"); if ($t) { $expert = 1; $db->query("UPDATE {$table}_expert SET answer=answer+1 WHERE username='******'"); } } $db->query("INSERT INTO {$table_answer} (qid,linkurl,content,username,expert,addtime,ip,status,hidden) VALUES ('{$itemid}','{$url}','{$content}','{$_username}','{$expert}','{$DT_TIME}','{$DT_IP}','{$status}','{$hidden}')");
function set_member($member) { global $MOD; $member['email'] = trim($member['email']); $member['mail'] = isset($member['mail']) ? trim($member['mail']) : ''; is_email($member['mail']) or $member['mail'] = ''; $member['msn'] = isset($member['msn']) ? trim($member['msn']) : ''; is_email($member['msn']) or $member['msn'] = ''; $member['qq'] = isset($member['qq']) ? trim($member['qq']) : ''; is_numeric($member['qq']) or $member['qq'] = ''; $member['ali'] = isset($member['ali']) ? trim($member['ali']) : ''; if (!$this->is_clean($member['ali'])) { $member['ali'] = ''; } $member['skype'] = isset($member['skype']) ? trim($member['skype']) : ''; if (!$this->is_clean($member['skype'])) { $member['skype'] = ''; } $member['address'] = isset($member['address']) ? trim($member['address']) : ''; if (!$this->is_clean($member['address'])) { $member['address'] = ''; } $member['postcode'] = isset($member['postcode']) ? trim($member['postcode']) : ''; is_numeric($member['postcode']) or $member['postcode'] = ''; $member['mode'] = isset($member['mode']) && is_array($member['mode']) && $member['mode'] ? implode(',', $member['mode']) : ''; $member['keyword'] = $member['company']; $member['homepage'] = isset($member['homepage']) ? fix_link($member['homepage']) : ''; $member['capital'] = isset($member['capital']) ? dround($member['capital']) : ''; $member['sound'] = intval($member['sound']); if ($this->userid) { $member['keyword'] = $member['company'] . strip_tags(area_pos($member['areaid'], ',')) . ',' . $member['business'] . ',' . $member['sell'] . ',' . $member['buy'] . ',' . $member['mode']; clear_upload($member['thumb'] . $member['introduce'], $this->userid); $new = $member['introduce']; if ($member['thumb']) { $new .= '<img src="' . $member['thumb'] . '">'; } $content_table = content_table(4, $this->userid, is_file(DT_CACHE . '/4.part'), $this->table_company_data); $r = $this->db->get_one("SELECT content FROM {$content_table} WHERE userid={$this->userid}"); $old = $r['content']; $r = $this->get_one(); if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); } else { if ($member['thumb']) { clear_upload($member['thumb'] . $member['introduce']); } } $member['content'] = $member['introduce']; $member['introduce'] = addslashes(get_intro($member['content'], $MOD['introduce_length'])); if (!defined('DT_ADMIN')) { $content = $member['content']; unset($member['content']); $member = dhtmlspecialchars($member); $member['content'] = dsafe($content); } if ($MOD['introduce_clear'] || $MOD['introduce_save']) { $member['content'] = stripslashes($member['content']); $member['content'] = save_local($member['content']); if ($MOD['introduce_clear']) { $member['content'] = clear_link($member['content']); } if ($MOD['introduce_save']) { $member['content'] = save_remote($member['content']); } $member['content'] = addslashes($member['content']); } if ($member['catid']) { $catids = explode(',', substr($member['catid'], 1, -1)); $cids = ''; foreach ($catids as $catid) { $C = get_cat($catid); if ($C) { $catid = $C['parentid'] ? $C['arrparentid'] . ',' . $catid : $catid; $cids .= $catid . ','; } } $cids = array_unique(explode(',', substr(str_replace(',0,', ',', ',' . $cids), 1, -1))); $member['catids'] = ',' . implode(',', $cids) . ','; } return $member; }
delete_upload($HOME['banner2'], $_userid); } if ($HOME['banner3'] != $setting['banner3']) { delete_upload($HOME['banner3'], $_userid); } if ($HOME['banner4'] != $setting['banner4']) { delete_upload($HOME['banner4'], $_userid); } if ($HOME['banner5'] != $setting['banner5']) { delete_upload($HOME['banner5'], $_userid); } clear_upload($setting['background'] . $setting['logo'] . $setting['video'] . $setting['banner'] . $setting['bannerf'] . $setting['banner1'] . $setting['banner2'] . $setting['banner3'] . $setting['banner4'] . $setting['banner5']); $announce = $setting['announce']; unset($setting['announce']); $setting = dhtmlspecialchars($setting); $setting['announce'] = dsafe($announce); update_company_setting($_userid, $setting); dmsg($L['home_msg_save'], 'home.php?tab=' . $tab); } } else { $CS = cache_read('module-4.php'); $api_map = $CS['map']; $api_stats = $CS['stats']; $api_kf = $CS['kf']; $menu_f = ','; foreach (explode(',', $MG['menu_c']) as $v) { $menu_f .= $MFILE[$v] . ','; } if ($MG['menu_d']) { $_menu_show = array(); foreach ($HMENU as $k => $v) {
} function get_chat_file($chatid) { return DT_ROOT . '/file/chat/' . substr($chatid, 0, 2) . '/' . $chatid . '.php'; } switch ($action) { case 'send': $chatid or exit('ko'); trim($word) or exit('ko'); if ($MOD['chat_maxlen'] && strlen($word) > $MOD['chat_maxlen'] * 3) { exit('max'); } $word = convert($word, 'UTF-8', DT_CHARSET); $word = stripslashes(trim($word)); $word = strip_tags($word); $word = dsafe($word); $word = nl2br($word); $word = strip_nr($word); $word = str_replace('|', ' ', $word); if ($MOD['chat_file'] && $MG['upload']) { clear_upload($word); } $chat = $db->get_one("SELECT * FROM {$table} WHERE chatid='{$chatid}'"); if ($chat) { $lastmsg = addslashes(dsubstr($word, 50)); if ($chat['touser'] == $_username) { $sql = "fgettime={$DT_TIME},lasttime={$DT_TIME},lastmsg='{$lastmsg}'"; if ($DT_TIME - $chat['freadtime'] > $chat_poll) { $db->query("UPDATE {$DT_PRE}member SET chat=chat+1 WHERE username='******'fromuser']}'"); $sql .= ",fnew=fnew+1"; }
function set($post) { global $MOD, $DT_TIME, $DT_IP, $AREA, $_username, $_userid; $AREA or $AREA = cache_read('area.php'); $post['city'] or $post['city'] = $post['areaid'] ? $AREA[$post['areaid']]['areaname'] : ''; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $post['edittime'] = $DT_TIME; $post['fromtime'] = strtotime($post['fromtime'] . ' 0:0:0'); $post['totime'] = strtotime($post['totime'] . ' 23:59:59'); $post['homepage'] = fix_link($post['homepage']); $post['sign'] = $post['sign'] ? 1 : 0; $post['fee'] = dround($post['fee']); $post['title'] = trim($post['title']); $post['content'] = stripslashes($post['content']); $post['content'] = save_local($post['content']); if ($MOD['clear_link']) { $post['content'] = clear_link($post['content']); } if ($MOD['save_remotepic']) { $post['content'] = save_remote($post['content']); } if ($MOD['introduce_length']) { $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length'])); } if ($this->itemid) { $post['editor'] = $_username; $new = $post['content']; if ($post['thumb']) { $new .= '<img src="' . $post['thumb'] . '">'; } $r = $this->get_one(); $old = $r['content']; if ($r['thumb']) { $old .= '<img src="' . $r['thumb'] . '">'; } delete_diff($new, $old); } else { $post['username'] = $post['editor'] = $_username; $post['ip'] = $DT_IP; } $content = $post['content']; unset($post['content']); $post = dhtmlspecialchars($post); $post['content'] = addslashes(dsafe($content)); return array_map("trim", $post); }
function _edit($message) { if (!$this->_is_message($message)) { return false; } clear_upload($message['content']); $message['title'] = htmlspecialchars(trim($message['title'])); $message['content'] = dsafe(addslashes(save_remote(save_local(stripslashes($message['content']))))); $message['groupids'] = implode(',', $message['groupids']); $this->db->query("UPDATE {$this->pre}message SET title='{$message['title']}',content='{$message['content']}',groupids='{$message['groupids']}' WHERE itemid='{$this->itemid}' "); return true; }
if (in_array($username, $tmp)) { // } else { $black = $black . ' ' . $username; } } else { $black = $username; } $db->query("UPDATE {$DT_PRE}member SET black='{$black}' WHERE userid={$_userid}"); $chatid = get_chat_id($_username, $username); $db->query("DELETE FROM {$table} WHERE chatid='{$chatid}'"); dmsg('屏蔽成功', 'message.php?action=setting'); break; case 'down': if ($data) { $data = stripslashes(dsafe($data)); $css = file_get('image/chat.css'); $css = str_replace('#chat{width:auto;height:286px;overflow:auto;', '#chat{width:700px;margin:auto;', $css); $css = str_replace("url('", "url('" . $MOD['linkurl'] . "image/", $css); $data = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;charset=' . DT_CHARSET . '"/><title>聊天记录</title><style type="text/css">' . $css . '</style><base href="' . $MOD['linkurl'] . '"/></head><body><div id="chat">' . $data . '</div></body></html>'; file_down('', 'chat_' . timetodate($DT_TIME, 'Y-m-d-H-i') . '.html', $data); } exit; break; case 'contact': check_name($touser) or dalert('不能与自己对话', 'goback'); $go = '?touser='******'&mid=' . $mid . '&itemid=' . $itemid . '&forward=' . $forward; if ($_username) { dheader($go); } $filename = get_chat_file(get_chat_id($chatuser, $touser));