+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Reputation.

  1. #1
    Villains Directors ripper's Avatar
    Join Date
    Mar 2004
    Location
    england,cheshire,winsford
    Posts
    1,082
    My Mood
    Aggressive

    Reputation.

    hi guys, might seem pointless like but when i try to add to peoples Rep it doesnt seem to add to the points its basically just jumps the page, ?

    Thanks


    Only God Can Judge Me.

  2. #2
    [insert clever tag here] JIMINATOR's Avatar
    Join Date
    Mar 2003
    Posts
    11,780
    one of the admins will have to figure it out, but it looks like the following JS may not be installed....
    clientscript/vbulletin_ajax_reputation.js
    RIP Father.

  3. #3
    Villains Directors ripper's Avatar
    Join Date
    Mar 2004
    Location
    england,cheshire,winsford
    Posts
    1,082
    My Mood
    Aggressive
    ok thanks jim


    Only God Can Judge Me.

  4. #4
    Owner Bingo's Avatar
    Join Date
    Oct 2002
    Location
    Florida
    Posts
    2,853
    My Mood
    Fine
    I noticed that a while back. I poked around the code and I can't figure it out.

    If I get some time this weekend I'll go look again. Problem is, I'm crap with code. I see where it's supposed to be and it seems like it's there, but obviously something is wrong.

    I promise to go take a look again but can't promise I'll figure it out. I really do wish I could get it working again though!

    Thanks for the headsup, mate.

    B
    -=(OUTLAWS)=- Bingo My Trade List


  5. #5
    [insert clever tag here] JIMINATOR's Avatar
    Join Date
    Mar 2003
    Posts
    11,780
    bingo, copy and paste into a file named:
    forums/clientscript/vbulletin_ajax_reputation.js
    the file should live with the other .js files

    Code:
    /*======================================================================*\
    || #################################################################### ||
    || # vBulletin 3.6.10 Patch Level 1
    || # ---------------------------------------------------------------- # ||
    || # Copyright ©2000-2008 Jelsoft Enterprises Ltd. All Rights Reserved. ||
    || # This file may not be redistributed in whole or significant part. # ||
    || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
    || # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
    || #################################################################### ||
    \*======================================================================*/
    
    /**
    * Register a post for ajax reputation
    *
    * @param	string	Postid
    *
    * @return	vB_Reputation_Object
    */
    function vbrep_register(postid)
    {
    	if (typeof vBrep == 'object' && typeof postid != 'undefined')
    	{
    		return vBrep.register(postid);
    	}
    }
    
    // #############################################################################
    // vB_Reputation_Handler
    // #############################################################################
    
    /**
    * vBulletin reputation registry
    */
    function vB_Reputation_Handler()
    {
    	this.reps = new Array();
    	this.ajax = new Array();
    };
    
    // =============================================================================
    // vB_Reputation_Handler methods
    
    /**
    * Register a control object as a reputation control
    *
    * @param	string	ID of the control object
    *
    * @return	vB_Reputation_Object
    */
    vB_Reputation_Handler.prototype.register = function(postid)
    {
    	if (AJAX_Compatible && (typeof vb_disable_ajax == 'undefined' || vb_disable_ajax < 2))
    	{
    		this.reps[postid] = new vB_Reputation_Object(postid);
    		if (obj = fetch_object('reputation_' + postid))
    		{
    			obj.onclick = vB_Reputation_Object.prototype.reputation_click;
    			return this.reps[postid];
    		}
    	}
    };
    
    // #############################################################################
    // initialize reputation registry
    
    vBrep = new vB_Reputation_Handler();
    
    // #############################################################################
    // vB_Reputation_Object
    // #############################################################################
    
    /**
    * vBulletin Reputation class constructor
    *
    * Manages a single reputation and control object
    * Initializes control object
    *
    * @param	string	postid
    */
    function vB_Reputation_Object(postid)
    {
    	this.postid = postid;
    	this.divname = 'reputationmenu_' + postid + '_menu';
    	this.divobj = null;
    	this.postobj = fetch_object('post' + postid);
    
    	this.vbmenuname = 'reputationmenu_' + postid;
    	this.vbmenu = null;
    
    	this.xml_sender_populate = null;
    	this.xml_sender_submit = null;
    
    	var me = this;
    
    	/**
    	* Populate OnReadyStateChange callback. Uses a closure to keep state.
    	* Remember to use me instead of "this" inside this function!
    	*/
    	this.onreadystatechange_populate = function()
    	{
    		if (me.xml_sender_populate.handler.readyState == 4 && me.xml_sender_populate.handler.status == 200)
    		{
    			if (me.xml_sender_populate.handler.responseXML)
    			{
    				// check for error first
    				var error = me.xml_sender_populate.fetch_data(fetch_tags(me.xml_sender_populate.handler.responseXML, 'error')[0]);
    				if (error)
    				{
    					alert(error);
    				}
    				else
    				{
    					if (!me.divobj)
    					{
    						// Create new div to hold reputation menu html
    						me.divobj = document.createElement('div');
    						me.divobj.id = me.divname;
    						me.divobj.style.display = 'none';
    						me.divobj.onkeypress = vB_Reputation_Object.prototype.repinput_onkeypress;
    						me.postobj.parentNode.appendChild(me.divobj);
    
    						me.vbmenu = vbmenu_register(me.vbmenuname, true);
    						// Remove menu's mouseover event
    						fetch_object(me.vbmenu.controlkey).onmouseover = '';
    						fetch_object(me.vbmenu.controlkey).onclick = '';
    					}
    
    					me.divobj.innerHTML = me.xml_sender_populate.fetch_data(fetch_tags(me.xml_sender_populate.handler.responseXML, 'reputationbit')[0]);
    
    					var inputs = fetch_tags(me.divobj, 'input');
    					for (var i = 0; i < inputs.length; i++)
    					{
    						if (inputs[i].type == 'submit')
    						{
    							var sbutton = inputs[i];
    							var button = document.createElement('input');
    							button.type = 'button';
    							button.className = sbutton.className;
    							button.value = sbutton.value;
    							button.onclick = vB_Reputation_Object.prototype.submit_onclick;
    							sbutton.parentNode.insertBefore(button, sbutton);
    							sbutton.parentNode.removeChild(sbutton);
    							button.name = sbutton.name;
    							button.id = sbutton.name + '_' + me.postid
    						}
    					}
    
    					me.vbmenu.show(fetch_object(me.vbmenuname));
    				}
    			}
    
    			if (is_ie)
    			{
    				me.xml_sender_populate.handler.abort();
    			}
    		}
    	}
    
    	/**
    	* Submit OnReadyStateChange callback. Uses a closure to keep state.
    	* Remember to use me instead of "this" inside this function!
    	*/
    	this.onreadystatechange_submit = function()
    	{
    		if (me.xml_sender_submit.handler.readyState == 4 && me.xml_sender_submit.handler.status == 200)
    		{
    			if (me.xml_sender_submit.handler.responseXML)
    			{
    				// Register new menu item for this reputation icon
    				if (!me.vbmenu)
    				{
    					me.vbmenu = vbmenu_register(me.vbmenuname, true);
    					// Remove menu's mouseover event
    					fetch_object(me.vbmenu.controlkey).onmouseover = '';
    					fetch_object(me.vbmenu.controlkey).onclick = '';
    				}
    
    				// check for error first
    				var error = me.xml_sender_submit.fetch_data(fetch_tags(me.xml_sender_submit.handler.responseXML, 'error')[0]);
    				if (error)
    				{
    					me.vbmenu.hide(fetch_object(me.vbmenuname));
    					alert(error);
    				}
    				else
    				{
    					me.vbmenu.hide(fetch_object(me.vbmenuname));
    					var repinfo =  fetch_tags(me.xml_sender_submit.handler.responseXML, 'reputation')[0];
    					var repdisplay = repinfo.getAttribute('repdisplay');
    					var reppower = repinfo.getAttribute('reppower');
    					var userid = repinfo.getAttribute('userid');
    
    					var spans = fetch_tags(document, 'span');
    					var postid = null;
    					var match = null;
    
    					for (var i = 0; i < spans.length; i++)
    					{
    						if (match = spans[i].id.match(/^reppower_(\d+)_(\d+)$/))
    						{
    							if (match[2] == userid)
    							{
    								spans[i].innerHTML = reppower;
    							}
    						}
    						else if (match = spans[i].id.match(/^repdisplay_(\d+)_(\d+)$/))
    						{
    							if (match[2] == userid)
    							{
    								spans[i].innerHTML = repdisplay;
    							}
    						}
    					}
    					alert(me.xml_sender_submit.fetch_data(repinfo));
    				}
    			}
    
    			if (is_ie)
    			{
    				me.xml_sender_submit.handler.abort();
    			}
    		}
    	}
    }
    
    /**
    * Handles click events on reputation icon
    */
    vB_Reputation_Object.prototype.reputation_click = function (e)
    {
    	e = e ? e : window.event;
    
    	do_an_e(e);
    	var postid = this.id.substr(this.id.lastIndexOf('_') + 1);
    	var repobj = vBrep.reps[postid];
    
    	// fetch and return reputation html
    	if (repobj.vbmenu == null)
    	{
    		repobj.populate();
    	}
    	else if (vBmenu.activemenu != repobj.vbmenuname)
    	{
    		repobj.vbmenu.show(fetch_object(repobj.vbmenuname));
    	}
    	else
    	{
    		repobj.vbmenu.hide();
    	}
    
    	return true;
    }
    
    /**
    * Handles click events on reputation submit button
    */
    
    vB_Reputation_Object.prototype.submit_onclick = function (e)
    {
    	e = e ? e : window.event;
    	do_an_e(e);
    
    	var postid = this.id.substr(this.id.lastIndexOf('_') + 1);
    	var repobj = vBrep.reps[postid];
    	repobj.submit();
    
    	return false;
    }
    
    /**
    *	Catches the keypress of the reputation controls to keep them from submitting to inlineMod
    */
    vB_Reputation_Object.prototype.repinput_onkeypress = function (e)
    {
    	e = e ? e : window.event;
    
    	switch (e.keyCode)
    	{
    		case 13:
    		{
    			vBrep.reps[this.id.split(/_/)[1]].submit();	
    			return false;
    		}
    		default:
    		{
    			return true;
    		}
    	}
    }
    
    /**
    * Queries for proper response to reputation, response varies
    *
    */
    vB_Reputation_Object.prototype.populate = function()
    {
    	this.xml_sender_populate = new vB_AJAX_Handler(true);
    	this.xml_sender_populate.onreadystatechange(this.onreadystatechange_populate);
    	this.xml_sender_populate.send('reputation.php?p=' + this.postid, 'p=' + this.postid + '&ajax=1');
    }
    
    /**
    * Submits reputation
    *
    */
    vB_Reputation_Object.prototype.submit = function()
    {
    	this.psuedoform = new vB_Hidden_Form('reputation.php');
    	this.psuedoform.add_variable('ajax', 1);
    	this.psuedoform.add_variables_from_object(this.divobj);
    
    	this.xml_sender_submit = new vB_AJAX_Handler(true);
    	this.xml_sender_submit.onreadystatechange(this.onreadystatechange_submit)
    	this.xml_sender_submit.send(
    		'reputation.php?do=addreputation&p=' + this.psuedoform.fetch_variable('p') + '&reputation=' + this.psuedoform.fetch_variable('reputation') + '&reason=' + PHP.urlencode(this.psuedoform.fetch_variable('reason')),
    		this.psuedoform.build_query_string()
    	);
    }
    
    /*======================================================================*\
    || ####################################################################
    || # Downloaded: 18:29, Wed Jun 11th 2008
    || # CVS: $RCSfile$ - $Revision: 15754 $
    || ####################################################################
    \*======================================================================*/
    Last edited by JIMINATOR; 02-04-2010 at 04:25 AM.
    RIP Father.

  6. #6
    Limited Edition EXEcution's Avatar
    Join Date
    Mar 2003
    Location
    Pennsylvania
    Posts
    16,151
    My Mood
    Pensive
    I dunno, this hax might steal your bank account number and make Jim the admin so he can ban us all.
    My Serious Sam Vids:
    Damnation - Frag
    You Wouldn't Believe - Trick

  7. #7
    Administrator
    Join Date
    Sep 2002
    Location
    Iowa
    Posts
    17,742
    My Mood
    Blah
    He can't ban everybody. Hehe

  8. #8
    Villains Directors ripper's Avatar
    Join Date
    Mar 2004
    Location
    england,cheshire,winsford
    Posts
    1,082
    My Mood
    Aggressive
    Quote Originally Posted by Bingo View Post
    I noticed that a while back. I poked around the code and I can't figure it out.

    If I get some time this weekend I'll go look again. Problem is, I'm crap with code. I see where it's supposed to be and it seems like it's there, but obviously something is wrong.

    I promise to go take a look again but can't promise I'll figure it out. I really do wish I could get it working again though!

    Thanks for the headsup, mate.

    B
    No Probs, cheers B


    Only God Can Judge Me.

  9. #9
    Owner Bingo's Avatar
    Join Date
    Oct 2002
    Location
    Florida
    Posts
    2,853
    My Mood
    Fine
    I'll do this soon. Obviously I want to do a full backup and download which takes quite a while. Superbowl weekend turns out not to be a weekend full of free time when I'm Chief Cooker and Party Central. lol

    Thanks though dude. If that works (not that I think it won't) then I owe you BIG time.
    -=(OUTLAWS)=- Bingo My Trade List


  10. #10
    Villains Directors ripper's Avatar
    Join Date
    Mar 2004
    Location
    england,cheshire,winsford
    Posts
    1,082
    My Mood
    Aggressive
    Quote Originally Posted by Bingo View Post
    I'll do this soon. Obviously I want to do a full backup and download which takes quite a while. Superbowl weekend turns out not to be a weekend full of free time when I'm Chief Cooker and Party Central. lol

    Thanks though dude. If that works (not that I think it won't) then I owe you BIG time.
    lol no probs on the time, when you have free time just have a look thanks man, let me no whn its fixed and youll be the 1st to receive the rep


    Only God Can Judge Me.

+ Reply to Thread
Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts