[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
Wyr!H@x!mu$
Registered User
Posts: 802
Joined: Fri Jan 24, 2003 12:06 pm
Location: Koedijk, Alkmaar, The Netherlands
Name: Cees-Jan
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Wyr!H@x!mu$ » Mon Jul 27, 2009 8:07 pm

Hey don't know if this has mentioned before but why does the mod doing a SQL query for each post to get the amount of cache in the bank? It's very easy to use an array as cache so atleast you don't do any double queries...

jimcarrel
Registered User
Posts: 671
Joined: Fri Jul 27, 2007 10:49 pm
Location: Oklahoma City, Oklahoma

Re: [RC] Ultimate Points 1.0.3

Post by jimcarrel » Tue Jul 28, 2009 4:08 pm

Was wondering if anyone has tried getting Ultimate points output info on the Board3Portal??
Grace--Getting what I don't deserve
Mercy--Not getting what I do deserve

User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by darkonia » Tue Jul 28, 2009 4:11 pm

jimcarrel wrote:Was wondering if anyone has tried getting Ultimate points output info on the Board3Portal??
www.die-muellers.org
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.

jimcarrel
Registered User
Posts: 671
Joined: Fri Jul 27, 2007 10:49 pm
Location: Oklahoma City, Oklahoma

Re: [RC] Ultimate Points 1.0.3

Post by jimcarrel » Tue Jul 28, 2009 4:32 pm

Excellent! My German? is really bad, but I figured it out. I'm off to install,,,, thanks a million (points!)
Grace--Getting what I don't deserve
Mercy--Not getting what I do deserve

User avatar
Bobski2000
Registered User
Posts: 130
Joined: Mon Feb 16, 2009 9:40 pm
Location: UK

Re: [RC] Ultimate Points 1.0.3

Post by Bobski2000 » Wed Jul 29, 2009 9:37 am

Everytime i visit a post i have done, i lose points!
Why?
Im not editing, just looking at it. Im loseing 30 points evertime i visit..

Help Please?

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 » Wed Jul 29, 2009 1:39 pm

How can I set point for each Topic and point for each Post?
Nice mod!!
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

User avatar
Bobski2000
Registered User
Posts: 130
Joined: Mon Feb 16, 2009 9:40 pm
Location: UK

Re: [RC] Ultimate Points 1.0.3

Post by Bobski2000 » Wed Jul 29, 2009 5:40 pm

@danielnguyen
Go into your ACP

Select Forum tab

Choose which forum you wish to choose to alter points, by selecting the green cog. (Configure)

Scroll down and you will see the points that are set for that forum..

Change them to you preference-- Points Per Topic, Per Post, Per edit.

Hope this helps.

------------------------------------------------------------------------------------------------------------------------------

Oh and ive sorted my points problem...

Everytime i visit a post i have done, i lose points!
Why?
Im not editing, just looking at it. Im loseing 30 points evertime i visit..

Help Please?
It was the advanced points section in the mod itself. Changed all the points to zero and now it works fine.
Shame the support is slow on here. It's a good mod!

User avatar
Wuerzi
Registered User
Posts: 60
Joined: Fri Aug 15, 2008 11:38 pm
Location: Germany/Würzburg
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Wuerzi » Wed Jul 29, 2009 5:52 pm

Bobski2000 wrote:Shame the support is slow on here.
yes we are sitting 24 hours at the pc, only for you ;)
Bobski2000 wrote: It's a good mod!
Thanks ;)

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 » Thu Jul 30, 2009 6:10 am

How can I integrate this mod with Thanks Post Mod? :D
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

icebox33
Registered User
Posts: 3
Joined: Sun Jul 12, 2009 9:02 pm

Re: [RC] Ultimate Points 1.0.3

Post by icebox33 » Thu Jul 30, 2009 7:34 am

I greet. I have the question. Does someone know as to alter the code and where would the Bank account by to be activated together with with the user registration?
Very sorry for the quality of speech but I do not speak English and I use google translator .

plasmino
Registered User
Posts: 261
Joined: Sat Jul 25, 2009 11:12 am

Re: [RC] Ultimate Points 1.0.3

Post by plasmino » Thu Jul 30, 2009 10:48 am

danielnguyen wrote:How can I integrate this mod with Thanks Post Mod? :D

I have integrate in thank post edit thank.php es:

SET points = points + '.$points.'
WHERE user_id = ' . $row['poster_id'];

with

SET USER_points = USER_points + '.$points.'
WHERE user_id = ' . $row['poster_id'];

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 » Thu Jul 30, 2009 1:37 pm

I have a problem with this mod.
When a member edit his posting, there point is substracted 10.00 point. The message they see after edit his post is::: You received -10.00 Galleon for the edit of the post

I had disable option:: gain point per edit in ACP but I don't know why this problem happens!
Please help me! Thanks
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

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. » Thu Jul 30, 2009 1:48 pm

danielnguyen wrote:I have a problem with this mod.
When a member edit his posting, there point is substracted 10.00 point. The message they see after edit his post is::: You received -10.00 Galleon for the edit of the post

I had disable option:: gain point per edit in ACP but I don't know why this problem happens!
Please help me! Thanks
they are aware of it and hopefully can get it fixed, for now a patch is posted here: http://www.phpbb.com/community/viewtopi ... #p10262315
Regards,
-Ashley.S. [ ProphpBB Free Forum Hosting Moderator ]

User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by keith10456 » Thu Jul 30, 2009 1:53 pm

keith10456 wrote:
keith10456 wrote:
femu wrote:
keith10456 wrote:I got the error when I ran the provided SQL script to convert from APS 0.9.2 to UP 1.0.3
Ok. Let's first see, if you might have these values already in the phpbb_acl_options ..

Go to your phpMyAdmin and check, if the three fields (u_use_robbery, u_use_lottery and u_use_transfer) probably already exists ....

If not, try again following queries:

Code: Select all

INSERT INTO phpbb_acl_options (auth_option, is_global, is_local, founder_only) VALUES ('u_use_robbery', 1, 0, 0);
INSERT INTO phpbb_acl_options (auth_option, is_global, is_local, founder_only) VALUES ('u_use_lottery', 1, 0, 0);
INSERT INTO phpbb_acl_options (auth_option, is_global, is_local, founder_only) VALUES ('u_use_transfer', 1, 0, 0);
If this works, go ahead with the next queries. But run them step by step.
That worked... One last problem though :( When I go to the "Robbery" in the ACP I get an error message letting me know that the html file is missing. I double-checked to ensure that all files where uploaded, purged cache, etc.

The error is:

Code: Select all

template->_tpl_load_file(): File ./style/.html 
Any thoughts on this?
Does anyone know what code/files I can check (outside of ensuring the html files are uploaded - because they are) to fix this?

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 » Thu Jul 30, 2009 2:16 pm

moltendorf wrote: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

I see this error when I run your sql code!

Code: Select all

Error

SQL query: Documentation

UPDATE phpbb_users u SET u.user_points = (( SELECT c.reg_points_bonus FROM phpbb_points_values c LIMIT 1 ) + IF(( SELECT SUM(f.phpbb_perpost + (f.phpbb_peredit * p.post_edit_count) + (@attachment_initial * p.post_attachment)) FROM phpbb_forums f, phpbb_posts p WHERE f.phpbb_id = p.phpbb_id AND p.poster_id = u.user_id ),( SELECT SUM(f.phpbb_perpost + (f.phpbb_peredit * p.post_edit_count) + (@attachment_initial * p.post_attachment)) FROM phpbb_forums f, phpbb_posts p WHERE f.phpbb_id = p.phpbb_id AND p.poster_id = u.user_id ),0) + IF[...]

MySQL said: Documentation
#1054 - Unknown column 'f.phpbb_perpost' in 'field list' 
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

Locked

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