public function user_video($uid_param)
{
if ($uid_param) {
$uid = $uid_param;
$this->count = 4;
} else {
if (empty($this->user_id) && empty($this->data['uname'])) {
$uid = $this->mid;
} else {
if ($this->user_id) {
$uid = intval($this->user_id);
} else {
$uid = model('User')->where(array('uname' => $this->data['uname']))->getField('uid');
}
}
}
$max_id = $this->max_id ? intval($this->max_id) : 0;
$count = $this->count ? intval($this->count) : 20;
$map['a.uid'] = $uid;
$map['a.type'] = 'postvideo';
$map['a.is_del'] = 0;
!empty($max_id) && ($map['a.feed_id'] = array('lt', $max_id));
$list = D()->table('`' . C('DB_PREFIX') . 'feed` AS a LEFT JOIN `' . C('DB_PREFIX') . 'feed_data` AS b ON a.`feed_id` = b.`feed_id`')->field('a.`feed_id`, a.`publish_time`, b.`feed_data`')->where($map)->order('feed_id DESC')->limit($count)->findAll();
$video_config = model('Xdata')->get('admin_Content:video_config');
$video_server = $video_config['video_server'] ? $video_config['video_server'] : SITE_URL;
$video_list = array();
foreach ($list as $k => $value) {
$tmp = unserialize($value['feed_data']);
$video_list[$k]['feed_id'] = $value['feed_id'];
$video_id = $tmp['video_id'];
if ($video_id) {
$video_list[$k]['video_id'] = $video_id;
$video_list[$k]['flashimg'] = $video_server . $tmp['image_path'];
if ($tmp['transfer_id'] && !D('video_transfer')->where('transfer_id=' . $tmp['transfer_id'])->getField('status')) {
$video_list[$k]['transfering'] = 1;
} else {
$video_list[$k]['flashvar'] = $tmp['video_mobile_path'] ? $video_server . $tmp['video_mobile_path'] : $video_server . $tmp['video_path'];
}
} else {
$video_list[$k]['flashimg'] = UPLOAD_URL . '/' . $tmp['flashimg'];
$pos = stripos($tmp['body'], 'http');
$video_list[$k]['flashvar'] = substr($tmp['body'], $pos);
}
}
return $video_list;
}