| Posts: n/a |
Modification I am trying to convert to vBulletin
I read this blog on Forum Trends regarding landing pages and taking the query that someone used when searching on a search engine and using it on the page they landed on to better entice them to register or to "stick around" long enough to read the thread.
I have not been able to convert it to work with vBulletin as he uses IPB. Anyone on here want to take a stab at it?
This is the code that does it I believe:
I have not been able to convert it to work with vBulletin as he uses IPB. Anyone on here want to take a stab at it?
This is the code that does it I believe:
PHP Code:
function ls_get_delim($ref) {
// Search engine match array
// Used for fast delimiter lookup for single host search engines.
// Non .com Google/MSN/Yahoo referrals are checked for after this array is checked
$search_engines = array('google.com' => 'q',
'go.google.com' => 'q',
'maps.google.com' => 'q',
'local.google.com' => 'q',
'search.yahoo.com' => 'p',
'search.msn.com' => 'q',
'msxml.excite.com' => 'qkw',
'search.lycos.com' => 'query',
'alltheweb.com' => 'q',
'search.aol.com' => 'query',
'search.iwon.com' => 'searchfor',
'ask.com' => 'q',
'ask.co.uk' => 'ask',
'search.cometsystems.com' => 'qry',
'hotbot.com' => 'query',
'overture.com' => 'Keywords',
'metacrawler.com' => 'qkw',
'search.netscape.com' => 'query',
'looksmart.com' => 'key',
'dpxml.webcrawler.com' => 'qkw',
'search.earthlink.net' => 'q',
'search.viewpoint.com' => 'k',
'mamma.com' => 'query');
$delim = false;
// Check to see if we have a host match in our lookup array
if (isset($search_engines[$ref])) {
$delim = $search_engines[$ref];
} else {
// Lets check for referrals for international TLDs and sites with strange formats
// Optimizations
$sub13 = substr($ref, 0, 13);
// Search string for engine
if(substr($ref, 0, 7) == 'google.')
$delim = "q";
elseif($sub13 == 'search.atomz.')
$delim = "sp-q";
elseif(substr($ref, 0, 11) == 'search.msn.')
$delim = "q";
elseif($sub13 == 'search.yahoo.')
$delim = "p";
elseif(preg_match('/home\.bellsouth\.net\/s\/s\.dll/i', $ref))
$delim = "bellsouth";
}
return $delim;
}
function ls_get_terms($d) {
$terms = null;
$query_array = array();
$query_terms = null;
// Get raw query
$query = explode($d.'=', $_SERVER['HTTP_REFERER']);
$query = explode('&', $query[1]);
$query = urldecode($query[0]);
// Remove quotes, split into words, and format for HTML display
$query = str_replace("'", '', $query);
$query = str_replace('"', '', $query);
$query_array = preg_split('/[\s,\+\.]+/',$query);
$query_terms = implode(' ', $query_array);
$terms = htmlspecialchars(urldecode($query_terms));
return $terms;
}
function ls_get_refer() {
// Break out quickly so we don't waste CPU cycles on non referrals
if (!isset($_SERVER['HTTP_REFERER']) || ($_SERVER['HTTP_REFERER'] == '')) return false;
$referer_info = parse_url($_SERVER['HTTP_REFERER']);
$referer = $referer_info['host'];
// Remove www. is it exists
if(substr($referer, 0, 4) == 'www.')
$referer = substr($referer, 4);
return $referer;
}










, are viewing vBulletinZone from searching blue widgets, why not register and yadda yadda" 
Linear Mode

