[2.0.18] Cash Mod

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
1036
66%
Very Good
239
15%
Good
121
8%
Fair
36
2%
Poor
126
8%
 
Total votes: 1558

User avatar
Brf
Support Team Member
Support Team Member
Posts: 50969
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.18] Cash Mod

Post by Brf » Tue Aug 26, 2008 10:48 pm

I think it would check the number of posts over the last 24 hours.... so if they kept posting within that 24-hour window, they would never get any cash.

User avatar
Mooncow
Registered User
Posts: 261
Joined: Tue Feb 25, 2003 8:10 am
Location: This Post
Contact:

Re: [2.0.18] Cash Mod

Post by Mooncow » Tue Aug 26, 2008 11:00 pm

yeah thats what i thought originally, i'll run some tests and see
I love teh phpBB

User avatar
Mooncow
Registered User
Posts: 261
Joined: Tue Feb 25, 2003 8:10 am
Location: This Post
Contact:

Re: [2.0.18] Cash Mod

Post by Mooncow » Wed Aug 27, 2008 1:36 am

it seems that they must not have posted for 24 hours before the next post.... (as i suspected- forum members were not gaining any more cash, whereas after waiting 25 hours, they would.)

from the code, does it seem as though it is meant to be this way?
I love teh phpBB

User avatar
Brf
Support Team Member
Support Team Member
Posts: 50969
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.18] Cash Mod

Post by Brf » Wed Aug 27, 2008 11:18 am

Yeah it is.... There is no way for it to tell whether the past posts were paid or not, so it assumes they were.
All it does is count up the number of posts with that timefence.

User avatar
Mooncow
Registered User
Posts: 261
Joined: Tue Feb 25, 2003 8:10 am
Location: This Post
Contact:

Re: [2.0.18] Cash Mod

Post by Mooncow » Wed Aug 27, 2008 1:22 pm

ah..... hmmmm
that makes things kinda awkward now
what kind of a system is usually used for this mod then? cos surely members will have huge amounts of cash this way?
I love teh phpBB

hongie
Registered User
Posts: 1
Joined: Sat Aug 30, 2008 5:21 pm

Re: [2.0.18] Cash Mod

Post by hongie » Sat Aug 30, 2008 5:26 pm

Can this be install on phpbb v3?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 50969
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.18] Cash Mod

Post by Brf » Sat Aug 30, 2008 6:00 pm

phpbb2 mods do not work with phpbb3.
You can search the phpbb3 mod forums for the phpbb3 version though.

oacblack
Registered User
Posts: 61
Joined: Tue Mar 27, 2007 6:33 am

Re: [2.0.18] Cash Mod

Post by oacblack » Tue Sep 02, 2008 1:04 am

BRF can you give me a general idea on what to replace that code with. where to pull from to check post set amount ect?

oacblack
Registered User
Posts: 61
Joined: Tue Mar 27, 2007 6:33 am

Re: [2.0.18] Cash Mod

Post by oacblack » Tue Sep 02, 2008 1:13 am

would it be something like

Code: Select all

if( $board_config['cash_perpost'] )
   {
      $points =  $board_config['cash_perreply'];

      $sql = "UPDATE " . USERS_TABLE . "
         SET user_points = user_points + $points
         WHERE user_id = $iai_id";
      if( !$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Could not update user points', '', __LINE__, __FILE__, $sql);
      }
        }

User avatar
Brf
Support Team Member
Support Team Member
Posts: 50969
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.18] Cash Mod

Post by Brf » Tue Sep 02, 2008 11:42 am

What are you talking about?
This cash mod already awards points per post. Why would you need any custom code?

oacblack
Registered User
Posts: 61
Joined: Tue Mar 27, 2007 6:33 am

Re: [2.0.18] Cash Mod

Post by oacblack » Wed Sep 03, 2008 5:38 am

I posted 1 page back. I am working with the AI bot trying to get him to get rewarded using the cash mod instead of the points mod. here is his post function

Code: Select all

//
// Update Stats for IAI: must be run AFTER update_post_stats() for original post
//
function iai_update_post_stats(&$forum_id, &$topic_id, &$iai_post_id, &$iai_id)
{
        global $db, $board_config;

        //This simply runs the 3 db updating functions (only used for IAI replies).

        $sql = "UPDATE " . FORUMS_TABLE . "
                SET forum_posts = forum_posts + 1, forum_last_post_id = $iai_post_id
                WHERE forum_id = $forum_id";
        if ( !($result = $db->sql_query($sql)) )
        {
                message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
        }

        $sql = "UPDATE " . TOPICS_TABLE . "
                SET topic_last_post_id = $iai_post_id, topic_replies = topic_replies + 1
                WHERE topic_id = $topic_id";
        if ( !($result = $db->sql_query($sql)) )
        {
                message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
        }

        $sql = "UPDATE " . USERS_TABLE . "
                SET user_posts = user_posts + 1
                WHERE user_id = $iai_id";
        if ( !($result = $db->sql_query($sql, END_TRANSACTION)) )
        {
                message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
        }
       
        if( $board_config['points_post'] )
	{
		$points =  $board_config['points_reply'];

		$sql = "UPDATE " . USERS_TABLE . "
			SET user_points = user_points + $points
			WHERE user_id = $iai_id";
		if( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not update user points', '', __LINE__, __FILE__, $sql);
		}
        }
        return;
}

User avatar
Brf
Support Team Member
Support Team Member
Posts: 50969
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.18] Cash Mod

Post by Brf » Wed Sep 03, 2008 11:56 am

So you already appear to be updating user_points. That should work fine, assuming you have called your cash user_points.

oacblack
Registered User
Posts: 61
Joined: Tue Mar 27, 2007 6:33 am

Re: [2.0.18] Cash Mod

Post by oacblack » Sun Sep 07, 2008 6:47 am

I do but it pulls data from

Code: Select all

if( $board_config['points_post'] )
   {
      $points =  $board_config['points_reply'];
which are relevent to points mod not cash mod to see how many points to reward :P

User avatar
Brf
Support Team Member
Support Team Member
Posts: 50969
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.18] Cash Mod

Post by Brf » Sun Sep 07, 2008 11:55 am

So?
Just put a number in there instead.

1412
Registered User
Posts: 14
Joined: Thu Sep 04, 2008 7:56 pm

Re: [2.0.18] Cash Mod

Post by 1412 » Thu Sep 11, 2008 12:41 pm

Is there any options available to restrict a certain user from being able to use his/her cash?

Post Reply

Return to “[2.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 12 guests