Well I still haven't tried to do what you were talking about but I'm having some issues with the arcade right now. Basically I'm planning on changing it so that arcade comments increment the user's post count. If you use updateprofile() or whatever the function is called, you can increase their post count but then there is an unread topic notification forever until you delete the comment tied to that (don't understand why, yet)
At the moment the arcade comments are made into posts by simply directly updating the database. I wonder if it might not be more complete to use the createpost() function (again, or whatever it's called). I'm in no position to question it though
I didn't make it and don't really understand what is going on - something will have to change though for my wishlist.
Anyway, in ArcadePlay.php I find these things:
function ArcadePlay()
{
global $scripturl, $txt, $db_prefix, $context, $arcSettings, $modSettings, $ID_MEMBER, $user_info;
//Added for shop mod SneakyWho_am_i disables all rules for guests
if(isset($modSettings['shopCostPerPlay']) && (!$user_info['is_guest']) && $modSettings['shopCostPerPlay'] > 0)
{
$credit = checkShopCredits();
if($credit < $modSettings['shopCostPerPlay'])
{
//cant play
fatal_lang_error('cannot_arcade_play_credit');
}
}
// end shop modAnd:
function checkShopCredits()
{
//function added for shop mod to check members credit
global $scripturl, $txt, $db_prefix, $ID_MEMBER;
$result = db_query("
SELECT
money
FROM {$db_prefix}members
WHERE ID_MEMBER = $ID_MEMBER", __FILE__, __LINE__);
$cash = mysql_fetch_assoc($result);
return $cash['money'];
}Looking good so far. We can abuse smf's permissions system to make some membergroups exempt from paying
using the admin panel - which is far better in my opinion than hardcoding which groups should be charged or not charged.
So combining this information with the stuff from my first post, we can make any membergourps able or unable to play/pay, and make some of them exempt from having to.
This is one step from being what you are talking about. I haven't gone through it properly but I think we would have to create another column in the database for the paid/free switch, and draw that into the admin template to let it be controlled. The code might start to resemble something like this:
function ArcadePlay()
{
global $scripturl, $txt, $db_prefix, $context, $arcSettings, $modSettings, $ID_MEMBER, $user_info;
//Added for shop mod SneakyWho_am_i uses custom permissions......
ifallowedTo('pay_for_games')
{
if(isset($context['arcade']['game']['non_free'] //REMEMBER WE GOT THIS FROM OUR EXTRA DB COLUMN
{
if(isset($modSettings['shopCostPerPlay'])&& $modSettings['shopCostPerPlay'] > 0)
{
$credit = checkShopCredits();
if($credit < $modSettings['shopCostPerPlay'])
//cant play
fatal_lang_error('cannot_arcade_play_credit');
}
}
}
}
// end shop modSomebody else could probably make that a lot prettier and I'm not sure I named the function properly, blah blah blah. but that's how I see it. You'dd apply this sort of thing to the bit where it charges you, and the bit where it checks for the pass. The fun part would be getting the info in and out of the database (admin template adjustment in games admin screen)
I hope I'm making sense.
The reason I want comments to increment the post count is, I use post counts to measure activity. Seems like the quickest and easiest way. Arcade users might be very active (arcade plays should be considered contributions) but they don't seem active when I count posts, so I think that their post count should increase if the arcade comments are made to become posts.
EDIT: Permissions of course are easy to create in SMF as I learned to my joy this week. ManagePermissions.php, add the permission to the array and then add the language strings for it (should be three) @ the language file and you're away laughing.
EDIT2:
Arcade.php:
else
{
//sneaky says guests can have posts after all
/*
$post = 0;
$postPerDay = 0;
*/
$post = 100;
$postPerDay = 100;
}
My guests can play even if they don't have any posts per day...