예제 #1
0
function toDate2($date)
{
    if (ereg("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})", $date)) {
        return date("Y-d-m", $date ? datetotime($date, 'DD/MM/YYYY') : time());
    } else {
        return date("Y-d-m");
    }
}
예제 #2
0
 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);
 }