本文整理汇总了PHP中get_intro函数的典型用法代码示例。如果您正苦于以下问题:PHP get_intro函数的具体用法?PHP get_intro怎么用?PHP get_intro使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_intro函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_list
function get_list($condition = 'status=3', $order = 'itemid DESC')
{
global $MOD, $pages, $page, $pagesize, $offset, $items, $sum;
if ($page > 1 && $sum) {
$items = $sum;
} else {
$r = $this->db->get_one("SELECT COUNT(*) AS num FROM {$this->table} WHERE {$condition}");
$items = $r['num'];
}
$pages = pages($items, $page, $pagesize);
if ($items < 1) {
return array();
}
$lists = array();
$result = $this->db->query("SELECT * FROM {$this->table} WHERE {$condition} ORDER BY {$order} LIMIT {$offset},{$pagesize}");
while ($r = $this->db->fetch_array($result)) {
$r['adddate'] = timetodate($r['addtime'], 5);
if (strpos($r['content'], '<hr class="club_break" />') !== false) {
$r['content'] = substr($r['content'], strpos($r['content'], '<hr class="club_break" />'));
}
$r['title'] = get_intro($r['content'], 50);
$r['alt'] = get_intro($r['content'], 500);
$r['linkurl'] = $MOD['linkurl'] . 'goto.php?itemid=' . $r['itemid'];
$lists[] = $r;
}
return $lists;
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:27,代码来源:reply.class.php
示例2: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid;
$post['editor'] = $_username;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['adddate'] = timetodate($post['addtime'], 3);
$post['edittime'] = $DT_TIME;
$post['editdate'] = timetodate($post['edittime'], 3);
$post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
$post['fee'] = dround($post['fee']);
$post['price'] = dround($post['price']);
$post['minamount'] = dround($post['minamount']);
$post['amount'] = dround($post['amount']);
$post['mycatid'] = intval($post['mycatid']);
$post['days'] = intval($post['days']);
$post['elite'] = $post['elite'] ? 1 : 0;
$post['title'] = trim($post['title']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
if ($MOD['introduce_length']) {
$post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
}
if ($this->itemid) {
$new = $post['content'];
if ($post['thumb']) {
$new .= '<img src="' . $post['thumb'] . '">';
}
if ($post['thumb1']) {
$new .= '<img src="' . $post['thumb1'] . '">';
}
if ($post['thumb2']) {
$new .= '<img src="' . $post['thumb2'] . '">';
}
$r = $this->get_one();
$old = $r['content'];
if ($r['thumb']) {
$old .= '<img src="' . $r['thumb'] . '">';
}
if ($r['thumb1']) {
$old .= '<img src="' . $r['thumb1'] . '">';
}
if ($r['thumb2']) {
$old .= '<img src="' . $r['thumb2'] . '">';
}
delete_diff($new, $old);
} else {
$post['ip'] = $DT_IP;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = addslashes(dsafe($content));
return array_map("trim", $post);
}
开发者ID:hcd2008,项目名称:destoon,代码行数:60,代码来源:sell.class.php
示例3: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
is_url($post['banner']) or $post['banner'] = '';
$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['cfg_photo'] = intval($post['cfg_photo']);
$post['cfg_video'] = intval($post['cfg_video']);
$post['cfg_type'] = intval($post['cfg_type']);
$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 ($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'] . '"/>';
}
if ($post['banner']) {
$new .= '<img src="' . $post['banner'] . '">';
}
$r = $this->get_one();
$old = $r['content'];
if ($r['thumb']) {
$old .= '<img src="' . $r['thumb'] . '"/>';
}
if ($r['banner']) {
$old .= '<img src="' . $r['banner'] . '">';
}
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);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:50,代码来源:special.class.php
示例4: set
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);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:48,代码来源:article.class.php
示例5: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $AREA, $_username, $_userid;
$AREA or $AREA = cache_read('area.php');
$post['city'] or $post['city'] = $post['areaid'] ? $AREA[$post['areaid']]['areaname'] : '';
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['edittime'] = $DT_TIME;
$post['fromtime'] = strtotime($post['fromtime'] . ' 0:0:0');
$post['totime'] = strtotime($post['totime'] . ' 23:59:59');
$post['homepage'] = fix_link($post['homepage']);
$post['sign'] = $post['sign'] ? 1 : 0;
$post['fee'] = dround($post['fee']);
$post['title'] = trim($post['title']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
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);
}
开发者ID:hcd2008,项目名称:destoon,代码行数:46,代码来源:exhibit.class.php
示例6: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
$post['filepath'] = isset($post['filepath']) && is_filepath($post['filepath']) ? file_vname($post['filepath']) : '';
$post['editor'] = $_username;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['edittime'] = $DT_TIME;
$post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
$post['discount'] = dround($post['price'] * 10 / $post['marketprice'], 1);
$post['savemoney'] = dround($post['marketprice'] - $post['price']);
$post['fee'] = dround($post['fee']);
$post['price'] = dround($post['price']);
$post['marketprice'] = dround($post['marketprice']);
$post['minamount'] = dround($post['minamount']);
$post['amount'] = dround($post['amount']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
if ($post['content'] && !$post['introduce'] && $post['introduce_length']) {
$post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
}
if ($this->itemid) {
$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['ip'] = $DT_IP;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = addslashes(dsafe($content));
return array_map("trim", $post);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:46,代码来源:group.class.php
示例7: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
$post['editor'] = $_username;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['edittime'] = $DT_TIME;
$post['fee'] = dround($post['fee']);
$post['video'] = fix_link(trim($post['video']));
$post['video_width'] = intval($post['video_width']);
$post['video_height'] = intval($post['video_height']);
$post['title'] = trim($post['title']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
if ($MOD['introduce_length']) {
$post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
}
if ($this->itemid) {
$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);
if ($r['video'] != $post['video']) {
delete_upload($r['video'], match_userid($r['video']));
}
} else {
$post['ip'] = $DT_IP;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = addslashes(dsafe($content));
return array_map("trim", $post);
}
开发者ID:hcd2008,项目名称:destoon,代码行数:45,代码来源:video.class.php
示例8: set
function set($post)
{
global $MOD, $DT_TIME, $_username, $_userid;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['edittime'] = $DT_TIME;
$post['content'] = addslashes(save_remote(save_local(stripslashes($post['content']))));
$post['introduce'] = addslashes(get_intro($post['content'], 120));
$post['passport'] = addslashes(get_user($post['username'], 'username', 'passport'));
if ($this->itemid) {
$post['editor'] = $_username;
$new = $post['content'];
$r = $this->get_one();
$old = $r['content'];
delete_diff($new, $old);
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = addslashes(dsafe($content));
clear_upload($post['content']);
return array_map("trim", $post);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:22,代码来源:expert.class.php
示例9: dalert
if ($rid) {
$R = $db->get_one("SELECT * FROM {$table}_reply WHERE itemid={$rid}");
$R && $R['status'] == 3 && $R['tid'] == $tid or dalert($L['my_not_reply']);
$str = $R['content'];
if (strpos($str, '<hr class="club_break" />') !== false) {
$str = substr($str, strpos($str, '<hr class="club_break" />'));
} else {
if (strpos($str, '<hr class="club_break">') !== false) {
$str = substr($str, strpos($str, '<hr class="club_break">'));
} else {
if (strpos($str, '<hr class="club_break"/>') !== false) {
$str = substr($str, strpos($str, '<hr class="club_break"/>'));
}
}
}
$str = get_intro($str, 500);
$R['quote'] = '<div class="club_quote"><div><a href="' . $MOD['linkurl'] . 'goto.php?itemid=' . $rid . '"><p>' . $R['passport'] . $L['my_reply_at'] . timetodate($R['addtime'], 5) . '</p>' . $str . '</a></div></div><hr class="club_break" />';
}
$need_captcha = $MOD['captcha_reply'] == 2 ? $MG['captcha'] : $MOD['captcha_reply'];
$need_question = $MOD['question_reply'] == 2 ? $MG['question'] : $MOD['question_reply'];
if ($submit) {
$msg = captcha($captcha, $need_captcha, true);
if ($msg) {
dalert($msg);
}
$msg = question($answer, $need_question, true);
if ($msg) {
dalert($msg);
}
if ($do->pass($post)) {
$post['tid'] = $tid;
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:my_reply.inc.php
示例10: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid, $GENDER, $MARRIAGE, $EDUCATION;
$post['editor'] = $_username;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['edittime'] = $DT_TIME;
$post['fee'] = dround($post['fee']);
$post['birthday'] = intval($post['byear']) . '-' . intval($post['bmonth']) . '-' . intval($post['bday']);
$post['age'] = date('Y', $DT_TIME) - intval($post['byear']);
$post['minsalary'] = intval($post['minsalary']);
$post['maxsalary'] = intval($post['maxsalary']);
$post['type'] = intval($post['type']);
$post['marriage'] = intval($post['marriage']);
$post['height'] = intval($post['height']);
$post['height'] = intval($post['height']);
$post['gender'] = intval($post['gender']);
$post['education'] = intval($post['education']);
$post['experience'] = intval($post['experience']);
$post['situation'] = intval($post['situation']);
$post['email'] = trim($post['email']);
$post['status'] = intval($post['status']);
$post['open'] = intval($post['open']);
$post['title'] = trim($post['title']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
if ($MOD['introduce_length']) {
$post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
}
if ($this->itemid) {
$new = $post['content'];
$r = $this->get_one();
$old = $r['content'];
delete_diff($new, $old);
} else {
$post['ip'] = $DT_IP;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = addslashes(dsafe($content));
return array_map("trim", $post);
}
开发者ID:hcd2008,项目名称:destoon,代码行数:48,代码来源:resume.class.php
示例11: set_member
function set_member($member)
{
global $MOD;
$member['email'] = trim($member['email']);
$member['mail'] = isset($member['mail']) ? trim($member['mail']) : '';
is_email($member['mail']) or $member['mail'] = '';
$member['msn'] = isset($member['msn']) ? trim($member['msn']) : '';
is_email($member['msn']) or $member['msn'] = '';
$member['qq'] = isset($member['qq']) ? trim($member['qq']) : '';
is_numeric($member['qq']) or $member['qq'] = '';
$member['ali'] = isset($member['ali']) ? trim($member['ali']) : '';
if (!$this->is_clean($member['ali'])) {
$member['ali'] = '';
}
$member['skype'] = isset($member['skype']) ? trim($member['skype']) : '';
if (!$this->is_clean($member['skype'])) {
$member['skype'] = '';
}
$member['address'] = isset($member['address']) ? trim($member['address']) : '';
if (!$this->is_clean($member['address'])) {
$member['address'] = '';
}
$member['postcode'] = isset($member['postcode']) ? trim($member['postcode']) : '';
is_numeric($member['postcode']) or $member['postcode'] = '';
$member['mode'] = isset($member['mode']) && is_array($member['mode']) && $member['mode'] ? implode(',', $member['mode']) : '';
$member['keyword'] = $member['company'];
$member['homepage'] = isset($member['homepage']) ? fix_link($member['homepage']) : '';
$member['capital'] = isset($member['capital']) ? dround($member['capital']) : '';
$member['sound'] = intval($member['sound']);
if ($this->userid) {
$member['keyword'] = $member['company'] . strip_tags(area_pos($member['areaid'], ',')) . ',' . $member['business'] . ',' . $member['sell'] . ',' . $member['buy'] . ',' . $member['mode'];
clear_upload($member['thumb'] . $member['introduce'], $this->userid);
$new = $member['introduce'];
if ($member['thumb']) {
$new .= '<img src="' . $member['thumb'] . '">';
}
$content_table = content_table(4, $this->userid, is_file(DT_CACHE . '/4.part'), $this->table_company_data);
$r = $this->db->get_one("SELECT content FROM {$content_table} WHERE userid={$this->userid}");
$old = $r['content'];
$r = $this->get_one();
if ($r['thumb']) {
$old .= '<img src="' . $r['thumb'] . '">';
}
delete_diff($new, $old);
} else {
if ($member['thumb']) {
clear_upload($member['thumb'] . $member['introduce']);
}
}
$member['content'] = $member['introduce'];
$member['introduce'] = addslashes(get_intro($member['content'], $MOD['introduce_length']));
if (!defined('DT_ADMIN')) {
$content = $member['content'];
unset($member['content']);
$member = dhtmlspecialchars($member);
$member['content'] = dsafe($content);
}
if ($MOD['introduce_clear'] || $MOD['introduce_save']) {
$member['content'] = stripslashes($member['content']);
$member['content'] = save_local($member['content']);
if ($MOD['introduce_clear']) {
$member['content'] = clear_link($member['content']);
}
if ($MOD['introduce_save']) {
$member['content'] = save_remote($member['content']);
}
$member['content'] = addslashes($member['content']);
}
if ($member['catid']) {
$catids = explode(',', substr($member['catid'], 1, -1));
$cids = '';
foreach ($catids as $catid) {
$C = get_cat($catid);
if ($C) {
$catid = $C['parentid'] ? $C['arrparentid'] . ',' . $catid : $catid;
$cids .= $catid . ',';
}
}
$cids = array_unique(explode(',', substr(str_replace(',0,', ',', ',' . $cids), 1, -1)));
$member['catids'] = ',' . implode(',', $cids) . ',';
}
return $member;
}
开发者ID:hcd2008,项目名称:destoon,代码行数:83,代码来源:member.class.php
示例12: dhtmlspecialchars
}
$reason = dhtmlspecialchars($reason);
$message = isset($message) ? 1 : 0;
require MD_ROOT . '/reply.class.php';
$do = new reply();
foreach ($itemid as $rid) {
$do->itemid = $rid;
$R = $do->get_one();
if (!$R || $R['status'] != 3 || $R['gid'] != $gid) {
continue;
}
$do->recycle($rid);
if ($message) {
send_message($R['username'], lang($L['manage_msg_title'], array($L['my_manage_type_reply'], get_intro($R['content'], 20), $L['my_manage_type_del'])), lang($L['manage_msg_content'], array($MOD['linkurl'] . 'goto.php?itemid=' . $R['itemid'], nl2br($reason), $_username)));
}
$title = addslashes(get_intro($R['content'], 50));
$db->query("INSERT INTO {$table}_manage (gid,rid,username,addtime,typeid,title,content,reason,message) VALUES ('{$gid}','{$rid}','{$_username}','{$DT_TIME}','1','{$title}','{$content}','{$reason}','{$message}')");
}
dmsg($L['reply_success_del'], $forward);
break;
default:
require MD_ROOT . '/manage.class.php';
$do = new manage();
$sfields = $L['my_fields_manage'];
$dfields = array('title', 'reason', 'content');
isset($fields) && isset($dfields[$fields]) or $fields = 0;
$typeid = isset($typeid) ? intval($typeid) : 0;
$message = isset($message) ? intval($message) : -1;
$fields_select = dselect($sfields, 'fields', '', $fields);
$condition = "username='{$_username}'";
if ($keyword) {
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:my_manage.inc.php
示例13: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
is_url($post['thumb']) or $post['thumb'] = '';
is_url($post['thumb1']) or $post['thumb1'] = '';
is_url($post['thumb2']) or $post['thumb2'] = '';
$post['filepath'] = isset($post['filepath']) && is_filepath($post['filepath']) ? file_vname($post['filepath']) : '';
$post['editor'] = $_username;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['adddate'] = timetodate($post['addtime'], 3);
$post['edittime'] = $DT_TIME;
$post['editdate'] = timetodate($post['edittime'], 3);
$post['fee'] = dround($post['fee']);
$post['step']['a1'] = intval($post['step']['a1']);
$post['step']['p1'] = dround($post['step']['p1'], 2, 1);
$post['step']['a2'] = intval($post['step']['a2']);
$post['step']['p2'] = dround($post['step']['p2'], 2, 1);
$post['step']['a3'] = intval($post['step']['a3']);
$post['step']['p3'] = dround($post['step']['p3'], 2, 1);
$post['price'] = $post['step']['p1'];
if ($post['step']['a2'] && $post['step']['a2'] <= $post['step']['a1'] || $post['step']['p2'] && $post['step']['p2'] >= $post['step']['p1']) {
$post['step']['a2'] = $post['step']['a3'] = $post['step']['p2'] = $post['step']['p3'] = 0;
}
if ($post['step']['a3'] && $post['step']['a3'] <= $post['step']['a2'] || $post['step']['p3'] && $post['step']['p3'] >= $post['step']['p2']) {
$post['step']['a3'] = $post['step']['p3'] = 0;
}
$post['step']['is'] = $post['step']['a2'] ? 'Y' : 'N';
count($post['step'] == 7) or exit;
$post['amount'] = intval($post['amount']);
$post['mycatid'] = intval($post['mycatid']);
$post['elite'] = $post['elite'] ? 1 : 0;
if (strpos($post['v1'], '|') === false) {
$post['n1'] = $post['v1'] = '';
}
if (strpos($post['v2'], '|') === false) {
$post['n2'] = $post['v2'] = '';
}
if (strpos($post['v3'], '|') === false) {
$post['n3'] = $post['v3'] = '';
}
$post['express_1'] = intval($post['express_1']);
$post['fee_start_1'] = dround($post['fee_start_1']);
$post['fee_step_1'] = dround($post['fee_step_1']);
$post['express_2'] = intval($post['express_2']);
$post['fee_start_2'] = dround($post['fee_start_2']);
$post['fee_step_2'] = dround($post['fee_step_2']);
$post['express_3'] = intval($post['express_3']);
$post['fee_start_3'] = dround($post['fee_start_3']);
$post['fee_step_3'] = dround($post['fee_step_3']);
$post['cod'] = intval($post['cod']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
if ($MOD['introduce_length']) {
$post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
}
if ($this->itemid) {
$new = $post['content'];
if ($post['thumb']) {
$new .= '<img src="' . $post['thumb'] . '"/>';
}
if ($post['thumb1']) {
$new .= '<img src="' . $post['thumb1'] . '"/>';
}
if ($post['thumb2']) {
$new .= '<img src="' . $post['thumb2'] . '"/>';
}
$r = $this->get_one();
$old = $r['content'];
if ($r['thumb']) {
$old .= '<img src="' . $r['thumb'] . '"/>';
}
if ($r['thumb1']) {
$old .= '<img src="' . $r['thumb1'] . '"/>';
}
if ($r['thumb2']) {
$old .= '<img src="' . $r['thumb2'] . '"/>';
}
delete_diff($new, $old);
} else {
$post['ip'] = $DT_IP;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['step'] = serialize($post['step']);
$post['content'] = addslashes(dsafe($content));
return array_map("trim", $post);
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:94,代码来源:mall.class.php
示例14: set
function set($post)
{
global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid;
$post['editor'] = $_username;
$post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
$post['adddate'] = timetodate($post['addtime'], 3);
$post['edittime'] = $DT_TIME;
$post['editdate'] = timetodate($post['edittime'], 3);
$post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
$post['fee'] = dround($post['fee']);
$post['total'] = intval($post['total']);
$post['email'] = trim($post['email']);
$post['minsalary'] = intval($post['minsalary']);
$post['maxsalary'] = intval($post['maxsalary']);
$post['type'] = intval($post['type']);
$post['gender'] = intval($post['gender']);
$post['education'] = intval($post['education']);
$post['experience'] = intval($post['experience']);
$post['minage'] = intval($post['minage']);
$post['maxage'] = intval($post['maxage']);
$post['title'] = trim($post['title']);
$post['content'] = stripslashes($post['content']);
$post['content'] = save_local($post['content']);
if ($MOD['clear_link']) {
$post['content'] = clear_link($post['content']);
}
if ($MOD['save_remotepic']) {
$post['content'] = save_remote($post['content']);
}
if ($MOD['introduce_length']) {
$post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
}
if ($this->itemid) {
$new = $post['content'];
$r = $this->get_one();
$old = $r['content'];
delete_diff($new, $old);
} else {
$post['ip'] = $DT_IP;
}
$content = $post['content'];
unset($post['content']);
$post = dhtmlspecialchars($post);
$post['content'] = addslashes(dsafe($content));
return array_map("trim", $post);
}
开发者ID:hcd2008,项目名称:destoon,代码行数:46,代码来源:job.class.php
示例15: isset
isset($username) && check_name($username) or $username = '';
$username or mobile_msg($L['msg_not_user']);
$_userid or dheader('login.php?forward=' . urlencode('know.php?action=' . $action . '&username=' . $username));
$user = userinfo($username);
$user or mobile_msg($L['msg_not_user']);
$typeid = isset($typeid) && $typeid == 1 ? 1 : 0;
if ($typeid == 1) {
$condition = "status=3 AND username='{$username}'";
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table}_answer WHERE {$condition}", 'CACHE');
$items = $r['num'];
$pages = mobile_pages($items, $page, $pagesize);
$lists = array();
if ($items) {
$result = $db->query("SELECT * FROM {$table}_answer WHERE {$condition} ORDER BY addtime DESC LIMIT {$offset},{$pagesize}");
while ($r = $db->fetch_array($result)) {
$r['title'] = get_intro($r['content'], 50);
$r['date'] = timetodate($r['addtime'], 'Y/m/d H:i');
$lists[] = $r;
}
$db->free_result($result);
}
} else {
$condition = "status=3 AND username='{$username}'";
$r = $db->get_one("SELECT COUNT(*) AS num FROM {$table} WHERE {$condition}", 'CACHE');
$items = $r['num'];
$pages = mobile_pages($items, $page, $pagesize);
$lists = array();
if ($items) {
$result = $db->query("SELECT " . $MOD['fields'] . " FROM {$table} WHERE {$condition} ORDER BY addtime DESC LIMIT {$offset},{$pagesize}");
while ($r = $db->fetch_array($result)) {
$r['date'] = timetodate($r['addtime'], 'Y/m/d H:i');
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:know.php
示例16: dheader
$table = $DT_PRE . 'page';
$table_data = $DT_PRE . 'page_data';
if ($itemid) {
$item = $db->get_one("SELECT * FROM {$table} WHERE itemid={$itemid}");
if (!$item || $item['status'] < 3 || $item['username'] != $username) {
dheader($MENU[$menuid]['linkurl']);
}
extract($item);
$t = $db->get_one("SELECT content FROM {$table_data} WHERE itemid={$itemid}");
$content = $t['content'];
if (!$DT_BOT) {
$db->query("UPDATE LOW_PRIORITY {$table} SET hits=hits+1 WHERE itemid={$itemid}", 'UNBUFFERED');
}
$head_title = $title . $DT['seo_delimiter'] . $head_title;
$head_keywords = $title . ',' . $COM['company'];
$head_description = get_intro($content, 200);
} else {
$content_table = content_table(4, $userid, is_file(DT_CACHE . '/4.part'), $DT_PRE . 'company_data');
$t = $db->get_one("SELECT content FROM {$content_table} WHERE userid={$userid}");
$content = $t['content'];
$COM['thumb'] = $COM['thumb'] ? $COM['thumb'] : DT_SKIN . 'image/company.jpg';
}
$TYPE = array();
$result = $db->query("SELECT itemid,title,style FROM {$table} WHERE status=3 AND username='{$username}' ORDER BY listorder DESC,addtime DESC");
while ($r = $db->fetch_array($result)) {
$r['alt'] = $r['title'];
$r['title'] = set_style($r['title'], $r['style']);
$r['linkurl'] = userurl($username, "file={$file}&itemid={$r['itemid']}", $domain);
$TYPE[] = $r;
}
include template('introduce', $template);
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:introduce.inc.php
示例17: compile_article_listing
/**
* compile_article_listing
*
*
*
*
*
*
*/
function compile_article_listing($query, $config_layout = '')
{
if (empty($query)) {
return false;
}
// get layout config from database
if (empty($config_layout)) {
$config = get_settings('layout');
$config_layout = $config['layout'];
}
// set up pagination
$per_page = $config_layout['per_page'];
$page_no = isset($_GET['page']) ? (int) $_GET['page'] : '1';
$from = $page_no * $per_page - $per_page;
$query_paginated = $query . " LIMIT " . (int) $from . ", " . (int) $per_page;
// run query
$conn = reader_connect();
$result = $conn->query($query_paginated);
// get total results
$total_result = $conn->query($query);
$total_articles = $total_result->num_rows;
$total_pages = ceil($total_articles / $per_page);
// get a complete id list of return articles
$id_list = array();
while ($total_row = $total_result->fetch_assoc()) {
$id_list[] = $total_row['id'];
}
// get results
$data = array();
while ($row = $result->fetch_assoc()) {
$row = stripslashes_deep($row);
// create links
$row['link'] = $config_layout['url_style'] == 'blog' ? WW_REAL_WEB_ROOT . '/' . date('Y/m/d', strtotime($row['date_uploaded'])) . '/' . $row['url'] . '/' : WW_REAL_WEB_ROOT . '/' . $row['category_url'] . '/' . $row['url'] . '/';
// do we need a summary?
if (empty($row['summary']) && $config_layout['list_style'] == 'summary') {
$row['summary'] = create_summary($row['body']);
}
// do we need an intro
if ($config_layout['list_style'] == 'intro') {
$row['intro'] = get_intro($row['body']);
if (empty($row['intro'])) {
$row['intro'] = '<p>' . extract_sentences($row['body'], 50) . ' <a href="' . $row['link'] . '">(continues...)</a></p>';
}
}
// do we need the full body?
if ($config_layout['list_style'] != 'full') {
unset($row['body']);
} else {
$row['body'] = convert_relative_urls($row['body']);
}
// get tags
$tags = get_article_tags($row['id']);
$row['tags'] = !empty($tags) ? $tags : '';
// add page counts and compile into array
$row['total_pages'] = $total_pages;
$row['total_found'] = $total_articles;
$row['id_list'] = $id_list;
$data[] = $row;
}
$result->close();
$total_result->close();
return $data;
}
开发者ID:justincawthorne,项目名称:mt-test,代码行数:72,代码来源:controller_functions.php
注:本文中的get_intro函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论