$highlight_style = $highlight_style . $highlight_color; $vals['highlight'] = $highlight_style; } if (!empty($id)) { $vals['modified'] = $time_stamp; $updated = $trade->save($vals, "update", $id); } else { $vals['submit_time'] = empty($vals['submit_time']) ? $time_stamp : $vals['submit_time']; $vals['expire_time'] = empty($vals['expire_time']) ? $time_stamp + 60 * 60 * 24 * 30 : $vals['expire_time']; $vals['created'] = $vals['modified'] = $time_stamp; $updated = $trade->save($vals); $last_insert_key = "{$tb_prefix}trades_id"; $id = $trade->{$last_insert_key}; } //seo info $meta->save('trade', $id, $_POST['data']['meta']); if (!$updated) { flash(); } else { if ($G['setting']['keyword_bidding']) { $keyword->setIds($vals['title'] . $vals['content'], 'trades', true, $id); } flash("success", "offer.php?do=search&page=" . $_REQUEST['page'] . "&type_id=" . $vals['type_id']); } } $amount = $trade->findCount(null, $conditions, "Trade.id"); $page->setPagenav($amount); $fields = "Trade.member_id,m.username,Trade.company_id,Trade.adwords,Trade.highlight,Trade.type_id,Trade.status,Trade.id,Trade.title,Trade.clicked,Trade.if_urgent,Trade.submit_time AS pubdate,Trade.submit_time,Trade.modified,Trade.expire_time AS expdate,Trade.expire_time,Trade.picture as TradePicture,require_point,require_membertype,ip_addr as IP,Trade.if_commend"; $joins[] = "LEFT JOIN {$tb_prefix}members m ON m.id=Trade.member_id"; $result = $trade->findAll($fields, $joins, $conditions, "Trade.id DESC", $page->firstcount, $page->displaypg); if (!empty($result)) {
$vals['picture'] = $attachment->file_full_url; } $vals['tag_ids'] = $tag->setTagId($_POST['data']['tag']); $vals['industry_id'] = PbController::getMultiId($_POST['industry']['id']); $vals['area_id'] = PbController::getMultiId($_POST['area']['id']); if (!empty($id)) { $vals['modified'] = $time_stamp; $result = $product->save($vals, "update", $id); } else { $vals['created'] = $vals['modified'] = $time_stamp; $result = $product->save($vals); $last_insert_key = "{$tb_prefix}product_id"; $id = $product->{$last_insert_key}; } //seo info $meta->save('product', $id, $_POST['data']['meta']); if (!$result) { flash(); } else { flash("success", "product.php?do=search&page=" . $_REQUEST['page']); } } if (isset($_POST['recommend'])) { foreach ($_POST['id'] as $val) { $commend_now = $product->field("if_commend", "id=" . $val); if ($commend_now == "0") { $result = $product->saveField("if_commend", "1", intval($val)); } else { $result = $product->saveField("if_commend", "0", intval($val)); } }
$vals['picture'] = $attachment->file_full_url; } $result = $news->save($vals, "update", $id); } else { $vals['created'] = $vals['modified'] = $time_stamp; if (!empty($_FILES['pic']['name'])) { $attachment->rename_file = "news-" . ($news->getMaxId() + 1); $attachment->upload_process(); $vals['picture'] = $attachment->file_full_url; } $result = $news->save($vals); $last_insert_key = "{$tb_prefix}newses_id"; $id = $news->{$last_insert_key}; } //seo info $meta->save('news', $id, $_POST['data']['meta']); if (!$result) { flash(); } } $amount = $news->findCount(null, $conditions); $page->setPagenav($amount); $result = $news->findAll("*", null, $conditions, "id DESC ", $page->firstcount, $page->displaypg); if (!empty($result)) { for ($i = 0; $i < count($result); $i++) { $t1 = intval(str_replace("-", "", $result[$i]['start_time'])); $t2 = intval(str_replace("-", "", $result[$i]['end_time'])); if ($t1 == 0) { $result[$i]['start_time'] = L("effective_now", "tpl"); } if ($t2 == 0) {