Back to vBulletin 4.x Template Modifications

Reputation points (+ / -) for new threads and posts
Mod Version: 0.4, by Thr33

vB Version: 4.0.x Rating: (0 vote - 0 average) Installs: 16
Released: 10 Mar 2010 Last Update: Never Downloads: 0
Not Supported Template Edits Translations  

Hey guys, im not a coder but ive been quickly trying to learn PHP over the 4 weeks ive had VBulletin. This is my first template mod cause ive not learn how to make plugins yet lol. I asked for weeks and weeks on how to do little things that would (when complete) construct my reputation system but know one replied with a respectable answer. Although once id managed to complete it and have it working i decided to share with you guys.

Purpose
I run a music production website where i provide downloads, but they are meant as a priveledge given to comitted members. So, to have access to the downloads section you must have 20 reps/reputation points (set as a rank in adminCP). This is now the share ratio because this mod rewards a rep point to the user who posts a new thread in the download section and deducts a rep point to those who reply to a thread. This will stop an progressive leeching issue, but of course without good moderation may introduce spamming (just a warning).

Modification
Ok down to the coding..

In > */includes/functions_newpost.php

find:
PHP Code:
                    eval(print_standard_redirect('redirect_postthanks'));
                }
                else
                {
                    eval(
print_standard_redirect('redirect_duplicatepost'truetrue));
                }
            }
        }
    } 
and, underneath put:
PHP Code:
    if ($type == 'thread')//if its a thread and not a post/reply
{
    
$result $vbulletin->db->query_first("SELECT reputation FROM user WHERE userid =".$vbulletin->userinfo['userid']." ORDER BY userid ASC");
    
$punkty=$result['reputation']+1;//incrase reputation by 1   CHANGE IF REQUIRED
    
$vbulletin->db->query_write("UPDATE user SET reputation=".$punkty." WHERE userid=".$vbulletin->userinfo['userid']);
   
$senderpermissions=2;
   
$registry =& $vbulletin;
   }
else
//if its anything but a thread, hense; post/reply
   
{
    
$result $vbulletin->db->query_first("SELECT reputation FROM user WHERE userid =".$vbulletin->userinfo['userid']." ORDER BY userid ASC");
    
$punkty=$result['reputation']-1;//decreases reputation by 1   CHANGE IF REQUIRED
    
$vbulletin->db->query_write("UPDATE user SET reputation=".$punkty." WHERE userid=".$vbulletin->userinfo['userid']);
   
$senderpermissions=2;
   
$registry =& $vbulletin;

--
If you want this feature in just a select number of forums you add this around the above:
PHP Code:
if ($foruminfo[forumid] = OR $foruminfo[forumid] =5)
{
//ABOVE CODE

or in a number of chained forums:
PHP Code:
if ($foruminfo[forumid]>AND $foruminfo[forumid]<8)// ADDED IN FORUMS 5, 6 AND 7
{
//ABOVE CODE

For this to apply to different usergroups
PHP Code:
if ($userinfo['usergroup'] =6)
{
//ABOVE CODE

--

Download

No files for download.

Similar Mods

Reputation For New Threads and Posts vBulletin 3.5 Add-ons
Give Reputation For New Posts & Threads vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024