本文整理汇总了PHP中table_class::find方法的典型用法代码示例。如果您正苦于以下问题:PHP table_class::find方法的具体用法?PHP table_class::find怎么用?PHP table_class::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table_class
的用法示例。
在下文中一共展示了table_class::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
public function find()
{
$argsnum = func_num_args();
switch ($argsnum) {
case 0:
$result = parent::find();
break;
case 1:
$p1 = func_get_arg(0);
$result = parent::find($p1);
break;
case 2:
$p1 = func_get_arg(0);
$p2 = func_get_arg(1);
$result = parent::find($p1, $p2);
break;
default:
break;
}
if (is_array($result)) {
foreach ($result as $v) {
$v->thumb_names = explode('|', $v->thumb_name);
}
} else {
if (is_object($result)) {
$result->thumb_names = explode('|', $result->thumb_name);
}
}
return $result;
}
示例2: update_news_pos
function update_news_pos($pos)
{
$db = get_db();
$category = new category_class('news');
if ($pos == 1) {
$category_id = $category->find_by_name('富豪报道');
$category_id = $category_id->id;
$type = 'richindex_news_';
} else {
$category_id = $category->find_by_name('创富者说');
$category_id = $category_id->id;
$type = 'richindex_news1_';
}
$table = new table_class('fb_page_pos');
$db->echo_sql = true;
$items = $db->query("select id,title,created_at,description,author from fb_news where category_id={$category_id} order by created_at desc limit 6");
$exist_items = $table->find('all', array('conditions' => "name like '{$type}%' and (end_time <= now() or end_time is null)", 'order' => "name"));
$db->echo_sql = false;
$len = empty($exist_items) ? 0 : count($exist_items);
for ($i = 0; $i < $len; $i++) {
$exist_items[$i]->display = $items[$i]->title;
$exist_items[$i]->description = $items[$i]->description;
$exist_items[$i]->href = dynamic_news_url($items[$i]);
$exist_items[$i]->statci_href = static_news_url($items[$i]);
$exist_items[$i]->title = $items[$i]->title;
$exist_items[$i]->alias = $items[$i]->author;
$exist_items[$i]->end_time = dt_increase(1, 'h', $exist_itmes->end_time);
$exist_items[$i]->save();
}
}
示例3:
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;
}
}
示例4: array
function __construct($type = null, $name = null)
{
$table = new table_class(get_config('tb_category'));
if (empty($name)) {
if (empty($type)) {
$items = $table->find('all');
} else {
$items = $table->find('all', array('conditions' => "category_type = '" . $type . "'", 'order' => 'sort_id ,priority'));
}
} else {
$items = $table->find('all', array('conditions' => "name = '" . $name . "'", 'order' => 'sort_id,priority'));
}
if ($items) {
foreach ($items as $item) {
$this->items[$item->id] = $item;
$this->group_items[$item->parent_id][] = $item->id;
$this->group_items[$item->id] = array();
}
}
}
示例5: update_list_pos
function update_list_pos($pos)
{
global $db;
$table = new table_class('fb_page_pos');
$type = pos_type($pos);
$items = $db->query("select name,comment,image_src,id from fb_custom_list_type where position = {$pos} order by created_at desc limit 4");
$exist_items = $table->find('all', array('conditions' => "name like 'listindex_{$type}%' and (end_time <= now() or end_time is null)", 'order' => "name"));
$len = empty($exist_items) ? 0 : count($exist_items);
for ($i = 0; $i < $len; $i++) {
$exist_items[$i]->display = $items[$i]->name;
$exist_items[$i]->description = $items[$i]->comment;
$exist_items[$i]->href = '/list/show_list.php?id=' . $items[$i]->id;
$exist_items[$i]->image1 = $items[$i]->image_src;
$exist_items[$i]->title = $items[$i]->name;
$exist_items[$i]->end_time = dt_increase(1, 'h', $exist_itmes->end_time);
$exist_items[$i]->save();
}
}
示例6: static_news
function static_news($id)
{
if (!$id) {
return false;
}
global $url_head;
$news = new table_class('fb_news');
$news->find($id);
$url = "{$url_head}/news/news.php?id={$id}";
$content = file_get_contents($url);
$date = date('Ym', strtotime($news->created_at));
$dir = "./review/{$date}";
if (!is_dir($dir)) {
mkdir($dir);
}
$file = $dir . "/{$id}.html";
if (write_to_file($file, $content, 'w')) {
echo "<a href='{$dir}/{$id}.html'>查看</a>";
return true;
} else {
return false;
}
}
示例7:
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Content-Language content=zh-CN>
<title>IPO设置</title>
<?php
require_once '../../frame.php';
judge_role();
css_include_tag('admin');
use_jquery();
?>
</head>
<?php
$db = get_db();
$record = new table_class('fb_ipo_info');
$record->find('first');
?>
<body>
<div id=icaption>
<div id=title>IPO设置</div>
</div>
<form id="ipo_edit" action="ipo_config.post.php" method="post">
<div id=itable>
<table cellspacing="1" align="center">
<tr class=tr4 id="list_name">
<td class=td1 width=15%>公司名称</td>
<td width="85%">
<input type="text" name="ipo[comany_name]" value="<?php
echo $record->comany_name;
?>
示例8: intval
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Content-Language content=zh-CN>
<title>forbes</title>
<?php
require_once '../../frame.php';
?>
</head>
<?php
require_once '../../frame.php';
#var_dump($_POST);
$magazine = new table_class("fb_old_magazine");
$id = intval($_POST['id']);
if ($id != '') {
$magazine->find($id);
}
$magazine->update_attributes($_POST['post']);
redirect('old_magazine_index.php');
示例9: intval
<?php
session_start();
include_once '../../frame.php';
judge_role();
$activity = new table_class("zzh_activity");
$id = intval($_POST['id']);
if ($id != '') {
$activity->find($id);
} else {
$activity->created_at = now();
}
$activity->update_attributes($_POST['post'], false);
$activity->update_file_attributes('post');
if ($_POST['is_old'] == 'on') {
$activity->is_old = 1;
} else {
$activity->is_old = 0;
}
$activity->save();
redirect('activity.php');
示例10:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Content-Language content=zh-CN>
<title>天地华宇-中国公路快运领导者</title><meta name="Keywords" content="天地华宇,天地华宇物流,天地华宇物流查询,华宇,华宇物流,华宇物流查询,天地华宇俱乐部,华宇俱乐部"/><meta name="Description" content="天地华宇-中国公路快运领导者"/>
</head>
<?php
require_once '../frame.php';
$id = $_POST['id'];
echo $id;
$employ = new table_class('hoau_employ');
$employ->find($id);
$employ->is_read = 1;
$employ->save();
?>
</html>
示例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: alert
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Content-Language content=zh-CN>
</head>
<?php
require "../../frame.php";
$id = $_POST['id'];
$city = new table_class('fb_city');
if ($id != '') {
$city->find($id);
}
if ($_FILES['city_photo']['name'] != null) {
$upload = new upload_file_class();
$upload->save_dir = "/upload/city/";
$img = $upload->handle('city_photo', 'filter_pic');
if ($img === false) {
alert('上传文件失败 !');
redirect($_SERVER['HTTP_REFERER']);
}
$city->photo = "/upload/city/{$img}";
}
if (!$city->update_attributes($_POST['city'])) {
alert('城市已存在或执行错误!');
redirect($_SERVER['HTTP_REFERER']);
}
redirect('index.php');
?>
</html>
示例13: intval
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Content-Language content=zh-cn>
</head>
<?php
$type = $_GET['type'];
switch ($type) {
case 'news':
$id = intval($_GET['id']);
$news = new table_class('fb_news');
if (empty($id)) {
return false;
}
$news->find($id);
if ($news->id <= 0) {
return false;
}
if (static_news($news, 'page')) {
echo '静态化新闻成功';
} else {
echo '静态化新闻失败';
}
break;
case 'index':
if (static_index()) {
echo '静态化首页成功!';
} else {
echo '静态化首页失败!';
}
示例14: intval
<?php
session_start();
include_once '../../frame.php';
judge_role();
$id = intval($_REQUEST['id']);
$menu1 = new table_class($tb_menu);
if ($id) {
$menu = $menu1->find($id);
$is_root = $menu->is_root;
} else {
$menu->parent_id = $_REQUEST['parent_id'] ? $_REQUEST['parent_id'] : 0;
$menu->role_level = 1;
if ($menu->parent_id == 0) {
$menu->href = "#";
}
}
if ($menu->parent_id) {
$parent_menu = $menu1->find($menu->parent_id);
if (empty($id)) {
$menu->role_level = $parent_menu->role_level;
}
}
$db = get_db();
$roles = $db->query('select * from eb_role');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta http-equiv=Content-Language content=zh-CN>
示例15:
<?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']);