Items:Display Message

From SMFShopWiki

Jump to: navigation, search
Display Message
Latest Item Version: 0.1
SMFShop Version Required: Any
PHP Version Required: Any
MySQL Version Required: Any

This is a very simple item for displaying a message. When you add it to your shop, it will ask you what message to use. Then, when someone purchases and uses the item, it will show them the message that you specified

Note that this item is untested, a much better version (that uses the BBCode editor, and parses BBCode) will come soon!

  1. <?php
  2. /**********************************************\
  3. | SMFSHOP (Shop MOD for Simple Machines Forum) |
  4. | (c) 2007 DanSoft Australia |
  5. | http://www.dansoftaustralia.net/ |
  6. \**********************************************/
  7.  
  8. //File: DisplayMessage.php
  9. // Item - Display a message when used
  10.  
  11. // VERSION: Not included in SMFShop yet
  12.  
  13. class item_DisplayMessage extends itemTemplate {
  14. function getItemDetails() {
  15. $this->authorName = "Daniel15";
  16. $this->authorWeb = "http://www.dansoftaustralia.net/";
  17. $this->authorEmail = "dansoft@dansoftaustralia.net";
  18.  
  19. $this->name = "Display Message";
  20. $this->desc = "Display an admin-defined message to user. You can choose what message to display";
  21. $this->price = 50;
  22. $this->require_input = false;
  23. $this->can_use_item = true;
  24. }
  25. function getAddInput() {
  26. return '
  27. Message to show user (you may use HTML here):
  28. <textarea name="info1" rows="15" style="width: 100%"></textarea>';
  29. }
  30.  
  31. function onUse() {
  32. global $item_info;
  33.  
  34. // This is very simple :-)
  35. return $item_info[1];
  36. }
  37.  
  38. }
  39.  
  40. ?>
Personal tools