wap_shoucang.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 . '/cache.fun.php';
  6. require_once MYMPS_INC . '/member.class.php';
  7. !$infoid && write_msg('收藏的信息主题ID不能为空!', 'olmsg');
  8. $log = $member_log->chk_in();
  9. switch ($log) {
  10. case true:
  11. $msg = '
  12. <!DOCTYPE html>
  13. <html lang="zh-CN" class="index_page">
  14. <head>
  15. <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width" />
  16. <meta name="format-detection" content="telephone=no" />
  17. <meta name="format-detection" content="email=no" />
  18. <meta name="format-detection" content="address=no;">
  19. <meta name="apple-mobile-web-app-capable" content="yes" />
  20. <meta name="apple-mobile-web-app-status-bar-style" content="default" />
  21. <title>系统提示 - <?=$mymps_global[SiteName]?></title>
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8 echo $charset; ?>">
  23. </head>
  24. <body>
  25. ';
  26. if (0 < $db->getOne('SELECT COUNT(id) FROM `' . $db_mymps . 'shoucang` WHERE infoid = \'' . $infoid . '\' AND userid = \'' . $s_uid . '\'')) {
  27. $msg .= '<style>div{line-height:28px; font-size:12px; text-align:left; float:left; margin-bottom:30px; color:#585858;} span{margin-left:5px; 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:10px;}</style><span></span><div>您已经收藏过该信息,不能重复收藏!<br />查看 <a href=\'' . $mymps_global[SiteUrl] . '/m/index.php?mod=member&action=shoucang\' style=\'font-size:14px;\'>我的收藏>></a></div>';
  28. }
  29. else {
  30. $r = $db->getRow('SELECT title,dir_typename FROM `' . $db_mymps . 'information` WHERE id = \'' . $infoid . '\'');
  31. $url = Rewrite('info', array('id' => $infoid, 'dir_typename' => $r['dir_typename']));
  32. $url = str_replace($mymps_global['SiteUrl'], '', $url);
  33. if (!$s_uid) {
  34. exit('无效的登录用户,请重新登录!');
  35. }
  36. $r['title'] = isset($r['title']) ? mhtmlspecialchars(maddslashes($r['title'])) : '';
  37. $db->query('INSERT INTO `' . $db_mymps . 'shoucang` (infoid,title,url,userid,intime)VALUES(\'' . $infoid . '\',\'' . $r['title'] . '\',\'' . $url . '\',\'' . $s_uid . '\',\'' . $timestamp . '\')');
  38. $msg .= '<style>div{line-height:28px; font-size:12px; text-align:left; float:left; margin-bottom:30px; color:#585858;} span{margin-left:5px; 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:10px;}</style><span></span><div>信息收藏成功,登陆会员中心查看!<br />查看 <a href=\'' . $mymps_global[SiteUrl] . '/m/index.php?mod=member&action=shoucang\'style=\'font-size:14px;\'>我的收藏>></a>';
  39. }
  40. $msg .= '
  41. </body>
  42. </html>
  43. ';
  44. echo $msg;
  45. $msg = $r = NULL;
  46. break;
  47. default:
  48. $mayimobile = get_mobile_settings();
  49. $mayimobile['mobiledomain'] = $mayimobile['mobiledomain'] ? $mayimobile['mobiledomain'] : $mymps_global['SiteUrl'] . '/m';
  50. $url = $mayimobile['mobiledomain'] . '/index.php?mod=member';
  51. echo '<script language = \'javascript\' type = \'text/javascript\'>window.location.href = \'' . $url . '\' </script>';
  52. break;
  53. }
  54. ?>