magic_updateline.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: magic_updateline.php 26749 2011-12-22 07:38:37Z chenmengshu $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class magic_updateline {
  12. var $version = '1.0';
  13. var $name = 'updateline_name';
  14. var $description = 'updateline_desc';
  15. var $price = '20';
  16. var $weight = '20';
  17. var $useevent = 0;
  18. var $targetgroupperm = false;
  19. var $copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
  20. var $magic = array();
  21. var $parameters = array();
  22. function getsetting(&$magic) {}
  23. function setsetting(&$magicnew, &$parameters) {}
  24. function usesubmit() {
  25. global $_G;
  26. $id = intval($_GET['id']);
  27. $idtype = $_GET['idtype'];
  28. magic_check_idtype($id, $idtype);
  29. $tablename = gettablebyidtype($idtype);
  30. C::t($tablename)->update_dateline_by_id_idtype_uid($id, $idtype, $_G['timestamp'], $_G['uid']);
  31. C::t('home_feed')->update($id, array('dateline'=>$_G['timestamp']), $idtype, $_G['uid']);
  32. usemagic($this->magic['magicid'], $this->magic['num']);
  33. updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id);
  34. showmessage('magics_use_success', '', array('magicname'=>$_G['setting']['magics']['updateline']), array('alert' => 'right', 'showdialog' => 1));
  35. }
  36. function show() {
  37. global $_G;
  38. $id = intval($_GET['id']);
  39. $idtype = $_GET['idtype'];
  40. magic_check_idtype($id, $idtype);
  41. magicshowtips(lang('magic/updateline', 'updateline_info'));
  42. echo '<p><input type="hidden" name="id" value="'.$id.'" /><input type="hidden" name="idtype" value="'.$idtype.'" /></p>';
  43. }
  44. }
  45. ?>