| The Arcive of vBulletin Modifications Site. | |
|  Reputation For New Threads and Posts Details »» | |||||||||||||||||||||||||
| 
 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));
		}
	}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();
}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();
}Code: $foruminfo[forumid]==37 OR $foruminfo[forumid]==41 OR $foruminfo[forumid]==11 Show Your Support 
 | |||||||||||||||||||||||||
| Comments | 
| 
			 
			#2  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			thanks. nice hack
		 | 
| 
			 
			#3  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			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. | 
| 
			 
			#4  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			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']);
	}
} | 
| 
			 
			#5  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			anyone no of this mod for 4.0 or 4.2?
		 | 
|  | 
| 
 | 
 | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
| 
 | |
|  More Information | |
| Template Usage: 
 Phrase Groups Available: 
 | Included Files: 
 Hooks Called: 
 |