Items/Remove Profile Image

From SMFShopWiki

Jump to: navigation, search
Remove Profile Image
Latest Item Version: 0.1
SMFShop Version Required: Any
PHP Version Required: Any
MySQL Version Required: Any

The "Remove Profile Image" item is a supplement to the Profile Image item. When used, it will remove the user's profile image (previously set by the Profile Image item).

This file should be saved to your Sources/shop/items directory as RemoveProfileImage.php.

  1. <?php
  2. /**********************************************************************************
  3. * RemoveProfileImage.php *
  4. * Profile Image item - Remove the user's profile image *
  5. ***********************************************************************************
  6. * SMFShop: Shop MOD for Simple Machines Forum *
  7. * =============================================================================== *
  8. * Software by: DanSoft Australia (http://www.dansoftaustralia.net/)*
  9. * Copyright 2005-2007 by: DanSoft Australia (http://www.dansoftaustralia.net/)*
  10. * Support, News, Updates at: http://www.dansoftaustralia.net/ *
  11. * *
  12. * Forum software by: Simple Machines (http://www.simplemachines.org) *
  13. * Copyright 2006-2007 by: Simple Machines LLC (http://www.simplemachines.org) *
  14. * 2001-2006 by: Lewis Media (http://www.lewismedia.com) *
  15. ***********************************************************************************
  16. * This program is free software; you may redistribute it and/or modify it under *
  17. * the terms of the provided license as published by Simple Machines LLC. *
  18. * *
  19. * This program is distributed in the hope that it is and will be useful, but *
  20. * WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY *
  21. * or FITNESS FOR A PARTICULAR PURPOSE. *
  22. * *
  23. * See the "license.txt" file for details of the Simple Machines license. *
  24. * The latest version of the license can always be found at *
  25. * http://www.simplemachines.org. *
  26. **********************************************************************************/
  27.  
  28. // If file is not called by SMF, don't let them get anywhere!
  29. if (!defined('SMF'))
  30. die('Hacking attempt...');
  31.  
  32. class item_RemoveProfileImage extends itemTemplate
  33. {
  34. function getItemDetails()
  35. {
  36. $this->authorName = 'Daniel15';
  37. $this->authorWeb = 'http://www.dansoftaustralia.net/';
  38. $this->authorEmail = 'dansoft@dansoftaustralia.net';
  39. $this->name = 'Remove Profile Image';
  40. $this->desc = 'Remove your current profile image';
  41. $this->price = 10;
  42.  
  43. $this->require_input = false;
  44. $this->can_use_item = true;
  45. }
  46.  
  47. function onUse()
  48. {
  49. global $db_prefix, $ID_MEMBER;
  50.  
  51. $result = db_query("
  52. UPDATE {$db_prefix}members
  53. SET shop_Flag = ''
  54. WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
  55.  
  56. return 'Successfully removed profile image!';
  57. }
  58.  
  59. }
  60.  
  61. ?>
Personal tools