Page 1 of 1

Landing Pages for Your Forum For vBulletin and improved welcome headers Rate Topic: -----

#1 WoodiE55  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-December 06

Posted 05 December 2006 - 07:38 PM

Login into vBulletin's admin panel and navigate to:

Plugin System -> Add New Plugin

PRODUCT: vBulletin
HOOK LOCATION: global_start
TITLE: Landing Page
PLUGIN PHP CODE: paste the following code...

$referer = $_SERVER['HTTP_REFERER'];

//Did they get here from a search?
if((preg_match('/www\.google.*/i',$referer))
   || preg_match('/search\.atomz.*/i',$referer)
	|| preg_match('/search\.live.*/i',$referer)
   || preg_match('/search\.msn.*/i',$referer)
   || preg_match('/search\.yahoo.*/i',$referer)
   || preg_match('/msxml\.excite\.com/i', $referer)
   || preg_match('/search\.lycos\.com/i', $referer)
   || preg_match('/www\.alltheweb\.com/i', $referer)
   || preg_match('/search\.aol\.com/i', $referer)
   || preg_match('/search\.iwon\.com/i', $referer)
   || preg_match('/ask\.com/i', $referer)
   || preg_match('/search\.cometsystems\.com/i', $referer)
   || preg_match('/www\.hotbot\.com/i', $referer)
   || preg_match('/www\.overture\.com/i', $referer)
   || preg_match('/www\.metacrawler\.com/i', $referer)
   || preg_match('/search\.netscape\.com/i', $referer)
   || preg_match('/www\.looksmart\.com/i', $referer)
   || preg_match('/go\.google\.com/i', $referer)
   || preg_match('/dpxml\.webcrawler\.com/i', $referer)
   || preg_match('/search\.earthlink\.net/i', $referer)
   || preg_match('/search\.viewpoint\.com/i', $referer)
   || preg_match('/www\.mamma\.com/i', $referer)
   || preg_match('/home\.bellsouth\.net\/s\/s\.dll/i', $referer)
   || preg_match('/www\.ask\.co\.uk/i', $referer)) {

  //Figure out which search and get the part of its URL which contains the search terms.
  if(preg_match('/(www\.google.*)|(search\.msn.*)|(search\.live.*)|(www\.alltheweb\.com)|(ask\.com)|(go\.google\.com)|(search\.earthlink\.net)/i',$referer))
	$delimiter = "q";
  elseif(preg_match('/www\.ask\.co\.uk/i', $referer))
	$delimiter = "ask";
  elseif(preg_match('/search\.atomz.*/i',$referer))
	$delimiter = "sp-q";
  elseif(preg_match('/search\.yahoo.*/i',$referer))
	$delimiter = "p";
  elseif(preg_match('/(msxml\.excite\.com)|(www\.metacrawler\.com)|(dpxml\.webcrawler\.com)/i', $referer))
	$delimiter = "qkw";
  elseif(preg_match('/(search\.lycos\.com)|(search\.aol\.com)|(www\.hotbot\.com)|(search\.netscape\.com)|(search\.mamma\.com)/i', $referer))
	$delimiter = "query";
  elseif(preg_match('/search\.iwon\.com/i', $referer))
	$delimiter = "searchfor";
  elseif(preg_match('/search\.cometsystems\.com/i', $referer))
	$delimiter = "qry";
  elseif(preg_match('/www\.overture\.com/i', $referer))
	$delimiter = "Keywords";
  elseif(preg_match('/www\.looksmart\.com/i', $referer))
	$delimiter = "key";
  elseif(preg_match('/search\.viewpoint\.com/i', $referer))
	$delimiter = "k";
  elseif(preg_match('/home\.bellsouth\.net\/s\/s\.dll/i', $referer))
	$delimiter = "string";

  $pattern = "/^.*" . $delimiter . "=([^&]+)&?.*\$/i";
  $query = preg_replace($pattern, '$1', $referer);

  //Remove quotation marks.
  $query = preg_replace('/\'|"/','',$query);

	$query_array = preg_split ("/[\s,\+\.]+/",$query);
	$query_terms = implode(" ", $query_array);
	$terms = htmlspecialchars(urldecode($query_terms));

}



PLUGIN IS ACTIVE: Yes

PRESS SAVE.

Now just add $terms in any template you want.



+++ IF YOU'RE USING Ted S - Improved Welcome headers from vbulletin.org +++

Styles & Templates -> Style Manager -> welcome_headers

FIND THIS:

<phrase 1="faq.php?$session[sessionurl]" 2="register.php?$session[sessionurl]" 3="$vboptions[bbtitle]" 4="sendmessage.php$session[sessionurl]">$vbphrase[welcome_guest]</phrase>


REPLACE WITH:

<phrase 1="faq.php?$session[sessionurl]" 2="register.php?$session[sessionurl]" 3="$vboptions[bbtitle]" 4="sendmessage.php$session[sessionurl]" 5="$terms">$vbphrase[welcome_guest]</phrase>


SAVE!


NOTE: The difference in the code is adding: 5="$terms" to the phrases. This will allow the $terms variable to work with the welcome headers for guest.

This post has been edited by skyhawk133: 05 December 2006 - 08:10 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Landing Pages for Your Forum

#2 BamaStangGuy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 05-October 06

Posted 05 December 2006 - 08:02 PM

Not working for me. Did exactly as instructions said. Copied and pasted then used the $terms to call it

This post has been edited by BamaStangGuy: 05 December 2006 - 08:03 PM

Was This Post Helpful? 0
  • +
  • -

#3 WoodiE55  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-December 06

Posted 05 December 2006 - 08:05 PM

View PostBamaStangGuy, on 5 Dec, 2006 - 08:02 PM, said:

Not working for me. Did exactly as instructions said. Copied and pasted then used the $terms to call it


I don't think this would cause an issue, but what version of vBulletin are you using?

The above instructions worked for 3.5.4


-Michael
Was This Post Helpful? 0
  • +
  • -

#4 BamaStangGuy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 05-October 06

Posted 05 December 2006 - 08:07 PM

View PostWoodiE55, on 5 Dec, 2006 - 08:05 PM, said:

View PostBamaStangGuy, on 5 Dec, 2006 - 08:02 PM, said:

Not working for me. Did exactly as instructions said. Copied and pasted then used the $terms to call it


I don't think this would cause an issue, but what version of vBulletin are you using?

The above instructions worked for 3.5.4


-Michael


3.6.0 patched
Was This Post Helpful? 0
  • +
  • -

#5 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Posted 05 December 2006 - 08:13 PM

I just updated the PHP portion of the code to include live.com. Yahoo is having a weird issue with the cop variable... should be pulling the p variable instead. Live.com should work now though.
Was This Post Helpful? 0
  • +
  • -

#6 BamaStangGuy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 05-October 06

Posted 05 December 2006 - 08:17 PM

View Postskyhawk133, on 5 Dec, 2006 - 08:13 PM, said:

I just updated the PHP portion of the code to include live.com. Yahoo is having a weird issue with the cop variable... should be pulling the p variable instead. Live.com should work now though.


lol go figure cause Yahoo is where I get my most referrers
Was This Post Helpful? 0
  • +
  • -

#7 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Posted 05 December 2006 - 08:21 PM

I'll get it fixed up for ya ;) It's just an issue with the regular expression the guy who wrote it originally is using.

Also, if you want to output each word uppercase, add $terms = ucwords($terms); before the closing bracket in the first section of code.
Was This Post Helpful? 0
  • +
  • -

#8 WoodiE55  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-December 06

Posted 06 December 2006 - 07:22 AM

View Postskyhawk133, on 5 Dec, 2006 - 08:21 PM, said:

I'll get it fixed up for ya ;) It's just an issue with the regular expression the guy who wrote it originally is using.

Also, if you want to output each word uppercase, add $terms = ucwords($terms); before the closing bracket in the first section of code.


skyhawk,

Thanks so much for your help on this! I owe you.


-Michael
Was This Post Helpful? 0
  • +
  • -

#9 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Posted 06 December 2006 - 07:24 AM

Have you noticed any increase/change in your registration rate?
Was This Post Helpful? 0
  • +
  • -

#10 WoodiE55  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 05-December 06

Posted 06 December 2006 - 09:56 AM

View Postskyhawk133, on 6 Dec, 2006 - 07:24 AM, said:

Have you noticed any increase/change in your registration rate?


Average RCNitroTalk.com for the last month or two receives about 5 new members each day. Yesterday it jumped to 8 new members. It'll be interesting to watch over the next week or two to really be able to get a sense of how well this works or not.


-Michael
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1