/**
  * 修改收货地址
  *
  * @param	intval	$id
  * @param	array	$data
  * @return	intavl
  */
 public function edit_address($id, $data)
 {
     if (!$data || !$id) {
         return NULL;
     }
     if ($data['default']) {
         $this->db->where('uid', $this->uid)->update('member_address', array('default' => 0));
     }
     $data['name'] = dr_strcut($data['name'], 20);
     $data['phone'] = $data['phone'];
     $data['zipcode'] = (int) $data['zipcode'];
     $this->db->where('id', $id)->where('uid', $this->uid)->update('member_address', $data);
     return $id;
 }
/**
 * 用于视频播放器字段输出
 *
 * @param	string	$name		字段名称
 * @param	array	$value		字段值
 * @param	intval	$width		宽度
 * @param	intval	$height		高度
 * @param	string	$next_url	下一集url
 * @param	string	$title		视频分享标题
 * @param	string	$url		视频分享url
 * @param	string	$desc		视频分享描述
 * @param	string	$thumb		视频分享图片
 * @return	array
 */
function dr_player($name, $value, $width, $height, $next_url = '', $title = '', $url = '', $desc = '', $thumb = '')
{
    $file = dr_get_file($value['file']);
    $str = '
	<div id="video" style="position:relative;z-index: 51;width:' . $width . 'px;height:' . $height . 'px;"><div id="a1"></div></div>
	<script type="text/javascript" src="' . SITE_URL . 'player/offlights.js"></script>
	<script type="text/javascript" src="' . SITE_URL . 'player/ckplayer.js" charset="utf-8"></script>
	<script type="text/javascript">
		var flashvars={
			s:2,
			f:\'' . SITE_URL . 'player/video.php?url=[$pat]\',
			a:\'' . $file . '\',
			c:0,
			b:1,
			h:4,
			p:1,' . PHP_EOL;
    // 定时点处理
    if ($value['point']) {
        $k = $n = '';
        foreach ($value['point'] as $time => $note) {
            $k .= $time . '|';
            $n .= $note . '|';
        }
        $str .= '			k:\'' . trim($k, '|') . '\',' . PHP_EOL;
        $str .= '			n:\'' . trim($n, '|') . '\',' . PHP_EOL;
    }
    // 广告处理
    $mod = get_module(APP_DIR, SITE_ID);
    $option = '';
    if ($mod['field'][$name]) {
        $option = $mod['field'][$name]['setting']['option'];
    } elseif ($mod['extend'][$name]) {
        $option = $mod['extend'][$name]['setting']['option'];
    }
    if ($option && $option['table']) {
        $ci =& get_instance();
        if ($option['time'][$ci->markrule]) {
            $time = $option['time'][$ci->markrule];
            // 查询该表的数据
            $form = $ci->get_cache('form-' . SITE_ID, $option['table']);
            if ($form) {
                $data = $ci->site[SITE_ID]->order_by('id', 'RANDOM')->limit(1)->get(SITE_ID . '_form_' . $form['table'])->row_array();
                if ($data) {
                    $str .= '			l:\'' . dr_thumb($data['thumb']) . '\',' . PHP_EOL;
                    $str .= '			r:\'' . $data['link'] . '\',' . PHP_EOL;
                    $str .= '			t:\'' . $time . '\',' . PHP_EOL;
                    $str .= '			d:\'' . dr_thumb($data['thumb']) . '\',' . PHP_EOL;
                    $str .= '			u:\'' . $data['link'] . '\',' . PHP_EOL;
                    $member = '<style>.dr_adv td, .dr_adv th { border-bottom: 1px solid #EEEEEE;height: 22px;line-height: 22px;padding-bottom: 3px;padding-top: 3px;}.dr_adv td{ text-align:right;}</style><table class="dr_adv">';
                    $MEMBER = $ci->get_cache('member');
                    $member .= '<tr>';
                    $member .= '	<th align="left" width="200">' . lang('m-347') . '</th>';
                    $member .= '	<td align="left">';
                    $member .= ' ' . (int) $option['time'][0] . lang('m-330');
                    $member .= ' </td>';
                    $member .= '</tr>';
                    foreach ($MEMBER['group'] as $group) {
                        if ($group['id'] > 2) {
                            $member .= '<tr>';
                            $member .= '	<th align="left">' . $group['name'] . '</th>';
                            $member .= '	<td align="left"></td>';
                            $member .= '</tr>';
                            foreach ($group['level'] as $level) {
                                $id = $group['id'] . '_' . $level['id'];
                                $member .= '<tr>';
                                $member .= '<th align="left" style="padding-left:40px">' . $level['name'] . '&nbsp;&nbsp;' . dr_show_stars($level['stars']) . '</th>';
                                $member .= '<td align="left">';
                                $member .= '' . (int) $option['time'][$id] . lang('m-330');
                                $member .= '</td>';
                                $member .= '</tr>';
                            }
                        } else {
                            $member .= '<tr>';
                            $member .= '	<th align="left">' . $group['name'] . '</th>';
                            $member .= '	<td align="left">';
                            $member .= ' ' . (int) $option['time'][$group['id']] . lang('m-330');
                            $member .= ' </td>';
                            $member .= '</tr>';
                        }
                    }
                    $member .= '<tr>';
                    $member .= '	<td style="border:none;text-align:center;"><a href="' . MEMBER_URL . 'index.php?c=account&m=upgrade" target="_blank" style="color:red;">' . lang('m-348') . '</a></td>';
                    $member .= '</tr>';
                    $member .= '</table>';
                }
            }
        }
    }
    if ($next_url) {
        $str .= '			e:0,' . PHP_EOL;
    } else {
        $str .= '			e:2,' . PHP_EOL;
    }
    $str .= '			my_title:\'' . $title . '\',
			my_url:\'' . $url . '\',
			my_summary:\'' . str_replace(array('\'', '"'), '', dr_clearhtml(dr_strcut($desc, 200))) . '\',
			my_pic:\'' . dr_get_file($thumb) . '\'
		};
		var params={
			bgcolor:\'#FFF\',
			allowFullScreen:true,
			allowScriptAccess:\'always\'
		};
		CKobject.embedSWF(\'' . SITE_URL . 'player/ckplayer.swf\',\'a1\',\'ckplayer_a1\',\'' . $width . '\',\'' . $height . '\',flashvars,params);
    ';
    if ($next_url) {
        $str .= 'function playerstop(){
			location.href="' . $next_url . '";
		}';
    }
    $str .= '
		function ckadjump(){
			var throughBox = art.dialog.through;
			throughBox({
				content: \'' . $member . '\',
				lock: true,
				opacity: 0.1
			});
		}
		var box = new LightBox();
		function closelights(){
			box.Show();
			CKobject._K_(\'video\').style.width=\'' . $width . 'px\';
			CKobject._K_(\'video\').style.height=\'' . $height . 'px\';
			swfobject.getObjectById(\'ckplayer_a1\').width=' . $width . ';
			swfobject.getObjectById(\'ckplayer_a1\').height=' . $height . ';
		}
		function openlights(){
			box.Close();
			CKobject._K_(\'video\').style.width=\'' . $width . 'px\';
			CKobject._K_(\'video\').style.height=\'' . $height . 'px\';
			swfobject.getObjectById(\'ckplayer_a1\').width=' . $width . ';
			swfobject.getObjectById(\'ckplayer_a1\').height=' . $height . ';
		}
	</script>
	';
    return $str;
}
 protected function get_content_data($data, $_data = NULL)
 {
     if (!$data[1]['description']) {
         $data[1]['description'] = trim(dr_strcut(dr_clearhtml($data[0]['content']), 200));
     }
     return $data;
 }
示例#4
0
文件: Syn.php 项目: surgeon-xie/jxseo
 /**
  * 字段表单输入
  *
  * @param	string	$cname	字段别名
  * @param	string	$name	字段名称
  * @param	array	$cfg	字段配置
  * @param	array	$data	值
  * @return  string
  */
 public function input($cname, $name, $cfg, $value = NULL, $id = 0)
 {
     // 编辑不出现
     if ($id) {
         return;
     }
     // 字段显示名称
     $text = (isset($cfg['validate']['required']) && $cfg['validate']['required'] == 1 ? '<font color="red">*</font>' : '') . '&nbsp;' . $cname . ':';
     // 字段提示信息
     $tips = isset($cfg['validate']['tips']) && $cfg['validate']['tips'] ? '<div class="onShow" id="dr_' . $name . '_tips">' . $cfg['validate']['tips'] . '</div>' : '';
     // 显示框宽度设置
     $width = isset($cfg['option']['width']) && $cfg['option']['width'] ? $cfg['option']['width'] : '80%';
     // 默认值
     $value = IS_POST ? $_POST['data']['syn'] : dr_string2array($value);
     // 查询当前模块是否在其他站点中出现
     $site = $this->ci->get_cache('module');
     unset($site[SITE_ID]);
     //
     $str = '<input type="radio" name="data[' . $name . '][use]" onclick="$(\'#dr_div_syn\').hide()" value="0" ' . (!$value['use'] ? 'checked' : '') . ' />&nbsp;关闭&nbsp;&nbsp;&nbsp;&nbsp;';
     $str .= '<input type="radio" name="data[' . $name . '][use]" onclick="$(\'#dr_div_syn\').show()" value="1" ' . ($value['use'] ? 'checked' : '') . ' />&nbsp;开启';
     $str .= '<div class="dr_format_wrap" id="dr_div_syn" style="margin-top:5px;' . ($value['use'] ? '' : 'display:none') . ';width:' . $width . '">';
     $str .= '<table width="100%">';
     // 查询当前模块是否在其他站点中出现
     if ($site) {
         foreach ($site as $sid => $dirs) {
             if (in_array(APP_DIR, $dirs)) {
                 $str .= '<tr>';
                 $str .= '	<td width=150 align=right>' . dr_strcut($this->ci->SITE[$sid]['SITE_NAME'], 15) . ':</td>';
                 $str .= '	<td>' . $this->ci->select_category($this->ci->get_cache('module-' . $sid . '-' . APP_DIR, 'category'), $value[$sid], ' name=\'data[' . $name . '][' . $sid . ']\'', ' -- ', 1, 1) . '</td>';
                 $str .= '</tr>';
             }
         }
     }
     $str .= '</table>';
     $str .= '</div>';
     return $this->input_format($name, $text, $str . $tips);
 }
示例#5
0
 public function group_select()
 {
     $id = (int) $this->input->get('id');
     $gid = (int) $this->input->get('gid');
     $group = $this->db->where('id', $gid)->get('sns_follow_group')->row_array();
     if ($group) {
         $this->db->where('id', $id)->update('sns_follow', array('gid' => $gid));
         exit(dr_strcut($group['title'], 15));
     }
     exit;
 }
示例#6
0
 /**
  * 字段入库值
  */
 public function insert_value($field)
 {
     $value = $this->ci->post[$field['fieldname']];
     // 下载远程图片
     if (preg_match_all("/(src)=([\"|']?)([^ \"'>]+\\.(gif|jpg|jpeg|png))\\2/i", $value, $imgs)) {
         $uid = isset($this->ci->_data['uid']) ? $this->ci->_data['uid'] : $this->ci->uid;
         $down = FALSE;
         // 附件总大小判断
         if ($uid && $uid == $this->ci->uid && !$this->ci->member['adminid'] && $this->ci->member_rule['attachsize']) {
             $data = $this->ci->db->select_sum('filesize')->where('uid', $uid)->get($this->ci->db->dbprefix('attachment'))->row_array();
             if ($filesize <= $this->ci->member_rule['attachsize'] * 1024 * 1024) {
                 $down = TRUE;
             }
         }
         // 开始下载远程图片
         if ($down) {
             $this->ci->load->model('attachment_model');
             foreach ($imgs[3] as $i => $img) {
                 if ($uid && (strpos($img, SITE_URL) === FALSE || strpos($img, SITE_ATTACH_URL) === FALSE)) {
                     $result = $this->ci->attachment_model->catcher($uid, $img);
                     if (is_array($result)) {
                         list($id, $file, $_ext) = $result;
                         $value = str_replace($imgs[0][$i], " id=\"{$id}\" src=\"" . dr_file($file) . "\"", $value);
                     }
                 }
             }
         }
     }
     // 第一张作为缩略图
     if (isset($this->ci->post['thumb']) && (!($thumb = dr_string2array($this->ci->data[1]['thumb'])) || !$thumb['file']) && preg_match("/(src)=([\"|']?)([^ \"'>]+\\.(gif|jpg|jpeg|png))\\2/Ui", $value, $img)) {
         $this->ci->data[1]['thumb'] = $img[3];
     }
     // 描述截取
     if (isset($this->ci->post['description']) && !$this->ci->data[1]['description']) {
         $this->ci->data[1]['description'] = str_replace(array(' ', PHP_EOL, '  '), '', dr_strcut(dr_clearhtml($value), 200));
     }
     $this->ci->data[$field['ismain']][$field['fieldname']] = $value;
 }
        ?>
" title="<?php 
        echo $t['title'];
        ?>
"><img src="<?php 
        echo dr_thumb($t['thumb'], 300, 300);
        ?>
" /></a>
        	<div class="titbg"><a href="<?php 
        echo $t['url'];
        ?>
" title="<?php 
        echo $t['title'];
        ?>
"><?php 
        echo dr_strcut($t['title'], 20);
        ?>
</a></div>
            <div class="jgbox"><font>¥ <?php 
        echo $t['price'];
        ?>
</font></div>
        </li>
        <?php 
    }
}
?>
		</ul>
	</div>
	<div class="clear"></div>
</div>
示例#8
0
 /**
  * 会员空间页
  */
 private function _space($uid)
 {
     if (!MEMBER_OPEN_SPACE) {
         $this->member_msg(lang('m-111'));
     }
     $this->load->model('space_model');
     $this->load->model('space_category_model');
     $space = $this->space_model->get($uid);
     if (!$space) {
         $this->template->assign('theme', MEMBER_PATH . 'templates/default/');
         $this->member_msg(lang('m-234'));
     }
     if (!$space['status']) {
         $this->member_msg(lang('m-235'));
     }
     $space = $this->field_format_value($this->get_cache('member', 'spacefield'), $space, 1);
     $style = $space['style'] ? $space['style'] : 'default';
     $theme = MEMBER_URL . 'templates/' . $style . '/';
     $action = $this->input->get('action');
     $member = $this->member_model->get_member($uid);
     $selected = 0;
     // 默认选中首页菜单
     $category = $this->space_category_model->get_data(0, $uid, 1);
     switch ($action) {
         case 'category':
             // 栏目处理
             $id = (int) $this->input->get('id');
             $cat = $category[$id];
             if (!$cat) {
                 $this->msg(lang('m-315'));
             }
             switch ($cat['type']) {
                 case 0:
                     // 外链
                     if (!$cat['link']) {
                         $this->msg(lang('m-316'));
                     }
                     redirect($cat['link'], 'location', 301);
                     return NULL;
                     break;
                 case 1:
                     // 模型
                     $model = $this->get_cache('space-model', $cat['modelid']);
                     if (!$model) {
                         $this->msg(lang('m-317'));
                     }
                     $template = 'list_' . $model['table'] . '.html';
                     // 选中顶级栏目
                     $temp = explode(',', $cat['pids']);
                     $selected = $temp[1] ? $temp[1] : $id;
                     break;
                 case 2:
                     // 单页
                     $template = 'page.html';
                     // 选中顶级栏目
                     $temp = explode(',', $cat['pids']);
                     $selected = $temp[1] ? $temp[1] : $id;
                     // 单页验证是否存在子栏目
                     if ($cat['child']) {
                         $temp = explode(',', $cat['childids']);
                         if (isset($temp[1]) && $category[$temp[1]]) {
                             $id = $temp[1];
                             $cat = $category[$id];
                         }
                     }
                     break;
             }
             // 栏目下级或者同级栏目
             $related = $parent = array();
             if ($cat['pid']) {
                 foreach ($category as $t) {
                     if ($t['pid'] == $cat['pid']) {
                         $related[] = $t;
                         if ($cat['child']) {
                             $parent = $cat;
                         } else {
                             $parent = $category[$t['pid']];
                         }
                     }
                 }
             } elseif ($cat['child']) {
                 $parent = $cat;
                 foreach ($category as $t) {
                     if ($t['pid'] == $cat['id']) {
                         $related[] = $t;
                     }
                 }
             }
             $this->template->assign(array('cat' => $cat, 'catid' => $id, 'parent' => $parent, 'related' => $related, 'modelid' => $cat['modelid'], 'urlrule' => dr_space_list_url($uid, $id, TRUE)));
             if ($cat['title']) {
                 $title = $cat['title'];
             } else {
                 $title = implode('-', array_reverse(explode('{-}', dr_space_catpos($uid, $id, '{-}', FALSE)))) . '-' . $space['name'];
             }
             $this->template->assign(array('meta_title' => $title, 'meta_keywords' => $cat['keywords'], 'meta_description' => $cat['description']));
             break;
         case 'show':
             // 内容处理
             $id = (int) $this->input->get('id');
             $mid = (int) $this->input->get('mid');
             $mod = $this->get_cache('space-model', $mid);
             if (!$mod) {
                 $this->msg(lang('m-317'));
             }
             $name = $this->db->dbprefix('space_' . $mod['table']) . '-space-show-' . $id;
             $data = $this->get_cache_data($name);
             if (!$data) {
                 $this->load->model('space_content_model');
                 $this->space_content_model->tablename = $this->db->dbprefix('space_' . $mod['table']);
                 $data = $this->space_content_model->get($uid, $id);
                 if (!$data) {
                     $this->msg(lang('m-303'));
                 }
                 if (!$data['status'] && $data['uid'] != $this->uid) {
                     $this->msg(lang('m-318'));
                 }
                 $cat = $category[$data['catid']];
                 if (!$cat) {
                     $this->msg(lang('m-315'));
                 }
                 // 检测转向字段
                 foreach ($mod['field'] as $t) {
                     if ($t['fieldtype'] == 'Redirect' && $data[$t['fieldname']]) {
                         redirect($data[$t['fieldname']], 'location', 301);
                         exit;
                     }
                 }
                 // 上一篇文章
                 $data['prev_page'] = $this->db->where('catid', $data['catid'])->where('id<', $id)->where('status', 1)->select('title,id,updatetime')->order_by('id desc')->limit(1)->get($this->space_content_model->tablename)->row_array();
                 // 下一篇文章
                 $data['next_page'] = $this->db->where('catid', $data['catid'])->where('id>', $id)->where('status', 1)->select('title,id,updatetime')->order_by('id asc')->limit(1)->get($this->space_content_model->tablename)->row_array();
                 $this->set_cache_data($name, $data, 360000);
             } else {
                 $cat = $category[$data['catid']];
                 if (!$cat) {
                     $this->msg(lang('m-315'));
                 }
             }
             // 格式化输出自定义字段
             $fields = $mod['field'];
             $fields['inputtime'] = array('fieldtype' => 'Date');
             $fields['updatetime'] = array('fieldtype' => 'Date');
             $data = $this->field_format_value($fields, $data, max(1, (int) $this->input->get('page')));
             // 栏目下级或者同级栏目
             $related = $parent = array();
             if ($cat['pid']) {
                 foreach ($category as $t) {
                     if ($t['pid'] == $cat['pid']) {
                         $related[] = $t;
                         if ($cat['child']) {
                             $parent = $cat;
                         } else {
                             $parent = $category[$t['pid']];
                         }
                     }
                 }
             } elseif ($cat['child']) {
                 $parent = $cat;
                 foreach ($category as $t) {
                     if ($t['pid'] == $cat['id']) {
                         $related[] = $t;
                     }
                 }
             }
             $template = 'show_' . $mod['table'] . '.html';
             // 选中顶级栏目
             $temp = explode(',', $cat['pids']);
             $selected = $temp[1] ? $temp[1] : $cat['id'];
             $this->template->assign($data);
             $this->template->assign(array('cat' => $cat, 'catid' => $cat['id'], 'parent' => $parent, 'related' => $related, 'modelid' => $cat['modelid']));
             $temp = dr_space_catpos($uid, $cat['id'], '{-}', FALSE);
             $temp = explode('{-}', $temp);
             $catstr = implode('-', array_reverse($temp));
             $this->template->assign(array('meta_title' => ($data['content_title'] ? $data['content_title'] . '-' : '') . $data['title'] . '-' . $catstr . '-' . $space['name'], 'meta_keywords' => $data['keywords'], 'meta_description' => dr_strcut(dr_clearhtml($data['content']), 200, '')));
             break;
         default:
             // 首页或者其他自定义页面
             $template = $action ? $action . '.html' : 'index.html';
             $this->template->assign(array('meta_title' => $space['title'] ? $space['title'] : $space['name'], 'meta_keywords' => $space['keywords'], 'meta_description' => $space['description']));
             break;
     }
     // 更新访问量pv
     $this->db->where('uid', (int) $uid)->update('space', array('hits' => $space['hits'] + 1));
     $space['mname'] = $member['name'];
     $this->template->assign(array('theme' => $theme, 'space' => $space + $member, 'spaceid' => $uid, 'tableid' => (int) substr((string) $uid, -1, 1), 'selected' => $selected, 'category' => $category));
     $this->template->space($style);
     $this->template->display($template);
 }
示例#9
0
 /**
  * 新浪微博分享
  *
  * @param	array	$data
  * @return  Bool|String
  */
 public function _execute_sinashare($data)
 {
     $data = dr_string2array($data);
     if (!$data) {
         return '执行值不存在';
     }
     $config = (require FCPATH . 'config/oauth.php');
     if (!isset($config['sina']) || !isset($config['sina']['key'])) {
         return 'Sina配置文件不正确或者Key不存在';
     }
     // 查询OAuth2授权信息
     $auth = $this->db->where('uid', (int) $data['uid'])->where('oauth', 'sina')->limit(1)->get('member_oauth')->row_array();
     if (!$auth) {
         return '会员uid:' . $data['uid'] . ' 授权信息不存在';
     }
     require_once FCPATH . 'dayrui/libraries/Share/Sina.php';
     $auth = new SaeTClientV2($config['sina']['key'], $config['sina']['secret'], $auth['access_token']);
     if ($data['thumb']) {
         $call = $auth->upload(dr_strcut($data['title'], 120) . ' ' . $data['url'], $data['thumb']);
     } else {
         $call = $auth->update(dr_strcut($data['title'], 120) . ' ' . $data['url']);
     }
     return isset($call['id']) && $call['id'] ? TRUE : (isset($call['error']) && $call['error'] ? $call['error'] : $call);
 }
示例#10
0
 /**
  * 发送短消息
  *
  * @param	intval	$fromuid		发送者uid
  * @param	string	$fromusername	发送者username
  * @param	array	$data			发送数据
  * @return	string
  */
 public function send($fromuid, $fromusername, $data)
 {
     if (!$fromuid || !$fromusername || !$data['username'] || !$data['message']) {
         return lang('m-062');
     }
     $subject = dr_safe_replace(htmlspecialchars($data['subject']));
     $message = dr_safe_replace(htmlspecialchars($data['message']));
     // 查询会员数据
     $member = array();
     $username = explode(',', $data['username']);
     foreach ($username as $name) {
         $uid = get_member_id($name);
         if ($uid) {
             $member[$uid] = $name;
         }
     }
     if (!$member) {
         return lang('m-066');
     }
     // 建立对应关系
     $relationship = $existplid = $pm_member_insertsql = array();
     // 多个对象是,关系数组为多位数组
     foreach ($member as $key => $value) {
         if ($fromuid == $key) {
             return lang('m-067');
         }
         //$key是接收者id
         $relationship[$key] = $this->_relationship($fromuid, $key);
     }
     // 处理标题
     $subject = !$subject ? dr_strcut(dr_clearhtml($message), 80) : $subject;
     // 作为最后一条消息内容
     $lastsummary = dr_strcut(dr_clearhtml($message), 150);
     // 短消息会话表中按“对应关系”来查询
     $list = $this->db->select('plid, min_max')->where_in('min_max', $relationship)->get('pm_lists')->result_array();
     if ($list) {
         foreach ($list as $t) {
             $existplid[$t['min_max']] = $t['plid'];
             // 获取到该关系的plid
         }
     }
     // 最后一条消息的数据组装
     $lastmessage = array('lastauthorid' => $fromuid, 'lastauthor' => $fromusername, 'lastsummary' => $lastsummary);
     $lastmessage = dr_array2string($lastmessage);
     // 按照对应关系来插入消息表中,当对应关系在库中不存在时,重新创建一个对应关系表
     foreach ($relationship as $key => $value) {
         if (!isset($existplid[$value])) {
             // 插入新的列表id
             $this->db->insert('pm_lists', array('authorid' => $fromuid, 'author' => $fromusername, 'pmtype' => 1, 'subject' => $subject, 'members' => 2, 'min_max' => $value, 'dateline' => SYS_TIME, 'lastmessage' => $lastmessage));
             // 获取会话列表ID
             $plid = $this->db->insert_id();
             // 将列表id插入到消息索引表中
             $this->db->insert('pm_indexes', array('plid' => $plid));
             // 得到一个短消息ID
             $pmid = $this->db->insert_id();
             // 以回话列表id作为散列存储
             $this->db->insert($this->_pm_tablename($plid), array('pmid' => $pmid, 'plid' => $plid, 'authorid' => $fromuid, 'message' => $message, 'dateline' => SYS_TIME, 'delstatus' => 0));
             // 存储到“接受者的”消息状态表
             $this->db->insert('pm_members', array('plid' => $plid, 'uid' => $key, 'isnew' => 1, 'pmnum' => 1, 'lastupdate' => 0, 'lastdateline' => SYS_TIME));
             // 存储到“发送者的”消息状态表
             $this->db->insert('pm_members', array('plid' => $plid, 'uid' => $fromuid, 'isnew' => 0, 'pmnum' => 1, 'lastupdate' => SYS_TIME, 'lastdateline' => SYS_TIME));
         } else {
             // 获取上面查询的会话列表ID
             $plid = $existplid[$value];
             // 将列表id插入到消息索引表中
             $this->db->insert('pm_indexes', array('plid' => $plid));
             // 得到一个短消息ID
             $pmid = $this->db->insert_id();
             // 以回话列表id作为散列存储
             $this->db->insert($this->_pm_tablename($plid), array('pmid' => $pmid, 'plid' => $plid, 'authorid' => $fromuid, 'message' => $message, 'dateline' => SYS_TIME, 'delstatus' => 0));
             // 存储到“接受者的”消息状态表
             if ($this->db->where('plid', $plid)->where('uid', $key)->count_all_results('pm_members')) {
                 // 如果已经存在了就更新状态表
                 $this->db->where('plid', $plid)->where('uid', $key)->set('isnew', 1)->set('lastdateline', SYS_TIME)->set('pmnum', 'pmnum+1', FALSE)->update('pm_members');
             } else {
                 $this->db->insert('pm_members', array('plid' => $plid, 'uid' => $key, 'isnew' => 1, 'pmnum' => 1, 'lastupdate' => 0, 'lastdateline' => SYS_TIME));
             }
             // 存储到“发送者的”消息状态表
             if ($this->db->where('plid', $plid)->where('uid', $fromuid)->count_all_results('pm_members')) {
                 // 如果已经存在了就更新状态表
                 $this->db->where('plid', $plid)->where('uid', $fromuid)->set('isnew', 0)->set('lastdateline', SYS_TIME)->set('pmnum', 'pmnum+1', FALSE)->update('pm_members');
             } else {
                 $this->db->insert('pm_members', array('plid' => $plid, 'uid' => $fromuid, 'isnew' => 0, 'pmnum' => 1, 'lastupdate' => SYS_TIME, 'lastdateline' => SYS_TIME));
             }
             // 更新最后一条消息信息
             $this->db->where('plid', $plid)->set('lastmessage', $lastmessage)->update('pm_lists');
         }
     }
     // 插入用户的新短消息表
     foreach ($member as $key => $value) {
         $this->db->replace('newpm', array('uid' => $key));
     }
     return NULL;
 }
                        <div class="sub">
                             <dl>
								<?php 
        $return_t2 = $this->list_tag("action=module module=photo catid={$t1['id']} flag=2  return=t2");
        if ($return_t2) {
            extract($return_t2);
        }
        $count_t2 = count($return_t2);
        if (is_array($return_t2)) {
            foreach ($return_t2 as $key_t2 => $t2) {
                ?>
                                 <dd><a href="<?php 
                echo $t2['url'];
                ?>
"><?php 
                echo dr_strcut($t2['title'], 15, '');
                ?>
</a></dd>
								<?php 
            }
        }
        ?>
                             </dl>
                         </div>
                    </li>
					<?php 
    }
}
?>
                </ul>
            </div>
            echo dr_url(APP_DIR . '/home/index', array('flag' => $flag, 'catid' => $t['catid']));
        } else {
            echo dr_url(APP_DIR . '/home/index', array('catid' => $t['catid']));
        }
        ?>
"><?php 
        $cache = $this->_cache_var('CATEGORY');
        eval('echo $cache' . $this->_get_var('$t[catid].name') . ';');
        unset($cache);
        ?>
</a></td>
			<td hide="1" align="center"><a href="javascript:;" onclick="dr_dialog_member('<?php 
        echo $t['uid'];
        ?>
')"><?php 
        echo dr_strcut($t['author'], 10);
        ?>
</a></td>
			<td align="left"><?php 
        echo dr_date($t['updatetime'], NULL, 'red');
        ?>
</td>
			<td align="left" class="dr_option">
            <div class="drmenu">
            <ul>
			<li><a class="ago" href="<?php 
        echo $t['url'];
        ?>
" target="_blank"><?php 
        echo lang('go');
        ?>
        echo $t['url'];
        ?>
" ><img src="<?php 
        echo dr_thumb($t['thumb'], 120, 90);
        ?>
" class="thumb" width="120" height="90" /></a>
                        <div class="texts">
                            <p class="title2"><a href="<?php 
        echo $t['url'];
        ?>
" class="title"><?php 
        echo dr_strcut($t['title'], 30);
        ?>
</a></p>
                            <p class="summary"><?php 
        echo dr_strcut($t['description'], 40);
        ?>
</p>
                        </div>
                        <?php 
    }
}
?>
                    </div>

                    <ul class="list list-point news-list">
                    	<!-- 调用模块的最新第1条以后的4条数据 -->
                    	<?php 
$return = $this->list_tag("action=module module=fang order=updatetime num=1,4");
if ($return) {
    extract($return);
    ?>
" target="right"><i class="icon-compass"></i></a>
                </li>
                <?php 
}
?>
                <li class="dropdown">
                    <a class="dropdown-toggle" href="javascript:;" onClick="dr_get_map()" title="<?php 
echo lang('html-025');
?>
"><i class="icon-sitemap"></i></a>
                </li>
            </ul>
            <div class="dropdown" id="dr_member">
                <a data-toggle="dropdown" class="dropdown-toggle" href="javascript:;"><?php 
echo dr_strcut($admin['username'], 8);
?>
&nbsp;<img style="width:27px;height:27px;" src="<?php 
echo dr_avatar($admin['uid']);
?>
" /></a>
                <ul class="dropdown-menu pull-right">
                    <li><a href="<?php 
echo MEMBER_URL;
?>
index.php?c=api&m=member" target="_blank" id="site_member"><i class="icon-user"></i> <?php 
echo lang('html-007');
?>
</a></li>
                    <li><a href="javascript:;" onClick="logout();"><i class="icon-signout"></i> <?php 
echo lang('html-005');