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)

kafi 09-26-2006 10:51 AM

Very usefull hack!!! Good Job!

Feature REQUEST .-) : - can you adopt changes so that users will get per Forum (groups) rep. points?
Example:

WEBDESIGN SITE FORUM will have these forums>
Photoshop Forums, Corel Forums, CSS Forums, PHP Forums .... so that we can specify which topic is user's best field of interest and profesionalism...

Paul M 09-26-2006 06:50 PM

That sounds like a very specific change for you, not something the majority need.

Anyway, there are no changes planned to this (esp as it's a 3.5 mod). Atm there are not even any plans to upgrade it to 3.6 as this will work on 3.6 as is.

Antivirus 09-27-2006 01:38 AM

Nice job Paul, it's great to see some added features for Reputation! In my opinion (along with User Notes), it's one of the often overlooked and features of vb. Nice to see an add-on for it.

kafi 09-29-2006 07:25 PM

Quote:

Originally Posted by Paul M
That sounds like a very specific change for you, not something the majority need.

Anyway, there are no changes planned to this (esp as it's a 3.5 mod). Atm there are not even any plans to upgrade it to 3.6 as this will work on 3.6 as is.

I think chart with reputation given per forum would be usefull also for others. Your hack is very close to this. If you search vb.org there are some requests for this...

My community beg for it, but I am not a coder :-(

zylstra 10-09-2006 05:21 PM

I want to show reputation links only for the forums in which reputation votes count, so I used the following code in the postbit template
Code:

        <if condition="$vboptions[noreplist]">
        <else />
                <if condition="$show['reputationlink']">
                        Rep Link
                </if>
        </if>

but it didn't work. Any ideas on how to implement this?

Paul M 10-09-2006 07:19 PM

It's not as easy as that - you would need to add another plugin to the hack to check if the forum you are in allows reputation.

zylstra 10-09-2006 08:01 PM

Thanks, Paul. I think I figured it out. I hooked
Code:

// No Reputation Link //
$flist = explode(',',$vbulletin->options['noreplist']); 
$show['ratablelink'] = (!in_array($threadinfo['forumid'],$flist)) ? true : false;

into showthread_getinfo.

Then I put
Code:

        <if condition="$show['ratablelink']">
                <if condition="$show['reputationlink']">
                        Rep Link
                </if>
        </if>

into the postbit template.

Paul M 10-09-2006 08:48 PM

Excellent :cool:

imranbaig 10-27-2006 04:13 PM

does this work with 3.62?

Paul M 10-27-2006 06:43 PM

Look up a few posts ;)

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 12:52 AM.

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.01309 seconds
  • Memory Usage 1,766KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)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
  • (19)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