Since SMF 1.1 came out, the behavior of the 'Find Members' popup has changed. Basically, it puts quotation marks around the username, whereas SMF 1.0 didn't. Thus, on the Send Money to someone and Send item to someone pages, you may get errors like this:
ERROR: The member you typed ('\"Daniel15\"') doesn't exist
Here's the fix for SMFShop 2.3, so it works properly again. The development version will be fixed soon.
In Sources/shop/Shop-Send.php, find:
// Get the id and name of member to send to
$result = db_query("SELECT ID_MEMBER, memberName
FROM {$db_prefix}members
WHERE memberName = '{$_POST['membername']}'
LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
// If the member's name is not what the user posted... They don't exist!
if ($row['memberName'] !== $_POST['membername']) {
$context['shop_buy_message'] = sprintf($txt['shop_member_no_exist'], $_POST['membername']);
Replace with:
// This code from PersonalMessage.php, lines 1531-1535. It trims the " characters off the membername posted,
// and then puts all names into an array
$_POST['membername'] = strtr($_POST['membername'], array('\\"' => '"'));
preg_match_all('~"([^"]+)"~', $_POST['membername'], $matches);
$moneyArrayTo = array_unique(array_merge($matches[1], explode(',', preg_replace('~"([^"]+)"~', '', $_POST['membername']))));
// We only want the first memberName found
$moneyTo = $moneyArrayTo[0];
// Get the id and name of member to send to
$result = db_query("SELECT ID_MEMBER, memberName
FROM {$db_prefix}members
WHERE memberName = '{$moneyTo}'
LIMIT 1", __FILE__, __LINE__);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
// No results? They don't exist!
if (mysql_num_rows($result) == 0) {
$context['shop_buy_message'] = sprintf($txt['shop_member_no_exist'], htmlentities($moneyTo));
Find:
// Get new owner's information
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$_POST['membername']}'", __FILE__, __LINE__);
$rowNewOwner = mysql_fetch_array($result, MYSQL_ASSOC);
Replace with:
// This code from PersonalMessage.php, lines 1531-1535. It trims the " characters off the membername posted,
// and then puts all names into an array
$_POST['membername'] = strtr($_POST['membername'], array('\\"' => '"'));
preg_match_all('~"([^"]+)"~', $_POST['membername'], $matches);
$itemArrayTo = array_unique(array_merge($matches[1], explode(',', preg_replace('~"([^"]+)"~', '', $_POST['membername']))));
// We only want the first memberName found
$itemTo = $itemArrayTo[0];
// Get new owner's information
$result = db_query("SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '{$itemTo}'", __FILE__, __LINE__);
$rowNewOwner = mysql_fetch_array($result, MYSQL_ASSOC);
// No results? They don't exist!
if (mysql_num_rows($result) == 0) {
printf($txt['shop_member_no_exist'], htmlentities($_POST['membername']));
die();
}