Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Reputation For New Threads and Posts Details »»
Reputation For New Threads and Posts
Version: 1.00, by Sir_Yaro Sir_Yaro is offline
Developer Last Online: Sep 2015 Show Printable Version Email this Page

Version: 3.5.7 Rating:
Released: 02-13-2007 Last Update: 03-02-2007 Installs: 2
Code Changes  
No support by the author.

Hi.
First of all I'm not a coder. So this hack for a professionals might looks like total disaster but it works and that what is important for me...
Like I said before I'm not a code therefore I don't give any support cause I barely know how this hack works

This is simple version of this hack:
https://vborg.vbsupport.ru/showthread.php?t=78853
It should (?) be compatible with 3.6.x as well.

In specified below forums system will give X reputation points for any new thread and it will send PM to the poster with informatin about it.
Code is clearly described. Take a closer look at places marked by CHANGE IT !.

Have fun

in includes/functions_newpost.php
find:
Code:
		if ($type == 'thread')
		{
			$vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
			eval(print_standard_redirect('redirect_duplicatethread', true, true));
		}
		else
		{
			$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$prevpostthreadid";
			eval(print_standard_redirect('redirect_duplicatepost', true, true));
		}
	}
If u want to give reputation for new posts and threads add below:
Code:
if ($foruminfo[forumid]>37 AND $foruminfo[forumid]<41)//works only in forums with id  between 37 and 41 (so 38,39 and 40 only) CHANGE IT !
{
    $result = $vbulletin->db->query_first("SELECT reputation FROM user WHERE userid =".$vbulletin->userinfo['userid']." ORDER BY userid ASC");

    $punkty=$result['reputation']+20;//incrase reputation by 20   CHANGE IT !
    $vbulletin->db->query_write("UPDATE user SET reputation=".$punkty." WHERE userid=".$vbulletin->userinfo['userid']);


   $senderpermissions=2;
   $registry =& $vbulletin;
   // create the DM to do error checking and insert the new PM
   $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
    $pmdm->set('fromuserid', 592); //change to admin ID number   CHANGE IT !
    $pmdm->set('fromusername', 'Sir_Yaro'); //change to admin name   CHANGE IT !
    $pmdm->set('title', 'Otrzymales(as) 20 pkt reputacji ');//title  CHANGE IT !
    $pmdm->set('message', "Otrzymales(as) 20 pkt reputacji za umieszczenie urzadzenia na liscie HCL\nDziekujemy bardzo i prosimy o dalsze wpisy :)"); //message   CHANGE IT !
   $pmdm->set_recipients($vbulletin->userinfo['username'], $senderpermissions);
   $pmdm->set('dateline', TIMENOW);
   $pmdm->save();

}
If you want to give reputation only for new threads add below:
Code:
if ($foruminfo[forumid]>37 AND $foruminfo[forumid]<41 AND $postinfo['postid'] == 0)//works only in forums with id  between 37 and 41 (so 38,39 and 40 only) CHANGE IT !
{
    $result = $vbulletin->db->query_first("SELECT reputation FROM user WHERE userid =".$vbulletin->userinfo['userid']." ORDER BY userid ASC");

    $punkty=$result['reputation']+20;//incrase reputation by 20   CHANGE IT !
    $vbulletin->db->query_write("UPDATE user SET reputation=".$punkty." WHERE userid=".$vbulletin->userinfo['userid']);


   $senderpermissions=2;
   $registry =& $vbulletin;
   // create the DM to do error checking and insert the new PM
   $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
    $pmdm->set('fromuserid', 592); //change to admin ID number   CHANGE IT !
    $pmdm->set('fromusername', 'Sir_Yaro'); //change to admin name   CHANGE IT !
    $pmdm->set('title', 'Otrzymales(as) 20 pkt reputacji ');//title  CHANGE IT !
    $pmdm->set('message', "Otrzymales(as) 20 pkt reputacji za umieszczenie urzadzenia na liscie HCL\nDziekujemy bardzo i prosimy o dalsze wpisy :)"); //message   CHANGE IT !
   $pmdm->set_recipients($vbulletin->userinfo['username'], $senderpermissions);
   $pmdm->set('dateline', TIMENOW);
   $pmdm->save();

}
If you want to use it in a few different forums you can use this code instead of previous one:
Code:
$foruminfo[forumid]==37 OR $foruminfo[forumid]==41 OR $foruminfo[forumid]==11
and so on....

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-14-2007, 10:50 AM
EnIgMa1234 EnIgMa1234 is offline
 
Join Date: Mar 2006
Location: .:: Ireland ::.
Posts: 1,306
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks. nice hack
Reply With Quote
  #3  
Old 03-12-2007, 12:47 AM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey, I'm not code god either but I did clean this up a little. I'm on 3.64 but I assume it'll work for you too.


create a new plugin at hook "newpost_complete"

Code:
$pointsperreply=1; // repuation points per reply.  0 to disable
$pointsperthread=1; // repuation points per thread.  0 to disable
if ($foruminfo[forumid]!=18 && $foruminfo[forumid]!=6) {
	if ($type == 'thread') {
		$reppoints=$pointsperthread;
	} else {
		$reppoints=$pointsperreply;
	}
	if ($reppoints) {
    	$vbulletin->db->query_write("UPDATE user SET reputation=reputation+".$reppoints." WHERE userid=".$vbulletin->userinfo['userid']);
	}
}

this uses only 1 query instead of 2, lets you set different values for threads & replies, and lets you disable either.

still not sure I want to hand out rep points for every post but since I'm using rep points for vBookie, they might need em.
Reply With Quote
  #4  
Old 03-12-2007, 01:01 AM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

was just thinking about it and you probably should throw something in there in case it's a guest posting.

Code:
$pointsperreply=1; // repuation points per reply.  0 to disable
$pointsperthread=1; // repuation points per thread.  0 to disable
if ($foruminfo[forumid]!=18 && $foruminfo[forumid]!=6 && $vbulletin->userinfo['usergroupid']>1) {
	if ($type == 'thread') {
		$reppoints=$pointsperthread;
	} else {
		$reppoints=$pointsperreply;
	}
	if ($reppoints) {
    	$vbulletin->db->query_write("UPDATE user SET reputation=reputation+".$reppoints." WHERE userid=".$vbulletin->userinfo['userid']);
	}
}
this should do it.
Reply With Quote
  #5  
Old 03-10-2010, 09:49 AM
Thr33's Avatar
Thr33 Thr33 is offline
 
Join Date: Sep 2008
Location: Manchester, UK
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone no of this mod for 4.0 or 4.2?
Reply With Quote
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 02:32 AM.


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.03883 seconds
  • Memory Usage 2,250KB
  • Queries Executed 20 (?)
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
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete