[MODDB] Ultimate Points 1.0.6

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
Locked
Mircea007
Registered User
Posts: 74
Joined: Mon Jun 15, 2009 9:24 pm

Re: [RC] Ultimate Points 1.0.3

Post by Mircea007 » Fri Jul 17, 2009 5:35 pm

how do i change how many points the users gets per post .... because is there as default 5 and in the settings/mods panel i cant see the option that says points per post ?


thank you
Flash Games like you never seen before

User avatar
SAFFLEUR
Registered User
Posts: 323
Joined: Thu Nov 24, 2005 5:56 am
Location: Lenoir NC
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by SAFFLEUR » Fri Jul 17, 2009 6:23 pm

Mircea007 wrote:how do i change how many points the users gets per post .... because is there as default 5 and in the settings/mods panel i cant see the option that says points per post ?


thank you
It is in the Forums page. Go to your forums and edit one it should give you option to define point per post, replt and post edit.

Mircea007
Registered User
Posts: 74
Joined: Mon Jun 15, 2009 9:24 pm

Re: [RC] Ultimate Points 1.0.3

Post by Mircea007 » Sat Jul 18, 2009 5:58 am

thank you i saw it now .... i think it would be easier to setup from the mod page for all cause this way i have to go through everysingle forum :D
Flash Games like you never seen before

User avatar
SAFFLEUR
Registered User
Posts: 323
Joined: Thu Nov 24, 2005 5:56 am
Location: Lenoir NC
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by SAFFLEUR » Sat Jul 18, 2009 6:19 am

Mircea007 wrote:thank you i saw it now .... i think it would be easier to setup from the mod page for all cause this way i have to go through everysingle forum :D
Perhaps but some sites do not want certains forums to give points. That is why it is done that way.

JustinMorr22
Registered User
Posts: 37
Joined: Tue Jul 14, 2009 3:50 pm

Re: [RC] Ultimate Points 1.0.3

Post by JustinMorr22 » Sat Jul 18, 2009 9:09 am

When I edit, it doesnt give me the 1 point that I put for every single forum. It actually gives me 0. It used to subtracked like 15 points before I changed it.

JustinMorr22
Registered User
Posts: 37
Joined: Tue Jul 14, 2009 3:50 pm

Re: [RC] Ultimate Points 1.0.3

Post by JustinMorr22 » Sat Jul 18, 2009 10:11 am

OK guys ever since I installed your mod on my forum something weird has happened and it only accurs with FireFox. The one Arcade button is different the the others and the right sides of my shoutbox and forumlist is wired. Look at my forum to see what I mean...

http://forums.dreamteamunleashed.com/index.php

Please help if you could. This happened right after I installed your mod...

danielnguyen
Registered User
Posts: 287
Joined: Thu Jan 24, 2008 11:44 am
Location: Vietnam
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by danielnguyen » Sat Jul 18, 2009 12:59 pm

A very nice mod! Thank you so much! I hope you continue to develop this mod to the final version!
My forum, for just teen only with many happy things
Cộng Đồng Teen Online - Cộng Đồng Teen Việt - Teen Việt Nam
Hội Ngộ - Giao Lưu - Học Hỏi - Giải Trí - Kết Bạn
http://www.congdongteenonline.net

iamwanted
Registered User
Posts: 23
Joined: Sat Jul 18, 2009 1:47 am

Re: [RC] Ultimate Points 1.0.3

Post by iamwanted » Sat Jul 18, 2009 1:18 pm

Pretty neat mod, I am going to try to install it today :)

go99live
Registered User
Posts: 206
Joined: Mon May 01, 2006 7:18 pm
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by go99live » Sat Jul 18, 2009 6:52 pm

Is there are way to install this mod keeping the current points that are in Adrian1 Advanced Points mod?

User avatar
Ashley.S.
Registered User
Posts: 468
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Ashley.S. » Sat Jul 18, 2009 7:19 pm

go99live wrote:Is there are way to install this mod keeping the current points that are in Adrian1 Advanced Points mod?
I believe that there is a converter in the contrib folder of the mod
Regards,
-Ashley.S. [ ProphpBB Free Forum Hosting Moderator ]

The-Lord
Registered User
Posts: 103
Joined: Thu Jan 31, 2008 12:13 pm

Re: [RC] Ultimate Points 1.0.3

Post by The-Lord » Sun Jul 19, 2009 2:13 pm

Does it support the Shop Mod by Adrian?

User avatar
Ashley.S.
Registered User
Posts: 468
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Ashley.S. » Sun Jul 19, 2009 2:18 pm

The-Lord wrote:Does it support the Shop Mod by Adrian?
yes it should
Regards,
-Ashley.S. [ ProphpBB Free Forum Hosting Moderator ]

User avatar
milkboy31
Registered User
Posts: 422
Joined: Tue Aug 09, 2005 2:44 pm

Re: [RC] Ultimate Points 1.0.3

Post by milkboy31 » Mon Jul 20, 2009 2:41 am

Thank you for finally making a points mod that just WORKS. No bugs, easy install with AutoMOD, etc...

Great work guys!

One request though: Can we limit points based on forum? I see you can set a points per post/reply/edit per forum... or you can set a points per character/word/etc globally for all forums... I'd like to set a points per character but only enable earning points in certain forums. Maybe this is possible and I just didn't "get it" so correct me if I'm wrong. A simple "points on/off" in the forum config page would be awesome.

Oh, and another... can you tell me how to add a field for points in the memberlist.php??? Thanks!

femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [RC] Ultimate Points 1.0.3

Post by femu » Mon Jul 20, 2009 7:22 am

milkboy31 wrote:Thank you for finally making a points mod that just WORKS. No bugs, easy install with AutoMOD, etc...

Great work guys!
Thanks ;)
milkboy31 wrote:One request though: Can we limit points based on forum? I see you can set a points per post/reply/edit per forum... or you can set a points per character/word/etc globally for all forums... I'd like to set a points per character but only enable earning points in certain forums. Maybe this is possible and I just didn't "get it" so correct me if I'm wrong. A simple "points on/off" in the forum config page would be awesome.
Unfortunatly not. Currently there no plans to set advaneced settings on a per forum basis.
milkboy31 wrote:Oh, and another... can you tell me how to add a field for points in the memberlist.php??? Thanks!
Where do you want to have the points? They are already in the memberview ....

Regards,
femu
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]

User avatar
moltendorf
Registered User
Posts: 173
Joined: Thu Dec 01, 2005 2:02 am
Location: San Ramon, California
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by moltendorf » Mon Jul 20, 2009 8:44 am

I have figured out what is causing the negative points issue when editing a fresh post or topic. The issue was caused by the "bonus" points that were not included in the calculation, meaning when you edit a post, even if you don't change anything, you will get -15 points + 0.05 for editing (for new topics), -5 points + 0.05 for editing (for new posts), and -x if you have bonuses included for attachments and polls.

I have resolved this issue; partly. Hopefully these changes will be included in the next release, but this will fix the issue.

Attachment points don't disappear if the user deletes the attachments, poll points don't disappear if you delete poll options, or the entire poll. Points are not added when you add poll options or new attachments to a post when editing. This is not caused by applying this patch, it is in the original MOD. My patch repairs what I would consider the more critical component, especially since I have attachments and polls set to no extra points.

femu, unless you did intend to remove the 15 points awarded for creating a new topic when the user edits his first post in the topic, I would consider this as a bug, same applies to the 5 points for a reply to a topic.

After installing the mod, apply this modification.
  1. Run this SQL query. Replace phpbb_ with your table prefix!

    Code: Select all

    ALTER TABLE phpbb_posts ADD points_bonus DECIMAL( 20, 2 ) DEFAULT '0.0' NOT NULL;
  2. Find in includes/functions_posting.php.

    Code: Select all

                    $sql = 'SELECT MAX(post_id) as last_post_id
                        FROM ' . POSTS_TABLE . "
                        WHERE topic_id = $topic_id " .
                            ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : ''); 
    Replace with.

    Code: Select all

                    $sql = 'SELECT MAX(post_id) as last_post_id, points_received
                        FROM ' . POSTS_TABLE . "
                        WHERE topic_id = $topic_id " .
                            ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : ''); 
  3. Find in includes/functions_posting.php.

    Code: Select all

                    // Start Ultimate Points
                    $sql = 'SELECT points_received, poster_id
                        FROM ' . POSTS_TABLE . '
                        WHERE post_id = ' . $data['post_id']; 
    Replace with.

    Code: Select all

                    // Start Ultimate Points
                    $sql = 'SELECT points_bonus, points_received, poster_id
                        FROM ' . POSTS_TABLE . '
                        WHERE post_id = ' . $data['post_id']; 
  4. Find in includes/functions_posting.php.

    Code: Select all

                        $sql = "UPDATE " . USERS_TABLE . " SET user_points = user_points - " . $row['points_received'] . " WHERE user_id = '" . $row['poster_id'] . "'";
                        $db->sql_query($sql);
    
                        $sql = "UPDATE " . POSTS_TABLE . " SET points_received = points_received - " . $row['points_received'] . " WHERE post_id = '" . $data['post_id'] . "'";
                        $db->sql_query($sql); 
    Replace with.

    Code: Select all

                        $sql = "UPDATE " . USERS_TABLE . " SET user_points = ((user_points - " . $row['points_received'] . ") + " . $row['points_bonus'] . ") WHERE user_id = '" . $row['poster_id'] . "'";
                        $db->sql_query($sql);
    
                        $sql = "UPDATE " . POSTS_TABLE . " SET points_received = ((points_received - " . $row['points_received'] . ") + points_bonus) WHERE post_id = '" . $data['post_id'] . "'";
                        $db->sql_query($sql); 
  5. Find in includes/functions_posting.php.

    Code: Select all

        // Start Ultimate Points
        if ( $config['points_enable'] )
        {
            $sql = "UPDATE " . POSTS_TABLE . " SET points_received = points_received + " . $data['user_points'] . " WHERE post_id = '" . $data['post_id'] . "'";
            $db->sql_query($sql);
        }
        // End Ultimate Points             
    Replace with.

    Code: Select all

        // Start Ultimate Points
        if ( $config['points_enable'] )
        {
            $sql = "UPDATE " . POSTS_TABLE . " SET points_received = points_received + " . $data['user_points'] . ", points_bonus = points_bonus + " . $data['user_points'] . " WHERE post_id = '" . $data['post_id'] . "'";
            $db->sql_query($sql);
        }
        // End Ultimate Points             
  6. Find in includes/points/functions_points.php

    Code: Select all

        /**
        * Receive cash for creating new polls
        */
        function new_poll($forum_id, $post_id, $options)
        {
            global $db, $config, $auth, $user;
    
                // Read out values data
                $sql_array = array(
                    'SELECT'    => '*',
                    'FROM'      => array(
                        POINTS_VALUES_TABLE => 'v',
                    ),
                );
                $sql = $db->sql_build_query('SELECT', $sql_array);
                $result = $db->sql_query($sql);
                $points_values = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
    
                $poll_options    = $poll_points = 0;
                $poll_options    = $points_values['points_per_poll_option'] * $options;
                $poll_points    = $points_values['points_per_poll'];
                $total            = $poll_options + $poll_points;
    
                $sql = 'UPDATE ' . USERS_TABLE . "
                    SET user_points = user_points + $total
                    WHERE user_id = " . $user->data['user_id'];
                $db->sql_query($sql);
    
                // Update post points
                $sql = 'UPDATE ' . POSTS_TABLE . "
                    SET points_received = points_received + $total
                    WHERE post_id = " . $post_id;
                $db->sql_query($sql);
            return $total;
        }
    
        /**
        * Receive points for attaching files
        */
        function new_attachment($forum_id, $post_id, $files)
        {
            global $db, $config, $auth, $user;
    
                // Read out values data
                $sql_array = array(
                    'SELECT'    => '*',
                    'FROM'      => array(
                        POINTS_VALUES_TABLE => 'v',
                    ),
                );
                $sql = $db->sql_build_query('SELECT', $sql_array);
                $result = $db->sql_query($sql);
                $points_values = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
    
                $attachment_files    = $attachment_points = 0;
                $attachment_files    = $points_values['points_per_attach_file'] * $files;
                $attachment_points    = $points_values['points_per_attach'];
                $total                = $attachment_files + $attachment_points;
                
                $sql = 'UPDATE ' . USERS_TABLE . "
                    SET user_points = user_points + $total
                    WHERE user_id = " . $user->data['user_id'];
                $db->sql_query($sql);
    
                // Update post points
                $sql = 'UPDATE ' . POSTS_TABLE . "
                    SET points_received = points_received + $total
                    WHERE post_id = " . $post_id;
                $db->sql_query($sql);
            return $total;
        }
    } 
    Replace with.

    Code: Select all

        /**
        * Receive cash for creating new polls
        */
        function new_poll($forum_id, $post_id, $options)
        {
            global $db, $config, $auth, $user;
    
                // Read out values data
                $sql_array = array(
                    'SELECT'    => '*',
                    'FROM'      => array(
                        POINTS_VALUES_TABLE => 'v',
                    ),
                );
                $sql = $db->sql_build_query('SELECT', $sql_array);
                $result = $db->sql_query($sql);
                $points_values = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
    
                $poll_options    = $poll_points = 0;
                $poll_options    = $points_values['points_per_poll_option'] * $options;
                $poll_points    = $points_values['points_per_poll'];
                $total            = $poll_options + $poll_points;
    
                $sql = 'UPDATE ' . USERS_TABLE . "
                    SET user_points = user_points + $total
                    WHERE user_id = " . $user->data['user_id'];
                $db->sql_query($sql);
    
                // Update post points
                $sql = 'UPDATE ' . POSTS_TABLE . "
                    SET points_received = points_received + $total,
                        points_bonus = points_bonus + $total
                    WHERE post_id = " . $post_id;
                $db->sql_query($sql);
            return $total;
        }
    
        /**
        * Receive points for attaching files
        */
        function new_attachment($forum_id, $post_id, $files)
        {
            global $db, $config, $auth, $user;
    
                // Read out values data
                $sql_array = array(
                    'SELECT'    => '*',
                    'FROM'      => array(
                        POINTS_VALUES_TABLE => 'v',
                    ),
                );
                $sql = $db->sql_build_query('SELECT', $sql_array);
                $result = $db->sql_query($sql);
                $points_values = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
    
                $attachment_files    = $attachment_points = 0;
                $attachment_files    = $points_values['points_per_attach_file'] * $files;
                $attachment_points    = $points_values['points_per_attach'];
                $total                = $attachment_files + $attachment_points;
    
                $sql = 'UPDATE ' . USERS_TABLE . "
                    SET user_points = user_points + $total
                    WHERE user_id = " . $user->data['user_id'];
                $db->sql_query($sql);
    
                // Update post points
                $sql = 'UPDATE ' . POSTS_TABLE . "
                    SET points_received = points_received + $total,
                        points_bonus = points_bonus + $total
                    WHERE post_id = " . $post_id;
                $db->sql_query($sql);
            return $total;
        }
    } 
After applying this patch, you should only lose points if you have points added for post/topic characters or post/topic words and you delete a large amount of your post.

I have created a sync query to add points to all users for their existing topics, posts, attachments, and polls.
See here: http://www.phpbb.com/community/viewtopi ... #p10269755
Last edited by moltendorf on Tue Jul 21, 2009 1:47 am, edited 5 times in total.
Did I ever mention that I think phpBB is awesome? I thought I did, but I'm not so sure, so I'll say it again: phpBB is awesome!
pantry \ snack :: is_good ( ) ? pantry \ snack :: hastily_consume ( ) : pantry \ snack :: reject ( );

Need some help? I have a solid understanding several programming and markup languages.
Projects: QuickChat: A Shoutbox, Live Post, ORANGEstyle

Locked

Return to “[3.0.x] MODs in Development”