vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   New Posting Features - Reputation points (+ / -) for new threads and posts (https://vborg.vbsupport.ru/showthread.php?t=237974)

Thr33 03-09-2010 10:00 PM

Reputation points (+ / -) for new threads and posts
 
1 Attachment(s)
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


--

Dr.osamA 03-11-2010 08:15 AM

any Screenshots plzzzz

Waiting . . . . . . .
________
SUZUKI RG150 SPECIFICATIONS

Thr33 03-12-2010 08:17 AM

Why would you need screenshots??

Create a thread = +1 reputation
Reply to a thread = -1 reputation

...simplez

karkey 03-22-2010 10:56 PM

hello
is there anyway to make this rep 2 for threads and 1 for reply's instead ?

or would changing to this work

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']+2;//increase reputation by 2   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;//increase reputation by 1   CHANGE IF REQUIRED
    
$vbulletin->db->query_write("UPDATE user SET reputation=".$punkty." WHERE userid=".$vbulletin->userinfo['userid']);
   
$senderpermissions=2;
   
$registry =& $vbulletin;



Thr33 03-23-2010 11:48 AM

Yes that would work fine.

Jaske 05-23-2010 09:58 PM

good job.

AliceHoward 08-21-2010 12:22 PM

What a wonderful idea, thank you ever so much for sharing with us, i know how it feels to have to struggle on with no help, well done you for getting this done.

I wonder how we might be able to make this work retroactively, I know you are just picking up in this field so this may be a little out there for you, but I wonder if anyone else also might know. I tried the obvious of rebuilding users rep' but it did nothing.

Gursimran 08-25-2010 11:45 AM

Can you please post a screen shot.

trungtin 08-25-2010 11:57 AM

You can view demo?

Thr33 02-23-2011 10:24 PM

You shouldnt need a demo, the description says it all. For a demo it would mean giving restricted access to an account, autoreplying with rep system bypass. Read the comments and you should understand what this edit does.

Kuya 05-02-2011 12:14 PM

Doesn't seem to work on my forum... Had it installed for a few weeks and my own reputation is still where I left it?

strudinox 05-03-2011 08:29 PM

Seems to be working fine for me. thanks!

Special Pages 05-04-2011 02:31 AM

Great job. Keep up the good work! :)

leejohn02 05-30-2011 09:54 PM

excellent mod nice and easy to install and easy to find and edit, cheers

fnrtop 07-31-2011 06:50 AM

how can I modify this so it becomes 1 rep point every 3 threads?

Thr33 09-13-2012 12:26 AM

Its not possible per numerous threads im afraid...

thermax04 01-27-2013 02:20 AM

I did this mod but it did not change the previous reputation count!! or it will work only for the new threads after applying the mod?

I made a new thread = +5 and new post = +1

I tested now, by making a new thread, but still it adds 1 point for the new thread!!

V4.1.11

thermax04 01-28-2013 03:10 PM

Quote:

Originally Posted by thermax04 (Post 2399778)
I did this mod but it did not change the previous reputation count!! or it will work only for the new threads after applying the mod?

I made a new thread = +5 and new post = +1

I tested now, by making a new thread, but still it adds 1 point for the new thread!!

V4.1.11

Up....up

CAG CheechDogg 02-20-2015 07:39 AM

I tried adding this and I get the following when trying to add a new thread or reply to a thread and it wont post the new thread or reply ...

The following errors occurred with your submission

Database Error

Jorandh 02-20-2015 12:36 PM

Quote:

Originally Posted by CAG CheechDogg (Post 2538063)
I tried adding this and I get the following when trying to add a new thread or reply to a thread and it wont post the new thread or reply ...


The following errors occurred with your submission

Database Error

Try this: https://vborg.vbsupport.ru/showthread.php?p=2538092

;)


All times are GMT. The time now is 05:49 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.01152 seconds
  • Memory Usage 1,788KB
  • 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
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete