vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Enhanced Reputation Given Checks (https://vborg.vbsupport.ru/showthread.php?t=101841)

Eagle Creek 10-30-2006 09:08 AM

Is there a vB 3.6.x version for this one?

Paul M 10-30-2006 11:03 AM

No, this works fine as is on 3.6

h2ojunkie 11-05-2006 03:18 AM

If you want to continue to use the VB default of negative reputation counting only 1/2 as much as positive reputation, you need to change the Negative Reputation section of Reputation Checks (2) to the following:

Code:

// Negative Reputation //
if ($reputation != 'pos')
{
        $reppower *= $vbulletin->options['negrepfactor'];
        if ($reppower < 1 & $reppower > 0)
        {
                $reppower = 1;
        }
        $reppower *= -1;
        if (!($perms['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cannegativerep'])) $reppower = 0;
}

I've only tested this on vb 3.6.2, so I'm not sure if it still applies for older versions

Paul M 11-05-2006 09:45 AM

I see no reason to need to change it, please explain.

h2ojunkie 11-05-2006 08:56 PM

If you set the reputation modification factor to 0.5 (vb default) so negative reputation only counts 1/2 has much as positive reputation.

Let's say a users rep power is 1.

Using your mod as it is, the following happens.
1st: reppower converted to a negative number (1 X -1) = -1 reppower
2nd: the negrepfactor is applied (-1 X 0.5) = -0.5 reppower

So now the system tries to apply a -0.5 to the users reputation. Except for some reason, when applying -0.5 to a users reputation, VB rounds it to zero, so no negative reputation is actually given. I couldn't find any code that was causing it to round to zero, but for some reason that's what happens. It appears that when it actually assigns the points to the users total reputation, it only factors in whole numbers, and does not round them. So a reppower of 5.5 for example, only applies 5 points to the users total reputation. Therefore a reppower of 0.5 only applies 0 points to the users reputation. What is weird, if you view the reputation comments in admin, you'll see it rounds 4.5 to a whole number and displays it as 5. But if you look at the users profile, you'll see that it rounded it down and only applied 4 points to the reputation.

So I took at look at the default negative rep code in functions_reputation.php to see how VB dealt with it by default (I'm writing this off the top of my head but I believe it went something like this):

PHP Code:

    $reppower $reppower/2
    
if ($reppower 1)
    {
        
$reppower 1;
    }
    
$reppower *= -1

So I took that and applied the same idea to your code except I added "greater than 0" condition because without it a person with a reppower of 0 would still be able to give negative rep to other members.

Paul M 11-05-2006 09:20 PM

Thank you for the note, however, it works exactly as it was designed - there is/was no requirement for it to work exactly like default vbulletin - I won't be changing it. :cool:

If you set the factor to 0.5 then it will almost be the same, the two exceptions being (as you have found) if your positive rep power is 1, then your negative rep will be 0 (not -1). The other exception is already mentioned in the notes (fixed Admin rep power). I will add another note to point out this small difference. :)

Guest210212002 11-07-2006 10:41 AM

That worked! Thank you very much as always bro. :) Much appreciated!

Phrost 12-03-2006 08:13 PM

Quote:

Originally Posted by zylstra (Post 1093315)
<if condition="$show['ratablelink']">

[/CODE]into the postbit template.

And if you wrap that conditional around the one that displays rep, you can limit showing reputation scores only in the forums in which it can be earned.

Paul M 12-11-2006 11:58 PM

Quote:

Originally Posted by Eagle Creek (Post 1107359)
Is there a vB 3.6.x version for this one?

There is now ;

https://vborg.vbsupport.ru/showthread.php?t=133775


All times are GMT. The time now is 04:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01193 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete