iTrader - Automatically add "Deal URL" to rating page
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');
PHP Code:
$templater = vB_Template::create('itrader_rate_trade');
Find: Code:
{vb:raw footer} 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> 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"> </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 |