Go Back   vBulletin Setup > vBulletinSetup Information > Making Money Marketing vBulletin > vBulletin Programming & Coding


Please Register to get full access to the forums.
Post New Thread  Reply



#1   12-04-2006, 08:10 PM
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:

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($ref013);

        
// Search string for engine
        
if(substr($ref07) == 'google.')
            
$delim "q";
        elseif(
$sub13 == 'search.atomz.')
            
$delim "sp-q";
        elseif(
substr($ref011) == '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($referer04) == 'www.')
        
$referer substr($referer4);

    return 
$referer;


Quote   |  



#2   12-04-2006, 10:39 PM
Send a message via AIM to Brandon Send a message via MSN to Brandon Send a message via Yahoo to Brandon Brandon is a glorious beacon of lightBrandon is a glorious beacon of lightBrandon is a glorious beacon of lightBrandon is a glorious beacon of light Join Date: Jul 2006 Posts: 9,826 Location: Topeka, KS


there is a 3.0.x hack that did this,, I'll track it down real fast.. maybe it'll help you

well, I don't see it right off the bat

but what it has was this..

say you are searching "blue widgets"

and you found this thread here..

at the bottom there is a box that said something like

", are viewing vBulletinZone from searching blue widgets, why not register and yadda yadda"
it was editable in acp..

I think it was the 3.0.x series, but it could have been the 3.5.x I had it on a board last year.
--------------------
Brandon Sheley / vBulletin Setup Staff
Check out our Newsletter for the latest vB and SEO news.
Are you looking for vBulletin work to be done on your forums ?
Would you like to Help Support vBulletin Setup.

Please do not PM me for support, that's what the forums are for.
Have you heard about Crowdgather?
Find it on Forums


Stay up to date by installing our Tool Bar
Quote   |  



#3   12-04-2006, 10:41 PM
Posts: n/a


Thanks
Quote   |  



#4   12-05-2006, 01:19 AM
Posts: n/a


Quote:
Originally Posted by Brandon View Post
there is a 3.0.x hack that did this,, I'll track it down real fast.. maybe it'll help you

well, I don't see it right off the bat

but what it has was this..

say you are searching "blue widgets"

and you found this thread here..

at the bottom there is a box that said something like

", are viewing vBulletinZone from searching blue widgets, why not register and yadda yadda"
it was editable in acp..

I think it was the 3.0.x series, but it could have been the 3.5.x I had it on a board last year.
That is exactly what this does but this was made for Wordpress

I am not good enough with PHP (not even close) to rewrite that for vBulletin. It is probably something simple too since we already got the function.
Quote   |  



#5   12-05-2006, 01:20 AM
SirAdrian will become famous soon enough Join Date: Nov 2006 Posts: 41


The code above has no reference to anything from IPB that I can see, so to get it to do something you would just have to trigger it and display what you want in a template.
Quote   |  



#6   12-05-2006, 01:24 AM
Posts: n/a


Quote:
Originally Posted by SirAdrian View Post
The code above has no reference to anything from IPB that I can see, so to get it to do something you would just have to trigger it and display what you want in a template.
Right, this is code from a wordpress plugin. Skyhawk took it and converted it to IPB for himself.

When you say trigger what do you mean exactly? Sorry not well versed in programming but I am trying to pick up what I can.
Quote   |  



#7   12-05-2006, 01:31 AM
SirAdrian will become famous soon enough Join Date: Nov 2006 Posts: 41


I think this will work,
PHP Code:
$searchTerms ls_get_terms(ls_get_delim(ls_get_refer())); 
Place $searchTerms in your template somewhere, and the PHP in a plugin executed before you want it displayed.

globally, global_start
in a thread, showthread_complete
etc
Quote   |  



#8   12-05-2006, 01:53 AM
Posts: n/a


Quote:
Originally Posted by SirAdrian View Post
I think this will work,
PHP Code:
$searchTerms ls_get_terms(ls_get_delim(ls_get_refer())); 
Place $searchTerms in your template somewhere, and the PHP in a plugin executed before you want it displayed.

globally, global_start
in a thread, showthread_complete
etc
You are awesome Now I got to try to translate that into english and see how you came to that

Thanks a bunch
Quote   |  
Post New Thread  Reply
vBulletin Setup > vBulletinSetup Information > Making Money Marketing vBulletin > vBulletin Programming & Coding


Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Another VB convert, Hi! rotor Introduce Yourself 5 08-02-2007 06:01 AM
vBulletin Installation and Modification Redline Link or Banner Sales and Trades 1 05-06-2007 10:25 PM
How can i convert skin from version 3.5.3 to 3.6.4 baongocnq vBulletin Questions 2 02-17-2007 02:09 PM
Looking for a Watermarking on the Fly Modification Brent vBulletin Programming & Coding 0 12-07-2006 02:18 PM
Is there a danger to convert the Forum pages to Html? big-ah vBulletin SEO Tips and SEO Questions 2 11-15-2006 12:50 AM


All times are GMT -6. The time now is 08:37 PM.

vBulletin Setup, vBulletin Setup Forums, vBulletin Services, vBulletin Blogs, vBulletin SEO, vBulletin Questions, vBulletin Skins, Styles, Templates
vBulletin Hacks / Modifications, vBulletin Monetization, Blogs, vBulletin Link Directory,Quality Link Directory