示例#1
0
文件: save.php 项目: yunsite/easysns
$data = array();
$data['type'] = $type;
$data['link'] = $url;
$data['time'] = date("Y-m-d H:i:s");
$data['desp'] = $desp;
switch ($type) {
    case VIDEO:
        $info = parse_url($url);
        $data['video_domain'] = $info['host'];
        $cnname = '视频';
        break;
    case MUSIC:
        $data['music_url'] = $url;
        $cnname = '音乐';
        break;
    case WEBPAGE:
        $cnname = '网页';
        break;
}
$data['uid'] = format_uid();
global $CI;
$CI->load->database();
$CI->db->insert('app_fav', $data);
$aid = $CI->db->insert_id();
if ($aid) {
    $aname = 'ishare';
    $appname = get_app_name_with_aid($aname);
    $title = '<a href="/user/space/' . format_uid() . '" target="_blank">' . _sess('u2_nickname') . '</a>' . $appname . '了一个<a href="/app/native/' . $aname . '/show/' . $aid . '/" target="_blank">' . $cnname . '</a>';
    send_to_feed(format_uid(), 'ishare', $title, mb_substr($data['desp'], 0, 20, 'utf-8'));
}
header('Location: /app/native/' . $GLOBALS['app'] . '/index');
示例#2
0
文件: ajax.php 项目: yunsite/easysns
 function saveres()
 {
     $aname = v('aname');
     $aid = v('aid');
     $uid = v('uid');
     $desp = z(v('desp'));
     if (is_login()) {
         if (!$aname || !$aid || !$uid || !$desp) {
             die(_text('system_error_id'));
         }
         $resid = $this->ajax->res_save($aname, $aid, NULL, $desp);
         if ($uid != format_uid()) {
             $appname = get_app_name_with_aid($aname);
             $title = '<a href="/user/space/' . format_uid() . '" target="_blank">' . _sess('u2_nickname') . '</a>回复了您的<a href="/app/native/' . $aname . '/show/' . $aid . '/" target="_blank">一篇' . $appname . '</a>';
             send_to_notice(format_uid($uid), $aname, $title);
             $pic = NULL;
             if ($aname == 'icase') {
                 $url = $this->ajax->get_unique_pic_url($aid);
                 if ($url) {
                     $pic = '/static/scripts/icon.php?url=' . urlencode($url);
                 }
             }
             $title = '<a href="/user/space/' . format_uid() . '" target="_blank">' . _sess('u2_nickname') . '</a>对<a href="/app/native/' . $aname . '/show/' . $aid . '/" target="_blank">' . $appname . '</a>发表了回复';
             send_to_feed(format_uid(), 'system_miniblog', $title, $desp, $pic);
         }
     }
     $this->getres($aname, $aid, $uid);
 }