Пример #1
0
 function insert()
 {
     $map['userId'] = $this->mid;
     $map['module'] = $_POST['module'];
     $map['recordId'] = $_POST['recordId'];
     $map['title'] = $_POST['title'];
     $map['content'] = getShareContent($map['module'], $map['recordId']);
     $map['info'] = $_POST['info'];
     $dao = D('UserShare');
     $c = $dao->create($map);
     $result = $dao->add();
     if ($result) {
         //记录动态
         /* add_user_feed */
         $feedTitle = $_POST['title'];
         $feedContent = "<div class=\"share-content\">" . $map['content'] . "</div>";
         $aa = $this->addUserFeed($this->mid, 'add', 'share', $result, $feedTitle, $feedContent);
         /* /add_user_feed */
         $this->success("分享成功!", 1);
     } else {
         $this->error("分享失败!", 0);
     }
 }
Пример #2
0
function getShare($id)
{
    $dao = D('UserShare');
    $share = $dao->find($id);
    if ($share->module == 'Url') {
        $content .= "<div class=\"share-content-desc\"><strong>" . $share->content . "</strong></div>";
    } else {
        $content .= getShareContent($share->module, $share->recordId);
    }
}