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['islink'] = isset($post['islink']) ? 1 : 0; $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME; $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 (strpos($post['content'], 'pagebreak') !== false) { $post['content'] = str_replace(array('<hr class="de-pagebreak" /></p>', '<p><hr class="de-pagebreak" />', '<hr class="de-pagebreak" /></div>', '<div><hr class="de-pagebreak" />'), array('</p><hr class="de-pagebreak" />', '<hr class="de-pagebreak" /><p>', '</div><hr class="de-pagebreak" />', '<hr class="de-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, $_username, $_userid; $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['title'] = trim($post['title']); $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); }