• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

iTrader - Automatically add "Deal URL" to rating page

Admin

Well-Known Member
Staff member
Administrator
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:
		$templater = vB_Template::create('itrader_rate_trade');          	  $templater->register('itrader', $itrader);           	  $templater->register('post', $post);		$template_hook['postbit_controls'] .= $templater->render();


Replace With:
PHP:
		$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.

tuoitrevnbiz18022013.png
 

Facebook Comments

New posts New threads New resources

Back
Top