shoucang.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. !defined('IN_MYMPS') && exit('FORBIDDEN');
  3. require_once MYMPS_DATA . '/config.db.php';
  4. require_once MYMPS_INC . '/db.class.php';
  5. require_once MYMPS_INC . '/member.class.php';
  6. $infoid = $infoid ? intval($infoid) : '';
  7. !$infoid && write_msg('收藏的信息主题ID不能为空!', 'olmsg');
  8. $log = $member_log->chk_in();
  9. switch ($log) {
  10. case true:
  11. $msg = '<br>';
  12. if (0 < $db->getOne('SELECT COUNT(id) FROM `' . $db_mymps . 'shoucang` WHERE infoid = \'' . $infoid . '\' AND userid = \'' . $s_uid . '\'')) {
  13. $msg .= '<style>div{font-family:microsoft yahei;line-height:28px; font-size:14px; text-align:left; float:left; margin-bottom:30px; color:#585858;} span{margin-left:25px; margin-right:15px; display:block; float:left; height:64px; width:64px; background:url(' . $mymps_global[SiteUrl] . '/template/default/images/post/info_icons.png) 0 -128px no-repeat; margin-bottom:30px;}</style><span></span><div>您好,您已经收藏过该信息。不能重复收藏哦!<br />查看 <a href=\'' . $mymps_global[SiteUrl] . '/member/index.php?m=shoucang\' target=_blank style=\'font-size:14px;\'>我的收藏>></a></div>';
  14. }
  15. else {
  16. $r = $db->getRow('SELECT title,catid,dir_typename FROM `' . $db_mymps . 'information` WHERE id = \'' . $infoid . '\'');
  17. $url = Rewrite('info', array('id' => $infoid, 'catid' => $r['catid'], 'dir_typename' => $r['dir_typename']));
  18. $url = str_replace($mymps_global['SiteUrl'], '', $url);
  19. if (!$s_uid) {
  20. exit('无效的登录用户,请重新登录!');
  21. }
  22. $r['title'] = isset($r['title']) ? mhtmlspecialchars(maddslashes($r['title'])) : '';
  23. $db->query('INSERT INTO `' . $db_mymps . 'shoucang` (infoid,title,url,userid,intime)VALUES(\'' . $infoid . '\',\'' . $r['title'] . '\',\'' . $url . '\',\'' . $s_uid . '\',\'' . $timestamp . '\')');
  24. $msg .= '<style>div{font-family:microsoft yahei;line-height:28px; font-size:14px; text-align:left; float:left; margin-bottom:30px; color:#585858;} span{margin-left:25px; margin-right:15px; display:block; float:left; height:64px; width:64px; background:url(' . $mymps_global[SiteUrl] . '/template/default/images/post/info_icons.png) 0 0 no-repeat; margin-bottom:30px;}</style><span></span><div>恭喜!已成功收藏到用户中心—我的收藏夹中!<br />查看 <a href=\'' . $mymps_global[SiteUrl] . '/member/index.php?m=shoucang\' target=_blank style=\'font-size:14px;\'>我的收藏>></a>';
  25. }
  26. echo $msg;
  27. $msg = $r = NULL;
  28. break;
  29. default:
  30. $authcodesettings = read_static_cache('authcodesettings');
  31. $gourl = 'shoucang';
  32. include MYMPS_ROOT . '/template/box/login.html';
  33. break;
  34. }
  35. ?>