SMFShop > Coding
Help With Points For Boards
Pure:
Something I wouldn't mind also. Very good idea Tanix. I just hope somebody who could implement this will read this topic.
Peace, Lance
Tanix:
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.
feeble:
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
--- Code: --- // 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 code ---
now just add something like this
--- Code: --- // 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__);
--- End code ---
Pure:
That's pretty neat actually feeble. I'll give this a shot. Yeah I understand what it means. Cheers. :)
Peace, Lance
Daniel15:
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version