School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,115 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,316 people online right now. Registration is fast and FREE... Join Now!



Landing Pages for Your Forum

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
  • Icon
  • Group: Contributors
  • Posts: 4
  • Joined: 05-December 06


Dream Kudos: 25

Posted 05 December 2006 - 06: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 - 07:10 PM

Was This Post Helpful? 0
  • +
  • -


#2 BamaStangGuy  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 05-October 06


Dream Kudos: 0

Posted 05 December 2006 - 07: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 - 07:03 PM

Was This Post Helpful? 0
  • +
  • -

#3 WoodiE55  Icon User is offline

  • New D.I.C Head
  • Icon
  • Group: Contributors
  • Posts: 4
  • Joined: 05-December 06


Dream Kudos: 25

Posted 05 December 2006 - 07: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
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 05-October 06


Dream Kudos: 0

Posted 05 December 2006 - 07: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 online

  • Head DIC Head
  • Icon
  • View blog
  • Group: Webmaster
  • Posts: 17,429
  • Joined: 17-March 01


Dream Kudos: 1650

Expert In: Web Development

Posted 05 December 2006 - 07: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
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 05-October 06


Dream Kudos: 0

Posted 05 December 2006 - 07: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 online

  • Head DIC Head
  • Icon
  • View blog
  • Group: Webmaster
  • Posts: 17,429
  • Joined: 17-March 01


Dream Kudos: 1650

Expert In: Web Development

Posted 05 December 2006 - 07: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
  • Icon
  • Group: Contributors
  • Posts: 4
  • Joined: 05-December 06


Dream Kudos: 25

Posted 06 December 2006 - 06: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 online

  • Head DIC Head
  • Icon
  • View blog
  • Group: Webmaster
  • Posts: 17,429
  • Joined: 17-March 01


Dream Kudos: 1650

Expert In: Web Development

Posted 06 December 2006 - 06: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
  • Icon
  • Group: Contributors
  • Posts: 4
  • Joined: 05-December 06


Dream Kudos: 25

Posted 06 December 2006 - 08: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

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month