gf_yst_store_referrer

The Gravity Forms Directory & Addons gf yst store referrer function.

Description

gf_yst_store_referrer( $data ); 

Parameters (1)

0. $data
The data.

Usage

  1. if ( !function_exists( 'gf_yst_store_referrer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-directory-addons/gravity-forms-referrer.php'; 
  3.  
  4. // The data. 
  5. $data = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gf_yst_store_referrer($data); 
  9.  

Defined (1)

The function is defined in the following location(s).

/gravity-forms-referrer.php  
  1. function gf_yst_store_referrer($data) { 
  2. $referrerinfo = ''; 
  3. $keywords = array(); 
  4. $i = 1; 
  5. foreach ($_SESSION['gf_yst_referer'] as $referer) { 
  6. $referrerinfo .= str_pad("Referer $i: ", 20) . $referer. "\r\n"; 
  7. $keywords_used = gf_yst_get_query($referer); 
  8. if ($keywords_used) { 
  9. $keywords[] = $keywords_used; 
  10. $i++; 
  11. $referrerinfo .= "\r\n"; 
  12.  
  13. $i = 1; 
  14. foreach ($_SESSION['gf_yst_pages'] as $page) { 
  15. $referrerinfo .= str_pad("Page visited $i: ", 20) . $page. "\r\n"; 
  16. $i++; 
  17. $referrerinfo .= "\r\n"; 
  18.  
  19. $i = 1; 
  20. if (count($keywords) > 0) { 
  21. foreach ($keywords as $keyword) { 
  22. $referrerinfo .= str_pad("Keyword $i: ", 20) . $keyword. "\r\n"; 
  23. $i++; 
  24. $referrerinfo .= "\r\n"; 
  25.  
  26. if (isset($data['notification']['message'])) { 
  27. $data['notification']['message'] .= "\r\nReferrer Info:\r\n".$referrerinfo; 
  28.  
  29. return $data;