Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Reputation points (+ / -) for new threads and posts Details »»
Reputation points (+ / -) for new threads and posts
Version: 0.4, by Thr33 Thr33 is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: New Posting Features - Version: 4.0.x Rating:
Released: 03-09-2010 Last Update: Never Installs: 16
Template Edits
Translations  
No support by the author.

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

--

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
Madita, Slavon

Comments
  #12  
Old 05-02-2011, 12:14 PM
Kuya's Avatar
Kuya Kuya is offline
 
Join Date: Aug 2010
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #13  
Old 05-03-2011, 08:29 PM
strudinox's Avatar
strudinox strudinox is offline
 
Join Date: Mar 2010
Location: California
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to be working fine for me. thanks!
Reply With Quote
  #14  
Old 05-04-2011, 02:31 AM
Special Pages Special Pages is offline
 
Join Date: Nov 2010
Location: www.TheDiscussionCafe.com
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great job. Keep up the good work!
Reply With Quote
  #15  
Old 05-30-2011, 09:54 PM
leejohn02 leejohn02 is offline
 
Join Date: Apr 2011
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excellent mod nice and easy to install and easy to find and edit, cheers
Reply With Quote
  #16  
Old 07-31-2011, 06:50 AM
fnrtop fnrtop is offline
 
Join Date: Mar 2007
Location: Jordan
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how can I modify this so it becomes 1 rep point every 3 threads?
Reply With Quote
  #17  
Old 09-13-2012, 12:26 AM
Thr33's Avatar
Thr33 Thr33 is offline
 
Join Date: Sep 2008
Location: Manchester, UK
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its not possible per numerous threads im afraid...
Reply With Quote
  #18  
Old 01-27-2013, 02:20 AM
thermax04 thermax04 is offline
 
Join Date: Apr 2011
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #19  
Old 01-28-2013, 03:10 PM
thermax04 thermax04 is offline
 
Join Date: Apr 2011
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thermax04 View Post
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
Reply With Quote
  #20  
Old 02-20-2015, 07:39 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #21  
Old 02-20-2015, 12:36 PM
Jorandh's Avatar
Jorandh Jorandh is offline
 
Join Date: Jan 2015
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
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

Reply With Quote
Благодарность от:
CAG CheechDogg
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07851 seconds
  • Memory Usage 2,351KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (3)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete