Integration With Sites

Redirect-script on PHP

Create script on your website with the code below:

<?php
$referer = urlencode($_SERVER['HTTP_REFERER']); // URL from where you came
header("LOCATION: http://mytds.com/?123&se_referer=" . $referer);
?>

A html link:

 <a href="http://mytds.com/group?charset=utf-8&keyword=Key_word">go to TDS</a>

Generated by PHP with se_referer:

<?php
$referer = $_SERVER['HTTP_REFERER']; // URL from where you came
echo '<a href="http://mytds.com/?123&se_referer=' . $referer . '">Link</a>';
?>

On PHP with keyword:

<?php
$referer = $_SERVER['HTTP_REFERER']; // URL from where you came
echo '<a href="http://mytds.com/?123&keyword=' . urlencode("Keyword with spaces") . ''">Link</a>';
?>

Generating the link on JavaScript:

<script>
var tds_url = 'http://mytds.com';   // URL of TDS
var group = '123';                       // alias or the group number
var charset = 'utf-8';                   // encoding of the keyword
var referer = encodeURIComponent(document.referrer);
var url = tds_url + '/?' + group + '&se_referer=' + referer + '&charset=' + charset;
document.write('<a href="' + url + '">Link</a>');
</script>

With the sending of se_referer:

var tds_url = 'http://mytds.com';   // URL of TDS
var group = '123';                        // alias or the group number
var charset = 'utf-8';                    // encoding of the keyword
var referer = encodeURIComponent(document.referrer);
var frame_url = tds_url + '/?' + group + '&se_referer=' + referer + '&charset=' + charset;
 
document.write('<iframe src="' +frame_url + '" frameborder="0" style="width:0; height:0"></iframe>');
</script>

Load Page through TDS in Frameset

Create a new page with the code below or with tag “frameset”:

<html><frameset rows="100%"><frame src="http://example.com?123"></frameset></html>

Replace value “src” with URL of your group.

Redirection Through Iframe With a Substitution of se_referrer and a Keyword from Title

<script type="text/javascript">
document.write('<iframe  frameborder="0" width="0" height="0" src="http://tds.com/group?se_referrer=' + encodeURIComponent(document.referrer)+ '&default_keyword=' + encodeURIComponent(document.title) + '">')
</script>

In the streams choose an action “Redirect for iframe”.

Redirection Through a Script With a Substitution of se_referrer and a Keyword from title

<script type="text/javascript">
document.write('<script type="text/javascript" src="http://tds.com/group?se_referrer=' + encodeURIComponent(document.referrer)+ '&default_keyword=' + encodeURIComponent(document.title) + '"><' + '/script>');
</script>

In the streams choose an action “Redirect for script”.

This js-script adds parameter se_referrer to all links with class “external”.

<script>
window.onload = function() {
   var items = document.getElementsByClassName('external');
   for(i = 0; i < items.length; i++) {
      var el = items[i];
      var referer = encodeURIComponent(document.referrer);
      var sep = (el.href.indexOf('?') != -1) ? '&' : '?';
      var href = el.href + sep;
      href += 'se_referer=' + referer;
      href += '&' + window.location.search.replace('?', '');
      el.href = href;
   }
}
</script>

jQuery version:

$(function(){
  $('a.external').each(function() {
     var el = $(this);
     var referer = encodeURIComponent(document.referrer);
     el.attr('href', el.attr('href') + '&se_referer=' + referer)
  })
});

Passing Parameters to a Script

<script type="text/javascript">
document.write('<script type="text/javascript" src="http://tds.com/group' + document.location.search + '"></script>')
</script>