Back to vBulletin 4.x Add-ons

iTrader - Automatically add "Deal URL" to rating page
Mod Version: 1.00, by LifesGreatestGift

vB Version: 4.2.0 Rating: (2 votes - 5.00 average) Installs: 15
Released: 18 Feb 2013 Last Update: Never Downloads: 0
Not Supported Uses Plugins Template Edits Re-usable Code  

this automatically adds the URL to the iTrader "Submit Feedback" page.

Note: jQuery will need to be loaded.

edit plugin iTrader postbit (postbit_display_complete)

Find:
PHP Code:
        $templater vB_Template::create('itrader_rate_trade');
                
$templater->register('itrader'$itrader);
                 
$templater->register('post'$post);
        
$template_hook['postbit_controls'] .= $templater->render(); 
Replace With:
PHP Code:
        $templater vB_Template::create('itrader_rate_trade');
                
$templater->register('itrader'$itrader);
                 
$templater->register('post'$post);
              
$templater->register('thread'$thread);
        
$template_hook['postbit_controls'] .= $templater->render(); 
edit template itrader_feedback

Find:
Code:
{vb:raw footer}
Replace With:
Code:
{vb:raw footer}
<script>
$(document).ready(function() {
	$.extend({
	  getUrlVars: function(){
		var vars = [], hash;
		var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
		for(var i = 0; i < hashes.length; i++)
		{
		  hash = hashes[i].split('=');
		  vars.push(hash[0]);
		  vars[hash[0]] = hash[1];
		}
		return vars;
	  },
	  getUrlVar: function(name){
		return $.getUrlVars()[name];
	  }
	});
	var ref_url = $.getUrlVar('ref_url');
if (ref_url != '' && ref_url != null) {
	$("input[name=dealurl]").val("{vb:raw vboptions.bburl}{vb:if "$vboptions['bburl']", '/', ''}showthread.php?t="+ref_url);
}
});
</script>
edit template itrader_rate_trade

Replace All With:
Code:
<a href="{vb:raw vboptions.bburl}/itrader_feedback.php?{vb:raw session.sessionurl}u={vb:raw post.userid}&ref_url={vb:raw thread.threadid}" style="background: url(images/itrader/icon_positive.png) no-repeat transparent left;padding-left: 20px;">{vb:rawphrase itrader_rate_seller}</a>
	<span class="seperator">&nbsp;</span>

Now, when a user is viewing a thread, and clicks the "Rate Seller" link, when they go to the following page, the Deal thread URL: (Optional) will be populated with the thread URL.

Download

No files for download.

Screenshots

Click image for larger version
Name:	Untitled.png
Views:	294
Size:	50.6 KB
ID:	143819  


vblts.ru supports vBulletin®, 2022-2024