Here is the code I used to make the item.
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2006 DanSoft Australia |
| http://www.dansoftaustralia.net/ |
\**********************************************/
//File: sendpm.php
// Email the admin item
// VERSION: 2.3 (Build 11)
// $Date: 2006-10-21 13:34:18 +1000 (Sat, 21 Oct 2006) $
// $Id: EmailAdmin.php 24 2006-10-21 03:34:18Z daniel15 $
class item_sendpm extends itemTemplate {
function getItemDetails() {
$this->authorName = "Daniel15";
$this->authorWeb = "http://www.dansoftaustralia.net/";
$this->authorEmail = "dansoft@dansoftaustralia.net";
$this->name = "Send PM to Admin v2";
$this->desc = "Send off an PM to the admin. A good use for this (for a web host) is an 'Add 100MB of Webspace to your hosting account'";
$this->price = 10;
}
$result = db_query("SELECT money, memberName, realName
FROM {$db_prefix}members
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$membersUserName = $row['memberName'];
$membersName = $row['realName'];
$pmfrom = array(
'id' => $ID_MEMBER,
'name' => $membersName,
'username' => $membersUserName
);
$pmto = array(
'to' => array(1),
'bcc' => array()
);
$subject = "Subject of the message";
$message = "Actual message goes here!";
sendpm($pmto, $subject, $message, 0, $pmfrom);
?>
It gives me
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/chougard/public_html/smf/Sources/shop/items/sendpm.php on line 26
Thanks for any help!