本文整理汇总了PHP中table_class::save方法的典型用法代码示例。如果您正苦于以下问题:PHP table_class::save方法的具体用法?PHP table_class::save怎么用?PHP table_class::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table_class
的用法示例。
在下文中一共展示了table_class::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save()
{
if (implode('|', $this->thumb_names) != $this->thumb_name) {
$this->thumb_name = implode('|', $this->thumb_names);
}
return parent::save();
}
示例2:
function __construct($u_id)
{
if ($u_id) {
$member = new table_class('eachbb.member');
$member->find($u_id);
$this->id = $u_id;
$this->name = $member->name;
$this->password = $member->password;
$this->email = $member->email;
$this->birthday = $member->birthday;
$this->address = $member->address;
$this->nick_name = $member->ture_name;
$db = get_db();
$db->query("select * from member_status where uid={$u_id}");
if ($db->record_count == 0) {
$status = new table_class('member_status');
$status->created_at = $member->created_at;
$status->last_login = $member->last_login;
$status->uid = $u_id;
$status->save();
}
$this->score = $status->score;
$this->visit_count = $status->visit_count;
$this->level = $status->level;
$this->last_login = $status->last_login;
}
}
示例3: send_mail
function send_mail($smtp_server, $smtp_user, $smtp_pwd, $from, $to, $title, $content)
{
$body = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18854"><LINK rel=stylesheet
href="BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}"></HEAD>
<BODY style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt">';
$body = $body . addslashes($content);
$body = $body . '</BODY></HTML>';
$email = new table_class('forbes_email.fb_email');
$email->email_to = $to;
$email->email_status = '0';
$email->email_subject = "=?UTF-8?B?" . base64_encode($title) . "?=";
$email->email_content = $body;
$email->save();
}
示例4: intval
<?php
require "../../frame.php";
$nid = intval($_POST['nid']);
$pid = intval($_POST['pid']);
$type = $_POST['type'];
$db = get_db();
if ($type == 'publish') {
$pos = new table_class("fb_list_relation");
$pos->list_id = $pid;
$pos->rela_id = $nid;
$pos->save();
} elseif ($type == 'revocation') {
$pos = new table_class("fb_list_relation");
$pos->delete($nid);
} elseif ("edit_priority" == $type) {
$id_str = explode("|", $_POST['id_str']);
$priority_str = explode("|", $_POST['priority_str']);
$id_str_num = sizeof($id_str) - 1;
$priority = 'priority';
for ($i = $id_str_num - 1; $i >= 0; $i--) {
if ($priority_str[$i] == "") {
$priority_str[$i] = "";
}
$db = get_db();
$sql = "update fb_list_relation set " . $priority . "=" . $priority_str[$i] . " where id=" . $id_str[$i];
$db->execute($sql);
}
}
示例5: count
if ($vote->max_vote_count) {
$limit = $vote->max_vote_count;
$db = get_db();
$has = $db->query("select count(id) as num from fb_survey_record where vote_id={$id} and source='{$source}'");
close_db();
if ($has[0]->num >= $limit) {
alert('您已经做过该调查表了,请不要重复提交!');
redirect('/survey/');
die;
}
}
$record = new table_class("fb_survey_record");
$record->source = $source;
$record->vote_id = $id;
$record->created_at = now();
$record->save();
$count = count($_POST['record_id']);
$record2 = new table_class("fb_survey_record2");
foreach ($_POST['record_id'] as $k) {
if (isset($_POST[$k])) {
foreach ($_POST[$k] as $v) {
$record2->id = 0;
$record2->record_id = $record->id;
$record2->vote_id = $k;
$record2->item_id = $v;
$record2->save();
}
}
}
alert("感谢您的参与!");
redirect("/survey/");
示例6: htmlspecialchars
die;
}
$share->email = htmlspecialchars($_GET['mail'][$i]);
if (strlen($_GET['email'][$i]) > 40) {
die;
}
if (isset($_COOKIE['name'])) {
$share->user = $_COOKIE['name'];
$sname = " {$_COOKIE['name']} ";
} else {
$share->user = $_SERVER['REMOTE_ADDR'];
$sname = "";
}
$share->created_at = now();
$share->news_id = $news_id;
$share->save();
if ($type == 'news') {
$content = $_GET['name'][$i] . ",你好:<br/><br/> 您的好友" . $sname . "想与您分享福布斯中文网的文章《" . $news->title . "》,您可以点击以下连接阅读<br/><br/> <a href='http://www.forbeschina.com" . static_news_url($news) . "'>http://www.forbeschina.com" . static_news_url($news) . "</a><br/> 如果点击以上链接不起作用,请将此网址复制并粘贴到新的浏览器窗口中。";
$title = $news->title;
} else {
if ($type == 'pic_list') {
$content = $_GET['name'][$i] . ",你好:<br/><br/> 您的好友" . $sname . "想与您分享福布斯中文网的榜单《" . $list->name . "》,您可以点击以下连接查看<br/><br/> <a href='http://www.forbeschina.com/list/" . $news_id . "'>http://www.forbeschina.com/list/" . $news_id . "</a><br/> 如果点击以上链接不起作用,请将此网址复制并粘贴到新的浏览器窗口中。";
$title = $list->name;
}
}
send_mail('smtp.qiye.163.com', 'userservice@forbeschina.com', 'userservice', 'userservice@forbeschina.com', $_GET['mail'][$i], $title, $content);
}
}
}
$user_id = front_user_id();
if ($user_id) {
示例7: explode
<?php
include '../../frame.php';
$params = explode(',', $_POST['params']);
$ids = array();
$table = new table_class('fb_rich_fortune');
foreach ($params as $param) {
$value = explode('|', $param);
$table->id = $value[0];
$table->rich_id = $_POST['rich_id'];
if ($value[1]) {
$table->fortune = $value[1];
}
if ($value[2]) {
$table->fortune_year = $value[2];
}
if ($value[3]) {
$table->fortune_order = $value[3];
}
$table->save();
array_push($ids, $table->id);
}
$ids = implode(',', $ids);
echo $ids;
示例8: alert
<?php
require "../../frame.php";
$id = $_POST['id'];
$f_mrb = new table_class('fb_fhb');
if ($id != '') {
$f_mrb->find($id);
}
$f_mrb->update_attributes($_POST['fhb'], false);
if ($_FILES['image_src']['name'] != '') {
$upload = new upload_file_class();
$upload->save_dir = '/upload/news/';
if (!($upload_name = $upload->handle('image_src', 'filter_pic'))) {
alert('上传图片失败!');
redirect($_SERVER['HTTP_REFERER']);
die;
}
$f_mrb->image_src = '/upload/news/' . $upload_name;
}
$f_mrb->save();
redirect('index.php');
示例9:
<?php
require_once '../frame.php';
rights($_SESSION["hoaurights"], '3');
$yywd = new table_class('hoau_yywd');
$id = $_POST['id'];
if ($id != '') {
$yywd->find($id);
}
$yywd->update_attributes($_POST['post'], false);
$yywd->save();
redirect($_POST['url']);
示例10: intval
<?php
session_start();
include_once '../../frame.php';
judge_role();
#var_dump($_POST);
$seo = new table_class("fb_seo");
$id = intval($_POST['id']);
if ($id != '') {
$seo->find($id);
}
$seo->update_attributes($_POST['seo'], false);
$seo->save();
redirect('index.php');
示例11: intval
<?php
require "../../frame.php";
$id = intval($_POST['id']);
$pid = intval($_POST['pid']);
$position = new table_class('fb_position');
if ($id != '') {
$position->find($id);
} else {
$position->page_id = '0';
}
if ($pid != '') {
$position->page_id = $pid;
}
$position->name = $_POST['name'];
$position->position_limit = $_POST['position_limit'];
$position->type = $_POST['type'];
$position->save();
redirect('index.php');
示例12: intval
<?php
session_start();
include_once '../../frame.php';
judge_role();
$partner = new table_class("zzh_partner");
$id = intval($_POST['id']);
if ($id != '') {
$partner->find($id);
} else {
$partner->created_at = now();
}
$partner->update_attributes($_POST['post'], false);
$partner->update_file_attributes('post');
$partner->save();
redirect('partner.php');
示例13: values
continue;
}
$db->execute("insert into eb_news_keywords (name) values('{$val}') on duplicate key update name='{$val}'");
}
}
//handle the publish schedule
if (isset($_POST['publish_schedule_date'])) {
$schedule = new table_class('eb_publish_schedule');
if ($id) {
$schedule->find_by_resource_id($id);
}
if ($_POST['publish_schedule_date']) {
$schedule->publish_date = $_POST['publish_schedule_date'];
$schedule->resource_id = $news->id;
$schedule->resource_type = 'news';
$schedule->save();
} else {
if ($schedule->id) {
$schedule->delete();
}
}
}
if ($_POST['copy_news']) {
$news->copy_from = $news->id;
$news->id = 0;
$news->category_id = intval($_POST['copy_news']);
$news->save();
}
$href = "news_list.php";
redirect($href . '?category=' . $_POST['news']['category_id']);
#var_dump($news);
示例14: alert
alert('上传视频失败 !');
redirect($_SERVER['HTTP_REFERER']);
die;
}
$ad->video = "/upload/jj/{$vid}";
}
if ($_FILES['flash']['name'] != null) {
if ($_FILES['flash']['size'] > 2000000) {
alert('上传flash不得大于2M,请重新上传 !');
redirect($_SERVER['HTTP_REFERER']);
die;
}
$upload = new upload_file_class();
$upload->save_dir = "/upload/jj/";
$flash = $upload->handle('flash');
if ($flash === false) {
alert('上传flash失败 !');
redirect($_SERVER['HTTP_REFERER']);
die;
}
$ad->flash = "/upload/jj/{$flash}";
}
$ad->save();
if (!$_POST['url']) {
redirect('channel.php');
} else {
redirect('ad_list.php?bid=' . $ad->banner_id . '&cid=' . $ad->channel_id);
}
?>
</body>
</html>
示例15: alert
alert('上传照片' . ($i + 1) . '失败!');
redirect($_SERVER['HTTP_REFERER']);
}
$famous->photo = "/upload/famous_ad/" . $img[$i]['name'];
}
$famous->save();
}
}
//var_dump($_FILES);
if ($_FILES['old_photo']['name'] != '') {
$upload = new upload_file_class();
$upload->save_dir = "/upload/famous_ad/";
$o_img = $upload->handle('old_photo', 'filter_pic');
}
//var_dump($o_img);
for ($i = 0; $i < count($_POST['old_title']); $i++) {
if ($_POST['old_title'][$i] != '') {
$famous = new table_class('fb_famous_ad');
$famous->find($_POST['old_id'][$i]);
$famous->title = $_POST['old_title'][$i];
if ($_FILES['old_photo']['name'][$i] != '') {
if ($o_img[$i]['result'] === false) {
alert('上传照片' . ($i + 1) . '失败!');
redirect($_SERVER['HTTP_REFERER']);
}
$famous->photo = "/upload/famous_ad/" . $o_img[$i]['name'];
}
$famous->save();
}
}
redirect('/admin/famous/index.php');