[ABD] User Reputation Points 0.3.1

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
Sharavarik
Registered User
Posts: 4
Joined: Sun Sep 21, 2008 8:11 am

Re: [Beta] User Reputation Points 0.2.0a

Post by Sharavarik »

maybe it's crashing because i use Mysql(i) :?
this code crashing
$sql = 'SELECT group_reputation_power FROM ' . GROUPS_TABLE . ' WHERE group_id = ' . $user_group_id;


ADD.
under mysql this problem too
matthewhotdude
Registered User
Posts: 82
Joined: Thu Aug 07, 2008 6:56 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by matthewhotdude »

Has anybody else had a Mysql error when moving posts since doing this mod?

Code: Select all

General Error
SQL ERROR [ mysql4 ]

[0]

SQL

No values specified for SQL IN comparison

BACKTRACE


FILE: includes/db/dbal.php
LINE: 385
CALL: dbal->sql_error()

FILE: includes/functions_admin.php
LINE: 454
CALL: dbal->sql_in_set()

FILE: includes/mcp/mcp_main.php
LINE: 637
CALL: move_topics()

FILE: includes/mcp/mcp_main.php
LINE: 93
CALL: mcp_move_topic()

FILE: includes/functions_module.php
LINE: 471
CALL: mcp_main->main()

FILE: includes/functions_module.php
LINE: 766
CALL: p_master->load_active()

FILE: mcp.php
LINE: 168
CALL: p_master->load()

Could it be somthing to do with the following code?

Code: Select all

/**
* Move topic(s)
*/
function move_topics($topic_ids, $forum_id, $auto_sync = true)
{
    global $db;

    if (empty($topic_ids))
    {
        return;
    }

    $forum_ids = array($forum_id);

    if (!is_array($topic_ids))
    {
        $topic_ids = array($topic_ids);
    }

    $sql = 'DELETE FROM ' . TOPICS_TABLE . '
        WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids) . '
            AND forum_id = ' . $forum_id;
    $db->sql_query($sql);

    if ($auto_sync)
    {
        $sql = 'SELECT DISTINCT forum_id
            FROM ' . TOPICS_TABLE . '
            WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
        $result = $db->sql_query($sql);

        while ($row = $db->sql_fetchrow($result))
        {
            $forum_ids[] = $row['forum_id'];
        }
        $db->sql_freeresult($result);
    }

    $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
    foreach ($table_ary as $table)
    {
        $sql = "UPDATE $table
            SET forum_id = $forum_id
            WHERE " . $db->sql_in_set('topic_id', $topic_ids);
        $db->sql_query($sql);
    }
    unset($table_ary);
    // user reputation points  
  $sql = 'DELETE FROM ' . REPUTATIONS_TABLE . '
        WHERE ' . $db->sql_in_set('rep_post_id', $post_ids);
      $db->sql_query($sql);  
// end 

    if ($auto_sync)
    {
        sync('forum', 'forum_id', $forum_ids, true, true);
        unset($forum_ids);
    }
}
Sharavarik
Registered User
Posts: 4
Joined: Sun Sep 21, 2008 8:11 am

Re: [Beta] User Reputation Points 0.2.0a

Post by Sharavarik »

matthewhotdude wrote:when moving posts since doing this mod?
emm..? moving topics maybe?
madtay
Registered User
Posts: 328
Joined: Tue Jun 27, 2006 10:27 pm
Contact:

Re: [Beta] User Reputation Points 0.2.0a

Post by madtay »

check your edit in that file again.. if you only do a partial find there is 3 or 4 matches, make sure its the last match you come to.
matthewhotdude
Registered User
Posts: 82
Joined: Thu Aug 07, 2008 6:56 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by matthewhotdude »

Code: Select all

 foreach ($table_ary as $table)
    {
        $sql = "DELETE FROM $table
            WHERE " . $db->sql_in_set('post_id', $post_ids);
        $db->sql_query($sql);
    }
    unset($table_ary);

    // Adjust users post counts
    if (sizeof($post_counts) && $post_count_sync)
    {
        foreach ($post_counts as $poster_id => $substract)
        {
            $sql = 'UPDATE ' . USERS_TABLE . '
                SET user_posts = 0
                WHERE user_id = ' . $poster_id . '
                AND user_posts < ' . $substract;
            $db->sql_query($sql);
            $sql = 'UPDATE ' . USERS_TABLE . '
                SET user_posts = user_posts - ' . $substract . '
                WHERE user_id = ' . $poster_id . '
                AND user_posts >= ' . $substract;
            $db->sql_query($sql);
        }
    }

    // Remove topics now having no posts?
    if (sizeof($topic_ids))
    {
        $sql = 'SELECT topic_id
            FROM ' . POSTS_TABLE . '
            WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
            GROUP BY topic_id';
        $result = $db->sql_query($sql);

        while ($row = $db->sql_fetchrow($result))
        {
            $remove_topics[] = $row['topic_id'];
        }
        $db->sql_freeresult($result);

        // Actually, those not within remove_topics should be removed. ;)
        $remove_topics = array_diff($topic_ids, $remove_topics);
    }
Theres my edit, It was the last match I came to
matthewhotdude
Registered User
Posts: 82
Joined: Thu Aug 07, 2008 6:56 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by matthewhotdude »

Sorted Yea stupid me had pasted it in the wrong place!
startsmart
Registered User
Posts: 16
Joined: Wed Aug 06, 2008 8:30 pm

Re: [Beta] User Reputation Points 0.2.0a ....... the solution

Post by startsmart »

In Memberlist.php there are 2 similar lines of :

Code: Select all

'SEARCH_IMG'	=> $user->img('icon_user_search', $user->lang['SEARCH']),
you add the reputation mod after each one of these 2 lines.

The mistake is:
you search for the above code twice and add the reputation mod after every result you found
----------------------------------------------------------------------------------------------------
The solution:
Add reputation mod after the first result you found only.... don't put it after the second result
---------------------------------------------------------------------------------------------------
Here is what to do with details:
---------------------------------------------------------------------------------------------------
Open Memberlist.php :
----Find-----

Code: Select all

'SEARCH_IMG'	=> $user->img('icon_user_search', $user->lang['SEARCH']),
----add after-----

Code: Select all

//user reputation point			
			'REPUTATION'	=> $member['user_reputation'],
			'S_REPUTATION'	=> ($config['rp_enable'] && !$member['user_hide_reputation']),
			'REP_POWER'		=>  get_rep_power($member['user_posts'], $member['user_regdate'], $member['user_reputation'], $member['group_id']),
// end user reputation point
---------------------------------------------------------------------------------------------------
don't search again for another:

Code: Select all

'SEARCH_IMG'	=> $user->img('icon_user_search', $user->lang['SEARCH']),
and put the mod lines after it.... this is located at line about 733
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

Re: [Beta] User Reputation Points 0.2.0a

Post by shahinavthal »

Can anyone help me to as to where i can find the reputation rank management module in ACP as i cant find it. I tried adding it manually onto the MODs tab but nothing gets updated...

I have changed the settings within the Group's permissions to enable the reputation but i am still unable to give any reputation..I got the reputation settings under Board configuration and am able to change the settings...I have set the everything to a low value so that i can test the MOD (like minimum posts, wait time etc)
Sharavarik
Registered User
Posts: 4
Joined: Sun Sep 21, 2008 8:11 am

Re: [Beta] User Reputation Points 0.2.0a

Post by Sharavarik »

startsmart, big thanks! it's realy was there. I put code under second line, but not first... :oops:
raudonaitis
Registered User
Posts: 6
Joined: Mon Sep 22, 2008 10:41 am

Re: [Beta] User Reputation Points 0.2.0a

Post by raudonaitis »

<startsmart> thank you very. Although the fool mistake, but I did not see it. Thanks again. ;)

P.S. Sorry for the bad English.
Mudjosh
Registered User
Posts: 234
Joined: Sat Jun 14, 2008 11:04 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by Mudjosh »

This is probably a dumb question but I am testing out this mod and for a while it worked well. Then I had a member get two rep points and instead of just 2 blocks, we had 5 come up.

I looked into the Rep. Acp and changed around the number of points per block but I still can't get 1 point per block to work.

I got it so that a member had 3 points and 3 blocks but then when I looked at a member with only 1 point they had 2 blocks.. I have no clue as to why this is happening.. Anyone know?

EDIT~~~~~~~~~~~~~~~~~~~~~

Ok I think I figured it out..


But for some reason, everytime I add the first rep point it adds two blocks.. Anyone know why about this?
maas
Registered User
Posts: 21
Joined: Fri Sep 26, 2008 5:56 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by maas »

will work fine with phpbb 3.0.2?
User avatar
dotn
Registered User
Posts: 8
Joined: Sun Mar 02, 2008 12:28 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by dotn »

when I enable feature "force user to comment" it doesn´t work. users still can give reputation without comment. how can repair it?
Check the best slovak hip-hop forum: hiphopforum.sk
User avatar
zkaraca
Registered User
Posts: 139
Joined: Wed Jan 30, 2008 7:52 pm

Re: [Beta] User Reputation Points 0.2.0a

Post by zkaraca »

That's a bug that will be fixed in the next release. It was reported earlier. Here' s how you can fix it:

Code: Select all

Just add new language entry 'RP_NO_COMMENT' in languahe/en/mod/reputation_mod.php
Asira.nl * Zeki.nl Just having some fun!
Locked

Return to “[3.0.x] Abandoned MODs”