46
General SMFShop Discussion / Re: Question about earning SMF Points
« on: February 15, 2008, 07:13:19 am »
Admin panel → Boards → click "modify" next to the board → Untick "Count Shop Points"
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
ALTER TABLE `smf_shop_items` CHANGE `trading` `trading` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'
class item_wsgpThe item filename needs to be the same as the last bit of the class name. So, either rename the file to wsgp.php, or change that line to class item_pmitem
Hm, I hope it still works with whatever version of the SMF-Shop there is now...lol.SMFShop hasn't really been updated since January 2007, so it'll be fine
Here is the solution:HTML injection doesn't allow them to obtain the admin password nor hack the forum. They're only injecting the HTML into a page that only they can see anyways, so it's pointless.
function onUse() {
Add after: $_POST['question'] = htmlspecialchars($_POST['question']);
// Should the board theme override the user preferred theme?
if (isset($boardOptions['override_theme']))
$boardUpdates[] = 'override_theme = ' . ($boardOptions['override_theme'] ? '1' : '0');
Add after: //BEGIN SMFShop Shop MOD 1.3 (Build 6) code
// Should posts in this board give credits?
if (isset($boardOptions['countMoney']))
$boardUpdates[] = 'countMoney = ' . ($boardOptions['countMoney'] ? '1' : '0');
//End Shop MOD
'override_theme' => false,
Add after:'countMoney' => 1,
b.override_theme,
Add after:b.countMoney,
'override_theme' => $row['override_theme'],
Add after:'countMoney' => $row['countMoney'],
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';
Replace with: // Show how many posts they have made.
// echo '
// ', $txt[26], ': ', $message['member']['posts'], '<br />
// <br />';
// BEGIN SMFShop MOD New Version Code
// Removed one <br /> from end of post count line.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
';
echo '
', $modSettings['shopCurrencyPrefix'], $message['member']['money'], $modSettings['shopCurrencySuffix'], '<br /><br />
<a href="', $scripturl, '?action=shop;do=invother2;member=', $message['member']['username'], '">View Inventory</a><br />
<a href="', $scripturl, '?action=shop;do=sendmoney;member=', $message['member']['username'], '">Send Money to ', $message['member']['name'], '</a><br />';
//END SMFShop code
I found that all MySQL tables of smfshop using latin1_swedish_ci coding, but i need win1251 cyrillic! Something tels me that i can change coding of each table throught phpMyAdmin.
Start to test
It's worked! If you have the same problem - just change coding of mysql shop tables
For example I wan't them to buy a specific Custom Title.Sure, that's easy . there's no item in SMFShop to do that, but you can easily add one. Save this:
<?php
/**********************************************************************************
* SMFShop item *
***********************************************************************************
* SMFShop: Shop MOD for Simple Machines Forum *
* =============================================================================== *
* Software by: DanSoft Australia (http://www.dansoftaustralia.net/)*
* Copyright 2005-2007 by: DanSoft Australia (http://www.dansoftaustralia.net/)*
* Support, News, Updates at: http://www.dansoftaustralia.net/ *
* *
* Forum software by: Simple Machines (http://www.simplemachines.org) *
* Copyright 2006-2007 by: Simple Machines LLC (http://www.simplemachines.org) *
* 2001-2006 by: Lewis Media (http://www.lewismedia.com) *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under *
* the terms of the provided license as published by Simple Machines LLC. *
* *
* This program is distributed in the hope that it is and will be useful, but *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version of the license can always be found at *
* http://www.simplemachines.org. *
**********************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');
class item_ChangeTitle extends itemTemplate
{
function getItemDetails()
{
$this->authorName = 'Daniel15';
$this->authorWeb = 'http://www.dansoftaustralia.net/';
$this->authorEmail = 'dansoft@dansoftaustralia.net';
$this->name = 'Change User Title to set value';
$this->desc = 'Change your user title to a value specified by the admin';
$this->price = 50;
$this->require_input = false;
}
function getAddInput()
{
global $item_info;
if ($item_info[1] == 0)
$item_info[1] = '';
return 'Custom title to use: <input name="info1" size="50" value="' . $item_info[1] . '" />';
}
function onUse()
{
global $item_info, $context, $func;
updateMemberData($context['user']['id'], array('usertitle' => '"' . $item_info[1] . '"'));
return 'Successfully changed your user title to ' . $item_info[1];
}
}
?>
As "ChangeTitle.php" in your SMF Sources/Shop/items/ directory. Then, when you add the item (via Add/Edit/Delete Items in the admin panel), it'll prompt you to enter in a custom title you'd like the item to use