SMF Shop
SMFShop => Coding => Topic started by: Tanix on January 28, 2007, 05:10:03 am
-
Currently, you can set boards on or off to count shop points. What would need to be done to set boards instead to a specific multiple of points? A laborious example:
Board 1 - zero so no points
Board 2 - multiple of 1, so regular points are scored for that board.
Board 3 - multiple of 1.5 - so points score for a post in that board is increased by 50%.
Board 4 - multiple of 2 - double points
-
If you go to "Boards" in the Admin center, then to the settings of a specific board, you can set whether a users post will count towards the shop or not. As far as I know there isn't a way to set a predetermined amount for each board. That would be handy though.
Michael
-
Yup, seen that thanks. What I'm looking to do is change the marker from on/off to a numeric value (say 0,1 and 2) then multiply the result by the points score for a post.
Why do that? To encourage posting in particular boards where people would score double credits.
-
Aight. Sorry no help here. ;)
-
np, thanks for trying.
-
Something I wouldn't mind also. Very good idea Tanix. I just hope somebody who could implement this will read this topic.
Peace, Lance
-
Thanks Pure. I'm having a go myself. Managed to do about half of what's needed I reckon but I'm a bit stuck at the mo on the rest.
-
extremely quick as i have to go to work
you must know what a boardid is and if statements to understand how to implement this btw.
open up sources/Post.php
locate
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));
// Is there a limit set, and are we over it?
if (isset($modSettings['shopPointsLimit']) && $modSettings['shopPointsLimit'] != 0 && $points > $modSettings['shopPointsLimit'])
// If so, set the number of points to the limit
$points = $modSettings['shopPointsLimit'];
// Give the user their points
$result_shop = db_query("
UPDATE {$db_prefix}members
SET money = money + {$points}
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1", __FILE__, __LINE__);
now just add something like this
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));
// Is there a limit set, and are we over it?
if (isset($modSettings['shopPointsLimit']) && $modSettings['shopPointsLimit'] != 0 && $points > $modSettings['shopPointsLimit'])
// If so, set the number of points to the limit
$points = $modSettings['shopPointsLimit'];
if{$board == 1)
$points = $points *2;
elseif($board == 2)
$point = $point * 3;
// Give the user their points
$result_shop = db_query("
UPDATE {$db_prefix}members
SET money = money + {$points}
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1", __FILE__, __LINE__);
-
That's pretty neat actually feeble. I'll give this a shot. Yeah I understand what it means. Cheers. :)
Peace, Lance
-
Sounds like a good idea, and feeble has given me an idea on how to do this :)
I'll try to implement this in a future version. I'm really busy at the moment, and probably won't have it done for a while, though.
-
yes i totaly agree with you, this should be implemented in earlyer stage becouse now serious boards are having trouble by ppl posting too much in offtopic.
there is so many thigns needed and not needed in shop mod but this one is must have becouse on other sort of forums like phpbb there is this option and i dont think is hard to invest it.
anyways if you found any alternativ solution i would gladly try it.
-
OK, I've started working on this, and an initial version is currently available in SMFShop Development Version (see the beta testing topic if you'd like to help beta-test the new version of SMFShop) :).
Take a look at the attached screenshot to see how the settings look at the moment (excuse the really stupid grammar mistake in the last setting!)
To get this working on SMFShop 3.0, follow these steps. Make a backup of any edited files, as you'll need to restore the originals if a new version of SMFShop comes out.
Open Sources/ManageBoards.php, and find:
$boardOptions['countMoney'] = isset($_POST['countMoney']);$boardOptions['posts_count'] = isset($_POST['count']);
Replace with:
$boardOptions['posts_count'] = isset($_POST['count']);
Find:
// Checkboxes....
Add before:
// Begin SMFShop code
// Are we counting credits in this board?
// TODO: Rename this? It's kept as countMoney for backwards compatibility...
$boardOptions['countMoney'] = isset($_POST['countMoney']);
// How many credits do we get per post/topic?
$boardOptions['shop_pertopic'] = !empty($_POST['shop_pertopic']) ? (int) $_POST['shop_pertopic'] : 0;
$boardOptions['shop_perpost'] = !empty($_POST['shop_perpost']) ? (int) $_POST['shop_perpost'] : 0;
// Bonuses in this board?
$boardOptions['shop_bonuses'] = isset($_POST['shop_bonuses']);
// End SMFShop code
Sources/Post.php, find:
// BEGIN SMFShop New Version (Build 12) code
// Get if this board gives credits for posting
$result_shop = db_query("
SELECT countMoney
FROM {$db_prefix}boards
WHERE ID_BOARD = $board
LIMIT 1", __FILE__, __LINE__);
$row_shop = mysql_fetch_array($result_shop, MYSQL_ASSOC);
// If we do give credits...
if (isset($row_shop['countMoney']) && $row_shop['countMoney'] == "1") {
// New topic?
if ($newTopic)
$points = $modSettings['shopPointsPerTopic'];
else
$points = $modSettings['shopPointsPerPost'];
// Now, on to bonuses.
// Strip out all BBCode
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $_POST['message']);
// Convert all newlines into spaces
$plaintext = str_replace(array('<br />', "\r", "\n"), ' ', $plaintext);
// Convert multiple successive spaces into a single space
$plaintext = preg_replace('/\s+/', ' ', $plaintext);
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));
// Is there a limit set, and are we over it?
if (isset($modSettings['shopPointsLimit']) && $modSettings['shopPointsLimit'] != 0 && $points > $modSettings['shopPointsLimit'])
// If so, set the number of points to the limit
$points = $modSettings['shopPointsLimit'];
// Give the user their points
$result_shop = db_query("
UPDATE {$db_prefix}members
SET money = money + {$points}
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1", __FILE__, __LINE__);
}
// END SMFShop
Replace with:
// Begin SMFShop code
// Get some information on this board
$result_shop = db_query("
SELECT countMoney, shop_pertopic, shop_perpost, shop_bonuses
FROM {$db_prefix}boards
WHERE ID_BOARD = $board
LIMIT 1", __FILE__, __LINE__);
$boardInfo = mysql_fetch_assoc($result_shop);
// If we do give credits...
if (!empty($boardInfo['countMoney']))
{
// New topic?
if ($newTopic)
$points = ($boardInfo['shop_pertopic'] != 0) ? $boardInfo['shop_pertopic'] : $modSettings['shopPointsPerTopic'];
else
$points = ($boardInfo['shop_perpost'] != 0) ? $boardInfo['shop_perpost'] : $modSettings['shopPointsPerPost'];
// Are bonuses allowed in this board?
if (!empty($boardInfo['shop_bonuses']))
{
// Strip out all BBCode
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $_POST['message']);
// Convert all newlines into spaces
$plaintext = str_replace(array('<br />', "\r", "\n"), ' ', $plaintext);
// Convert multiple successive spaces into a single space
$plaintext = preg_replace('/\s+/', ' ', $plaintext);
// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));
// Is there a limit set, and are we over it?
if (isset($modSettings['shopPointsLimit']) && $modSettings['shopPointsLimit'] != 0 && $points > $modSettings['shopPointsLimit'])
// If so, set the number of points to the limit
$points = $modSettings['shopPointsLimit'];
}
// Give the user their points
$result_shop = db_query("
UPDATE {$db_prefix}members
SET money = money + {$points}
WHERE ID_MEMBER = {$ID_MEMBER}
LIMIT 1", __FILE__, __LINE__);
}
// End SMFShop code
Sources/Subs-Boards.php, find:
//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
Replace with:
// Begin SMFShop code
// Should posts in this board give gredits?
if (isset($boardOptions['countMoney']))
$boardUpdates[] = 'countMoney = ' . ($boardOptions['countMoney'] ? '1' : '0');
// Custom credits per post/topic
if (isset($boardOptions['shop_pertopic']))
$boardUpdates[] = 'shop_pertopic = ' . (int) $boardOptions['shop_pertopic'];
if (isset($boardOptions['shop_perpost']))
$boardUpdates[] = 'shop_perpost = ' . (int) $boardOptions['shop_perpost'];
// Any bonuses here?
if (isset($boardOptions['shop_bonuses']))
$boardUpdates[] = 'shop_bonuses = ' . ($boardOptions['shop_bonuses'] ? '1' : '0');
// End SMFShop code
Find:
'countMoney' => 1,
Replace with:
// Begin SMFShop code
'countMoney' => 1,
'shop_pertopic' => 0,
'shop_perpost' => 0,
'shop_bonuses' => 1,
// End SMFShop code
Find:
b.countMoney,
Replace with:
b.countMoney, b.shop_pertopic, b.shop_perpost, b.shop_bonuses
Find:
'countMoney' => $row['countMoney'],
Replace with:
// Begin SMFShop code
'countMoney' => $row['countMoney'],
'shop_pertopic' => $row['shop_pertopic'],
'shop_perpost' => $row['shop_perpost'],
'shop_bonuses' => $row['shop_bonuses'],
// End SMFShop code
Themes/default/ManageBoards.template.php, find:
//BEGIN SMFShop Shop MOD 1.3 (Build 6) code
loadLanguage("Shop");
echo ' <tr>
<td>
<b>', $txt['shop_count_points'], '</b><br />
', $txt['shop_count_points_msg'], '<br /><br />
</td>
<td valign="top" align="right">
<input type="checkbox" name="countMoney"', $context['board']['countMoney'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>';
//END SHOP MOD
Replace with:
// Begin SMFShop code
loadLanguage('Shop');
echo '
<tr>
<td>
<b>', $txt['shop_count_points'], '</b><br />
', $txt['shop_count_points_msg'], '<br /><br />
</td>
<td valign="top" align="right">
<input type="checkbox" name="countMoney"', $context['board']['countMoney'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>
<tr>
<td>
<b>', $txt['shop_credits'], '</b><br />
', $txt['shop_credits_msg'], '<br /><br />
</td>
<td valign="top" align="right">
', $txt['shop_per_new_topic'], ': ', $modSettings['shopCurrencyPrefix'], '<input type="text" name="shop_pertopic" value="', $context['board']['shop_pertopic'], '" size="5" />', $modSettings['shopCurrencySuffix'], '<br />
', $txt['shop_per_new_post'], ': ', $modSettings['shopCurrencyPrefix'], '<input type="text" name="shop_perpost" value="', $context['board']['shop_perpost'], '" size="5" />', $modSettings['shopCurrencySuffix'], '
</td>
</tr>
<tr>
<td>
<b>', $txt['shop_bonuses_enabled'], '</b><br />
', $txt['shop_bonuses_enabled_msg'], '<br /><br />
</td>
<td valign="top" align="right">
<input type="checkbox" name="shop_bonuses"', $context['board']['shop_bonuses'] ? ' checked="checked"' : '', ' class="check" />
</td>
</tr>';
// End SMFShop code
Themes/default/languages/Shop.english.php, at the very bottom (above ?>), add:
// New entries in SMFShop Development Version
$txt['shop_bonuses_enabled'] = 'Enable Shop Bonuses';
$txt['shop_bonuses_enabled_msg'] = 'Shop Bonuses will be take effect in this board';
$txt['shop_credits'] = 'Shop Credits';
$txt['shop_credits_msg'] = 'If custom values are set for these two settings, they will override the settings set on the SMFShop administration page. Set these to "0" to use the default values (currently ' . $modSettings['shopCurrencyPrefix'] . $modSettings['shopPointsPerTopic'] . $modSettings['shopCurrencySuffix'] . ' per topic, and ' . $modSettings['shopCurrencyPrefix'] . $modSettings['shopPointsPerPost'] . $modSettings['shopCurrencySuffix'] . ' per post)';
Then, run this query in phpMyAdmin:
ALTER TABLE `smf_boards` ADD `shop_pertopic` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_perpost` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_bonuses` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1';
I'm hoping that this works, I haven't actually tested it on a fresh SMFShop 3.0 installation...
-
:(( ok I followed all of the above and its broken
I run the query and I got this message:
Error
SQL query:
ALTER TABLE `smf_boards` ADD `shop_pertopic` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_perpost` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_bonuses` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
MySQL said: Documentation
#1060 - Duplicate column name 'shop_pertopic'
and when I go to admin > boards in my forum I get this:
Database Error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.permission_mode, c.ID_CAT, c.name AS cName, c.catOrder, c.canCollapse
FROM sm' at line 4
File: /home/******/public_html/testforum/Sources/Subs-Boards.php
Line: 1486
Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.2, while your database is at version 1.1.1. The above error might possibly go away if you execute the latest version of upgrade.php.
I don't need to run the upgrade thing, will restoring the sources files fix it or do I have to do something with the database now too?
help!
-
What's on lines 1480- 1490 in Subs-Boards.php (use an editor like Notepad++ that shows line numbers)?
-
// Load a lot of usefull information regarding the boards and categories.
function getBoardTree()
{
global $db_prefix, $cat_tree, $boards, $boardList, $txt, $modSettings;
// Getting all the board and category information you'd ever wanted.
$request = db_query("
SELECT
IFNULL(b.ID_BOARD, 0) AS ID_BOARD, b.ID_PARENT, b.name AS bName, b.description, b.childLevel,
b.boardOrder, b.countPosts, b.memberGroups, b.ID_THEME, b.override_theme,
b.countMoney, b.shop_pertopic, b.shop_perpost, b.shop_bonuses b.permission_mode, c.ID_CAT, c.name AS cName, c.catOrder, c.canCollapse
FROM {$db_prefix}categories AS c
LEFT JOIN {$db_prefix}boards AS b ON (b.ID_CAT = c.ID_CAT)
ORDER BY c.catOrder, b.childLevel, b.boardOrder", __FILE__, __LINE__);
$cat_tree = array();
$boards = array();
$last_board_order = 0;
while ($row = mysql_fetch_assoc($request))
{
if (!isset($cat_tree[$row['ID_CAT']]))
{
$cat_tree[$row['ID_CAT']] = array(
'node' => array(
'id' => $row['ID_CAT'],
'name' => $row['cName'],
'order' => $row['catOrder'],
'canCollapse' => $row['canCollapse']
),
'is_first' => empty($cat_tree),
'last_board_order' => $last_board_order,
'children' => array()
);
$prevBoard = 0;
$curLevel = 0;
}
if (!empty($row['ID_BOARD']))
{
if ($row['childLevel'] != $curLevel)
$prevBoard = 0;
$boards[$row['ID_BOARD']] = array(
'id' => $row['ID_BOARD'],
'category' => $row['ID_CAT'],
'parent' => $row['ID_PARENT'],
'level' => $row['childLevel'],
'order' => $row['boardOrder'],
'name' => $row['bName'],
'memberGroups' => explode(',', $row['memberGroups']),
'description' => $row['description'],
'count_posts' => empty($row['countPosts']),
'theme' => $row['ID_THEME'],
'override_theme' => $row['override_theme'],// Begin SMFShop code
'countMoney' => $row['countMoney'],
'shop_pertopic' => $row['shop_pertopic'],
'shop_perpost' => $row['shop_perpost'],
'shop_bonuses' => $row['shop_bonuses'],
// End SMFShop code
'use_local_permissions' => !empty($modSettings['permission_enable_by_board']) && $row['permission_mode'] == 1,
'permission_mode' => empty($modSettings['permission_enable_by_board']) ? (empty($row['permission_mode']) ? 'normal' : ($row['permission_mode'] == 2 ? 'no_polls' : ($row['permission_mode'] == 3 ? 'reply_only' : 'read_only'))) : 'normal',
'prev_board' => $prevBoard
);
$prevBoard = $row['ID_BOARD'];
$last_board_order = $row['boardOrder'];
if (empty($row['childLevel']))
{
$cat_tree[$row['ID_CAT']]['children'][$row['ID_BOARD']] = array(
'node' => &$boards[$row['ID_BOARD']],
'is_first' => empty($cat_tree[$row['ID_CAT']]['children']),
'children' => array()
);
$boards[$row['ID_BOARD']]['tree'] = &$cat_tree[$row['ID_CAT']]['children'][$row['ID_BOARD']];
}
else
{
// Parent doesn't exist!
this line
// Getting all the board and category information you'd ever wanted.
$request = db_query("
SELECT <-------------------------
near the top of the code above, is line 1480, Daniel
-
any help with this please Daniel? I can't access/view boards or posts on the testforum.
Should I just restore the sources back up and start over? I don't know how to change any of the database stuff though if that is necessary
-
your issue is here
.shop_perpost, b.shop_bonuses b.permission_mode, c.ID_C
ill let you spot it
Error
SQL query:
ALTER TABLE `smf_boards` ADD `shop_pertopic` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_perpost` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_bonuses` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
MySQL said: Documentation
#1060 - Duplicate column name 'shop_pertopic'
means shop_pertopic already exists, column titles must be unique in each table, so it cant add it again.
so just check the table in your phpmyadmin for the column names if you know how to read the query, either drop them or alter the table query.
more then likely it should be setup correctly in your table, again check this my phpmyadmin
or
just change the query to
ALTER TABLE `smf_boards` ADD `shop_perpost` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_bonuses` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
-
lol thanks for letting me spot it but since I dont know what any of it means...
Can you tell me what I need to change?
And I dont know how to read the query *novice* so I guess option two?
-
.shop_perpost, b.shop_bonuses, b.permission_mode, c.ID_C
your missing a comma between .shop_bonuses and b.permission_mode
-
thanks feeble, I'm a dummy.
I'll go try and see if it works now
-
ok I added the comma
then ran the query in your post:
ALTER TABLE `smf_boards` ADD `shop_perpost` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_bonuses` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
but in phpmyadmin I got an error saying I had duplicate column:
Error
SQL query:
ALTER TABLE `smf_boards` ADD `shop_perpost` DECIMAL( 9, 2 ) UNSIGNED NOT NULL ,
ADD `shop_bonuses` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'
MySQL said: Documentation
#1060 - Duplicate column name 'shop_perpost'
but I looked at the boards and I only have one of each of these:
countMoney shop_pertopic shop_perpost shop_bonuses
so I still can't read threads or get to boards in the admin panel
-
Would be it best to reload the sources files again and forget about this? Do I need to change the database anywhere?
-
but I looked at the boards and I only have one of each of these:
countMoney shop_pertopic shop_perpost shop_bonuses
so I still can't read threads or get to boards in the admin panel
i dont understand. if you already have the columns, why are you trying to add them again?
-
I followed the instructions exactly in Daniels post and thats what it told me to do, but that was the error I got
Then you posted with the query in your post, so I made the comma change and run the query like you suggested.
I dont know what the query means, I'm just following the instructions (badly)
Now when I try to click on a thread I get this:
Unknown column 'b.Avtr_Use' in 'field list'
*clueless*
-
I gave up and restored my sources from backup as I couldnt access boards or posts.
If I need to make changes to the database can someone please tell me what to do.
-
ok sorry i couldnt help you out better
But its probably best to actually try and understand what you were altering, and what the code you were copying and pasting means.
should make it easier next time you attempt to do this.
-
ok sorry i couldnt help you out better
But its probably best to actually try and understand what you were altering, and what the code you were copying and pasting means.
should make it easier next time you attempt to do this.
no worries feeble but I dont have time to take a course in php unfortunately. I guess I understand what was going to change which was why I attempted it but what all the code means, that could take some time lol
I have restored my forum from back up and now its back to 1.1.1 and nothing will work *sigh*
At least its a testforum
-
Yeah, sorry, this is still in beta so may not work perfectly ;).
About the database columns, the error meant that you had already added them. If they've already been added, you don't need to add them again - Just skip the queries.
Now when I try to click on a thread I get this:
Unknown column 'b.Avtr_Use' in 'field list'
This error is not related to SMFShop.
-
yeah I thought it was something like that but I was following the instructions so I dont know how they could have already been added since I didnt add them until I run the query right?
anyway, no matter, I am reinstalling my testforum and al the mods again lol
Frustratingly some of the mods are getting that 'modification parse error' this time around when they didnt previously. There seems to be a lot of that going around on the smf forum.
-
This worked perfectly with my shop 3.0. However, I did get the comma error. Weird because I highlighted the code and it seemed to drop that comma.
For other users, be sure you check that comma before asking...that's what my problem was.
:)
Thanks for the hard work with all these goodies.
-
Frustratingly some of the mods are getting that 'modification parse error' this time around when they didnt previously. There seems to be a lot of that going around on the smf forum.
It's a problem with SMF's Package Manager and PHP 5.2... Some changes in PHP 5 broke the package manager, and we're currently working on a fix for it.
This worked perfectly with my shop 3.0
Good to know :)
Please report any bugs you encounter (this is still beta, it's been pulled straight from the SMFShop development version).
-
Frustratingly some of the mods are getting that 'modification parse error' this time around when they didnt previously. There seems to be a lot of that going around on the smf forum.
It's a problem with SMF's Package Manager and PHP 5.2... Some changes in PHP 5 broke the package manager, and we're currently working on a fix for it.
That would be so great, I have several things I cant install, and nothing I change makes any difference.
I never did get this points thing to work, I guess I did something wrong though I thought I followed the instructions well. I might try again when I got more free time
-
Jen is correct , i installed it and it worked for me fine too , except for the comma , which is weird too , i copied and paste from the original posts too..hehehe ;D
well perplexed , i think u gotta redo again but clean up your codes , could be becoz some tables left behind by your avatar maker , avtr_use is from that mod . Btw i have avatar maker n shop running too , along with this recent mod!
thumbs up basil n daniel!!
-
Jen is correct , i installed it and it worked for me fine too , except for the comma , which is weird too , i copied and paste from the original posts too..hehehe ;D
well perplexed , i think u gotta redo again but clean up your codes , could be becoz some tables left behind by your avatar maker , avtr_use is from that mod . Btw i have avatar maker n shop running too , along with this recent mod!
thumbs up basil n daniel!!
My testforum was restored thanks, but I dont have the avatar mod as yet, so I dont know what that avtr_use thing could be :D no matter, its all gone now :)
-
If you go to "Boards" in the Admin center, then to the settings of a specific board, you can set whether a users post will count towards the shop or not. As far as I know there isn't a way to set a predetermined amount for each board. That would be handy though.
Does this not work on SMF 2.0 or something? I cannot figure out how to do this